]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4 (darwin): Add -install_name to the link line only
authorChristoph Egger <Christoph_Egger@gmx.de>
Fri, 11 Oct 2002 15:04:05 +0000 (15:04 +0000)
committerRobert Boehne <rboehne@gnu.org>
Fri, 11 Oct 2002 15:04:05 +0000 (15:04 +0000)
when -dynamiclib is specified for a module.
* ltmain.in (darwin): Use -bind_at_load when linking shared
libraries.

ChangeLog
libtool.m4
ltmain.in

index b6e7a0c0587e6c487c7db0f9b071be8454c5ad0c..b52be4bca0b464b11560a27ab75ba15b4655015a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2002-10-11  Christoph Egger  <Christoph_Egger@gmx.de>
+
+       * libtool.m4 (darwin): Add -install_name to the link line only
+       when -dynamiclib is specified for a module.
+       * ltmain.in (darwin): Use -bind_at_load when linking shared
+       libraries.
+
 2002-09-09  Albert Chin-A-Young  <china@thewrittenword.com>
 
        * libtool.m4: Custom $symcode for Tru64 UNIX to catch 'Q',
index de9ac4f7abfa0472c94f4c47b529d39c066b1d1d..501faef0af7378e2127cb1ef9305ea0e4d9a0d23 100644 (file)
@@ -1583,7 +1583,7 @@ else
     #        cross-compilation, but unfortunately the echo tests do not
     #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
     #       `"' quotes if we put them in here... so don't!
-    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
+    archive_cmds='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib ${lib}-master.o $deplibs$linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
     # We need to add '_' to the symbols in $export_symbols first
     #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
     hardcode_direct=yes
index d06b8f726cf07559b31f866b7e1092da744e4c9b..316f85d43ab71b8755816e33eae68ef4c5cb1de0 100644 (file)
--- a/ltmain.in
+++ b/ltmain.in
@@ -3172,6 +3172,13 @@ EOF
        # On Rhapsody replace the C library is the System framework
        compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
        finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'`
+       case $host in
+       *darwin*)
+         # Don't allow lazy linking, it breaks C++ global constructors
+         compile_command="$compile_command ${wl}-bind_at_load"
+         finalize_command="$finalize_command ${wl}-bind_at_load"
+         ;;
+       esac
        ;;
       esac