--- /usr/portage/sys-libs/glibc/glibc-2.3.1-r3.ebuild 2003-03-11 11:52:29.000000000 +0000 +++ glibc-2.3.1-r3.ebuild 2003-03-23 03:12:26.000000000 +0000 @@ -1,13 +1,24 @@ # Copyright 1999-2003 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /home/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.8 2003/03/11 11:34:14 zwelch Exp $ +# $Header: /home/cvsroot/gentoo-x86/sys-libs/glibc/glibc-2.3.1-r3.ebuild,v 1.7 2003/03/09 03:37:06 azarah Exp $ IUSE="nls pic build" -inherit eutils flag-o-matic gcc +inherit eutils flag-o-matic gcc crosscompile filter-flags "-fomit-frame-pointer -malign-double" +# A bit brute force but if we are cross compiling +# at the moment remove any march and mcpu flags. +# Aiken 12/03/2003 +if cross-target || cross-build +then + filter-flags "-march -mcpu" + # Also don't want portage striping the new library with the + # system strip. + RESTRICT="nostrip" +fi + # Sparc support ... replace-flags "-mcpu=ultrasparc" "-mcpu=v8" replace-flags "-mcpu=v9" "-mcpu=v8" @@ -44,7 +55,7 @@ http://ftp.gnu.org/gnu/glibc/glibc-linuxthreads-${PV}.tar.gz" HOMEPAGE="http://www.gnu.org/software/libc/libc.html" -KEYWORDS="~x86 ~ppc sparc ~alpha ~mips ~hppa" +KEYWORDS="x86 ~ppc sparc ~alpha ~mips ~hppa" # Is 99% compadible, just some .a's bork SLOT="2.2" LICENSE="GPL-2" @@ -53,15 +64,18 @@ # Drobbins, 18 Mar 2002: we now rely on the system profile to select the correct linus-headers DEPEND=">=sys-devel/gcc-3.2-r1 >=sys-devel/binutils-2.13.90.0.16 - virtual/os-headers + sys-kernel/linux-headers nls? ( sys-devel/gettext )" -RDEPEND="virtual/os-headers +RDEPEND="sys-kernel/linux-headers sys-apps/baselayout nls? ( sys-devel/gettext ) build? ( >=sys-apps/portage-1.9.0 )" PROVIDE="virtual/glibc" +# Default to /usr for the install location +# Aiken 11/03/2003 +LOC=/usr pkg_config() { if [ "`gcc-major-version`" -ne "3" -o "`gcc-minor-version`" -lt "2" ] @@ -141,24 +155,22 @@ epatch ${FILESDIR}/${PV}/${P}-ulps-mips.patch fi - # Some patches for hppa. - # (27 Jan 2003) - if [ "${ARCH}" = "hppa" ] - then - cd ${S} - epatch ${FILESDIR}/${PV}/glibc23-00-hppa-pthreads.dpatch - epatch ${FILESDIR}/${PV}/glibc23-01-hppa-dl-machine.dpatch - epatch ${FILESDIR}/${PV}/glibc23-02-hppa-min-kern-unwind-fde.dpatch - epatch ${FILESDIR}/${PV}/glibc23-03-hppa-mcontext.dpatch - epatch ${FILESDIR}/${PV}/glibc23-04-hppa-fcntl64.dpatch - epatch ${FILESDIR}/${PV}/glibc23-05-hppa-buildhack.dpatch - epatch ${FILESDIR}/${PV}/glibc23-06-hppa-tests.dpatch - epatch ${FILESDIR}/${PV}/glibc23-07-hppa-atomicity.dpatch - epatch ${FILESDIR}/${PV}/glibc23-08-hppa-configure.dpatch - epatch ${FILESDIR}/${PV}/glibc23-hppa-shmlba.dpatch - fi - - + # Some patches for hppa. + # (27 Jan 2003) + if [ "${ARCH}" = "hppa" ] + then + cd ${S} + epatch ${FILESDIR}/${PV}/glibc23-00-hppa-pthreads.dpatch + epatch ${FILESDIR}/${PV}/glibc23-01-hppa-dl-machine.dpatch + epatch ${FILESDIR}/${PV}/glibc23-02-hppa-min-kern-unwind-fde.dpatch + epatch ${FILESDIR}/${PV}/glibc23-03-hppa-mcontext.dpatch + epatch ${FILESDIR}/${PV}/glibc23-04-hppa-fcntl64.dpatch + epatch ${FILESDIR}/${PV}/glibc23-05-hppa-buildhack.dpatch + epatch ${FILESDIR}/${PV}/glibc23-06-hppa-tests.dpatch + epatch ${FILESDIR}/${PV}/glibc23-07-hppa-atomicity.dpatch + epatch ${FILESDIR}/${PV}/glibc23-08-hppa-configure.dpatch + epatch ${FILESDIR}/${PV}/glibc23-hppa-shmlba.dpatch + fi } src_compile() { @@ -167,11 +179,20 @@ # These should not be set, else the # zoneinfo do not always get installed ... unset LANGUAGE LANG LC_ALL + + # Set the prefix if we are building a cross compiling + # tool chain. Also set the compiler. + # Aiken 11/03/2003 + if cross-target + then + LOC=/usr/${CCHOST} + CC=${CCHOST}-gcc + fi # If we build for the build system we use the kernel headers from the target # ( use build || use sparc ) \ # && myconf="${myconf} --with-headers=${ROOT}usr/include" - myconf="${myconf} --with-headers=${ROOT}usr/include" + myconf="${myconf} --with-headers=${ROOT}${LOC}/include" # Set it without "build" as well, else it might use the current kernel's # headers, which might just fail (the linux-headers package is usually well # tested...) @@ -183,14 +204,29 @@ # && myconf="${myconf} --with-tls" myconf="${myconf} --without-tls --without-__thread" - if [ "`uname -r | cut -d. -f2`" -ge "4" ] + # Removing this for cross compiling. Specifying a minimum kernel + # is ok if the target is running a recent enough kernel. This + # does not work for me as my target runs a 2.2.x kernel. + # Aiken 12/03/2003 + if ! cross-target && ! cross-build then - myconf="${myconf} --enable-kernel=2.4.0" + if [ "`uname -r | cut -d. -f2`" -ge "4" ] + then + myconf="${myconf} --enable-kernel=2.4.0" + fi fi # This should not be done for: ia64 s390 s390x # use x86 && CFLAGS="${CFLAGS} -freorder-blocks" - + + # Set the --build and --host options if we are doing a tool + # chain. + # Aiken 12/03/2003 + if cross-target + then + myconf="${myconf} --build=${CBUILD} --host=${CCHOST}" + fi + einfo "Configuring GLIBC..." rm -rf buildhere mkdir buildhere @@ -200,10 +236,10 @@ --without-cvs \ --enable-add-ons=yes \ --disable-profile \ - --prefix=/usr \ - --mandir=/usr/share/man \ - --infodir=/usr/share/info \ - --libexecdir=/usr/lib/misc \ + --prefix=${LOC} \ + --mandir=${LOC}/share/man \ + --infodir=${LOC}/share/info \ + --libexecdir=${LOC}/lib/misc \ ${myconf} || die einfo "Building GLIBC..." @@ -237,7 +273,7 @@ einfo "Installing man pages and docs..." # Install linuxthreads man pages - dodir /usr/share/man/man3 + dodir ${LOC}/share/man/man3 doman ${S}/man/*.3thr # Install nscd config file @@ -247,7 +283,7 @@ dodoc BUGS ChangeLog* CONFORMANCE COPYING* FAQ INTERFACE \ NEWS NOTES PROJECTS README* else - rm -rf ${D}/usr/share ${D}/usr/lib/gconv + rm -rf ${D}/${LOC}/share ${D}/${LOC}/lib/gconv fi if [ "`use pic`" ] @@ -262,21 +298,47 @@ done fi - # Is this next line actually needed or does the makefile get it right? - # It previously has 0755 perms which was killing things. - fperms 4755 /usr/lib/misc/pt_chown + # Aiken 12/03/2003 + if ! cross-target + then + # Is this next line actually needed or does the makefile get it right? + # It previously has 0755 perms which was killing things. + fperms 4755 ${LOC}/lib/misc/pt_chown - rm -f ${D}/etc/ld.so.cache + rm -f ${D}/etc/ld.so.cache + + # Prevent overwriting of the /etc/localtime symlink. We'll handle the + # creation of the "factory" symlink in pkg_postinst(). + rm -f ${D}/etc/localtime - # Prevent overwriting of the /etc/localtime symlink. We'll handle the - # creation of the "factory" symlink in pkg_postinst(). - rm -f ${D}/etc/localtime + # Some things want this, notably ash. + dosym ${LOC}/lib/libbsd-compat.a ${LOC}/lib/libbsd.a + else + cd ${D}/usr/${CCHOST}/lib - # Some things want this, notably ash. - dosym /usr/lib/libbsd-compat.a /usr/lib/libbsd.a + # This creates the normal lib sym links before portage + # installs the cross glibc. This way portage knows about + # the sym links so when this package is unmerged the unmerge + # is clean. + ldconfig -N . + + # As this is a cross compile RESTRICT has been used to stop + # portage from stripping the new libs. We do it here using + # the correct strip. +# ${CCHOST}-strip --strip-debug * + einfo "If you strip the lib make sure you use the correct strip" + fi } pkg_postinst() { + # At the moment just return for the cross compile tool + # chain case. + # Aiken 11/03/2003 + if cross-target + then + return 0 + fi + # Correct me if I am wrong here, but my /etc/localtime is a file # created by zic .... # I am thinking that it should only be recreated if no /etc/localtime