Skip to content

Commit

Permalink
2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
Browse files Browse the repository at this point in the history
	* libtool.m4: Sync darwin bits from libtool cvs to build a gcc with
	shared/dylibed libraries.
	* ltmain.sh: Likewise.
	* ltcf-c.sh: Likewise, disable shared library build for OS-X < 10.3.
	* ltcf-cxx.sh: Likewise.
	* ltcf-gcj.sh: Likewise.
	* ltconfig: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73729 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
andreast committed Nov 19, 2003
1 parent a27aa52 commit fbccfde
Show file tree
Hide file tree
Showing 7 changed files with 234 additions and 18 deletions.
10 changes: 10 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>

* libtool.m4: Sync darwin bits from libtool cvs to build a gcc with
shared/dylibed libraries.
* ltmain.sh: Likewise.
* ltcf-c.sh: Likewise, disable shared library build for OS-X < 10.3.
* ltcf-cxx.sh: Likewise.
* ltcf-gcj.sh: Likewise.
* ltconfig: Likewise.

2003-11-17 Stan Cox <scox@redhat.com>

* MAINTAINERS: Add myself as iq2000 port maintainer.
Expand Down
5 changes: 4 additions & 1 deletion libtool.m4
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
# this will be overwritten by pass_all, but leave it in just in case
lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
lt_cv_file_magic_cmd='/usr/bin/file -L'
case "$host_os" in
Expand All @@ -617,6 +618,7 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
lt_cv_deplibs_check_method=pass_all
;;
freebsd* )
Expand Down Expand Up @@ -780,8 +782,9 @@ AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
*-*-beos* | *-*-cygwin* | *-*-pw32*)
*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
# These system don't have libm
# on darwin the libm is a symbolic link to libSystem.dylib
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
Expand Down
59 changes: 46 additions & 13 deletions ltcf-c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -175,16 +175,6 @@ EOF
$CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags'
;;

darwin* | rhapsody*)
allow_undefined_flag='-undefined suppress'
archive_cmds='$CC `test .$module = .yes && echo -bundle || echo -dynamiclib` $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts -install_name $rpath/$soname `test -n "$verstring" -a x$verstring != x0.0 && echo $verstring`'
# We need to add '_' to the symbols in $export_symbols first
#archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols'
hardcode_direct=yes
hardcode_shlibpath_var=no
whole_archive_flag_spec='-all_load $convenience'
;;

netbsd*)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
Expand Down Expand Up @@ -385,10 +375,53 @@ else
fix_srcfile_path='`cygpath -w "$srcfile"`'
;;

freebsd1*)
ld_shlibs=no
darwin* | rhapsody*)
case "$host_os" in
rhapsody* | darwin1.[[012]])
allow_undefined_flag='-undefined suppress'
;;
*) # Darwin 1.3 on
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
allow_undefined_flag='-flat_namespace -undefined suppress'
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[[012]])
allow_undefined_flag='-flat_namespace -undefined suppress'
;;
10.*)
allow_undefined_flag='-undefined dynamic_lookup'
;;
esac
fi
;;
esac
# Disable shared library build on OS-X older than 10.3.
case $host_os in
darwin[1-6]*)
can_build_shared=no
;;
darwin7*)
can_build_shared=yes
;;
esac
output_verbose_link_cmd='echo'
archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
module_cmds='$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
archive_expsym_cmds='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}'
module_expsym_cmds='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}'
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
whole_archive_flag_spec='-all_load $convenience'
link_all_deplibs=yes
;;

freebsd1*)
ld_shlibs=no
;;

# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
Expand Down Expand Up @@ -670,7 +703,7 @@ else
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
lt_cv_prog_cc_pic='-fno-common'
ac_cv_prog_cc_pic='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
Expand Down
47 changes: 46 additions & 1 deletion ltcf-cxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,51 @@ case $host_os in
;;
esac
;;

darwin* | rhapsody*)
case "$host_os" in
rhapsody* | darwin1.[[012]])
allow_undefined_flag='-undefined suppress'
;;
*) # Darwin 1.3 on
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
allow_undefined_flag='-flat_namespace -undefined suppress'
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[[012]])
allow_undefined_flag='-flat_namespace -undefined suppress'
;;
10.*)
allow_undefined_flag='-undefined dynamic_lookup'
;;
esac
fi
;;
esac
# Disable shared library build on OS-X older than 10.3.
case $host_os in
darwin[1-6]*)
can_build_shared=no
;;
darwin7*)
can_build_shared=yes
;;
esac
output_verbose_link_cmd='echo'
archive_cmds='$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'
module_cmds='$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
archive_expsym_cmds='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}'
module_expsym_cmds='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}'
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
whole_archive_flag_spec='-all_load $convenience'
link_all_deplibs=yes
;;

dgux*)
case $cc_basename in
ec++)
Expand Down Expand Up @@ -712,7 +757,7 @@ if test "$with_gcc" = yes; then
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
lt_cv_prog_cc_pic='-fno-common'
ac_cv_prog_cc_pic='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
Expand Down
49 changes: 49 additions & 0 deletions ltcf-gcj.sh
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,49 @@ else
fix_srcfile_path='`cygpath -w "$srcfile"`'
;;

darwin* | rhapsody*)
case "$host_os" in
rhapsody* | darwin1.[[012]])
allow_undefined_flag='-undefined suppress'
;;
*) # Darwin 1.3 on
if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
allow_undefined_flag='-flat_namespace -undefined suppress'
else
case ${MACOSX_DEPLOYMENT_TARGET} in
10.[[012]])
allow_undefined_flag='-flat_namespace -undefined suppress'
;;
10.*)
allow_undefined_flag='-undefined dynamic_lookup'
;;
esac
fi
;;
esac
# Disable shared library build on OS-X older than 10.3.
case $host_os in
darwin[1-6]*)
can_build_shared=no
;;
darwin7*)
can_build_shared=yes
;;
esac
output_verbose_link_cmd='echo'
archive_cmds='$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'
module_cmds='$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
archive_expsym_cmds='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}'
module_expsym_cmds='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}'
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
whole_archive_flag_spec='-all_load $convenience'
link_all_deplibs=yes
;;


freebsd1*)
ld_shlibs=no
;;
Expand Down Expand Up @@ -628,6 +671,12 @@ fi
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;

darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
ac_cv_prog_cc_pic='-fno-common'
;;
amigaos*)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
Expand Down
23 changes: 21 additions & 2 deletions ltconfig
Original file line number Diff line number Diff line change
Expand Up @@ -965,6 +965,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
library_names_spec=
libname_spec='lib$name'
soname_spec=
shrext=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
Expand Down Expand Up @@ -1102,13 +1103,28 @@ cygwin* | mingw* | pw32*)

darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
lt_cv_dlopen="dyld"
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
version_type=darwin
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${versuffix}.`test .$module = .yes && echo so || echo dylib` ${libname}${release}${major}.$`test .$module = .yes && echo so || echo dylib` ${libname}.`test .$module = .yes && echo so || echo dylib`'
soname_spec='${libname}${release}${major}.`test .$module = .yes && echo so || echo dylib`'
# Disable shared library build on OS-X older than 10.3.
case $host_os in
darwin[1-6]*)
can_build_shared=no
;;
darwin7*)
can_build_shared=yes
;;
esac
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)'
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"`
sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;

freebsd1*)
Expand Down Expand Up @@ -2325,6 +2341,9 @@ objext="$objext"
# Old archive suffix (normally "a").
libext="$libext"
# Shared library suffix (normally ".so").
shrext='$shrext'
# Executable file suffix (normally "").
exeext="$exeext"
Expand Down
Loading

0 comments on commit fbccfde

Please sign in to comment.