[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] darwin xlc support
From: |
Peter O'Gorman |
Subject: |
[PATCH] darwin xlc support |
Date: |
Sun, 21 Mar 2004 22:34:31 +0900 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 |
Hi,
Discovered that ibm offered 60 day trials of their compiler set, so used one
to add support for xlc on Mac OS X.
Should have been doing a million other things of course :).
Patch attached, okay to apply?
Peter
Index: ChangeLog
2004-03-21 Peter O'Gorman <address@hidden>
* m4/libtool.m4, ltmain.in (darwin): Support IBM's xlc and xlc++.
from Scott James Remnant <address@hidden>
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.390
diff -u -3 -p -u -r1.390 ltmain.in
--- ltmain.in 14 Mar 2004 14:36:54 -0000 1.390
+++ ltmain.in 21 Mar 2004 11:16:04 -0000
@@ -3090,7 +3090,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)
Index: m4/libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/libtool.m4,v
retrieving revision 1.52
diff -u -3 -p -u -r1.52 libtool.m4
--- m4/libtool.m4 17 Mar 2004 23:32:37 -0000 1.52
+++ m4/libtool.m4 21 Mar 2004 11:16:13 -0000
@@ -172,6 +172,8 @@ test -z "$LTCC" && LTCC=$CC
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
# Only perform the check for file, if the check method requires it
test -z "$MAGIC_CMD" && MAGIC_CMD=file
case $deplibs_check_method in
@@ -2326,7 +2328,12 @@ esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
darwin*)
- reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+ if test "$GCC" = yes; then
+ reload_cmds='$CC -nostdlib ${wl}-r -o $output$reload_objs'
+ else
+ reload_cmds='$LD$reload_flag -o $output$reload_objs'
+ fi
+ ;;
esac
_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl
_LT_DECL([], [reload_cmds], [2])dnl
@@ -2963,6 +2970,16 @@ m4_if([$1], [CXX], [
;;
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++)
@@ -3218,6 +3235,16 @@ m4_if([$1], [CXX], [
_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
@@ -3765,40 +3792,52 @@ _LT_EOF
;;
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
+ _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}'
- _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
+ case "$cc_basename" in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _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
;;
dgux*)
@@ -4706,35 +4745,41 @@ case $host_os in
fi
;;
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'
- 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
- 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_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 "$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
_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'
@@ -4745,13 +4790,20 @@ case $host_os in
_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}'
- _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
+ case "$cc_basename" in
+ xlc*)
+ output_verbose_link_cmd='echo'
+ _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
;;
- [PATCH] darwin xlc support,
Peter O'Gorman <=