[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH-1.5] Backport Mac OS X xlc support
From: |
Peter O'Gorman |
Subject: |
[PATCH-1.5] Backport Mac OS X xlc support |
Date: |
Fri, 23 Jul 2004 21:55:20 +0900 |
User-agent: |
Mozilla Thunderbird 0.6 (Macintosh/20040502) |
Okay to apply?
Peter
--
Peter O'Gorman - http://www.pogma.com
Index: ChangeLog
2004-07-22 Peter O'Gorman <address@hidden>
* libtool.m4, ltmain.in [darwin]: Backport xlc support from cvs HEAD.
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/libtool.m4,v
retrieving revision 1.314.2.38
diff -u -3 -p -u -r1.314.2.38 libtool.m4
--- libtool.m4 8 Jul 2004 13:43:59 -0000 1.314.2.38
+++ libtool.m4 22 Jul 2004 14:46:47 -0000
@@ -200,6 +200,8 @@ if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
fi
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
# Only perform the check for file, if the check method requires it
case $deplibs_check_method in
file_magic*)
@@ -2836,6 +2838,7 @@ case $host_os in
esac
;;
+
cygwin* | mingw* | pw32*)
# _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
@@ -2859,57 +2862,69 @@ case $host_os in
_LT_AC_TAGVAR(ld_shlibs, $1)=no
fi
;;
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined
${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace
${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace
${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined
${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- darwin* | rhapsody*)
- if test "$GXX" = yes; then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
- case "$host_os" in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined
suppress'
+ 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_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name
$rpath/$soname $verstring'
else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace
-undefined suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
- ;;
- esac
+ _LT_AC_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_AC_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
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name
$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym
${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$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~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ case "$cc_basename" in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags
${wl}-install_name ${wl}`echo $rpath/$soname` $verstring'
+ _LT_AC_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
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags
${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
fi
- ;;
- esac
- 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_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name
$rpath/$soname $verstring'
- else
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load
-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_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load
$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
- if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module
$allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name
$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym
${lib}'
- else
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load
-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~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
- fi
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,,"
-e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(hardcode_direct, $1)=no
- _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
- _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
- _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
- else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
+ ;;
dgux*)
case $cc_basename in
@@ -4597,6 +4612,16 @@ AC_MSG_CHECKING([for $compiler option to
;;
esac
;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case "$cc_basename" in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
dgux*)
case $cc_basename in
ec++)
@@ -4850,6 +4875,16 @@ AC_MSG_CHECKING([for $compiler option to
_LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
fi
;;
+ darwin*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ case "$cc_basename" in
+ xlc*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ ;;
+ esac
+ ;;
mingw* | pw32* | os2*)
# This hack is so that the source file can tell whether it is being
@@ -5377,40 +5412,53 @@ $echo "local: *; };" >> $output_objdir/$
;;
darwin* | rhapsody*)
- if test "$GCC" = yes ; then
- _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in
- rhapsody* | darwin1.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
- ;;
- *) # Darwin 1.3 on
- if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined
suppress'
- else
- case ${MACOSX_DEPLOYMENT_TARGET} in
- 10.[[012]])
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace
-undefined suppress'
- ;;
- 10.*)
- _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined dynamic_lookup'
- ;;
- esac
- fi
- ;;
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined
${wl}suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace
${wl}-undefined ${wl}suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace
${wl}-undefined ${wl}suppress'
+ ;;
+ 10.*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined
${wl}dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
esac
- output_verbose_link_cmd='echo'
- _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load
-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'
- _LT_AC_TAGVAR(module_cmds, $1)='$CC ${wl}-bind_at_load
$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
- _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load
-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~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
- _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_AC_TAGVAR(hardcode_direct, $1)=no
_LT_AC_TAGVAR(hardcode_automatic, $1)=yes
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
_LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
_LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ if test "$GCC" = yes ; then
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname
$verstring'
+ _LT_AC_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
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag
-o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname
$verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
else
- _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ case "$cc_basename" in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=''
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag
-o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo
$rpath/$soname` $verstring'
+ _LT_AC_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
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag
-o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name
${wl}$rpath/$soname $verstring~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[
]*,," -e "s,^\(..*\),_&," < $export_symbols >
$output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib
-bundle $libobjs $deplibs$compiler_flags~nmedit -s
$output_objdir/${libname}-symbols.expsym ${lib}'
+ ;;
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
fi
;;
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.334.2.34
diff -u -3 -p -u -r1.334.2.34 ltmain.in
--- ltmain.in 24 Jun 2004 12:25:33 -0000 1.334.2.34
+++ ltmain.in 22 Jul 2004 14:47:07 -0000
@@ -2999,7 +2999,7 @@ EOF
versuffix="$major.$age.$revision"
# Darwin ld doesn't like 0 for these options...
minor_current=`expr $current + 1`
- verstring="-compatibility_version $minor_current -current_version
$minor_current.$revision"
+ verstring="${wl}-compatibility_version ${wl}$minor_current
${wl}-current_version ${wl}$minor_current.$revision"
;;
freebsd-aout)
- [PATCH-1.5] Backport Mac OS X xlc support,
Peter O'Gorman <=