[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
darwin fsfgcc.diff
From: |
Peter O'Gorman |
Subject: |
darwin fsfgcc.diff |
Date: |
Sun, 1 Jun 2003 22:05:26 +0900 |
Hi,
Here is a diff that removes the check for apple gcc and just checks for
gcc. I am sure someone will complain next that some other compiler
isn't supported :/
Also, a small change in ltdl.c to make it compile with fsf gcc (Apple's
dyld.h header causes a compilation failure otherwise), and change to
ltmain.in to not add to newlib_search_path if the path is already there.
Please apply these patches to the 1.5 branch and HEAD, because of the
sub directory, you will have to use -p0 in the patch.
Inline and attached, all tests pass with fsf gcc-3.3 and Apple gcc-3.1.
Thanks,
Peter
Index: ChangeLog
===================================================================
RCS file: /cvsroot/libtool/libtool/ChangeLog,v
retrieving revision 1.1229
diff -u -r1.1229 ChangeLog
--- ChangeLog 30 May 2003 15:25:10 -0000 1.1229
+++ ChangeLog 1 Jun 2003 12:47:32 -0000
@@ -1,3 +1,9 @@
+2003-06-01 Peter O'Gorman <address@hidden>
+
+ * libtool.m4 (darwin): Remove checks for Apple gcc, just check for gcc
+ * libltdl/ltdl.c (HAVE_MACH_O_DYLD_H): #define __private_extern__ fof
fsf gcc
+ * ltmain.in (darwin): Only add new paths to newlib_search_path.
+
2003-05-30 Gary V. Vaughan <address@hidden>
* libltdl/ltdl.c (argz_insert): Corrected an off by one error when
Index: libtool.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libtool.m4,v
retrieving revision 1.319
diff -u -r1.319 libtool.m4
--- libtool.m4 21 May 2003 04:45:25 -0000 1.319
+++ libtool.m4 1 Jun 2003 12:47:35 -0000
@@ -1256,17 +1256,16 @@
version_type=darwin
need_lib_prefix=no
need_version=no
- # FIXME: Relying on posixy $() will cause problems for
- # cross-compilation, but unfortunately the echo tests do not
- # yet detect zsh echo's removal of \ escapes.
library_names_spec='${libname}${release}${versuffix}$shared_ext
${libname}${release}${major}$shared_ext ${libname}$shared_ext'
soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext='$(test .$module = .yes && echo .so || echo .dylib)'
# Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the
same.
- if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
- sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n"
"$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" |
grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e
"s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n"
"$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" |
grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e
"s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ else
+ sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib'
fi
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
@@ -2551,7 +2550,7 @@
fi
;;
darwin* | rhapsody*)
- if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ if test "$GCC" = yes; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in
rhapsody* | darwin1.[[012]])
@@ -2561,22 +2560,20 @@
test -z ${LD_TWOLEVEL_NAMESPACE} &&
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined
suppress'
;;
esac
- # FIXME: Relying on posixy $() will cause problems for
- # 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!
- output_verbose_link_cmd='echo'
+ 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 -bundle $allow_undefined_flag
-o $lib $libobjs $deplibs$compiler_flags'
+ _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 -bundle
$allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit
-s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _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
- fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
;;
esac
AC_MSG_RESULT([$enable_shared])
@@ -2879,7 +2876,7 @@
;;
darwin* | rhapsody*)
- if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ if test "$GXX" = yes; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in
rhapsody* | darwin1.[[012]])
@@ -2889,31 +2886,33 @@
test -z ${LD_TWOLEVEL_NAMESPACE} &&
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined
suppress'
;;
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 -bundle ${wl}-bind_at_load
$allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ 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 -bundle
$allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit
-s $output_objdir/${libname}-symbols.expsym ${lib}'
+ 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
- fi
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
;;
dgux*)
@@ -5328,7 +5327,7 @@
;;
darwin* | rhapsody*)
- if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ if test "$GXX" = yes ; then
_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
case "$host_os" in
rhapsody* | darwin1.[[012]])
@@ -5338,10 +5337,6 @@
test -z ${LD_TWOLEVEL_NAMESPACE} &&
_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined
suppress'
;;
esac
- # FIXME: Relying on posixy $() will cause problems for
- # 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_int_apple_cc_single_mod=no
output_verbose_link_cmd='echo'
if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
@@ -5352,19 +5347,21 @@
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 -bundle ${wl}-bind_at_load
$allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ _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 -bundle
$allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~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
fi
;;
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.335
diff -u -r1.335 ltmain.in
--- ltmain.in 9 Apr 2003 17:54:06 -0000 1.335
+++ ltmain.in 1 Jun 2003 12:47:37 -0000
@@ -2568,7 +2568,11 @@
if test -f "$path/$depdepl" ; then
depdepl="$path/$depdepl"
fi
- newlib_search_path="$newlib_search_path $path"
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
path=""
fi
;;
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.176
diff -u -r1.176 ltdl.c
--- libltdl/ltdl.c 30 May 2003 15:25:10 -0000 1.176
+++ libltdl/ltdl.c 1 Jun 2003 12:47:38 -0000
@@ -1580,6 +1580,10 @@
#if HAVE_MACH_O_DYLD_H
+#if !defined(__APPLE_CC__) && !defined(__MWERKS__) &&
!defined(__private_extern__)
+/* Is this correct? Does it still function properly? */
+#define __private_extern__ extern
+#endif
# include <mach-o/dyld.h>
#endif
#include <mach-o/getsect.h>
fsfgcc.diff.gz
Description: GNU Zip compressed data
- darwin fsfgcc.diff,
Peter O'Gorman <=