get 'libtool --tag CXX' to work

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|

get 'libtool --tag CXX' to work

Marc Espie-2
The preserve_args fragment was missing, thus the generated relink commands
were bogus.

Okay ?

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile
--- Makefile 2 Nov 2005 02:47:09 -0000 1.44
+++ Makefile 6 Dec 2005 19:01:26 -0000
@@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
 
 VERSION= 1.5.20
 DISTNAME= libtool-${VERSION}
-PKGNAME= ${DISTNAME}p1
+PKGNAME= ${DISTNAME}p2
 PKGNAME-ltdl= libltdl-${VERSION}p1
 CATEGORIES= devel
 MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
Index: patches/patch-ltmain_in
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
retrieving revision 1.13
diff -u -p -r1.13 patch-ltmain_in
--- patches/patch-ltmain_in 2 Nov 2005 02:47:09 -0000 1.13
+++ patches/patch-ltmain_in 6 Dec 2005 19:01:26 -0000
@@ -1,7 +1,18 @@
 $OpenBSD: patch-ltmain_in,v 1.13 2005/11/02 02:47:09 brad Exp $
---- ltmain.in.orig Wed Aug 31 14:25:28 2005
-+++ ltmain.in Tue Nov  1 15:13:43 2005
-@@ -1089,14 +1089,15 @@ EOF
+--- ltmain.in.orig Wed Aug 31 20:25:28 2005
++++ ltmain.in Tue Dec  6 19:57:56 2005
+@@ -468,7 +468,9 @@ do
+     preserve_args="$preserve_args $arg"
+     ;;
+
+-  --tag) prevopt="--tag" prev=tag ;;
++  --tag) prevopt="--tag" prev=tag
++    preserve_args="$preserve_args --tag"
++    ;;
+   --tag=*)
+     set tag "$optarg" ${1+"$@"}
+     shift
+@@ -1089,14 +1091,15 @@ EOF
   if test -n "$link_static_flag"; then
     dlopen_self=$dlopen_self_static
   fi
@@ -18,7 +29,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
  break
  ;;
        esac
-@@ -1984,6 +1985,17 @@ EOF
+@@ -1984,6 +1987,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -36,7 +47,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2257,20 @@ EOF
+@@ -2245,20 +2259,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -67,7 +78,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2457,12 @@ EOF
+@@ -2445,8 +2459,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -81,7 +92,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2660,7 @@ EOF
+@@ -2644,7 +2662,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -90,7 +101,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5948,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5950,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Marc Espie-2
On Tue, Dec 06, 2005 at 08:27:47PM +0100, Marc Espie wrote:

> The preserve_args fragment was missing, thus the generated relink commands
> were bogus.
>
> Okay ?
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/Makefile,v
> retrieving revision 1.44
> diff -u -p -r1.44 Makefile
> --- Makefile 2 Nov 2005 02:47:09 -0000 1.44
> +++ Makefile 6 Dec 2005 19:01:26 -0000
> @@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
>  
>  VERSION= 1.5.20
>  DISTNAME= libtool-${VERSION}
> -PKGNAME= ${DISTNAME}p1
> +PKGNAME= ${DISTNAME}p2
>  PKGNAME-ltdl= libltdl-${VERSION}p1
>  CATEGORIES= devel
>  MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
> Index: patches/patch-ltmain_in
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
> retrieving revision 1.13
> diff -u -p -r1.13 patch-ltmain_in
> --- patches/patch-ltmain_in 2 Nov 2005 02:47:09 -0000 1.13
> +++ patches/patch-ltmain_in 6 Dec 2005 19:01:26 -0000
> @@ -1,7 +1,18 @@
>  $OpenBSD: patch-ltmain_in,v 1.13 2005/11/02 02:47:09 brad Exp $
> ---- ltmain.in.orig Wed Aug 31 14:25:28 2005
> -+++ ltmain.in Tue Nov  1 15:13:43 2005
> -@@ -1089,14 +1089,15 @@ EOF
> +--- ltmain.in.orig Wed Aug 31 20:25:28 2005
> ++++ ltmain.in Tue Dec  6 19:57:56 2005
> +@@ -468,7 +468,9 @@ do
> +     preserve_args="$preserve_args $arg"
> +     ;;
> +
> +-  --tag) prevopt="--tag" prev=tag ;;
> ++  --tag) prevopt="--tag" prev=tag
> ++    preserve_args="$preserve_args --tag"
> ++    ;;
> +   --tag=*)
> +     set tag "$optarg" ${1+"$@"}
> +     shift
> +@@ -1089,14 +1091,15 @@ EOF
>    if test -n "$link_static_flag"; then
>      dlopen_self=$dlopen_self_static
>    fi
> @@ -18,7 +29,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
>   break
>   ;;
>         esac
> -@@ -1984,6 +1985,17 @@ EOF
> +@@ -1984,6 +1987,17 @@ EOF
>   ;;
>       esac
>       for pass in $passes; do
> @@ -36,7 +47,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
>         if test "$linkmode,$pass" = "lib,link" ||
>   test "$linkmode,$pass" = "prog,scan"; then
>   libs="$deplibs"
> -@@ -2245,20 +2257,20 @@ EOF
> +@@ -2245,20 +2259,20 @@ EOF
>      # It is a libtool convenience library, so add in its objects.
>      convenience="$convenience $ladir/$objdir/$old_library"
>      old_convenience="$old_convenience $ladir/$objdir/$old_library"
> @@ -67,7 +78,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
>    continue
>   fi # $pass = conv
>  
> -@@ -2445,8 +2457,12 @@ EOF
> +@@ -2445,8 +2459,12 @@ EOF
>   fi
>  
>   link_static=no # Whether the deplib will be linked statically
> @@ -81,7 +92,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
>    if test "$installed" = no; then
>      notinst_deplibs="$notinst_deplibs $lib"
>      need_relink=yes
> -@@ -2644,7 +2660,7 @@ EOF
> +@@ -2644,7 +2662,7 @@ EOF
>      add_dir=
>      add=
>      # Finalize command for both is simple: just hardcode it.
> @@ -90,7 +101,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
>        add="$libdir/$linklib"
>      elif test "$hardcode_minus_L" = yes; then
>        add_dir="-L$libdir"
> -@@ -5932,40 +5948,6 @@ relink_command=\"$relink_command\""
> +@@ -5932,40 +5950,6 @@ relink_command=\"$relink_command\""
>       # Exit here if they wanted silent mode.
>       test "$show" = : && exit $EXIT_SUCCESS
>  

Note that this issue stands in the way of getting kde to use standard
libtool.

I am currently checking that at least kdelibs is happy with this diff
and standard libtool, so far, so good...

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Marc Espie-2
On Tue, Dec 06, 2005 at 09:59:19PM +0100, Marc Espie wrote:
> I am currently checking that at least kdelibs is happy with this diff
> and standard libtool, so far, so good...
Okay, this shit still does not work (well, the patch is good).

The cincher is,
libtool --tag=disable-static --tag=CXX
does not work, since --tag=CXX will redefine build_old_libs to yes.

YUCK.

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Jacob Meuser
In reply to this post by Marc Espie-2
On Tue, Dec 06, 2005 at 08:27:47PM +0100, Marc Espie wrote:

> The preserve_args fragment was missing, thus the generated relink commands
> were bogus.
>
> Okay ?
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/Makefile,v
> retrieving revision 1.44
> diff -u -p -r1.44 Makefile
> --- Makefile 2 Nov 2005 02:47:09 -0000 1.44
> +++ Makefile 6 Dec 2005 19:01:26 -0000
> @@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
>  
>  VERSION= 1.5.20
>  DISTNAME= libtool-${VERSION}
> -PKGNAME= ${DISTNAME}p1
> +PKGNAME= ${DISTNAME}p2
>  PKGNAME-ltdl= libltdl-${VERSION}p1
>  CATEGORIES= devel
>  MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
> Index: patches/patch-ltmain_in
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
> retrieving revision 1.13
> diff -u -p -r1.13 patch-ltmain_in
> --- patches/patch-ltmain_in 2 Nov 2005 02:47:09 -0000 1.13
> +++ patches/patch-ltmain_in 6 Dec 2005 19:01:26 -0000
> @@ -1,7 +1,18 @@
>  $OpenBSD: patch-ltmain_in,v 1.13 2005/11/02 02:47:09 brad Exp $
> ---- ltmain.in.orig Wed Aug 31 14:25:28 2005
> -+++ ltmain.in Tue Nov  1 15:13:43 2005
> -@@ -1089,14 +1089,15 @@ EOF
> +--- ltmain.in.orig Wed Aug 31 20:25:28 2005
> ++++ ltmain.in Tue Dec  6 19:57:56 2005
> +@@ -468,7 +468,9 @@ do
> +     preserve_args="$preserve_args $arg"
> +     ;;
> +
> +-  --tag) prevopt="--tag" prev=tag ;;
> ++  --tag) prevopt="--tag" prev=tag
> ++    preserve_args="$preserve_args --tag"

should probably be

> ++    preserve_args="$preserve_args $arg"

if you wish to sumbit this upstream

--
<[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Jacob Meuser
In reply to this post by Marc Espie-2
On Tue, Dec 06, 2005 at 10:27:59PM +0100, Marc Espie wrote:
> On Tue, Dec 06, 2005 at 09:59:19PM +0100, Marc Espie wrote:
> > I am currently checking that at least kdelibs is happy with this diff
> > and standard libtool, so far, so good...
> Okay, this shit still does not work (well, the patch is good).
>
> The cincher is,
> libtool --tag=disable-static --tag=CXX
> does not work, since --tag=CXX will redefine build_old_libs to yes.

you mean in the TAGs section?  or deep inside libtool?

is this with modules and libraries, or modules only?

what problem does it actually cause?  only static?  static and
dynamic but static gets chosen when dynamic is preferred?

and it looks like build_libtool_libs=yes will (should anyway)
override build_old_libs=yes.

--
<[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Ralf Wildenhues
Jacob Meuser <jakemsr <at> jakemsr.com> writes:
> On Tue, Dec 06, 2005 at 10:27:59PM +0100, Marc Espie wrote:
> > On Tue, Dec 06, 2005 at 09:59:19PM +0100, Marc Espie wrote:
> > > I am currently checking that at least kdelibs is happy with this diff
> > > and standard libtool, so far, so good...

Thanks for the patch!

> > The cincher is,
> > libtool --tag=disable-static --tag=CXX
> > does not work, since --tag=CXX will redefine build_old_libs to yes.
>
> you mean in the TAGs section?  or deep inside libtool?

Yes, in the TAGs section it will.

> is this with modules and libraries, or modules only?

Doesn't matter.

> what problem does it actually cause?  only static?  static and
> dynamic but static gets chosen when dynamic is preferred?

It's just that
  --tag=CXX
loads a set of variables, which includes build_old_libs.

> and it looks like build_libtool_libs=yes will (should anyway)
> override build_old_libs=yes.

Well, I'm not sure how to solve this.  If you pass
  --tag=disable-static --tag=disable-shared
or
  --tag=CC --tag=CXX --tag=F77

what would you expect to happen?  In those cases, taking the last one
given seems sane to me.  But we already break down here: we don't move
from static-only to shared-only.  So my first thought was just to
document that the last tag decides, and that going from static to shared
won't work.  But then again I don't know how KDE libs build rules are
generated, and it might not be easy to change the order of the arguments
for a set of rules.
  --tag=CXX --tag=disable-static

should do what you want.  Is that sufficient?  If not, we need to create
two more variables want_old_libs/want_libtool_libs to differentiate between
capability and desired operation.

Cheers,
Ralf

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Marc Espie-2
On Wed, Dec 07, 2005 at 08:45:51AM +0000, Ralf Wildenhues wrote:

> Jacob Meuser <jakemsr <at> jakemsr.com> writes:
> > On Tue, Dec 06, 2005 at 10:27:59PM +0100, Marc Espie wrote:
> > > On Tue, Dec 06, 2005 at 09:59:19PM +0100, Marc Espie wrote:
> > > > I am currently checking that at least kdelibs is happy with this diff
> > > > and standard libtool, so far, so good...
>
> Thanks for the patch!
>
> > > The cincher is,
> > > libtool --tag=disable-static --tag=CXX
> > > does not work, since --tag=CXX will redefine build_old_libs to yes.
> >
> > you mean in the TAGs section?  or deep inside libtool?
>
> Yes, in the TAGs section it will.
>
> > is this with modules and libraries, or modules only?
>
> Doesn't matter.
>
> > what problem does it actually cause?  only static?  static and
> > dynamic but static gets chosen when dynamic is preferred?
>
> It's just that
>   --tag=CXX
> loads a set of variables, which includes build_old_libs.
>
> > and it looks like build_libtool_libs=yes will (should anyway)
> > override build_old_libs=yes.
>
> Well, I'm not sure how to solve this.  If you pass
>   --tag=disable-static --tag=disable-shared
> or
>   --tag=CC --tag=CXX --tag=F77
>
> what would you expect to happen?  In those cases, taking the last one
> given seems sane to me.  But we already break down here: we don't move
> from static-only to shared-only.  So my first thought was just to
> document that the last tag decides, and that going from static to shared
> won't work.  But then again I don't know how KDE libs build rules are
> generated, and it might not be easy to change the order of the arguments
> for a set of rules.
>   --tag=CXX --tag=disable-static

It's not easy to change stuff there, not at all.


> should do what you want.  Is that sufficient?  If not, we need to create
> two more variables want_old_libs/want_libtool_libs to differentiate between
> capability and desired operation.

Yes, that's the way I want. And this is the kind of patch I'm working on...

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Ralf Wildenhues
In reply to this post by Marc Espie-2
* Marc Espie wrote on Tue, Dec 06, 2005 at 08:27:47PM CET:
> The preserve_args fragment was missing, thus the generated relink commands
> were bogus.

I have applied this to branch-1-5.

Cheers,
Ralf

2005-12-07  Marc Espie  <[hidden email]>

        * ltmain.in: Preserve both parts of `--tag TAG', for
        relink_command.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.108
diff -u -r1.334.2.108 ltmain.in
--- ltmain.in 3 Dec 2005 08:34:11 -0000 1.334.2.108
+++ ltmain.in 7 Dec 2005 20:52:50 -0000
@@ -467,7 +467,11 @@
     preserve_args="$preserve_args $arg"
     ;;
 
-  --tag) prevopt="--tag" prev=tag ;;
+  --tag)
+    prevopt="--tag"
+    prev=tag
+    preserve_args="$preserve_args --tag"
+    ;;
   --tag=*)
     set tag "$optarg" ${1+"$@"}
     shift


Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Marc Espie-2
In reply to this post by Marc Espie-2

Here's the patch I intend to commit.
This includes the former --tag CXX fix, plus the part that makes
--tag=disable-static
--tag=disable-shared

independent from other tags by delaying their effect.

As far as I can tell, kde is fairly happy with this....

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.44
diff -u -p -r1.44 Makefile
--- Makefile 2 Nov 2005 02:47:09 -0000 1.44
+++ Makefile 8 Dec 2005 23:12:49 -0000
@@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
 
 VERSION= 1.5.20
 DISTNAME= libtool-${VERSION}
-PKGNAME= ${DISTNAME}p1
+PKGNAME= ${DISTNAME}p2
 PKGNAME-ltdl= libltdl-${VERSION}p1
 CATEGORIES= devel
 MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
Index: patches/patch-libltdl_ltmain_sh
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-libltdl_ltmain_sh,v
retrieving revision 1.13
diff -u -p -r1.13 patch-libltdl_ltmain_sh
--- patches/patch-libltdl_ltmain_sh 2 Nov 2005 02:47:09 -0000 1.13
+++ patches/patch-libltdl_ltmain_sh 8 Dec 2005 23:12:49 -0000
@@ -1,7 +1,18 @@
 $OpenBSD: patch-libltdl_ltmain_sh,v 1.13 2005/11/02 02:47:09 brad Exp $
---- libltdl/ltmain.sh.orig Wed Aug 31 14:55:39 2005
-+++ libltdl/ltmain.sh Tue Nov  1 15:15:22 2005
-@@ -1089,14 +1089,15 @@ EOF
+--- libltdl/ltmain.sh.orig Wed Aug 31 20:55:39 2005
++++ libltdl/ltmain.sh Tue Dec  6 19:58:54 2005
+@@ -468,7 +468,9 @@ do
+     preserve_args="$preserve_args $arg"
+     ;;
+
+-  --tag) prevopt="--tag" prev=tag ;;
++  --tag) prevopt="--tag" prev=tag
++    preserve_args="$preserve_args --tag"
++    ;;
+   --tag=*)
+     set tag "$optarg" ${1+"$@"}
+     shift
+@@ -1089,14 +1091,15 @@ EOF
   if test -n "$link_static_flag"; then
     dlopen_self=$dlopen_self_static
   fi
@@ -18,7 +29,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.13
  break
  ;;
        esac
-@@ -1984,6 +1985,17 @@ EOF
+@@ -1984,6 +1987,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -36,7 +47,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.13
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2257,20 @@ EOF
+@@ -2245,20 +2259,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -67,7 +78,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.13
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2457,12 @@ EOF
+@@ -2445,8 +2459,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -81,7 +92,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.13
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2660,7 @@ EOF
+@@ -2644,7 +2662,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -90,7 +101,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.13
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5948,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5950,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
Index: patches/patch-ltmain_in
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
retrieving revision 1.13
diff -u -p -r1.13 patch-ltmain_in
--- patches/patch-ltmain_in 2 Nov 2005 02:47:09 -0000 1.13
+++ patches/patch-ltmain_in 8 Dec 2005 23:12:49 -0000
@@ -1,7 +1,46 @@
 $OpenBSD: patch-ltmain_in,v 1.13 2005/11/02 02:47:09 brad Exp $
---- ltmain.in.orig Wed Aug 31 14:25:28 2005
-+++ ltmain.in Tue Nov  1 15:13:43 2005
-@@ -1089,14 +1089,15 @@ EOF
+--- ltmain.in.orig Wed Aug 31 20:25:28 2005
++++ ltmain.in Wed Dec  7 09:43:10 2005
+@@ -352,6 +352,8 @@ func_extract_archives ()
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
++disable_libs=no
++
+ # Parse our command line options once, thoroughly.
+ while test "$#" -gt 0
+ do
+@@ -468,7 +470,9 @@ do
+     preserve_args="$preserve_args $arg"
+     ;;
+
+-  --tag) prevopt="--tag" prev=tag ;;
++  --tag) prevopt="--tag" prev=tag
++    preserve_args="$preserve_args --tag"
++    ;;
+   --tag=*)
+     set tag "$optarg" ${1+"$@"}
+     shift
+@@ -500,6 +504,18 @@ if test -n "$prevopt"; then
+   exit $EXIT_FAILURE
+ fi
+
++case $disable_libs in
++no)
++  ;;
++shared)
++  build_libtool_libs=no
++  build_old_libs=yes
++  ;;
++static)
++  build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
++  ;;
++esac
++
+ # If this variable is set in any of the actions, the command in it
+ # will be execed at the end.  This prevents here-documents from being
+ # left over by shells.
+@@ -1089,14 +1105,15 @@ EOF
   if test -n "$link_static_flag"; then
     dlopen_self=$dlopen_self_static
   fi
@@ -18,7 +57,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
  break
  ;;
        esac
-@@ -1984,6 +1985,17 @@ EOF
+@@ -1984,6 +2001,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -36,7 +75,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2257,20 @@ EOF
+@@ -2245,20 +2273,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -67,7 +106,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2457,12 @@ EOF
+@@ -2445,8 +2473,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -81,7 +120,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2660,7 @@ EOF
+@@ -2644,7 +2676,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -90,7 +129,7 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5948,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
@@ -131,3 +170,18 @@ $OpenBSD: patch-ltmain_in,v 1.13 2005/11
      exit $EXIT_SUCCESS
      ;;
 
+@@ -6516,12 +6514,11 @@ exit $?
+ # configuration.  But we'll never go from static-only to shared-only.
+
+ # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+-build_libtool_libs=no
+-build_old_libs=yes
++disable_libs=shared
+ # ### END LIBTOOL TAG CONFIG: disable-shared
+
+ # ### BEGIN LIBTOOL TAG CONFIG: disable-static
+-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
++disable_libs=static
+ # ### END LIBTOOL TAG CONFIG: disable-static
+
+ # Local Variables:

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Ralf Wildenhues
[ see http://article.gmane.org/gmane.os.openbsd.ports/15455 ]

* Marc Espie wrote on Fri, Dec 09, 2005 at 12:13:45AM CET:
>
> This includes the former --tag CXX fix, plus the part that makes
> --tag=disable-static
> --tag=disable-shared
>
> independent from other tags by delaying their effect.

libtool-patches readers: any reason against putting this in branch-1-5
and forward-porting?  I can't see any, but am not totally sure.

If not, I'll forward-port and write a test for HEAD.  The only bit I
changed was to use plain echo instead of $echo, which is safe here.

Cheers, and thank you for the patch,
Ralf

2005-12-09  Marc Espie  <[hidden email]>

        * ltmain.in: Change semantics of `--tag=disable-static' and
        `--tag=disable-shared': The last one given wins now, both
        override the default setting inherited by other `--tag'
        arguments, even if passed later on the command line.
        Still make sure we do not disable both kinds by falling back
        to static libraries.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.108
diff -u -r1.334.2.108 ltmain.in
--- ltmain.in 3 Dec 2005 08:34:11 -0000 1.334.2.108
+++ ltmain.in 9 Dec 2005 08:48:27 -0000
@@ -351,6 +351,8 @@
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -499,6 +501,18 @@
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no)
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
@@ -6740,12 +6754,11 @@
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
+disable_libs=shared
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables:

Reply | Threaded
Open this post in threaded view
|

Re: get 'libtool --tag CXX' to work

Peter O'Gorman
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ralf Wildenhues wrote:
| [ see http://article.gmane.org/gmane.os.openbsd.ports/15455 ]
|
| * Marc Espie wrote on Fri, Dec 09, 2005 at 12:13:45AM CET:
|
|>This includes the former --tag CXX fix, plus the part that makes
|>--tag=disable-static
|>--tag=disable-shared
|>
|>independent from other tags by delaying their effect.
|
|
| libtool-patches readers: any reason against putting this in branch-1-5
| and forward-porting?  I can't see any, but am not totally sure.

Looks fine.

Peter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iQCVAwUBQ5l7k7iDAg3OZTLPAQKzbAP8D9PW301bi8Wk0P48g78cZ9EvCdZZ1sgz
BFBqfiHVrJNXIyp9vC+pmwxDorTXSUGexaEogcQgAGPuzwZ/1VhnXNOZkwe7Qit2
wfuyEjV86ZMgf2aqL+T9jBMYV9LAZ58KPBMf9CbCfeqYMWsNDy++5IG2lNZF84Tl
DkEzyyFyUdU=
=R6CV
-----END PGP SIGNATURE-----

Reply | Threaded
Open this post in threaded view
|

libtool vs. -lresolv

Marc Espie-2
In reply to this post by Ralf Wildenhues
OpenBSD just has a dummy libresolv, that is used for some `legacy' programs
that expect to link against it. It doesn't contain anything useful...

Some configure stuff (kde for instance) detects the presence of libresolv,
and tries to link against it... And of course, libtool detects that there is
just a static library, and thus refuses to build shared modules using that
library...

The following patch fixes that.

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile
--- Makefile 12 Dec 2005 15:15:16 -0000 1.45
+++ Makefile 15 Dec 2005 18:16:43 -0000
@@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
 
 VERSION= 1.5.20
 DISTNAME= libtool-${VERSION}
-PKGNAME= ${DISTNAME}p2
+PKGNAME= ${DISTNAME}p3
 PKGNAME-ltdl= libltdl-${VERSION}p1
 CATEGORIES= devel
 MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
Index: patches/patch-libltdl_ltmain_sh
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-libltdl_ltmain_sh,v
retrieving revision 1.14
diff -u -p -r1.14 patch-libltdl_ltmain_sh
--- patches/patch-libltdl_ltmain_sh 12 Dec 2005 15:15:16 -0000 1.14
+++ patches/patch-libltdl_ltmain_sh 15 Dec 2005 18:16:43 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-libltdl_ltmain_sh,v 1.14 2005/12/12 15:15:16 espie Exp $
 --- libltdl/ltmain.sh.orig Wed Aug 31 20:55:39 2005
-+++ libltdl/ltmain.sh Wed Dec  7 09:44:14 2005
++++ libltdl/ltmain.sh Thu Dec 15 19:10:15 2005
 @@ -352,6 +352,8 @@ func_extract_archives ()
  # Darwin sucks
  eval std_shrext=\"$shrext_cmds\"
@@ -57,7 +57,21 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
  break
  ;;
        esac
-@@ -1984,6 +2001,17 @@ EOF
+@@ -1503,6 +1520,13 @@ EOF
+   continue
+   ;;
+ esac
++ elif test "X$arg" = "X-lresolv"; then
++ case $host in
++ *-*-openbsd*)
++   # dummy library, no shared version
++   continue
++   ;;
++ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+@@ -1984,6 +2008,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -75,7 +89,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2273,20 @@ EOF
+@@ -2245,20 +2280,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -106,7 +120,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2473,12 @@ EOF
+@@ -2445,8 +2480,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -120,7 +134,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2676,7 @@ EOF
+@@ -2644,7 +2683,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -129,7 +143,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
@@ -170,7 +184,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
      exit $EXIT_SUCCESS
      ;;
 
-@@ -6516,12 +6514,11 @@ exit $?
+@@ -6516,12 +6521,11 @@ exit $?
  # configuration.  But we'll never go from static-only to shared-only.
 
  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
Index: patches/patch-ltmain_in
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
retrieving revision 1.14
diff -u -p -r1.14 patch-ltmain_in
--- patches/patch-ltmain_in 12 Dec 2005 15:15:16 -0000 1.14
+++ patches/patch-ltmain_in 15 Dec 2005 18:16:43 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-ltmain_in,v 1.14 2005/12/12 15:15:16 espie Exp $
 --- ltmain.in.orig Wed Aug 31 20:25:28 2005
-+++ ltmain.in Wed Dec  7 09:43:10 2005
++++ ltmain.in Thu Dec 15 19:09:43 2005
 @@ -352,6 +352,8 @@ func_extract_archives ()
  # Darwin sucks
  eval std_shrext=\"$shrext_cmds\"
@@ -57,7 +57,21 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
  break
  ;;
        esac
-@@ -1984,6 +2001,17 @@ EOF
+@@ -1503,6 +1520,13 @@ EOF
+   continue
+   ;;
+ esac
++ elif test "X$arg" = "X-lresolv"; then
++ case $host in
++ *-*-openbsd*)
++   # dummy library, no shared version
++   continue
++   ;;
++ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+@@ -1984,6 +2008,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -75,7 +89,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2273,20 @@ EOF
+@@ -2245,20 +2280,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -106,7 +120,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2473,12 @@ EOF
+@@ -2445,8 +2480,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -120,7 +134,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2676,7 @@ EOF
+@@ -2644,7 +2683,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -129,7 +143,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
@@ -170,7 +184,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
      exit $EXIT_SUCCESS
      ;;
 
-@@ -6516,12 +6514,11 @@ exit $?
+@@ -6516,12 +6521,11 @@ exit $?
  # configuration.  But we'll never go from static-only to shared-only.
 
  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared

Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Ralf Wildenhues
Hi Marc,

* Marc Espie wrote on Thu, Dec 15, 2005 at 07:18:26PM CET:
> OpenBSD just has a dummy libresolv, that is used for some `legacy' programs
> that expect to link against it. It doesn't contain anything useful...

Then the kde configure should not pick it up, with AC_SEARCH_LIBS for
example.

> Some configure stuff (kde for instance) detects the presence of libresolv,
> and tries to link against it... And of course, libtool detects that there is
> just a static library, and thus refuses to build shared modules using that
> library...
>
> The following patch fixes that.

The patch is fine as a workaround for above.  But regarding upstream
libtool, I'd rather like the fix be done in the right place, in KDEs
configury.

Cheers,
Ralf

Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Marc Espie-2
In reply to this post by Marc Espie-2
Yet another patch, this one pedantic, and mixed with the other one,
since I don't want to bump the package twice.

I've patched configure directly, since patching libtool.m4 makes things
a bit awkward to regenerate (patch to libtool.m4 attached).

On OpenBSD, the ld.so path is /usr/lib, and never includes /lib. Thus,
do not put /lib there... this is more correct, and removes some useless
tests...


Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/libtool/Makefile,v
retrieving revision 1.45
diff -u -p -r1.45 Makefile
--- Makefile 12 Dec 2005 15:15:16 -0000 1.45
+++ Makefile 15 Dec 2005 18:45:34 -0000
@@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
 
 VERSION= 1.5.20
 DISTNAME= libtool-${VERSION}
-PKGNAME= ${DISTNAME}p2
+PKGNAME= ${DISTNAME}p3
 PKGNAME-ltdl= libltdl-${VERSION}p1
 CATEGORIES= devel
 MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure 15 Dec 2005 18:45:34 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- configure.orig Thu Dec 15 19:34:34 2005
++++ configure Thu Dec 15 19:34:56 2005
+@@ -8646,6 +8646,7 @@ nto-qnx*)
+
+ openbsd*)
+   version_type=sunos
++  sys_lib_dlsearch_path_spec="/usr/lib"
+   need_lib_prefix=no
+   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+   case $host_os in
Index: patches/patch-libltdl_ltmain_sh
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-libltdl_ltmain_sh,v
retrieving revision 1.14
diff -u -p -r1.14 patch-libltdl_ltmain_sh
--- patches/patch-libltdl_ltmain_sh 12 Dec 2005 15:15:16 -0000 1.14
+++ patches/patch-libltdl_ltmain_sh 15 Dec 2005 18:45:34 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-libltdl_ltmain_sh,v 1.14 2005/12/12 15:15:16 espie Exp $
 --- libltdl/ltmain.sh.orig Wed Aug 31 20:55:39 2005
-+++ libltdl/ltmain.sh Wed Dec  7 09:44:14 2005
++++ libltdl/ltmain.sh Thu Dec 15 19:10:15 2005
 @@ -352,6 +352,8 @@ func_extract_archives ()
  # Darwin sucks
  eval std_shrext=\"$shrext_cmds\"
@@ -57,7 +57,21 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
  break
  ;;
        esac
-@@ -1984,6 +2001,17 @@ EOF
+@@ -1503,6 +1520,13 @@ EOF
+   continue
+   ;;
+ esac
++ elif test "X$arg" = "X-lresolv"; then
++ case $host in
++ *-*-openbsd*)
++   # dummy library, no shared version
++   continue
++   ;;
++ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+@@ -1984,6 +2008,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -75,7 +89,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2273,20 @@ EOF
+@@ -2245,20 +2280,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -106,7 +120,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2473,12 @@ EOF
+@@ -2445,8 +2480,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -120,7 +134,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2676,7 @@ EOF
+@@ -2644,7 +2683,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -129,7 +143,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
@@ -170,7 +184,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
      exit $EXIT_SUCCESS
      ;;
 
-@@ -6516,12 +6514,11 @@ exit $?
+@@ -6516,12 +6521,11 @@ exit $?
  # configuration.  But we'll never go from static-only to shared-only.
 
  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
Index: patches/patch-ltmain_in
===================================================================
RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
retrieving revision 1.14
diff -u -p -r1.14 patch-ltmain_in
--- patches/patch-ltmain_in 12 Dec 2005 15:15:16 -0000 1.14
+++ patches/patch-ltmain_in 15 Dec 2005 18:45:34 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-ltmain_in,v 1.14 2005/12/12 15:15:16 espie Exp $
 --- ltmain.in.orig Wed Aug 31 20:25:28 2005
-+++ ltmain.in Wed Dec  7 09:43:10 2005
++++ ltmain.in Thu Dec 15 19:09:43 2005
 @@ -352,6 +352,8 @@ func_extract_archives ()
  # Darwin sucks
  eval std_shrext=\"$shrext_cmds\"
@@ -57,7 +57,21 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
  break
  ;;
        esac
-@@ -1984,6 +2001,17 @@ EOF
+@@ -1503,6 +1520,13 @@ EOF
+   continue
+   ;;
+ esac
++ elif test "X$arg" = "X-lresolv"; then
++ case $host in
++ *-*-openbsd*)
++   # dummy library, no shared version
++   continue
++   ;;
++ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+@@ -1984,6 +2008,17 @@ EOF
  ;;
      esac
      for pass in $passes; do
@@ -75,7 +89,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
        if test "$linkmode,$pass" = "lib,link" ||
  test "$linkmode,$pass" = "prog,scan"; then
  libs="$deplibs"
-@@ -2245,20 +2273,20 @@ EOF
+@@ -2245,20 +2280,20 @@ EOF
     # It is a libtool convenience library, so add in its objects.
     convenience="$convenience $ladir/$objdir/$old_library"
     old_convenience="$old_convenience $ladir/$objdir/$old_library"
@@ -106,7 +120,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
   continue
  fi # $pass = conv
 
-@@ -2445,8 +2473,12 @@ EOF
+@@ -2445,8 +2480,12 @@ EOF
  fi
 
  link_static=no # Whether the deplib will be linked statically
@@ -120,7 +134,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
   if test "$installed" = no; then
     notinst_deplibs="$notinst_deplibs $lib"
     need_relink=yes
-@@ -2644,7 +2676,7 @@ EOF
+@@ -2644,7 +2683,7 @@ EOF
     add_dir=
     add=
     # Finalize command for both is simple: just hardcode it.
@@ -129,7 +143,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
       add="$libdir/$linklib"
     elif test "$hardcode_minus_L" = yes; then
       add_dir="-L$libdir"
-@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
+@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
      # Exit here if they wanted silent mode.
      test "$show" = : && exit $EXIT_SUCCESS
 
@@ -170,7 +184,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
      exit $EXIT_SUCCESS
      ;;
 
-@@ -6516,12 +6514,11 @@ exit $?
+@@ -6516,12 +6521,11 @@ exit $?
  # configuration.  But we'll never go from static-only to shared-only.
 
  # ### BEGIN LIBTOOL TAG CONFIG: disable-shared

d (322 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Thorsten Glaser-3
In reply to this post by Ralf Wildenhues
Ralf Wildenhues dixit:

>The patch is fine as a workaround for above.  But regarding upstream
>libtool, I'd rather like the fix be done in the right place, in KDEs
>configury.

It's not only KDE which barfs at it. Things get worse when you also
have a dummy libdl (libdl functions are in libc), which - out of a
sudden - unbreaks lots of stuff which just refuses to build e.g. mo-
dules without a libdl existing.

It may be a workaround, but it's an effective one.

Thanks Marc!

bye,
//mirabile

PS: Marc, you might want to fix your Message-ID headers to end
    in a unique domain which actually belongs to you (it doesn't
    need to exist) to aid archives which index by it.
--
Subject: crazy fix for zlib
we get the good interface we want, apache gets the broken api they want.
i guess it is kinda twisted though.
        -- Ted Unangst auf [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Ralf Wildenhues
* Thorsten Glaser wrote on Thu, Dec 15, 2005 at 08:10:09PM CET:

> Ralf Wildenhues dixit:
>
> >The patch is fine as a workaround for above.  But regarding upstream
> >libtool, I'd rather like the fix be done in the right place, in KDEs
> >configury.
>
> It's not only KDE which barfs at it. Things get worse when you also
> have a dummy libdl (libdl functions are in libc), which - out of a
> sudden - unbreaks lots of stuff which just refuses to build e.g. mo-
> dules without a libdl existing.
>
> It may be a workaround, but it's an effective one.

Hmm, yes, I see the point in fixing it in one place.  OTOH, the
AC_SEARCH_LIBS one does not have to be adapted for other systems --
do other BSD systems have a stub libresolv?

Maybe we should have a variable to set in libtool.m4 with a list of
libraries to skip, to stop ltmain from getting messier.

Cheers,
Ralf

Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Brad Smith-14
In reply to this post by Marc Espie-2
On Thu, Dec 15, 2005 at 07:46:41PM +0100, Marc Espie wrote:
> Yet another patch, this one pedantic, and mixed with the other one,
> since I don't want to bump the package twice.
>
> I've patched configure directly, since patching libtool.m4 makes things
> a bit awkward to regenerate (patch to libtool.m4 attached).
>
> On OpenBSD, the ld.so path is /usr/lib, and never includes /lib. Thus,
> do not put /lib there... this is more correct, and removes some useless
> tests...

Personally I really don't like this patch. This just covers up broken configure
scripts. libtool is bad enough as it is nevermind adding more disgusting
hacks to it. I won't reject this going into our own local tree but it
should not be put into libtool upstream no matter what.
 

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/Makefile,v
> retrieving revision 1.45
> diff -u -p -r1.45 Makefile
> --- Makefile 12 Dec 2005 15:15:16 -0000 1.45
> +++ Makefile 15 Dec 2005 18:45:34 -0000
> @@ -6,7 +6,7 @@ COMMENT-ltdl= "GNU libtool system indepe
>  
>  VERSION= 1.5.20
>  DISTNAME= libtool-${VERSION}
> -PKGNAME= ${DISTNAME}p2
> +PKGNAME= ${DISTNAME}p3
>  PKGNAME-ltdl= libltdl-${VERSION}p1
>  CATEGORIES= devel
>  MASTER_SITES= ${MASTER_SITE_GNU:=libtool/}
> Index: patches/patch-configure
> ===================================================================
> RCS file: patches/patch-configure
> diff -N patches/patch-configure
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-configure 15 Dec 2005 18:45:34 -0000
> @@ -0,0 +1,11 @@
> +$OpenBSD$
> +--- configure.orig Thu Dec 15 19:34:34 2005
> ++++ configure Thu Dec 15 19:34:56 2005
> +@@ -8646,6 +8646,7 @@ nto-qnx*)
> +
> + openbsd*)
> +   version_type=sunos
> ++  sys_lib_dlsearch_path_spec="/usr/lib"
> +   need_lib_prefix=no
> +   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
> +   case $host_os in
> Index: patches/patch-libltdl_ltmain_sh
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/patches/patch-libltdl_ltmain_sh,v
> retrieving revision 1.14
> diff -u -p -r1.14 patch-libltdl_ltmain_sh
> --- patches/patch-libltdl_ltmain_sh 12 Dec 2005 15:15:16 -0000 1.14
> +++ patches/patch-libltdl_ltmain_sh 15 Dec 2005 18:45:34 -0000
> @@ -1,6 +1,6 @@
>  $OpenBSD: patch-libltdl_ltmain_sh,v 1.14 2005/12/12 15:15:16 espie Exp $
>  --- libltdl/ltmain.sh.orig Wed Aug 31 20:55:39 2005
> -+++ libltdl/ltmain.sh Wed Dec  7 09:44:14 2005
> ++++ libltdl/ltmain.sh Thu Dec 15 19:10:15 2005
>  @@ -352,6 +352,8 @@ func_extract_archives ()
>   # Darwin sucks
>   eval std_shrext=\"$shrext_cmds\"
> @@ -57,7 +57,21 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>   break
>   ;;
>         esac
> -@@ -1984,6 +2001,17 @@ EOF
> +@@ -1503,6 +1520,13 @@ EOF
> +   continue
> +   ;;
> + esac
> ++ elif test "X$arg" = "X-lresolv"; then
> ++ case $host in
> ++ *-*-openbsd*)
> ++   # dummy library, no shared version
> ++   continue
> ++   ;;
> ++ esac
> + fi
> + deplibs="$deplibs $arg"
> + continue
> +@@ -1984,6 +2008,17 @@ EOF
>   ;;
>       esac
>       for pass in $passes; do
> @@ -75,7 +89,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>         if test "$linkmode,$pass" = "lib,link" ||
>   test "$linkmode,$pass" = "prog,scan"; then
>   libs="$deplibs"
> -@@ -2245,20 +2273,20 @@ EOF
> +@@ -2245,20 +2280,20 @@ EOF
>      # It is a libtool convenience library, so add in its objects.
>      convenience="$convenience $ladir/$objdir/$old_library"
>      old_convenience="$old_convenience $ladir/$objdir/$old_library"
> @@ -106,7 +120,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>    continue
>   fi # $pass = conv
>  
> -@@ -2445,8 +2473,12 @@ EOF
> +@@ -2445,8 +2480,12 @@ EOF
>   fi
>  
>   link_static=no # Whether the deplib will be linked statically
> @@ -120,7 +134,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>    if test "$installed" = no; then
>      notinst_deplibs="$notinst_deplibs $lib"
>      need_relink=yes
> -@@ -2644,7 +2676,7 @@ EOF
> +@@ -2644,7 +2683,7 @@ EOF
>      add_dir=
>      add=
>      # Finalize command for both is simple: just hardcode it.
> @@ -129,7 +143,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>        add="$libdir/$linklib"
>      elif test "$hardcode_minus_L" = yes; then
>        add_dir="-L$libdir"
> -@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
> +@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
>       # Exit here if they wanted silent mode.
>       test "$show" = : && exit $EXIT_SUCCESS
>  
> @@ -170,7 +184,7 @@ $OpenBSD: patch-libltdl_ltmain_sh,v 1.14
>       exit $EXIT_SUCCESS
>       ;;
>  
> -@@ -6516,12 +6514,11 @@ exit $?
> +@@ -6516,12 +6521,11 @@ exit $?
>   # configuration.  But we'll never go from static-only to shared-only.
>  
>   # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
> Index: patches/patch-ltmain_in
> ===================================================================
> RCS file: /cvs/ports/devel/libtool/patches/patch-ltmain_in,v
> retrieving revision 1.14
> diff -u -p -r1.14 patch-ltmain_in
> --- patches/patch-ltmain_in 12 Dec 2005 15:15:16 -0000 1.14
> +++ patches/patch-ltmain_in 15 Dec 2005 18:45:34 -0000
> @@ -1,6 +1,6 @@
>  $OpenBSD: patch-ltmain_in,v 1.14 2005/12/12 15:15:16 espie Exp $
>  --- ltmain.in.orig Wed Aug 31 20:25:28 2005
> -+++ ltmain.in Wed Dec  7 09:43:10 2005
> ++++ ltmain.in Thu Dec 15 19:09:43 2005
>  @@ -352,6 +352,8 @@ func_extract_archives ()
>   # Darwin sucks
>   eval std_shrext=\"$shrext_cmds\"
> @@ -57,7 +57,21 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>   break
>   ;;
>         esac
> -@@ -1984,6 +2001,17 @@ EOF
> +@@ -1503,6 +1520,13 @@ EOF
> +   continue
> +   ;;
> + esac
> ++ elif test "X$arg" = "X-lresolv"; then
> ++ case $host in
> ++ *-*-openbsd*)
> ++   # dummy library, no shared version
> ++   continue
> ++   ;;
> ++ esac
> + fi
> + deplibs="$deplibs $arg"
> + continue
> +@@ -1984,6 +2008,17 @@ EOF
>   ;;
>       esac
>       for pass in $passes; do
> @@ -75,7 +89,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>         if test "$linkmode,$pass" = "lib,link" ||
>   test "$linkmode,$pass" = "prog,scan"; then
>   libs="$deplibs"
> -@@ -2245,20 +2273,20 @@ EOF
> +@@ -2245,20 +2280,20 @@ EOF
>      # It is a libtool convenience library, so add in its objects.
>      convenience="$convenience $ladir/$objdir/$old_library"
>      old_convenience="$old_convenience $ladir/$objdir/$old_library"
> @@ -106,7 +120,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>    continue
>   fi # $pass = conv
>  
> -@@ -2445,8 +2473,12 @@ EOF
> +@@ -2445,8 +2480,12 @@ EOF
>   fi
>  
>   link_static=no # Whether the deplib will be linked statically
> @@ -120,7 +134,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>    if test "$installed" = no; then
>      notinst_deplibs="$notinst_deplibs $lib"
>      need_relink=yes
> -@@ -2644,7 +2676,7 @@ EOF
> +@@ -2644,7 +2683,7 @@ EOF
>      add_dir=
>      add=
>      # Finalize command for both is simple: just hardcode it.
> @@ -129,7 +143,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>        add="$libdir/$linklib"
>      elif test "$hardcode_minus_L" = yes; then
>        add_dir="-L$libdir"
> -@@ -5932,40 +5964,6 @@ relink_command=\"$relink_command\""
> +@@ -5932,40 +5971,6 @@ relink_command=\"$relink_command\""
>       # Exit here if they wanted silent mode.
>       test "$show" = : && exit $EXIT_SUCCESS
>  
> @@ -170,7 +184,7 @@ $OpenBSD: patch-ltmain_in,v 1.14 2005/12
>       exit $EXIT_SUCCESS
>       ;;
>  
> -@@ -6516,12 +6514,11 @@ exit $?
> +@@ -6516,12 +6521,11 @@ exit $?
>   # configuration.  But we'll never go from static-only to shared-only.
>  
>   # ### BEGIN LIBTOOL TAG CONFIG: disable-shared

Content-Description: pedantic.diff

> --- libtool.m4.orig Thu Dec 15 19:45:40 2005
> +++ libtool.m4 Thu Dec 15 19:46:01 2005
> @@ -1580,6 +1580,7 @@ nto-qnx*)
>  
>  openbsd*)
>    version_type=sunos
> +  sys_lib_dlsearch_path_spec="/usr/lib"
>    need_lib_prefix=no
>    # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
>    case $host_os in

Reply | Threaded
Open this post in threaded view
|

Re: libtool vs. -lresolv

Peter Valchev
In reply to this post by Thorsten Glaser-3
> >The patch is fine as a workaround for above.  But regarding upstream
> >libtool, I'd rather like the fix be done in the right place, in KDEs
> >configury.
>
> It's not only KDE which barfs at it. Things get worse when you also
> have a dummy libdl (libdl functions are in libc), which - out of a
> sudden - unbreaks lots of stuff which just refuses to build e.g. mo-
> dules without a libdl existing.

libdl has been dead/gone for a LONG time now.

In fact it is silly to keep libresolv around at this day and age.
"Legacy" programs that think they need it can be trivially fixed.
I don't think having it around gains anything anymore, it's 2005.

Reply | Threaded
Open this post in threaded view
|

FYI: OpenBSD dlsearch path (was: libtool vs. -lresolv)

Ralf Wildenhues
In reply to this post by Marc Espie-2
* Marc Espie wrote on Thu, Dec 15, 2005 at 07:46:41PM CET:
>
> On OpenBSD, the ld.so path is /usr/lib, and never includes /lib. Thus,
> do not put /lib there... this is more correct, and removes some useless
> tests...

I assume that Brad's comment was about the other part of the patch
only(?).  So I have applied the following to CVS branch-1-5 and HEAD.

Cheers,
Ralf

branch-1-5:
2005-12-18  Marc Espie  <[hidden email]>

        * libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER) [ openbsd ]
        <sys_lib_dlsearch_path_spec>: Set to `/usr/lib' only.

Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.141
diff -u -r1.314.2.141 libtool.m4
--- libtool.m4 27 Nov 2005 15:18:03 -0000 1.314.2.141
+++ libtool.m4 18 Dec 2005 12:04:55 -0000
@@ -1636,6 +1636,7 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in


HEAD:
2005-12-18  Marc Espie  <[hidden email]>

        * libltdl/m4/libtool.m4 (AC_LIBTOOL_SYS_DYNAMIC_LINKER)
        [ openbsd ] <sys_lib_dlsearch_path_spec>: Set to `/usr/lib'
        only.

Index: libltdl/m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/libtool.m4,v
retrieving revision 1.51
diff -u -r1.51 libtool.m4
--- libltdl/m4/libtool.m4 8 Dec 2005 04:17:02 -0000 1.51
+++ libltdl/m4/libtool.m4 18 Dec 2005 12:05:28 -0000
@@ -2348,6 +2348,7 @@
 
 openbsd*)
   version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
   need_lib_prefix=no
   # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
   case $host_os in


Reply | Threaded
Open this post in threaded view
|

FYI: --tag=disable-static (was: get 'libtool --tag CXX' to work)

Ralf Wildenhues
In reply to this post by Peter O'Gorman
Sorry for the delay.

* Peter O'Gorman wrote on Fri, Dec 09, 2005 at 01:41:55PM CET:

> Ralf Wildenhues wrote:
> | [ see http://article.gmane.org/gmane.os.openbsd.ports/15455 ]
> |
> | * Marc Espie wrote on Fri, Dec 09, 2005 at 12:13:45AM CET:
> |
> |>This includes the former --tag CXX fix, plus the part that makes
> |>--tag=disable-static
> |>--tag=disable-shared
> |>
> |>independent from other tags by delaying their effect.
> |
> | libtool-patches readers: any reason against putting this in branch-1-5
> | and forward-porting?  I can't see any, but am not totally sure.
>
> Looks fine.

Well, I just applied this to branch-1-5 for now.  CVS HEAD works
differently here: build_old_libs and build_libtool_libs are not output
for each tag (CXX, F77, ...), only for the default (CC) tag, so the
other ones can't overwrite the setting done by --tag=disable-shared.

Cheers,
Ralf

2005-12-18  Marc Espie  <[hidden email]>
 
        * ltmain.in: Change semantics of `--tag=disable-static' and
        `--tag=disable-shared': The last one given wins now, both
        override the default setting inherited by other `--tag'
        arguments, even if passed later on the command line.
        Still make sure we do not disable both kinds by falling back
        to static libraries.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.110
diff -u -r1.334.2.110 ltmain.in
--- ltmain.in 13 Dec 2005 14:39:22 -0000 1.334.2.110
+++ ltmain.in 18 Dec 2005 12:24:59 -0000
@@ -351,6 +351,8 @@
 # Darwin sucks
 eval std_shrext=\"$shrext_cmds\"
 
+disable_libs=no
+
 # Parse our command line options once, thoroughly.
 while test "$#" -gt 0
 do
@@ -503,6 +505,18 @@
   exit $EXIT_FAILURE
 fi
 
+case $disable_libs in
+no)
+  ;;
+shared)
+  build_libtool_libs=no
+  build_old_libs=yes
+  ;;
+static)
+  build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+  ;;
+esac
+
 # If this variable is set in any of the actions, the command in it
 # will be execed at the end.  This prevents here-documents from being
 # left over by shells.
@@ -6748,12 +6762,11 @@
 # configuration.  But we'll never go from static-only to shared-only.
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-shared
-build_libtool_libs=no
-build_old_libs=yes
+disable_libs=shared
 # ### END LIBTOOL TAG CONFIG: disable-shared
 
 # ### BEGIN LIBTOOL TAG CONFIG: disable-static
-build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+disable_libs=static
 # ### END LIBTOOL TAG CONFIG: disable-static
 
 # Local Variables: