]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libtool.m4, ltconfig.in, ltcf-c.sh, ltcf-cxx.sh: Fixed
authorChristoph Pfisterer <cp@chrisp.de>
Sun, 1 Apr 2001 14:28:18 +0000 (14:28 +0000)
committerGary V. Vaughan <gary@gnu.org>
Sun, 1 Apr 2001 14:28:18 +0000 (14:28 +0000)
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".

ChangeLog
NEWS
libtool.m4
ltcf-c.sh
ltcf-cxx.sh
ltconfig.in
ltmain.in

index 1c4059c4b1946d52f98cf9f3eef5c6c4de81bfcc..21247ab45023cf024d63aecc185adc59624f9085 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-04-01  Christoph Pfisterer  <cp@chrisp.de>
+
+       * 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  <gvv@techie.com>
 
        * ltmain.in: Remove the code for stripping duplicate deplibs
diff --git a/NEWS b/NEWS
index 9533c19674c2aa49d7481f42e967430b94b3cac1..c62576cb7cb17988fe883dc0fcc844a6498243c5 100644 (file)
--- 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.
index 324676aab3f11abcf7d3bd51ea61f47dbaf3d908..0be8bc25228e284aa3b470c7d2328147a5e1fec5 100644 (file)
@@ -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* )
index 9e3a65950eaa72ff8c82e0c6be77df6767d3dab8..671a907041a18a77e74b724c69df7b0e3e7207e3 100644 (file)
--- 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
index c399d34c9dc254696b8a391c862891299a34f870..91ee3d56596e18ec55ac973a5636fbe76b8015b2 100644 (file)
@@ -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
index fd68f22b846987ec34ce1429c1e26bb7f3d4060a..925b5e77953808df9d3e7f9ef52354e0aa412797 100755 (executable)
@@ -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
   ;;
index fadabff2e37ff0d93c1cdc5590e4b7d1b72de39c..95fc40dec20e3287ac60aa1aee804ad9f20bf8d4 100644 (file)
--- 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