merge more cross-compile support (hopefully the last)
authorMike Frysinger <vapier@gentoo.org>
Sat, 4 Dec 2004 07:23:03 +0000 (07:23 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 4 Dec 2004 07:23:03 +0000 (07:23 +0000)
sys-libs/glibc/Manifest
sys-libs/glibc/glibc-2.3.4.20040808-r1.ebuild
sys-libs/glibc/glibc-2.3.4.20041102.ebuild

index 2db376da482b92fdc0d3d7b520b07e74b13fbdde..5e3fe185473e3086772dca537b4f53e06bdcbdeb 100644 (file)
@@ -7,8 +7,8 @@ MD5 e4f211c5762191a6fce67b15caf38c31 glibc-2.3.2-r12.ebuild 20537
 MD5 d59fdfb3aca88476d792b71922c765a5 glibc-2.3.3.20040420-r2.ebuild 21630
 MD5 48dcbf88afd15efb62b4313337261968 glibc-2.3.4.20040619-r2.ebuild 21077
 MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
-MD5 d88fb76a3bc6988aa299a87dce226e4f glibc-2.3.4.20040808-r1.ebuild 22823
-MD5 acd92ae15d9a6fe0c7f35cee6b13dd67 glibc-2.3.4.20041102.ebuild 27582
+MD5 f6d6f78d7284d104dee203728ba76dbd glibc-2.3.4.20040808-r1.ebuild 23328
+MD5 c6dbd9da0f3713498ad1de30636ac8f2 glibc-2.3.4.20041102.ebuild 28083
 MD5 9cc1e6b6f749dba7c8759bd07266f7d9 files/digest-glibc-2.2.5-r9 143
 MD5 2d5306ef875573750af642a9f93b634a files/digest-glibc-2.3.2-r12 312
 MD5 42af7e35fe2404a49954f91fd1aee891 files/digest-glibc-2.3.3.20040420-r2 312
@@ -137,7 +137,7 @@ MD5 039f62650037a4a15cef3066b26d27c9 files/2.3.4/glibc-2.3.4-mips-update-__throw
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.9.10 (GNU/Linux)
 
-iD8DBQFBsSxkroRuSHgZdywRAmCEAJ92S/67JHrM9/jwyKjsJyR7A+g0ngCcDKnO
-a75it87akwilkQ+nOWEAHNw=
-=sOJc
+iD8DBQFBsWXrroRuSHgZdywRAr+qAJwOfhiORqhPQyWM6ScNegtOj3M+DQCfdhse
+yOmhxT7R8eMgSwkffi8s8cE=
+=gMEm
 -----END PGP SIGNATURE-----
index f06e34e01cb540f629fb860467f03eac5fa00fee..bf04e8fa3def995a91467c5cf2c90f52f36a9c4c 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/sys-libs/glibc/glibc-2.3.4.20040808-r1.ebuild,v 1.15 2004/12/04 03:17:33 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.4.20040808-r1.ebuild,v 1.16 2004/12/04 07:23:03 vapier Exp $
 
 inherit eutils flag-o-matic gcc versionator
 
@@ -80,6 +80,20 @@ alt_headers() {
        fi
        echo "${ALT_HEADERS}"
 }
+alt_prefix() {
+       if [[ ${CTARGET} = ${CHOST} ]] ; then
+               echo /usr
+       else
+               echo /usr/${CTARGET}
+       fi
+}
+alt_libdir() {
+       if [[ ${CTARGET} = ${CHOST} ]] ; then
+               echo /$(get_libdir)
+       else
+               echo /usr/${CTARGET}/lib
+       fi
+}
 
 setup_flags() {
        # Over-zealous CFLAGS can often cause problems.  What may work for one
@@ -561,6 +575,9 @@ src_compile() {
        want_tls || myconf="${myconf} --without-tls"
        want_tls && myconf="${myconf} --with-tls"
 
+       # Who knows if this works :)
+       [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
+
        # some silly people set LD_RUN_PATH and that breaks things.
        # see bug 19043
        unset LD_RUN_PATH
@@ -576,10 +593,10 @@ src_compile() {
                --without-gd \
                --without-cvs \
                --with-headers=$(alt_headers) \
-               --prefix=/usr \
-               --mandir=/usr/share/man \
-               --infodir=/usr/share/info \
-               --libexecdir=/usr/lib/misc \
+               --prefix=$(alt_prefix) \
+               --mandir=$(alt_prefix)/share/man \
+               --infodir=$(alt_prefix)/share/info \
+               --libexecdir=$(alt_prefix)/lib/misc \
                --enable-bind-now \
                ${myconf} || die
 
@@ -600,13 +617,18 @@ src_install() {
        make PARALLELMFLAGS="${MAKEOPTS}" \
                install_root=${D} \
                install || die
+       if [[ ${CTARGET} != ${CHOST} ]] ; then
+               # punt all the junk not needed by a cross-compiler
+               rm -r "${D}"/usr/${CTARGET}/{bin,etc,lib/gconv,sbin,share}
+       fi
+
        # now, strip everything but the thread libs #46186
-       mkdir ${T}/thread-backup
-       mv ${D}/$(get_libdir)/lib{pthread,thread_db}* ${T}/thread-backup/
+       mkdir -p ${T}/thread-backup
+       mv ${D}/$(alt_libdir)/lib{pthread,thread_db}* ${T}/thread-backup/
        env -uRESTRICT prepallstrip
 
        # this directory can be empty in certain cases so || die is wrong
-       ls  ${T}/thread-backup/*  1>/dev/null 2>&1 && mv -f ${T}/thread-backup/* ${D}/$(get_libdir)/
+       ls  ${T}/thread-backup/*  1>/dev/null 2>&1 && mv -f ${T}/thread-backup/* ${D}/$(alt_libdir)/
 
        # If librt.so is a symlink, change it into linker script (Redhat)
        if [ -L "${D}/usr/lib/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]; then
index 8065e42f2baf99b06a945f9ba6ac0e4bcfcf7a4f..7265b34fd93d7539e1609deb0bcd78cb19f9451b 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/sys-libs/glibc/glibc-2.3.4.20041102.ebuild,v 1.9 2004/12/04 03:17:33 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.4.20041102.ebuild,v 1.10 2004/12/04 07:23:03 vapier Exp $
 
 inherit eutils flag-o-matic gcc versionator
 
@@ -80,6 +80,20 @@ alt_headers() {
        fi
        echo "${ALT_HEADERS}"
 }
+alt_prefix() {
+       if [[ ${CTARGET} = ${CHOST} ]] ; then
+               echo /usr
+       else
+               echo /usr/${CTARGET}
+       fi
+}
+alt_libdir() {
+       if [[ ${CTARGET} = ${CHOST} ]] ; then
+               echo /$(get_libdir)
+       else
+               echo /usr/${CTARGET}/lib
+       fi
+}
 
 setup_flags() {
        # Over-zealous CFLAGS can often cause problems.  What may work for one
@@ -599,6 +613,8 @@ glibc_do_configure() {
                die "invalid pthread option"
        fi
 
+       # Who knows if this works :)
+       [[ -n ${CBUILD} ]] && myconf="${myconf} --build=${CBUILD}"
        myconf="${myconf} --without-cvs
                        --enable-bind-now
                        --build=${CHOST}
@@ -606,10 +622,10 @@ glibc_do_configure() {
                        --disable-profile
                        --without-gd
                        --with-headers=$(alt_headers)
-                       --prefix=/usr
-                       --mandir=/usr/share/man
-                       --infodir=/usr/share/info
-                       --libexecdir=/usr/lib/misc"
+                       --prefix=$(alt_prefix)
+                       --mandir=$(alt_prefix)/share/man
+                       --infodir=$(alt_prefix)/share/info
+                       --libexecdir=$(alt_prefix)/lib/misc"
 
        GBUILDDIR="${WORKDIR}/build-${CTARGET}-$1"
        mkdir -p ${GBUILDDIR}
@@ -661,6 +677,10 @@ src_install() {
                        install_root=${D} \
                        install || die
        fi
+       if [[ ${CTARGET} != ${CHOST} ]] ; then
+               # punt all the junk not needed by a cross-compiler
+               rm -r "${D}"/usr/${CTARGET}/{bin,etc,lib/gconv,sbin,share}
+       fi
 
        if use !nptlonly && want_nptl ; then
                einfo "Installing NPTL to $(get_libdir)/tls/..."
@@ -723,13 +743,13 @@ src_install() {
 
        # now, strip everything but the thread libs #46186
        mkdir -p ${T}/thread-backup
-       mv ${D}/$(get_libdir)/lib{pthread,thread_db}* ${T}/thread-backup/
+       mv ${D}/$(alt_libdir)/lib{pthread,thread_db}* ${T}/thread-backup/
        if use !nptlonly && want_nptl ; then
                mkdir -p ${T}/thread-backup/tls
-               mv ${D}/$(get_libdir)/tls/lib{pthread,thread_db}* ${T}/thread-backup/tls
+               mv ${D}/$(alt_libdir)/tls/lib{pthread,thread_db}* ${T}/thread-backup/tls
        fi
        env -uRESTRICT prepallstrip
-       cp -R -- ${T}/thread-backup/* ${D}/$(get_libdir)/ || die
+       cp -R -- ${T}/thread-backup/* ${D}/$(alt_libdir)/ || die
 
        # If librt.so is a symlink, change it into linker script (Redhat)
        if [ -L "${D}/usr/$(get_libdir)/librt.so" -a "${LIBRT_LINKERSCRIPT}" = "yes" ]; then