Added darwintoolize. This closes bug #65272.
authorMamoru Komachi <usata@gentoo.org>
Sun, 10 Oct 2004 17:11:37 +0000 (17:11 +0000)
committerMamoru Komachi <usata@gentoo.org>
Sun, 10 Oct 2004 17:11:37 +0000 (17:11 +0000)
eclass/ELT-patches/darwin/ltconfig-1.2.patch [new file with mode: 0644]
eclass/ELT-patches/darwin/ltconfig-1.3.patch [new file with mode: 0644]
eclass/ELT-patches/darwin/ltmain.sh-1.2.patch [new file with mode: 0644]
eclass/ELT-patches/darwin/ltmain.sh-1.3.patch [new file with mode: 0644]
eclass/ELT-patches/sed/1.4.3
eclass/libtool.eclass

diff --git a/eclass/ELT-patches/darwin/ltconfig-1.2.patch b/eclass/ELT-patches/darwin/ltconfig-1.2.patch
new file mode 100644 (file)
index 0000000..da9f7e4
--- /dev/null
@@ -0,0 +1,66 @@
+--- ltconfig-1.2       Wed May 19 09:17:36 1999
++++ ltconfig   Wed Oct  6 14:29:08 2004
+@@ -459,6 +459,11 @@
+   os2*)
+     # We can build DLLs from non-PIC.
+     ;;
++  darwin* | rhapsody*)
++    # PIC is the default on this platform
++    # Common symbols not allowed in MH_DYLIB files
++    pic_flag='-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,
+@@ -785,6 +790,23 @@
+     hardcode_shlibpath_var=no
+     ;;
+ 
++  darwin* | rhapsody*)
++    case "$host_os" in
++    rhapsody* | darwin1.[012])
++      allow_undefined_flag='-undefined suppress'
++      ;;
++    *) # Darwin 1.3 on
++      allow_undefined_flag='-flat_namespace -undefined suppress'
++      ;;
++    esac
++    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++    # We need to add '_' to the symbols in $export_symbols first
++    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols $lib'
++    hardcode_direct=yes
++    hardcode_shlibpath_var=no
++    whole_archive_flag_spec='-all_load $convenience'
++    ;;
++
+   hpux9*)
+     archive_cmds='$rm $objdir/$soname;$LD -b +s +b $install_libdir -o $objdir/$soname$libobjs;mv $objdir/$soname $lib'
+     hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+@@ -1134,6 +1156,27 @@
+   version_type=sunos
+   library_names_spec='${libname}${release}.so.$versuffix'
+   shlibpath_var=LD_LIBRARY_PATH
++  ;;
++
++darwin* | rhapsody*)
++  dynamic_linker="$host_os dyld"
++  version_type=darwin
++  need_lib_prefix=no
++  need_version=no
++  deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++  file_magic_cmd='/usr/bin/file -L'
++  case "$host_os" in
++  rhapsody* | darwin1.[012])
++    file_magic_test_file='/System/Library/Frameworks/System.framework/System'
++    ;;
++  *) # Darwin 1.3 on
++    file_magic_test_file='/usr/lib/libSystem.dylib'
++    ;;
++  esac
++  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
+   ;;
+ 
+ hpux9* | hpux10*)
diff --git a/eclass/ELT-patches/darwin/ltconfig-1.3.patch b/eclass/ELT-patches/darwin/ltconfig-1.3.patch
new file mode 100644 (file)
index 0000000..49ae67d
--- /dev/null
@@ -0,0 +1,67 @@
+--- ltconfig.darwin    2000-02-02 19:53:22.000000000 -0500
++++ ltconfig   2004-09-23 20:25:11.000000000 -0400
+@@ -678,6 +678,11 @@
+   cygwin* | mingw* | os2*)
+     # We can build DLLs from non-PIC.
+     ;;
++  darwin* | rhapsody*)
++    # PIC is the default on this platform
++    # Common symbols not allowed in MH_DYLIB files
++    pic_flag='-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,
+@@ -1361,6 +1372,23 @@
+     hardcode_shlibpath_var=no
+     ;;
+ 
++  darwin* | rhapsody*)
++    case "$host_os" in
++    rhapsody* | darwin1.[012])
++      allow_undefined_flag='-undefined suppress'
++      ;;
++    *) # Darwin 1.3 on
++      allow_undefined_flag='-flat_namespace -undefined suppress'
++      ;;
++    esac
++    archive_cmds='$nonopt $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs $linkopts $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
++    # We need to add '_' to the symbols in $export_symbols first
++    #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols $lib'
++    hardcode_direct=yes
++    hardcode_shlibpath_var=no
++    whole_archive_flag_spec='-all_load $convenience'
++    ;;
++
+   hpux9* | hpux10* | hpux11*)
+     case "$host_os" in
+     hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;;
+@@ -1897,6 +1931,27 @@
+   esac
+   ;;
+ 
++darwin* | rhapsody*)
++  dynamic_linker="$host_os dyld"
++  version_type=darwin
++  need_lib_prefix=no
++  need_version=no
++  deplibs_check_method='file_magic Mach-O dynamically linked shared library'
++  file_magic_cmd='/usr/bin/file -L'
++  case "$host_os" in
++  rhapsody* | darwin1.[012])
++    file_magic_test_file='/System/Library/Frameworks/System.framework/System'
++    ;;
++  *) # Darwin 1.3 on
++    file_magic_test_file='/usr/lib/libSystem.dylib'
++    ;;
++  esac
++  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
++  ;;
++
+ gnu*)
+   version_type=linux
+   need_lib_prefix=no
+
diff --git a/eclass/ELT-patches/darwin/ltmain.sh-1.2.patch b/eclass/ELT-patches/darwin/ltmain.sh-1.2.patch
new file mode 100644 (file)
index 0000000..aaab86a
--- /dev/null
@@ -0,0 +1,40 @@
+--- ltmain.sh-1.2      Wed May 19 09:17:36 1999
++++ ltmain.sh  Wed Oct  6 14:38:37 2004
+@@ -967,6 +967,16 @@
+         versuffix="$current.$revision"
+         ;;
+ 
++      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"
++        ;;
++
+       *)
+         $echo "$modename: unknown library version type \`$version_type'" 1>&2
+         echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+@@ -1000,9 +1010,17 @@
+         allow_undefined_flag="$no_undefined_flag"
+       fi
+ 
+-      # Add libc to deplibs on all systems.
+-      dependency_libs="$deplibs"
+-      deplibs="$deplibs -lc"
++      case "$version_type" in
++      rhapsody|darwin)
++        # Rhapsody C library is in the System framework
++        deplibs="$deplibs -framework System"
++        ;;
++      *)
++        # Add libc to deplibs on all other systems.
++        dependency_libs="$deplibs"
++        deplibs="$deplibs -lc"
++        ;;
++      esac
+ 
+       if test "$build_libtool_libs" = yes; then
+         # Get the real and link names of the library.
diff --git a/eclass/ELT-patches/darwin/ltmain.sh-1.3.patch b/eclass/ELT-patches/darwin/ltmain.sh-1.3.patch
new file mode 100644 (file)
index 0000000..7148efb
--- /dev/null
@@ -0,0 +1,64 @@
+--- ltmain.sh.darwin   2000-02-02 19:53:22.000000000 -0500
++++ ltmain.sh  2004-09-23 20:25:11.000000000 -0400
+@@ -24,6 +24,8 @@
+ # configuration script generated by Autoconf, you may include it under
+ # the same distribution terms that you use for the rest of that program.
+ 
++_S_=${LIBTOOL_CMD_SEP-\~}
++
+ # Check that we have a working $echo.
+ if test "X$1" = X--no-reexec; then
+   # Discard the --no-reexec flag, and continue.
+@@ -1079,6 +1079,11 @@
+           # These systems don't actually have c library (as such)
+           continue
+           ;;
++        *-*-rhapsody* | *-*-darwin1.[012])
++          # Rhapsody C library is in the System framework
++          deplibs="$deplibs -framework System"
++          continue
++          ;;
+         esac
+       elif test "$arg" = "-lm"; then
+         case "$host" in
+@@ -1086,6 +1091,11 @@
+           # These systems don't actually have math library (as such)
+           continue
+           ;;
++        *-*-rhapsody* | *-*-darwin1.[012])
++          # Rhapsody math library is in the System framework
++          deplibs="$deplibs -framework System"
++          continue
++          ;;
+         esac
+       fi
+       deplibs="$deplibs $arg"
+@@ -1753,6 +1763,16 @@
+         versuffix="-$major-$age-$revision"
+         ;;
+ 
++      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"
++        ;;
++
+       *)
+         $echo "$modename: unknown library version type \`$version_type'" 1>&2
+         echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+@@ -1795,6 +1824,10 @@
+       *-*-cygwin* | *-*-mingw* | *-*-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.
+         deplibs="$deplibs -lc"
+
index 20178a03de05309be5614d106df6e776e6228001..9c51ac2de0ff97664711c3e6419abe1a3796c5ab 100644 (file)
@@ -1,11 +1,13 @@
 --- ltmain.sh  2003-02-13 14:54:24.000000000 +0100
 +++ ltmain.sh  2003-02-13 15:24:49.000000000 +0100
-@@ -48,6 +48,9 @@ EOF
+@@ -48,6 +48,11 @@ EOF
    exit 0
  fi
  
-+# define SED for historic ltconfig's generated by Libtool 1.3
++# define variables for historic ltconfig's generated by Libtool 1.3
 +test -z "$SED" && SED=sed
++test -z "$EGREP" && EGREP=egrep
++test -z "$LTCC" && LTCC=${CC-gcc}
 +
  # The name of this program.
  progname=`$echo "$0" | ${SED} 's%^.*/%%'`
index 7cf56cf97e15479813f20bc512937b88497584f8..f44d798b53b4295418c4c65fb980a451393d6876 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.35 2004/09/29 03:49:59 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.36 2004/10/10 17:11:37 usata Exp $
 #
 # Author: Martin Schlemmer <azarah@gentoo.org>
 #
@@ -161,6 +161,11 @@ elibtoolize() {
                esac
        done
 
+       if use ppc-macos ; then
+               glibtoolize --copy --force
+               darwintoolize
+       fi
+
        for x in ${my_dirlist}
        do
                local tmp="$(echo "${x}" | sed -e "s|${S}||")"
@@ -299,3 +304,31 @@ uclibctoolize() {
                esac
        done
 }
+
+darwintoolize() {
+       local targets=""
+       local x
+
+       if [ -z "$@" ] ; then
+               targets="$(find ${S} -name ltmain.sh -o -name ltconfig)"
+       fi
+
+       einfo "Applying Darwin/libtool patches ..."
+       for x in ${targets} ; do
+               [ ! -s "${x}" ] && continue
+               case $(basename "${x}") in
+               ltmain.sh|ltconfig)
+                       local ver="$(grep '^VERSION=' ${x})"
+                       ver="${ver/VERSION=}"
+                       if [ "${ver:0:3}" == "1.4" -o "${ver:0:3}" == "1.5" ];
+                       then
+                               ver="1.3"   # 1.4, 1.5 and 1.3 are compat
+                       fi
+
+                       ebegin " Fixing \${S}${x/${S}}"
+                       patch -p0 "${x}" "${ELT_PATCH_DIR}/darwin/$(basename "${x}")-${ver:0:3}.patch" > /dev/null
+                       eend $? "PLEASE CHECK ${x}"
+                       ;;
+               esac
+       done
+}