Subject: pkg/18588: Wine configure messes up sonames for dlopen
To: None <gnats-bugs@gnats.netbsd.org>
From: None <fvdl@wasabisystems.com>
List: netbsd-bugs
Date: 10/09/2002 01:44:18
>Number:         18588
>Category:       pkg
>Synopsis:       Wine configure messes up sonames for dlopen
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Oct 08 16:54:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Frank van der Linden
>Release:        NetBSD 1.6I
>Organization:
Wasabi Systems, Inc.
>Environment:
System: NetBSD k2 1.6I NetBSD 1.6I (K2) #0: Tue Oct 8 22:41:55 CEST 2002 fvdl@k2:/work/trees/current/sys/arch/i386/compile/K2 i386
Architecture: i386
Machine: i386
>Description:
	The Wine (pkgsrc/emulators/wine) configure script tries to determine
	the names of some shared objects, because it wants to dlopen() them.
	For this, it compiles a testprogram, executes ldd on it, and feeds
	the output to grep and then sed. However, the sed command is wrong.
	It finds the part of the ldd output *before* the =>, so it
	gets "-lfreetype" for example. Naturally, wine then does not
	find any file by this name:

   448 wine     NAMI  "/usr/X11R6/lib/-lfreetype.8"
   448 wine     RET   __stat13 -1 errno 2 No such file or directory
   448 wine     CALL  __stat13(0x4805b740,0x48506a6c)
   448 wine     NAMI  "/usr/pkg/lib/-lfreetype.8"
   448 wine     RET   __stat13 -1 errno 2 No such file or directory
   448 wine     CALL  __stat13(0x4805b740,0x48506a6c)
   448 wine     NAMI  "/usr/lib/-lfreetype.8"
   448 wine     RET   __stat13 -1 errno 2 No such file or directory

>How-To-Repeat:
	Install the wine pkg, run some application.
>Fix:
	Add the following patch to the package (warning: it contains
	TAB characters, so don't copy/paste it):

-------------------------------- cut here -------------------------------------
$NetBSD$

--- configure.orig	Sun Aug  4 20:59:16 2002
+++ configure	Wed Oct  9 01:02:24 2002
@@ -10764,7 +10764,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep libX11\\.so | sed 's/^[ 	]*\([^ 	]*\)[ 	]*=>.*$/\1/'`
+  ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep libX11\\.so | sed 's/^.*=>[	 ]*\(.*\)[	 ]*/\1/'`
   if test "x$ac_cv_lib_soname_X11" = "x"
   then
      ac_cv_lib_soname_X11="libX11.so"
@@ -10830,7 +10830,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep libXext\\.so | sed 's/^[ 	]*\([^ 	]*\)[ 	]*=>.*$/\1/'`
+  ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep libXext\\.so | sed 's/^.*=>[	 ]*\(.*\)[	 ]*/\1/'`
   if test "x$ac_cv_lib_soname_Xext" = "x"
   then
      ac_cv_lib_soname_Xext="libXext.so"
@@ -10896,7 +10896,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrender\\.so | sed 's/^[ 	]*\([^ 	]*\)[ 	]*=>.*$/\1/'`
+  ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep libXrender\\.so | sed 's/^.*=>[	 ]*\(.*\)[	 ]*/\1/'`
   if test "x$ac_cv_lib_soname_Xrender" = "x"
   then
      ac_cv_lib_soname_Xrender="libXrender.so"
@@ -10962,7 +10962,7 @@
   ac_status=$?
   echo "$as_me:$LINENO: \$? = $ac_status" >&5
   (exit $ac_status); }; }; then
-  ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep libfreetype\\.so | sed 's/^[ 	]*\([^ 	]*\)[ 	]*=>.*$/\1/'`
+  ac_cv_lib_soname_freetype=`$ac_cv_path_LDD conftest$ac_exeext | grep libfreetype\\.so | sed 's/^.*=>[	 ]*\(.*\)[	 ]*/\1/'`
   if test "x$ac_cv_lib_soname_freetype" = "x"
   then
      ac_cv_lib_soname_freetype="libfreetype.so"
>Release-Note:
>Audit-Trail:
>Unformatted: