]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Document that disable-static plus -all-static is not portable.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 24 Mar 2008 14:28:43 +0000 (14:28 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 24 Mar 2008 14:28:43 +0000 (14:28 +0000)
* doc/libtool.texi (Link mode): -all-static does not go well
with disable-static on most systems.
* tests/static.at (static linking flags for programs) [!aix]:
With --disable-static but nonempty link_static_flag, skip the
m-all-static link.  Do not skip it on AIX, as there the
enable_static is self-inflicted, and thus expected to work.
* THANKS: Update.
Report by Nix.

ChangeLog
THANKS
doc/libtool.texi
tests/static.at

index 399749eff4713e840b73d52e58f98dc6c81e41c9..9593f9c63221287a3a177f4ca54a2d4280038d20 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2008-03-24  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Document that disable-static plus -all-static is not portable.
+       * doc/libtool.texi (Link mode): -all-static does not go well
+       with disable-static on most systems.
+       * tests/static.at (static linking flags for programs) [!aix]:
+       With --disable-static but nonempty link_static_flag, skip the
+       m-all-static link.  Do not skip it on AIX, as there the
+       enable_static is self-inflicted, and thus expected to work.
+       * THANKS: Update.
+       Report by Nix.
+
 2008-03-17  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
        * libltdl/m4/libtool.m4 (_LT_CHECK_BUILDDIR): No need to escape
diff --git a/THANKS b/THANKS
index 9f24876ea19db777ff547de6d84b7571d35d49e9..236bbaba0451883c6f10ba61701d59a98d0461c8 100644 (file)
--- a/THANKS
+++ b/THANKS
   Marc J. Fraioli              fraioli@dg-rtp.dg.com
   Mark Kettenis                        kettenis@phys.uva.nl
   Mike Frysinger               vapier@gentoo.org
+  Nix                          nix@esperi.org.uk
   Olly Betts                   olly@muscat.co.uk
   Patrick Welche               prlw1@newn.cam.ac.uk
   Paul Eggert                  eggert@twinsun.com
index e9610da25817038169c99ead2bd35430dcc09a15..1bc53ef846e2ef37aef13aa13a8c289517c6d30f 100644 (file)
@@ -1322,7 +1322,8 @@ The following components of @var{mode-args} are treated specially:
 @item -all-static
 If @var{output-file} is a program, then do not link it against any
 shared libraries at all.  If @var{output-file} is a library, then only
-create a static library.
+create a static library.  In general, this flag cannot be used together
+with @samp{disable-static} (@pxref{LT_INIT}).
 
 @item -avoid-version
 Tries to avoid versioning (@pxref{Versioning}) for libraries and modules,
index 4f9cd4422eb3c17a70f194fb8f23b8d0479a5aae..74b1c63426f4e942b7df0e06345d0b0dd6f2b5fc 100644 (file)
@@ -1,6 +1,6 @@
 # static.at -- test flags for static/dynamic linking          -*- Autotest -*-
 #
-#   Copyright (C) 2006, 2007 Free Software Foundation, Inc.
+#   Copyright (C) 2006, 2007, 2008 Free Software Foundation, Inc.
 #   Written by Ralf Wildenhues, 2006
 #
 #   This file is part of GNU Libtool.
@@ -92,6 +92,16 @@ eval `$LIBTOOL --config |
 if test -n "$per_deplib_static_flag" && test -n "$per_deplib_dynamic_flag"; then
   per_deplib=:
 fi
+# On GNU/Linux with --disable-static, m-all-static fails to link.
+# What we'd like to state here is: if the user actively passed
+# --disable-static (as opposed to: the libtool.m4 macros set
+# enable_static=no), then they cannot expect -all-static to work.
+# So we punt, knowing that we mangle enable_static on AIX only.
+can_link_all_static=-all-static
+case $host_os,$have_static,$link_static_flag in
+  aix*) ;;
+  *,false,?*) can_link_all_static= ;;
+esac
 
 # Create broken libraries.  They will later be moved to those
 # directories where the respective libraries should be linked
@@ -248,10 +258,10 @@ for withdep in no yes; do
   $CC $CPPFLAGS $CFLAGS -c m.c
 
   # global static flags.
-  for st in -static -static-libtool-libs -all-static; do
+  for st in -static -static-libtool-libs $can_link_all_static; do
     AT_CHECK([$LIBTOOL --mode=link $CC $CFLAGS $LDFLAGS $st -o m$st m.$OBJEXT \
-             -L$libdir1 -la1 a2/liba2.la -L$libdir3 -R$libdir3 -la3],
-            [0], [ignore], [ignore])
+       -L$libdir1 -la1 a2/liba2.la -L$libdir3 -R$libdir3 -la3],
+       [0], [ignore], [ignore])
   done
 
   # per-deplib static/shared flags.
@@ -296,7 +306,7 @@ for withdep in no yes; do
 
   ### install the programs.
   # We can't install any program that links dynamically against liba2.
-  for st in -static -static-libtool-libs -all-static `$per_deplib && echo 2 12 23 123 123a`; do 
+  for st in -static -static-libtool-libs $can_link_all_static `$per_deplib && echo 2 12 23 123 123a`; do 
     echo "# m$st"
     AT_CHECK([$LIBTOOL --mode=install cp m$st $bindir/m$st], [0], [ignore], [stderr])
     if $have_static; then