[RFA/PATCH] Darwin fixes for ltconfig, ltcf-c.sh

Klee Dienes
2002-11-13T16:55:14Z

[-- Attachment #1: Type: text/plain, Size: 1248 bytes --]

The enclosed patch fixes the Darwin support in the top-level libtool
support files of the binutils and GDB source repository. For the most
part it just adds more Darwin-specific config blocks to ltconfig and
ltcf-c.sh, and fixes a couple of nits in the existing Darwin support.

The only non-Darwin-specific patch is the change to default
CONFIG_SHELL to /bin/sh in ltconfig ... this prevents ltconfig from
silently setting max_cmd_len to "none" if CONFIG_SHELL is not passed to
ltconfig.

2002-11-12 Klee Dienes <kdienes@apple.com>

* ltconfig: Default CONFIG_SHELL to /bin/sh if no value is
passed in
by the environment. Recognize "macos10" as specifying a
Darwin-based system. Remove extra '$' in library_names_spec
for the
Darwin configuration.
* ltcf-c.sh: Move the Darwin config-block from the
"$with_gnu_ld =
yes" section to the "$with_gnu_ld = no" section (Darwin doesn't
use
GNU ld as it's linker). Use ac_cv_prog_cc_pic to set pic
flags, not
lt_cv_prog_cc_pic. Add a Darwin block for pic flags when using
GCC
as well as when using the system compiler. Recognize "macos10"
as
specifying a Darwin-based system in all clauses.

[-- Attachment #2: ltconfig.txt --]
[-- Type: text/plain, Size: 4838 bytes --]

2002-11-12 Klee Dienes <kdienes@apple.com>

* ltconfig: Default CONFIG_SHELL to /bin/sh if no value is passed in
by the environment. Recognize "macos10" as specifying a
Darwin-based system. Remove extra '$' in library_names_spec for the
Darwin configuration.
* ltcf-c.sh: Move the Darwin config-block from the "$with_gnu_ld =
yes" section to the "$with_gnu_ld = no" section (Darwin doesn't use
GNU ld as it's linker). Use ac_cv_prog_cc_pic to set pic flags, not
lt_cv_prog_cc_pic. Add a Darwin block for pic flags when using GCC
as well as when using the system compiler. Recognize "macos10" as
specifying a Darwin-based system in all clauses.

diff -u --exclude=CVS --exclude=Makefile --exclude=configure cygnus.cygnus/src/./ltcf-c.sh cygnus.current/src/./ltcf-c.sh
--- cygnus.cygnus/src/./ltcf-c.sh Tue Jul 30 13:32:54 2002
+++ cygnus.current/src/./ltcf-c.sh Wed Oct 30 21:53:09 2002
@@ -175,16 +175,6 @@
$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'
@@ -456,6 +446,16 @@
link_all_deplibs=yes
;;

+ darwin* | rhapsody* | macos10*)
+ allow_undefined_flag='-undefined error'
+ 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 -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -667,10 +667,10 @@
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;
- darwin* | rhapsody*)
+ darwin* | rhapsody* | macos10*)
# 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
@@ -710,6 +710,12 @@
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody* | macos10*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ ac_cv_prog_cc_pic='-fno-common'
;;

newsos6)
diff -u --exclude=CVS --exclude=Makefile --exclude=configure cygnus.cygnus/src/./ltconfig cygnus.current/src/./ltconfig
--- cygnus.cygnus/src/./ltconfig Tue Jul 30 13:33:02 2002
+++ cygnus.current/src/./ltconfig Wed Oct 30 21:53:10 2002
@@ -27,6 +27,7 @@
# A lot of this script is taken from autoconf-2.10.

# Check that we are running under the correct shell.
+CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
SHELL=${CONFIG_SHELL-/bin/sh}
echo=echo
if test "X$1" = X--no-reexec; then
@@ -1100,12 +1101,12 @@
lt_cv_dlopen_libs=
;;

-darwin* | rhapsody*)
+darwin* | rhapsody* | macos10*)
dynamic_linker="$host_os dyld"
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`'
+ 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`'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH