From: Christoph Pfisterer Date: Sun, 1 Apr 2001 14:28:18 +0000 (+0000) Subject: * libtool.m4, ltconfig.in, ltcf-c.sh, ltcf-cxx.sh: Fixed X-Git-Tag: multi-language-merge-point~45 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=e906349423f21fea09a2503824d7dd9c532fd1c6;p=thirdparty%2Flibtool.git * libtool.m4, ltconfig.in, ltcf-c.sh, ltcf-cxx.sh: Fixed support for Darwin and Rhapsody. Now correctly hardcodes the library path and adds versioning. Other small fixes. * ltmain.in: Fixed special cases for libc and libm on Rhapsody and Darwin. One of them was misplaced. Added version_type case for Rhapsody and Darwin, named "darwin". --- diff --git a/ChangeLog b/ChangeLog index 1c4059c4b..21247ab45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2001-04-01 Christoph Pfisterer + + * libtool.m4, ltconfig.in, ltcf-c.sh, ltcf-cxx.sh: Fixed + support for Darwin and Rhapsody. Now correctly hardcodes the + library path and adds versioning. Other small fixes. + * ltmain.in: Fixed special cases for libc and libm on Rhapsody and + Darwin. One of them was misplaced. Added version_type case for + Rhapsody and Darwin, named "darwin". + 2001-03-31 Gary V. Vaughan * ltmain.in: Remove the code for stripping duplicate deplibs diff --git a/NEWS b/NEWS index 9533c1967..c62576cb7 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,8 @@ New in 1.3d: 2000-??-??; CVS version 1.3c, Libtool team: * libltdl can now be built as a dll with win32. * m4 macros needed to configure libltdl split out into libltdl/ltdl.m4. * New port to NEWS-OS Release 6. -* Improved support for mingw32, Compaq Tru64 V5.0 and Digital Unix V4.*. +* Improved support for darwin (rhapsody), mingw32, Compaq Tru64 V5.0 + and Digital Unix V4.*. * Initial support for ia64 linux. * Initial support for a.out freebsd shared libs. * Initial support for Paul Sokolovsky's pw32 POSIX over win32 layer. diff --git a/libtool.m4 b/libtool.m4 index 324676aab..0be8bc252 100644 --- a/libtool.m4 +++ b/libtool.m4 @@ -536,8 +536,15 @@ cygwin* | mingw* |pw32*) darwin* | rhapsody*) lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1` + lt_cv_file_magic_cmd='/usr/bin/file -L' + case "$host_os" in + rhapsody* | darwin1.[012]) + lt_cv_file_magic_test_file='/System/Library/Frameworks/System.framework/System' + ;; + *) # Darwin 1.3 on + lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib' + ;; + esac ;; freebsd* ) diff --git a/ltcf-c.sh b/ltcf-c.sh index 9e3a65950..671a90704 100644 --- a/ltcf-c.sh +++ b/ltcf-c.sh @@ -173,16 +173,14 @@ 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 warning' - archive_cmds='$CC $(if test "$module" = "yes"; then echo -bundle; else - echo -dynamiclib; fi) -o $lib $libobjs $deplibs $linkopts' - archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - ## What we need is to hardcode the path to the library, not the search path - #hardcode_direct=yes - #hardcode_libdir_flag_spec='-install_name $libdir/$lib' + 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' + whole_archive_flag_spec='-all_load $convenience' ;; netbsd*) @@ -612,9 +610,6 @@ else ac_cv_prog_cc_static='-static' case $host_os in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then @@ -624,20 +619,28 @@ else lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; - *djgpp*) - # DJGPP does not support shared libraries at all - ac_cv_prog_cc_pic= + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. ;; cygwin* | mingw* | os2*) # 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' ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + ac_cv_prog_cc_pic= ;; sysv4*MP*) if test -d /usr/nec; then diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh index c399d34c9..91ee3d565 100644 --- a/ltcf-cxx.sh +++ b/ltcf-cxx.sh @@ -651,9 +651,6 @@ if test "$with_gcc" = yes; then ac_cv_prog_cc_static='-static' case $host_os in - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then @@ -663,20 +660,28 @@ if test "$with_gcc" = yes; then lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' fi ;; - *djgpp*) - # DJGPP does not support shared libraries at all - ac_cv_prog_cc_pic= + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. ;; cygwin* | mingw* | os2*) # 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' ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - ac_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_cv_prog_cc_pic='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + ac_cv_prog_cc_pic= ;; sysv4*MP*) if test -d /usr/nec; then diff --git a/ltconfig.in b/ltconfig.in index fd68f22b8..925b5e779 100755 --- a/ltconfig.in +++ b/ltconfig.in @@ -1096,10 +1096,12 @@ cygwin* | mingw* | pw32*) ;; darwin* | rhapsody*) - library_names_spec='${libname}.`if test "$module" = "yes"; then echo so; else echo dylib; fi`' + dynamic_linker="$host_os dyld" + version_type=darwin need_lib_prefix=no need_version=no - postinstall_cmds='chmod +x $lib' + 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 ;; diff --git a/ltmain.in b/ltmain.in index fadabff2e..95fc40dec 100644 --- a/ltmain.in +++ b/ltmain.in @@ -1205,9 +1205,10 @@ EOF # These systems don't actually have c library (as such) continue ;; - *-*-rhapsody* | *-*-darwin*) - # Darwin C library is in the System framework + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework deplibs="$deplibs -framework System" + continue ;; esac elif test "$arg" = "-lm"; then @@ -1216,9 +1217,10 @@ EOF # These systems don't actually have math library (as such) continue ;; - *-*-rhapsody* | *-*-darwin*) - # Darwin math library is in the System framework + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody math library is in the System framework deplibs="$deplibs -framework System" + continue ;; esac fi @@ -1245,10 +1247,6 @@ EOF $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 fast_install=no ;; - *-*-rhapsody* | *-*-darwin*) - # Darwin C library is in the System framework - deplibs="$deplibs -framework System" - ;; *) no_install=yes ;; @@ -2547,6 +2545,26 @@ EOF case $version_type in none) ;; + darwin) + # Like Linux, but with the current version available in + # verstring for coding it into the library header + major=.`expr $current - $age` + 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" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + irix) major=`expr $current - $age + 1` verstring="sgi$major.$revision" @@ -2591,16 +2609,6 @@ EOF versuffix=".$current.$revision" ;; - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. @@ -2723,6 +2731,10 @@ EOF *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs -framework System" + ;; *) # Add libc to deplibs on all other systems if necessary. if test $build_libtool_need_lc = "yes"; then