Subject: pkg/22222: gocr executable built from pkgsrc fails to execute
To: None <gnats-bugs@gnats.netbsd.org>
From: Marko Schuetz <MarkoSchuetz@web.de>
List: netbsd-bugs
Date: 07/22/2003 20:54:09
>Number:         22222
>Category:       pkg
>Synopsis:       gocr executable built from pkgsrc fails to execute
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 22 18:55:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Marko Sch=FCtz
>Release:        NetBSD 1.6T
>Organization:
individual
>Environment:
System: NetBSD xpad.hisplace.rhein-main.de 1.6T NetBSD 1.6T (XPAD) #2: =
Sun Jul 6 14:34:08 CEST 2003 marko@xpad.hisplace.rhein-main.de:/usr/src=
/sys/arch/i386/compile/XPAD i386
Architecture: i386
Machine: i386
>Description:
	The gocr package does not depend on the netpbm package, but if
	netpbm is installed, it is detected by the configure script
	and portions of code referencing symbols in libnetpbm.so.??
	are compiled into the object code. However, the appropriate
	paths for loading of the shared library are not set and hence
	starting the executable will produce a shared library not
	found error.
>How-To-Repeat:
	#Install netpbm
	cd ${PREFIX}/graphics/netpbm
	make install
	cd ../../textproc/gocr
	make install
	gocr
>Fix:
	This patch is a quick fix. It modifies the configure script
	not to detect anything related to netpbm. It replaces patch-aa
	of the gocr package.

$NetBSD$

--- configure.orig	2002-08-12 17:18:53.000000000 +0200
+++ configure
@@ -946,9 +946,10 @@ else
 fi
 =

 =

-CPPFLAGS=3D-I/usr/X11R6/include
+CPPFLAGS=3D"-I${X11BASE}/include -I${LOCALBASE}/include"
 #LDFLAGS=3D"-L/usr/X11R6/lib -lpbm -lpgm -lppm -lpnm"
-LDFLAGS=3D"-L/usr/X11R6/lib -L/usr/local/netpbm/lib"
+#LDFLAGS=3D"-L${X11BASE}/lib -L${LOCALBASE}/lib -Wl,-R${X11BASE}/lib -=
Wl,-R${LOCALBASE}/lib -lnetpbm"
+LDFLAGS=3D"-L${X11BASE}/lib -L${LOCALBASE}/lib"
 =

 ## pnm can only be found, if LDFLAGS contains -lpgm -lpnm ... etc. =

 ## is there a better solution ?
@@ -989,7 +990,7 @@ else
 fi
 rm -f conftest*
 test "$ac_cv_search_pnm_readpaminit" =3D "no" && for i in pam netpam p=
nm netpnm netpbm; do
-LIBS=3D"-l$i  $ac_func_search_save_LIBS"
+LIBS=3D"$ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 995 "configure"
 #include "confdefs.h"
@@ -1051,7 +1052,7 @@ else
 fi
 rm -f conftest*
 test "$ac_cv_search_pbm_init" =3D "no" && for i in pbm pnm netpbm; do
-LIBS=3D"-l$i  $ac_func_search_save_LIBS"
+LIBS=3D"$ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 1057 "configure"
 #include "confdefs.h"
@@ -1113,7 +1114,7 @@ else
 fi
 rm -f conftest*
 test "$ac_cv_search_pgm_init" =3D "no" && for i in pgm pnm netpbm; do
-LIBS=3D"-l$i  $ac_func_search_save_LIBS"
+LIBS=3D"$ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 1119 "configure"
 #include "confdefs.h"
@@ -1175,7 +1176,7 @@ else
 fi
 rm -f conftest*
 test "$ac_cv_search_ppm_init" =3D "no" && for i in ppm pnm netpbm; do
-LIBS=3D"-l$i  $ac_func_search_save_LIBS"
+LIBS=3D"$ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 1181 "configure"
 #include "confdefs.h"
@@ -1237,7 +1238,7 @@ else
 fi
 rm -f conftest*
 test "$ac_cv_search_pnm_init" =3D "no" && for i in pnm netpbm; do
-LIBS=3D"-l$i  $ac_func_search_save_LIBS"
+LIBS=3D"$ac_func_search_save_LIBS"
 cat > conftest.$ac_ext <<EOF
 #line 1243 "configure"
 #include "confdefs.h"
@@ -1455,7 +1456,8 @@ EOF
 =

 fi
 =

-for ac_hdr in unistd.h pnm.h pam.h wchar.h
+#for ac_hdr in unistd.h pnm.h pam.h wchar.h
+for ac_hdr in unistd.h wchar.h
 do
 ac_safe=3D`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6


----Security_Multipart(Tue_Jul_22_20:54:09_2003_131)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (NetBSD)

iD8DBQA/HYhbOrTq/v3ACNoRApmBAKCI5+urD5JPx7/dP8CSO85KkNdPgwCfQKzc
6THm7SAmZkjIxlhJxVHH/20=
=JB9+
-----END PGP SIGNATURE-----

----Security_Multipart(Tue_Jul_22_20:54:09_2003_131)----
>Release-Note:
>Audit-Trail:
>Unformatted:
 ----Security_Multipart(Tue_Jul_22_20:54:09_2003_131)--
 Content-Type: Text/Plain; charset=iso-8859-1
 Content-Transfer-Encoding: quoted-printable