From 78fe98953919aa5d6db68c38954ba3810c956db1 Mon Sep 17 00:00:00 2001 From: Peter O'Gorman Date: Fri, 17 Sep 2004 13:41:54 +0000 Subject: [PATCH] * m4/libtool.m4 [darwin] (_LT_LANG_CXX_CONFIG): Changes for 10.4. * config/libtool.in [darwin]: ditto. --- ChangeLog | 5 ++++ config/ltmain.in | 9 +++++-- m4/libtool.m4 | 66 +++++++++++++++++++++++++----------------------- 3 files changed, 46 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 784099f38..ada486080 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-09-17 Peter O'Gorman + + * m4/libtool.m4 [darwin] (_LT_LANG_CXX_CONFIG): Changes for 10.4. + * config/libtool.in [darwin]: ditto. + 2004-09-16 Gary V. Vaughan My most recent `2004-09-02 Gary V. Vaughan' patch for mkdir_p diff --git a/config/ltmain.in b/config/ltmain.in index 135710d5a..5109b192a 100644 --- a/config/ltmain.in +++ b/config/ltmain.in @@ -5511,9 +5511,14 @@ EOF case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors + # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[0123]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` diff --git a/m4/libtool.m4 b/m4/libtool.m4 index c5820bd46..da2a362ef 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -3803,18 +3803,14 @@ _LT_EOF _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[[012]]) + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -4742,18 +4738,14 @@ if test "$caught_CXX_error" != yes; then _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' ;; *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[[012]]) + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no @@ -4766,14 +4758,24 @@ if test "$caught_CXX_error" != yes; then if test "$GXX" = yes ; then lt_int_apple_cc_single_mod=no output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi + case ${MACOSX_DEPLOYMENT_TARGET-10.0} in + 10.[[0123]]) + # only use -single_module on bona fide Apple compilers. + if ($CC -v) && $CC -v 2>&1| grep Apple 2>&1 >/dev/null ; then + if $CC -dumpspecs 2>&1 | $GREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + ;; + esac _LT_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, # it doesn't exist in older darwin ld's -- 2.47.2