configure can't find `new_panel` function within libpanel of ncurses + patch

Christian Wiese <[email protected]>
Newsgroups gmane.linux.evms.devel
Message-ID <[email protected]>
Hi,

while compiling evms 2.5.5 from source I ran into a problem that the
configure script of evms can't find the `new_panel` function within
libpanel which doesn't seem to be correct in that particular case.

--------------snip--------------------------
# nm /usr/lib/libpanel.a | grep new_panel
00000000 T new_panel
--------------snip--------------------------

Snip of the configure output:
--------------snip--------------------------
checking for newwin in -lncurses... yes
checking for new_panel in -lpanel... no
checking for readline in -lreadline... yes
--------------snip--------------------------


As side effect the ncurses based text-mode interface of evms won't be
build

Snip of the configure output:

--------------snip-----------------------------------------------
configure:      not building text-mode ... requires panel library
--------------snip-----------------------------------------------


While checking the `config.log` of the package built I discovered a
problem within the check of `new_panel`:

--------------snip---------------------------------------------------------
configure:7281: checking for new_panel in -lpanel
configure:7311: gcc -o conftest -g -O2   conftest.c -lpanel  -ldl -lc
>&5 /usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_new.o):
>In function `new_panel':
p_new.c:(.text+0x33): undefined reference to `_nc_panelhook'
p_new.c:(.text+0x78): undefined reference to `_nc_panelhook'
p_new.c:(.text+0x84): undefined reference to `_nc_panelhook'
p_new.c:(.text+0x91): undefined reference to `_nc_panelhook'
p_new.c:(.text+0xa7): undefined reference to `_nc_panelhook'
/usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_new.o):p_new.c:(.text+0xb3):
more undefined refer ences to `_nc_panelhook' follow
/usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_new.o):
In function `new_panel': p_new.c:(.text+0xbc): undefined reference to
`stdscr' p_new.c:(.text+0xda): undefined reference to `_nc_panelhook'
p_new.c:(.text+0xe2): undefined reference to `_nc_panelhook'
/usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_show.o):
In function `show_panel': p_show.c:(.text+0x25): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x2c): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x36): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x7f): undefined reference to `wtouchln'
p_show.c:(.text+0x84): undefined reference to `_nc_panelhook'
p_show.c:(.text+0x126): undefined reference to `_nc_panelhook'
p_show.c:(.text+0x137): undefined reference to `_nc_panelhook'
p_show.c:(.text+0x158): undefined reference to `_nc_panelhook'
p_show.c:(.text+0x165): undefined reference to `_nc_panelhook'
/usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_show.o):p_show.c:(.text+0x179):
more undefined re ferences to `_nc_panelhook' follow
/usr/lib/gcc/i686-unknown-linux-gnu/4.1.1/../../../libpanel.a(p_show.o):
In function `show_panel': p_show.c:(.text+0x1f5): undefined reference
to `is_linetouched' p_show.c:(.text+0x2a1): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x2c1): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x2d6): undefined reference to
`_nc_panelhook' p_show.c:(.text+0x2e9): undefined reference to
`_nc_panelhook' collect2: ld returned 1 exit status
--------------snip---------------------------------------------------------


That smells like an missing `-lncurses` as we can see on the gcc call
of the test:

--------------snip---------------------------------------------------------
configure:7311: gcc -o conftest -g -O2   conftest.c -lpanel  -ldl -lc
>&5
--------------snip---------------------------------------------------------

should be something like that:

--------------snip---------------------------------------------------------
configure:7311: gcc -o conftest -g -O2   conftest.c -lpanel -lncurses
-ldl -lc  >&5
--------------snip---------------------------------------------------------

`-lncurses` should be prepended to $LIBS if the test for ncurses was
successful which is not the case!

Solution that works here:

--------------snip---------------------------------------------------------
--- evms-2.5.5/configure.orig   2006-12-13 17:55:08.733626000 +0200
+++ evms-2.5.5/configure        2006-12-13 18:01:20.040831250 +0200
@@ -7274,6 +7274,7 @@
   have_ncurses="yes";
              NCURSES_LIBS="-lncurses";
              NCURSES_CPPFLAGS="-I/usr/include/ncurses"
+             LIBS="-lncurses $LIBS"
 else
   have_ncurses="no"
 fi
--------------snip---------------------------------------------------------

The above patch is attached to this mail as well.
Any comments highly appreciated!

Cheers,
-- Chris

P.S. You can find a ticket I filed regarding that issue also at:
http://trac.opensde.org/ticket/233

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

_______________________________________________
Evms-devel mailing list
[email protected]
To subscribe/unsubscribe, please visit:
https://lists.sourceforge.net/lists/listinfo/evms-devel
evms-2.5.5-configure-ncurses-libs.patch (text/x-patch, 1.2 KB)
Index: package/filesystem/evms/evms-2.5.5-configure-ncurses-libs.patch
===================================================================
--- package/filesystem/evms/evms-2.5.5-configure-ncurses-libs.patch	(revision 0)
+++ package/filesystem/evms/evms-2.5.5-configure-ncurses-libs.patch	(revision 0)
@@ -0,0 +1,22 @@
+Submitted by: Christian Wiese (morfoh at opensde.org)
+Date: 2006-12-13
+Initial Package Version: 2.5.5
+Upstream Status: submitted
+Origin: evms-2.5.5-configure-ncurses-libs.patch by Christian Wiese made for the
+Open System Development Environment (http://opensde.org)
+Description: Fixes the check for new_panel function within the configure script.
+	     The EVMS configure script does not save -lncurses into LIBS if
+	     ncurses was detected. As side effect the check for the new_panel
+	     function doesn't link against -lncurses which lets the test fail
+	     even if new_panel is available within -lpanel.
+
+--- evms-2.5.5/configure.orig	2006-12-13 17:55:08.733626000 +0200
++++ evms-2.5.5/configure	2006-12-13 18:01:20.040831250 +0200
+@@ -7274,6 +7274,7 @@
+   have_ncurses="yes";
+ 	      NCURSES_LIBS="-lncurses";
+ 	      NCURSES_CPPFLAGS="-I/usr/include/ncurses"
++	      LIBS="-lncurses $LIBS"
+ else
+   have_ncurses="no"
+ fi
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFgHRgFAiA38MZhZ0RAiTfAJ4jgcdVlD+Jn39F8VvCduQF1BQNvQCeKCUL
8PhbmgfarpEnxsXzCr5dXbM=
=mSqc
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.