On Fri, Jan 06, 2006 at 11:44:17AM +0100, Marc Espie wrote:
> A lot of ports have been converted. libtool now sports an OpenBSD-specific
> patch that makes SHARED_LIBS `just work'.
> 
> Specifically, if a port sets USE_LIBTOOL and SHARED_LIBS, in -current,
> it should `just do the right thing'.
> 
> There is still one big unsettled issue, that even Brad's update of libtool
> to 1.5.22 does not solve: libtool will prefer libraries already installed
> under /usr/local to the currently built copy.
> 
> The libtool guys have taken steps to remedy that fact, but those steps do
> not work at all (I wonder if it was even tested, which is kind of weird
> considering 1.5 is supposed to be a stable branch): specifically, there's
> no way an absolute path (as in not_instpath) can match a relative path
> (as in deplibs)...

yes, it was obviously not tested, and apparently added just before
making the release.  granted, paths to deplibs of not installed
libs are absolute, but relative paths on the command line are not ...

> We will probably end up solving that locally. Baring that, currently, this
> requires deinstalling stuff in case of major bumps to rebuild ports.

try the following.  doesn't add extraneous paths this time.

here are some libtool commands and the resulting compiler commands
from a glib2 build log with the patch below:

/usr/local/bin/libtool  --mode=link cc  -O2 -pipe -Wall  -L/usr/local/lib -o 
glib-genmarshal  glib-genmarshal.o ../glib/libglib-2.0.la -lintl -liconv 
cc -O2 -pipe -Wall -o .libs/glib-genmarshal glib-genmarshal.o  
-L/home/portobj/glib2-2.8.4/glib-2.8.4/glib/.libs  -L/usr/local/lib -lglib-2.0 
-lintl -liconv -Wl,-rpath,/usr/local/lib

/usr/local/bin/libtool  --mode=link cc  -O2 -pipe -Wall  -L/usr/local/lib -o 
libgobject-2.0.la -rpath /usr/local/lib  -version-info 800:4:0  -export-dynamic 
 -export-symbols-regex "^[^_].*" gboxed.lo gclosure.lo genums.lo gobject.lo 
gparam.lo gparamspecs.lo gsignal.lo gsourceclosure.lo gtype.lo gtypemodule.lo 
gtypeplugin.lo gvalue.lo gvaluearray.lo gvaluetransform.lo gvaluetypes.lo 
../glib/libglib-2.0.la -lintl -liconv 
cc -shared  -fPIC -DPIC -o .libs/libgobject-2.0.so.800.4  .libs/gboxed.o 
.libs/gclosure.o .libs/genums.o .libs/gobject.o .libs/gparam.o 
.libs/gparamspecs.o .libs/gsignal.o .libs/gsourceclosure.o .libs/gtype.o 
.libs/gtypemodule.o .libs/gtypeplugin.o .libs/gvalue.o .libs/gvaluearray.o 
.libs/gvaluetransform.o .libs/gvaluetypes.o  
-L/home/portobj/glib2-2.8.4/glib-2.8.4/glib/.libs -L/usr/local/lib -liconv 
-lintl -lglib-2.0  -Wl,-retain-symbols-file,.libs/libgobject-2.0.exp

/usr/local/bin/libtool  --mode=link cc  -O2 -pipe -Wall  -L/usr/local/lib -o 
libgmodule-2.0.la -rpath /usr/local/lib  -Wl,-E -version-info 800:4:0  
-export-dynamic   gmodule.lo   ../glib/libglib-2.0.la -lintl -liconv 
cc -shared  -fPIC -DPIC -o .libs/libgmodule-2.0.so.800.4  .libs/gmodule.o  
-L/home/portobj/glib2-2.8.4/glib-2.8.4/glib/.libs -L/usr/local/lib -liconv 
-lintl -lglib-2.0  -Wl,-E

/usr/local/bin/libtool  --mode=link cc  -O2 -pipe -Wall  -L/usr/local/lib -o 
libgthread-2.0.la -rpath /usr/local/lib  -version-info 800:4:0  -export-dynamic 
  gthread-impl.lo  -pthread ../glib/libglib-2.0.la -lintl -liconv 
cc -shared  -fPIC -DPIC -o .libs/libgthread-2.0.so.800.4  .libs/gthread-impl.o  
-L/home/portobj/glib2-2.8.4/glib-2.8.4/glib/.libs -L/usr/local/lib -liconv 
-lintl -lglib-2.0  -pthread

/usr/local/bin/libtool  --mode=link cc  -O2 -pipe -Wall  -L/usr/local/lib -o 
closures  closures.o ../../gobject/libgobject-2.0.la 
../../gthread/libgthread-2.0.la -pthread -lintl -liconv 
cc -O2 -pipe -Wall -o .libs/closures closures.o -pthread  
-L/home/portobj/glib2-2.8.4/glib-2.8.4/gobject/.libs 
-L/home/portobj/glib2-2.8.4/glib-2.8.4/gthread/.libs 
-L/home/portobj/glib2-2.8.4/glib-2.8.4/glib/.libs  -L/usr/local/lib 
-lgobject-2.0 -lgthread-2.0 -lglib-2.0 -lintl -liconv -Wl,-rpath,/usr/local/lib



-- 
<[EMAIL PROTECTED]>

Index: devel/libtool/Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.51
diff -u -r1.51 Makefile
--- devel/libtool/Makefile      7 Jan 2006 09:58:39 -0000       1.51
+++ devel/libtool/Makefile      7 Jan 2006 10:52:06 -0000
@@ -6,6 +6,7 @@
 
 VERSION=       1.5.22
 DISTNAME=      libtool-${VERSION}
+PKGNAME=       ${DISTNAME}p0
 PKGNAME-ltdl=  libltdl-${VERSION}
 SHARED_LIBS=           ltdl 4.3
 MODGNU_SHARED_LIBS=    ltdl '-no-undefined'
Index: devel/libtool/patches/patch-ltmain_in
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
retrieving revision 1.18
diff -u -r1.18 patch-ltmain_in
--- devel/libtool/patches/patch-ltmain_in       7 Jan 2006 09:58:39 -0000       
1.18
+++ devel/libtool/patches/patch-ltmain_in       7 Jan 2006 10:52:06 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-ltmain_in,v 1.18 2006/01/07 09:58:39 brad Exp $
---- ltmain.in.orig     Thu Jan  5 18:24:18 2006
-+++ ltmain.in  Thu Jan  5 18:25:53 2006
+--- ltmain.in.orig     Sun Dec 18 13:43:52 2005
++++ ltmain.in  Sat Jan  7 02:38:20 2006
 @@ -2073,6 +2073,17 @@ EOF
        ;;
      esac
@@ -82,7 +82,135 @@
        # Remove version info from name if versioning should be avoided
        if test "$avoid_version" = yes && test "$need_version" = no; then
          major=
-@@ -6257,40 +6275,6 @@ relink_command=\"$relink_command\""
+@@ -3807,33 +3825,44 @@ EOF
+       deplibs=$newdeplibs
+       fi
+ 
+-
+       # move library search paths that coincide with paths to not yet
+       # installed libraries to the beginning of the library search list
+       new_libs=
+-      for path in $notinst_path; do
+-      case " $new_libs " in
+-      *" -L$path/$objdir "*) ;;
+-      *)
+-        case " $deplibs " in
+-        *" -L$path/$objdir "*)
+-          new_libs="$new_libs -L$path/$objdir" ;;
+-        esac
+-        ;;
+-      esac
+-      done
+-      for deplib in $deplibs; do
++      notinst_libs=
++      for deplib in $deplibs ; do
+       case $deplib in
+-      -L*)
+-        case " $new_libs " in
+-        *" $deplib "*) ;;
++        -L*)
++          dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
++          # We need an absolute path.
++          case $dir in
++          [\\/]* | [A-Za-z]:[\\/]*) ;;
++          *)
++            absdir=`cd "$dir" && pwd`
++            if test -z "$absdir"; then
++              $echo "$modename: cannot determine absolute directory name of 
\`$dir'" 1>&2
++              exit $EXIT_FAILURE
++            fi
++            dir="$absdir"
++            ;;
++          esac
++          case " $notinst_libs $new_libs " in
++          *" -L$dir "*) ;;
++          *)
++            case " $notinst_path " in
++            *" ${dir:%/$objdir} "*)
++              notinst_libs="$notinst_libs -L$dir"
++              ;;
++            *)
++              new_libs="$new_libs -L$dir"
++              ;;
++            esac
++            ;;
++          esac
++          ;;
+         *) new_libs="$new_libs $deplib" ;;
+-        esac
+-        ;;
+-      *) new_libs="$new_libs $deplib" ;;
+       esac
+       done
+-      deplibs="$new_libs"
++      deplibs="$notinst_libs $new_libs"
+ 
+ 
+       # All the library-specific variables (install_libdir is set above).
+@@ -4355,31 +4384,42 @@ EOF
+       # move library search paths that coincide with paths to not yet
+       # installed libraries to the beginning of the library search list
+       new_libs=
+-      for path in $notinst_path; do
+-      case " $new_libs " in
+-      *" -L$path/$objdir "*) ;;
+-      *)
+-        case " $compile_deplibs " in
+-        *" -L$path/$objdir "*)
+-          new_libs="$new_libs -L$path/$objdir" ;;
+-        esac
+-        ;;
+-      esac
+-      done
+-      for deplib in $compile_deplibs; do
++      notinst_libs=
++      for deplib in $compile_deplibs ; do
+       case $deplib in
+-      -L*)
+-        case " $new_libs " in
+-        *" $deplib "*) ;;
++        -L*)
++          dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'`
++          # We need an absolute path.
++          case $dir in
++          [\\/]* | [A-Za-z]:[\\/]*) ;;
++          *)
++            absdir=`cd "$dir" && pwd`
++            if test -z "$absdir"; then
++              $echo "$modename: cannot determine absolute directory name of 
\`$dir'" 1>&2
++              exit $EXIT_FAILURE
++            fi
++            dir="$absdir"
++            ;;
++          esac
++          case " $notinst_libs $new_libs " in
++          *" -L$dir "*) ;;
++          *)
++            case " $notinst_path " in
++            *" ${dir:%/$objdir} "*)
++              notinst_libs="$notinst_libs -L$dir"
++              ;;
++            *)
++              new_libs="$new_libs -L$dir"
++              ;;
++            esac
++            ;;
++          esac
++          ;;
+         *) new_libs="$new_libs $deplib" ;;
+-        esac
+-        ;;
+-      *) new_libs="$new_libs $deplib" ;;
+       esac
+       done
+-      compile_deplibs="$new_libs"
++      compile_deplibs="$notinst_libs $new_libs"
+ 
+-
+       compile_command="$compile_command $compile_deplibs"
+       finalize_command="$finalize_command $finalize_deplibs"
+ 
+@@ -6257,40 +6297,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
  

Reply via email to