Add support for just installing glibc headers when doing a cross-compile.
authorMike Frysinger <vapier@gentoo.org>
Fri, 18 Nov 2005 03:52:09 +0000 (03:52 +0000)
committerMike Frysinger <vapier@gentoo.org>
Fri, 18 Nov 2005 03:52:09 +0000 (03:52 +0000)
Package-Manager: portage-2.0.53_rc7

sys-libs/glibc/ChangeLog
sys-libs/glibc/Manifest
sys-libs/glibc/glibc-2.3.6-r1.ebuild

index 3ed76430e3ae8316aa2a414874c8e1a22856c436..43b2e479857a43207a9c3891ba07922322b19439 100644 (file)
@@ -1,6 +1,9 @@
 # ChangeLog for sys-libs/glibc
 # Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.410 2005/11/14 22:52:59 azarah Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/ChangeLog,v 1.411 2005/11/18 03:52:09 vapier Exp $
+
+  18 Nov 2005; Mike Frysinger <vapier@gentoo.org> glibc-2.3.6-r1.ebuild:
+  Add support for just installing glibc headers when doing a cross-compile.
 
 *glibc-2.3.6-r1 (14 Nov 2005)
 
index 5673389f72b12eda7d42b49aed0b433983f74b4c..40587429ce30a4c2cc35cf3a5453a68931054cd4 100644 (file)
@@ -1,7 +1,7 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA1
 
-MD5 279506bd49b3de03a0dad874887f031e ChangeLog 86628
+MD5 15452ce5c55ab01fe633b28301eff49a ChangeLog 86778
 MD5 941f13d27badc76c1e3704c59acaff26 files/2.3.1/glibc-2.3.1-ctype-compat-v3.patch 2823
 MD5 67b125cec4f1f0d26ce4df706451fee6 files/2.3.1/glibc-2.3.1-fpu-cw-mips.patch 433
 MD5 1c4e567ed001f9489e11ee06c1ced0b7 files/2.3.1/glibc-2.3.1-libc_wait-compat.patch 1053
@@ -137,13 +137,13 @@ MD5 4536ac9d1f309dc0890741dce8cb012e glibc-2.3.5-r3.ebuild 38908
 MD5 1cb57f1757c26c0e0286cb0ef6c36171 glibc-2.3.5.20050421.ebuild 40152
 MD5 48b60115273ba9fa755a6ef94fe8c3b6 glibc-2.3.5.20050722.ebuild 39299
 MD5 9c15c32a0bbef91769c4fd0c0d7a66c3 glibc-2.3.5.ebuild 40143
-MD5 117f5cb72f6e34b5ad0d8d9310c716b4 glibc-2.3.6-r1.ebuild 40317
+MD5 eb6575db85582f440333c8f79e5a1ca1 glibc-2.3.6-r1.ebuild 42013
 MD5 c1860f958f09de634ae4e2e0b0377bd9 glibc-2.3.6.ebuild 40082
 MD5 567094e03359ffc1c95af7356395228d metadata.xml 162
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.2 (GNU/Linux)
 
-iD8DBQFDfBXxgIKl8Uu19MoRAqa7AJ9X3odnwW7NiXNpHplIdXAWsG2CSwCfcMuK
-5DoaMh3QOmoerTpeweHvojY=
-=78lc
+iD8DBQFDfVBAgIKl8Uu19MoRAq0QAJ0ceRpawZ4LqUD31dEkOsl+HTwdowCfRy9E
+5iiyfCxt3HJu1sswtcPE7HA=
+=DAX0
 -----END PGP SIGNATURE-----
index e9b6caa05f530094dcf9725e036df44d19f5161f..b39193dc3f7ea276906f567e89e07824289d64da 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.6-r1.ebuild,v 1.2 2005/11/17 05:31:12 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.6-r1.ebuild,v 1.3 2005/11/18 03:52:09 vapier Exp $
 
 # Here's how the cross-compile logic breaks down ...
 #  CTARGET - machine that will target the binaries
@@ -66,6 +66,10 @@ fi
 is_crosscompile() {
        [[ ${CHOST} != ${CTARGET} ]]
 }
+just_headers() {
+       [[ -z ${_E_CROSS_HEADERS_ONLY} ]] && return 1
+       is_crosscompile
+}
 
 GLIBC_RELEASE_VER=$(get_version_component_range 1-3)
 
@@ -248,6 +252,31 @@ toolchain-glibc_src_compile() {
        fi
 }
 
+toolchain-glibc_headers_compile() {
+       GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
+       mkdir -p "${GBUILDDIR}"
+       cd "${GBUILDDIR}"
+
+       local myconf="--disable-sanity-checks --enable-hacker-mode"
+       myconf="${myconf}
+               --enable-add-ons=linuxthreads
+               --without-cvs
+               --enable-bind-now
+               --build=${CBUILD_OPT:-${CBUILD}}
+               --host=${CTARGET_OPT:-${CTARGET}}
+               --with-headers=${ROOT}$(alt_headers)
+               --prefix=$(alt_prefix)
+               --mandir=$(alt_prefix)/share/man
+               --infodir=$(alt_prefix)/share/info
+               --libexecdir=$(alt_prefix)/lib/misc/glibc
+               ${EXTRA_ECONF}"
+
+       einfo "Configuring GLIBC headers with: ${myconf// /\n\t\t}"
+       CC=gcc \
+       CFLAGS="-O1 -pipe" \
+       ${S}/configure ${myconf} || die "failed to configure glibc"
+}
+
 toolchain-glibc_src_test() {
        # This is wrong, but glibc's tests fail bad when screwing
        # around with sandbox, so lets just punt it
@@ -515,6 +544,23 @@ toolchain-glibc_src_install() {
        done
 }
 
+toolchain-glibc_headers_install() {
+       GBUILDDIR=${WORKDIR}/build-${ABI}-${CTARGET}-headers
+       cd "${GBUILDDIR}"
+       make install_root="${D}" install-headers || die "install-headers failed"
+       # Copy over headers that are not part of install-headers ... these
+       # are pretty much taken verbatim from crosstool, see it for more details
+       insinto $(alt_headers)/bits
+       doins misc/syscall-list.h bits/stdio_lim.h || die "doins include bits"
+       insinto $(alt_headers)/gnu
+       doins "${S}"/include/gnu/stubs.h || die "doins include gnu"
+       # Make sure we install the sys-include symlink so that when 
+       # we build a 2nd stage cross-compiler, gcc finds the target 
+       # system headers correctly.  See gcc/doc/gccinstall.info
+       dosym include $(alt_prefix)/sys-include
+       dosym . $(alt_prefix)/usr
+}
+
 toolchain-glibc_pkg_postinst() {
        # Mixing nptlonly and -nptlonly glibc can prove dangerous if libpthread
        # isn't removed in unmerge which happens sometimes.  See bug #87671
@@ -863,12 +909,6 @@ setup_locales() {
 glibc_do_configure() {
        local myconf
 
-       # These should not be set, else the
-       # zoneinfo do not always get installed ...
-       unset LANGUAGE LANG LC_ALL
-       # silly users
-       unset LD_RUN_PATH
-
        # set addons
        pushd ${S} > /dev/null
        ADDONS=$(echo */configure | sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|glibc-compat\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d')
@@ -994,6 +1034,11 @@ use_multilib() {
 
 # Setup toolchain variables that would be defined in the profiles for these archs.
 setup_env() {
+       # These should not be set, else the zoneinfo do not always get installed ...
+       unset LANGUAGE LANG LC_ALL
+       # silly users
+       unset LD_RUN_PATH
+
        if is_crosscompile || tc-is-cross-compiler ; then
                multilib_env ${CTARGET}
                if ! use multilib ; then
@@ -1208,7 +1253,11 @@ src_compile() {
                fi
        fi
 
-       toolchain-glibc_src_compile
+       if just_headers ; then
+               toolchain-glibc_headers_compile
+       else
+               toolchain-glibc_src_compile
+       fi
 }
 
 src_test() {
@@ -1267,7 +1316,11 @@ src_install() {
                fi
        fi
 
-       toolchain-glibc_src_install
+       if just_headers ; then
+               toolchain-glibc_headers_install
+       else
+               toolchain-glibc_src_install
+       fi
 
        # Handle stupid lib32 BS on amd64 and ppc64
        if [[ -n ${OLD_LIBDIR} ]] ; then