From: Christoph Egger Date: Fri, 11 Oct 2002 15:04:05 +0000 (+0000) Subject: * libtool.m4 (darwin): Add -install_name to the link line only X-Git-Tag: release-1-4-3~8 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=f54e3bccafd79a21761316614ee0ca238f1a5723;p=thirdparty%2Flibtool.git * 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. --- diff --git a/ChangeLog b/ChangeLog index b6e7a0c05..b52be4bca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-10-11 Christoph Egger + + * 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 * libtool.m4: Custom $symcode for Tru64 UNIX to catch 'Q', diff --git a/libtool.m4 b/libtool.m4 index de9ac4f7a..501faef0a 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -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 diff --git a/ltmain.in b/ltmain.in index d06b8f726..316f85d43 100644 --- 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