Index: libtool.m4 =================================================================== RCS file: /cvsroot/libtool/libtool/libtool.m4,v retrieving revision 1.265 diff -u -b -r1.265 libtool.m4 --- libtool.m4 4 Oct 2002 15:34:50 -0000 1.265 +++ libtool.m4 8 Oct 2002 22:00:05 -0000 @@ -2631,6 +2631,12 @@ _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; + darwin*) + shared_flag='-dynamiclib' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs && $CC -dynamiclib -install_name $rpath/$soname $predep_objects ${lib}-master.o $deplibs $postdep_objects $compiler_flags -o $lib' + output_verbose_link_cmd='$CC -dynamiclib $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"' + ;; + dgux*) case $cc_basename in ec++) @@ -4950,7 +4956,7 @@ # 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! - _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' + _LT_AC_TAGVAR(archive_cmds, $1)='$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 #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols' _LT_AC_TAGVAR(hardcode_direct, $1)=yes Index: ltmain.in =================================================================== RCS file: /cvsroot/libtool/libtool/ltmain.in,v retrieving revision 1.301 diff -u -b -r1.301 ltmain.in --- ltmain.in 25 Sep 2002 04:26:20 -0000 1.301 +++ ltmain.in 8 Oct 2002 22:00:06 -0000 @@ -3644,6 +3644,14 @@ ;; esac + 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 + compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs"