diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-05-19 07:53:22 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2013-05-19 07:53:22 +0000 |
commit | 052c099a2d9c7496855bbfa4cc8b9772bde7c5a7 (patch) | |
tree | 430cf960c78299220eb7ddddd603d27b24cc052a /sys-libs | |
parent | Version bump to latest ruby version in tree. Add additional upstream fix for ... (diff) | |
download | historical-052c099a2d9c7496855bbfa4cc8b9772bde7c5a7.tar.gz historical-052c099a2d9c7496855bbfa4cc8b9772bde7c5a7.tar.bz2 historical-052c099a2d9c7496855bbfa4cc8b9772bde7c5a7.zip |
Backport posix_fallocate #458920 and socket.h #465792 changes from upstream.
Package-Manager: portage-2.2.0_alpha170/cvs/Linux x86_64
Manifest-Sign-Key: 0xFB7C4156
Diffstat (limited to 'sys-libs')
-rw-r--r-- | sys-libs/uclibc/ChangeLog | 7 | ||||
-rw-r--r-- | sys-libs/uclibc/Manifest | 30 | ||||
-rw-r--r-- | sys-libs/uclibc/uclibc-0.9.33.2-r4.ebuild | 340 |
3 files changed, 362 insertions, 15 deletions
diff --git a/sys-libs/uclibc/ChangeLog b/sys-libs/uclibc/ChangeLog index 998ee04d0806..fa3ed232f9b8 100644 --- a/sys-libs/uclibc/ChangeLog +++ b/sys-libs/uclibc/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for sys-libs/uclibc # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.76 2013/05/19 05:36:27 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/ChangeLog,v 1.77 2013/05/19 07:53:11 vapier Exp $ + +*uclibc-0.9.33.2-r4 (19 May 2013) + + 19 May 2013; Mike Frysinger <vapier@gentoo.org> +uclibc-0.9.33.2-r4.ebuild: + Backport posix_fallocate #458920 and socket.h #465792 changes from upstream. 19 May 2013; Mike Frysinger <vapier@gentoo.org> uclibc-9999.ebuild: Drop cpu selection for most targets since it is either pointless (does diff --git a/sys-libs/uclibc/Manifest b/sys-libs/uclibc/Manifest index 489f7e78c4f0..d88a0aee3984 100644 --- a/sys-libs/uclibc/Manifest +++ b/sys-libs/uclibc/Manifest @@ -14,6 +14,7 @@ DIST uClibc-0.9.33.2-patches-1.tar.bz2 2351 SHA256 f85756b12ce5f20747f7900b30016 DIST uClibc-0.9.33.2-patches-2.tar.bz2 2854 SHA256 a43192a582ad5428daaceec23aaf096ac037a723eb79724aa716f3850674fecd SHA512 f7ef2bc1a2498e2215828c52003a4ddc4ebe79dd43def367398fad7895c5e5ce9ae4ce68e51141193ef7d47d0727ed477c7b00fbb95b47cd6f251aacbd15048c WHIRLPOOL 80bd9de5b4c5eb671a462a094cd016d0931885ca4604a489017cc36ae5d960a5f08cb72185011d796d5bf9c4809ed2331416ca9b0dae00991ac1e998fc31f7c9 DIST uClibc-0.9.33.2-patches-3.tar.bz2 4002 SHA256 2c06d1f80c8b7e5b0ef60571720273e2ccc55551a3dacc9ed5f7c04e9eda7018 SHA512 935dded858fbd4ce7317bdd1c097f26d8752bd241c12c9b1420e621bb80e59d8f74f84a8ae4df86bb07a03b2354e6c8ce4ba980aaa6d9be63c5e518da393db52 WHIRLPOOL d72989fbc7c700191b5703591bff4ff39ba6a3bb9c230cefb11c21cb2cd5f3f25bd52e8f6783bc651bd273d15146246491923bb1c357ce117da496910acefe6e DIST uClibc-0.9.33.2-patches-5.tar.bz2 10084 SHA256 9c9814360470b1ff3308a85fe8a61ce35eb57c288301b7244450b894f9627a29 SHA512 efd70db740d090d4791e4afc33db2a26df9151ca5be8bcd499ce65d33222af784cb11cbc1f6a4288cab5a4ad1b686488ce836bb62629a9c04f643d40706ac917 WHIRLPOOL b88c36d0eb3f3398a5e96d155cdd8d1b3f6c02ecba4d3f7b167f35c983cf6098e3795839f3f8e0564a91d364c6e2aa0408adcc4647af2143be51a892f2508b27 +DIST uClibc-0.9.33.2-patches-6.tar.bz2 19661 SHA256 81f090b8446c09614d01a2de0637ee21fd16b57f3b5740d6d2f9e02a6869cf27 SHA512 ae2be61ab469b27d9c9b8c3d457f67e24b261db45f511c4d330364aef5843fc0775bc3de61bb9e6e027fabaea7f5736ab4fef9aaddc4d4a777743768afbe0129 WHIRLPOOL a8cd8b066374a49483caa1ea4df1446145c6bafa4f85c00d9136f185dc2ab9f616abc0687c25559e34d6f33a5015f963303293223b1e9f0a7b5777d5b08a3030 DIST uClibc-0.9.33.2.tar.bz2 2834029 SHA256 988d2c777e0605fe253d12157f71ec68f25d1bb8428725d2b7460bf9977e1662 SHA512 1cf18fe5418e12ae12ce995d7455d465bc4737f225afc49512ec69858771e099bead7b18408b01c7e6f845dcc80c3b4f875332eeffdcc04ae4b48474fb29a8dd WHIRLPOOL e2ca16c179893a58228e701ddf8b5614cb6b3fe2eaa6e2a9b909a27f78a348723fa7ec99f7b437ce35d9ac0870e3e2ec4e4d46834ca6b3cbc3d8fa5306b57fb4 DIST uClibc-locale-030818.tgz 236073 SHA256 c4362be318a38f18d98dccf462d22d95bab92f05548bb93f65298fe9afaebd57 EBUILD uclibc-0.9.28.3-r8.ebuild 14630 SHA256 27a5827a295d4b02c34136abcc8a41793d33c9dba849d5050a416760eb9cc8b0 SHA512 bdd97456ff19eb03f47245f8a971deebefb11d3808f15382422d39a437cc7f2881bf799f04baffe5a302ec35b406030bc4c5d79d7e6a5c68de38ebe12dd47f20 WHIRLPOOL 18e5a59ddb7e980affb2e3b84c23109a9744072b5ec525d86bc71ceea057aa19a2340ff23314ccfd56e63fde25d83d0acada8649431b417aaf62851187fa4eb0 @@ -25,24 +26,25 @@ EBUILD uclibc-0.9.33.1.ebuild 10612 SHA256 f175807254cff8e8e91fb0173d3d965f3eee2 EBUILD uclibc-0.9.33.2-r1.ebuild 10638 SHA256 b3c450389a1c396563382e8061fa206baef9acece2cc709a9acc73a03c090217 SHA512 915b875e34f14af9be8a6f682d9d502f99c9fcd6fcec21bbb01089aa8df9c974b7bd833a3f80ac413bf79c231658692cf9a04dcdced4ef1f5d47475e2716c8ff WHIRLPOOL 63cc2fd711fe328d447aead14cf404345ca9ffed306ef474b363d7bd59dcb8f44d31fb1d95964b220c1f082e4a60aba9e3bc87c349856a9833966b4182145fa8 EBUILD uclibc-0.9.33.2-r2.ebuild 10631 SHA256 08f05130b3b7b7df2f0a0bb3330e2599132e872f2e38fe9f9b3586df6a180deb SHA512 a5fa061a09d21aa5d743d5d118e2a60357eff384a959e4e099d9056c557fd2f3d995dd79b01c25e7cd905ff66836e2a540b14a1fd6fcf9229db441763c9d17f5 WHIRLPOOL 60f695ca98a92f99618c4bd1c5adc68527c407c30b9ef22a83aafa9372ff16f4e6f67821cbd5aa48bae8d327e9d16c6ac5d5cb5fe39819f04ba492b1d13a9a72 EBUILD uclibc-0.9.33.2-r3.ebuild 10768 SHA256 5efe6a51165a63f7821accf3dd4b09ffed5e0729c965cac560075e6df2e90480 SHA512 5179bcee9831d3d61cbd9fbeeaa615bc7bd71c5c7d81ba2e107bfe65503439ec3a166ed91f3112ee33fea63a53b2505d95795c8fcf94d666373e3e1e918e52ef WHIRLPOOL e9b20565a20bd6e8a6c9c17168629cb885c40a5b9d246d4656c363eee654b4aeda621c81e552fa36ab1cc0292a24a709d0c9cb99d21c30a1952f9f44f5594878 +EBUILD uclibc-0.9.33.2-r4.ebuild 9116 SHA256 069bc3fbc10d5e2eb6e87618aed2e8bc508ed406329aad051ab4ec11095588f0 SHA512 f2dd164ca21701b17ae6991fa498905ef04599b503f369d3ac906f752fe059f8c32d810a763b62237dc6e4751177d17bca8f3c678ad4f78dbbf7609651dc863f WHIRLPOOL 57f4e1334d94228488d0ad2c8574d5cbb7d504a94d60aec65c43b636b91839b2364339e9ee0fbf2187bffe846edb948205b2879dbdf7837553ba42a436321f4d EBUILD uclibc-0.9.33.2.ebuild 10630 SHA256 db49c741a424d2433ec3978184c979b2a9fcb903f83eeb110adcec76940b342e SHA512 75e974586c57662f2f39d6a80a1162ec611b31b4dfa881a2ab2094f6b35c6b9375c98a53c957580395b4754cc8c27b4a53737b6d9a0f099ab4a3c45ae1169125 WHIRLPOOL 9f8f01465c556c372d926e701abef49770c1772b40ad83325439343d22561a4b1f4cf6c9bcdba78815f2e8af11d3455deee3dd81225c54b83de3dd132e2462c9 EBUILD uclibc-9999.ebuild 9108 SHA256 ddeff7104340a8a5c5bd46dbe44d27cc000bb84899b089ba530210e55cf6f9de SHA512 fa14dcf54ea00811d87d04aa1c47230b6181268de53c545532ec44e412c45166cf9f32c0aa70dfa10841ed32ed5de1ba73eab2ac870ba60c259fda78cd5fccd5 WHIRLPOOL 8e63062268e7d87c03c05a025f894f9a7acd5711c0bec199dbe98cacb88391db8758a137804a0cc43f48b65aad6d288cd2b3744ecd5a23b6779ee735f6e61388 -MISC ChangeLog 21516 SHA256 b987fda30e775ebcc60a5e5ea9f1c61e022c9c7dc1529c44ae830acbe76ae6d1 SHA512 4b80b91d18e4818cb162c9b922f4658b0fd82925cc44105a6c85a1948a1659336277c320db3c2f74973591c5b9bfa1c2ffc7c22d3ab22a688d952f5e67694241 WHIRLPOOL cdda0e5a7db9bb06533a06757e54cc8d06132d2c167f806fb768796f64796e02d8da301c8865a0250ed2c47f278784582fc0eeba75bb150999e7905be4e935a3 +MISC ChangeLog 21709 SHA256 19d3ab911375af369b7fe18192eae7b51d9ec3e39a0548ac9676dd8384bc39fa SHA512 a98f6ef025ed9b5dbfdd9fb2e85c3d3b8e034dce40aedab2601d5e91b9b32336658c21d3db1125b92f6c0e8cc4c7b50b5266dd2b00a50a12860e3e56b8523972 WHIRLPOOL 32f1461203615e4d39124924ea342d4f82f6ae4f02e2db0954f6f732b9a9975782e9a0bf9c9de4432a4375c55478a85702390bdba53b7256e5665d7e1c040ef4 MISC metadata.xml 1435 SHA256 cd15ca4d65ec270c128fb37bd2c489b6e83c566203028cc8ecf9a90bea9c071d SHA512 84b5c8b1afe189587178d7736c3fca20b8079cf5ab666d524962e104a0a531de3fe39bdb2d3b69e4a77c322b8392fe7df292ea50ff89d80f99201aef1a12bc2b WHIRLPOOL 1e93f7bf529709eea2a8dfa81737bff41d22bd8af35ed562f06479f337b53ddc7aedd362c91f8361016c462edb5e8007586a7fde7f960fd4b7b88eff02c42e81 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) -iQIcBAEBCAAGBQJRmGTkAAoJELEHsLL7fEFWlIsP/3Rx6WChFMUtwiPLJygKP/5j -QmNLgJL0aed0LFuznkOJhpkBrrIGXXgzjFvvjnsRVb3HbHqkiZH4j2enE6RxwJyy -ym8/TYLGdXlxKLmgRQXQev+kZwwCj88GXjyBd5W26NfD8Hh/RNFiOo3GKzWO0bsZ -KLzCzfcGCfit0gw2EGS+Q/q+PqB/eCj3zt1jeQLxZnlFV17X6o/i1r9Paew7N7wp -Y87xzifxXWQ0D9HGH/weg4jnwtCAiVizFDxdQXaVTndYyaPhqUcFlgZGb3ZDGiU6 -fqVm7FrD4A41EBWYOaoMDcPsTOKOf5orY3tPrXOqH6kJLazhiAPaAmQVdMWyy/xf -J8vS0o2j3gOteM4g9NkvB9KxTKAOb6fVP9p2cntbYPaJ/ruiqyUTAnMIr1AmSlEE -7I+1/LB9bEV297+pgCJcXF3iFCo3AoeMno7eg4c5fQCXbftBYUGr7r625G/xFxE2 -7XS0AfbyzRCBbih3fdfj9suOfyLj8rHvwpnMRu666ujAMKsG2TMSa5+cdEV5ANE8 -ntTXVFMuZEhU00fYqWHnOSPLanm6h459qPVBouWlxm+jCXZhDimJG1P7T5SKeOtP -8duQO635CxRQo8W7++IDaNaJReFkdjJoKVFuRtk1Pr0HZJ58sl4iZyd7lBKbeLsj -YUdNwHk8DABHWnn0rnwj -=Ntk7 +iQIcBAEBCAAGBQJRmIToAAoJELEHsLL7fEFWb38P/iA96543OVwUYe0twnBwkOa1 +PjhywJQcARfFsABclG2g8Rjd9fXG6c4tfaulsb6uGSQSta3Lg5e/xH9JUA0Bnm58 +VAMfAH0bxLgIdhnC5trXxGIaF25iU8EcQvYJev6mocxhuS/82CYGPtRYSx3Clu0u +ZpKrQZQg8uvyWBhcwm56vds7mThwnvBKQHN0iU8zXfLp1zwMTRlNMLrubbGiRnbT +QTm9ApoDF4LXyNvzuQ+m3bG186vlA7+sTynjiiyWsbFvOHFiVpwRzYRKhdi4d6vc +idvc+2ezGLpMZfVgKhlkwBslhuTkpBlBdfZZCx+QJwLYeSrM2aZU//bEp/g/a9Qp +Od283pnY6zd4hQDPniTdwH8w7G2NIGRtY1iWY7dul3dcmyuizOFj9YUuNsC2DIqg +uO2z6wnOL+mesdpFE8BwkgbCp4uxc7g3eguL0W6OQN2362mjQ6BYm7agy4Z1YYA5 +pXtcSBkf9CGxTY/4mAA9rgiT/9zTzGmkKaSVI6/X110JMXzqsb5+P0RjUMHcDUtp +8CMuCYm8k4N4ToFRMjcs78wHY2ggWeGoksnNSiOw3EUtg/XZUPonWnYhSo7qfCUE +E8ZBUxxf4OpClMpjPDXnsXQhTuw4ibcgUMRlGoj4FtNyNkZ6xR2RewYB7xwYVEth +CxOLoqfS8fyYo7WoRb1+ +=p7P6 -----END PGP SIGNATURE----- diff --git a/sys-libs/uclibc/uclibc-0.9.33.2-r4.ebuild b/sys-libs/uclibc/uclibc-0.9.33.2-r4.ebuild new file mode 100644 index 000000000000..4e4d5670e416 --- /dev/null +++ b/sys-libs/uclibc/uclibc-0.9.33.2-r4.ebuild @@ -0,0 +1,340 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-libs/uclibc/uclibc-0.9.33.2-r4.ebuild,v 1.1 2013/05/19 07:53:11 vapier Exp $ + +inherit eutils flag-o-matic multilib toolchain-funcs savedconfig +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="git://git.busybox.net/uClibc" + inherit git-2 +fi + +export CBUILD=${CBUILD:-${CHOST}} +export CTARGET=${CTARGET:-${CHOST}} +if [[ ${CTARGET} == ${CHOST} ]] ; then + if [[ ${CATEGORY/cross-} != ${CATEGORY} ]] ; then + export CTARGET=${CATEGORY/cross-} + fi +fi + +MY_P=uClibc-${PV} +DESCRIPTION="C library for developing embedded Linux systems" +HOMEPAGE="http://www.uclibc.org/" +if [[ ${PV} != "9999" ]] ; then + PATCH_VER="6" + SRC_URI="http://uclibc.org/downloads/${MY_P}.tar.bz2 + ${PATCH_VER:+mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.bz2}" + KEYWORDS="-* ~amd64 ~arm ~m68k ~mips ~ppc ~sh ~sparc ~x86" +fi + +LICENSE="LGPL-2" +SLOT="0" +IUSE="debug hardened iconv ipv6 nptl rpc ssp uclibc-compat wordexp crosscompile_opts_headers-only" +RESTRICT="strip" + +S=${WORKDIR}/${MY_P} + +is_crosscompile() { + [[ ${CHOST} != ${CTARGET} ]] +} +alt_build_kprefix() { + if [[ ${CBUILD} == ${CHOST} && ${CTARGET} == ${CHOST} ]] ; then + echo /usr/include + else + echo /usr/${CTARGET}/usr/include + fi +} + +just_headers() { + use crosscompile_opts_headers-only && is_crosscompile +} + +uclibc_endian() { + # XXX: this wont work for a toolchain which is bi-endian, but we + # dont have any such thing at the moment, so not a big deal + touch "${T}"/endian.s + $(tc-getAS ${CTARGET}) "${T}"/endian.s -o "${T}"/endian.o + case $(file "${T}"/endian.o) in + *" MSB "*) echo "BIG";; + *" LSB "*) echo "LITTLE";; + *) echo "NFC";; + esac + rm -f "${T}"/endian.{s,o} +} + +pkg_setup() { + if [ ${CTARGET} = ${CHOST} ] ; then + case ${CHOST} in + *-uclinux*|*-uclibc*) ;; + *) die "Use sys-devel/crossdev to build a uclibc toolchain" ;; + esac + fi +} + +check_cpu_opts() { + case ${CTARGET} in + # Need to handle $ABI here w/mips. + mips[1234]*) export UCLIBC_CPU="MIPS_ISA_${CTARGET:4:1}";; + sh[2345]*) export UCLIBC_CPU="SH${CTARGET:2:1}";; + i[3456]86*) export UCLIBC_CPU="${CTARGET:1:1}86";; + # XXX: Should figure out how to handle sparc. + esac +} + +kconfig_q_opt() { + local flag=$1; shift + case ${flag} in + y|n) ;; + *) flag=$(usex ${flag} y n) ;; + esac + + local var="defs_${flag}" + eval "${var}+=( $* )" +} + +get_opt() { + ( + unset ${1} + . ${2:-"${S}"/.config} + echo ${!1} + ) +} + +src_oldconfig() { + yes "" 2>/dev/null | emake -s oldconfig >/dev/null +} +src_config() { + restore_config .config + if [ -f .config ]; then + src_oldconfig + return 0 + else + ewarn "Could not locate user configfile, so we will save a default one" + fi + + emake ARCH=${target} defconfig >/dev/null || die + + local defs_{y,n} defs + + defs=( + DO{DEBUG_PT,ASSERTS} + SUPPORT_LD_DEBUG_EARLY + UCLIBC_HAS_PROFILING + ) + kconfig_q_opt n "${defs[@]}" + kconfig_q_opt debug DODEBUG SUPPORT_LD_DEBUG + + sed -i -e '/ARCH_.*_ENDIAN/d' .config + kconfig_q_opt y "ARCH_WANTS_$(uclibc_endian)_ENDIAN" + + if [[ ${CTARGET} == arm* ]] ; then + kconfig_q_opt n CONFIG_ARM_OABI + kconfig_q_opt y CONFIG_ARM_EABI + fi + + defs=( + MALLOC_GLIBC_COMPAT + DO_C99_MATH + UCLIBC_HAS_{CTYPE_CHECKED,WCHAR,HEXADECIMAL_FLOATS,GLIBC_CUSTOM_PRINTF,FOPEN_EXCLUSIVE_MODE,GLIBC_CUSTOM_STREAMS,PRINTF_M_SPEC} + UCLIBC_HAS_FENV + UCLIBC_HAS_{N,}FTW + UCLIBC_HAS_GNU_GLOB + UCLIBC_HAS_LIBUTIL + UCLIBC_HAS_PROGRAM_INVOCATION_NAME + UCLIBC_HAS_RESOLVER_SUPPORT + UCLIBC_HAS_TZ_FILE_READ_MANY + UCLIBC_HAS_UTMPX + UCLIBC_SUPPORT_AI_ADDRCONFIG + UCLIBC_SUSV3_LEGACY + UCLIBC_SUSV3_LEGACY_MACROS + UCLIBC_SUSV4_LEGACY + UCLIBC_USE_NETLINK + PTHREADS_DEBUG_SUPPORT + ) + kconfig_q_opt y "${defs[@]}" + kconfig_q_opt n UCLIBC_HAS_CTYPE_UNSAFE + kconfig_q_opt n UCLIBC_HAS_LOCALE + kconfig_q_opt n HAS_NO_THREADS + kconfig_q_opt ipv6 UCLIBC_HAS_IPV6 + kconfig_q_opt nptl UCLIBC_HAS_THREADS_NATIVE + kconfig_q_opt !nptl LINUXTHREADS_OLD + kconfig_q_opt rpc UCLIBC_HAS_{,{FULL,REENTRANT}_}RPC + kconfig_q_opt wordexp UCLIBC_HAS_WORDEXP + kconfig_q_opt uclibc-compat UCLIBC_HAS_LIB{NSL,RESOLV}_STUB COMPAT_ATEXIT + + # we need to do it independently of hardened to get ssp.c built into libc + kconfig_q_opt y UCLIBC_HAS_SSP + kconfig_q_opt n UCLIBC_HAS_SSP_COMPAT + kconfig_q_opt y UCLIBC_HAS_ARC4RANDOM + kconfig_q_opt n PROPOLICE_BLOCK_ABRT + kconfig_q_opt y PROPOLICE_BLOCK_SEGV + + # arm/mips do not emit PT_GNU_STACK, but if we enable this here + # it will be emitted as RWE, ppc has to be checked, x86 needs it + # this option should be used independently of hardened + if has $(tc-arch) x86 || has $(tc-arch) ppc ; then + kconfig_q_opt y UCLIBC_BUILD_NOEXECSTACK + else + kconfig_q_opt n UCLIBC_BUILD_NOEXECSTACK + fi + kconfig_q_opt y UCLIBC_BUILD_RELRO + kconfig_q_opt hardened UCLIBC_BUILD_PIE + kconfig_q_opt hardened UCLIBC_BUILD_NOW + kconfig_q_opt !ssp SSP_QUICK_CANARY + kconfig_q_opt ssp UCLIBC_BUILD_SSP + + local def + for def in 1 2 ; do + # Run twice as some config opts depend on others being enabled first. + for def in ${defs_y[@]} ; do + sed -i -e "s:.*\<${def}\>.*set:${def}=y:g" .config + done + for def in ${defs_n[@]} ; do + sed -i -e "s:${def}=y:# ${def} is not set:g" .config + done + src_oldconfig + done + + einfo "Enabled options:" + for def in ${defs_y[@]} ; do + einfo " " $(grep "^${def}=y" .config || echo "could not find ${def}") + done + einfo "Disabled options:" + for def in ${defs_n[@]} ; do + einfo " " $(grep "^# ${def} is not set" .config || echo "could not find ${def}") + done + + # setup build and run paths + sed -i \ + -e "/^CROSS_COMPILER_PREFIX/s:=.*:=\"${CTARGET}-\":" \ + -e "/^KERNEL_HEADERS/s:=.*:=\"$(alt_build_kprefix)\":" \ + -e "/^SHARED_LIB_LOADER_PREFIX/s:=.*:=\"/$(get_libdir)\":" \ + -e "/^DEVEL_PREFIX/s:=.*:=\"/usr\":" \ + -e "/^RUNTIME_PREFIX/s:=.*:=\"/\":" \ + -e "/^UCLIBC_EXTRA_CFLAGS/s:=.*:=\"${UCLIBC_EXTRA_CFLAGS}\":" \ + .config || die + + src_oldconfig +} + +src_unpack() { + if [[ ${PV} == "9999" ]] ; then + git-2_src_unpack + else + unpack ${A} + fi + cd "${S}" + if [[ -n ${PATCH_VER} ]] ; then + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch + fi + + epatch_user + + check_cpu_opts + + echo + einfo "Runtime Prefix: /" + einfo "Devel Prefix: /usr" + einfo "Kernel Prefix: $(alt_build_kprefix)" + einfo "CBUILD: ${CBUILD}" + einfo "CHOST: ${CHOST}" + einfo "CTARGET: ${CTARGET}" + einfo "CPU: ${UCLIBC_CPU:-default}" + einfo "ENDIAN: $(uclibc_endian)" + echo + + ########## CPU SELECTION ########## + + local target=$(tc-arch) config_target + case ${target} in + amd64) target="x86_64";; + arm) target="arm"; config_target="GENERIC_ARM";; + avr) target="avr32";; + mips) target="mips"; config_target="MIPS_ISA_1";; + ppc) target="powerpc";; + sh) target="sh"; config_target="SH4";; + x86) target="i386"; config_target="486";; + esac + if [[ -n ${config_target} ]] ; then + sed -i -e "s:default CONFIG_${config_target}:default CONFIG_${UCLIBC_CPU:-${config_target}}:" \ + extra/Configs/Config.${target} || die + fi + sed -i -e "s:^HOSTCC.*=.*:HOSTCC=$(tc-getBUILD_CC):" Rules.mak + + src_config + + if use iconv ; then + # Run after make clean, otherwise files removed + find ./extra/locale/charmaps -name "*.pairs" > extra/locale/codesets.txt + if [[ ! -f /etc/locale.gen ]] ; then + # See ./extra/locale/LOCALES for examples + die "Please create an appropriate /etc/locale.gen for locale support" + fi + echo -e "@euro e\n@cyrillic c\n#---\nUTF-8 yes\n8-BIT yes\n#---\n\n" > ./extra/locale/locales.txt + cat /etc/locale.gen >> ./extra/locale/locales.txt + fi +} + +src_compile() { + emake headers || die + just_headers && return 0 + + emake || die + if is_crosscompile ; then + emake -C utils hostutils || die + else + emake utils || die + fi +} + +src_test() { + is_crosscompile && return 0 + + # assert test fails on pax/grsec enabled kernels - normal + # vfork test fails in sandbox (both glibc/uclibc) + emake UCLIBC_ONLY=1 check || die +} + +src_install() { + local sysroot=${D} + is_crosscompile && sysroot+="/usr/${CTARGET}" + + local target="install" + just_headers && target="install_headers" + emake DESTDIR="${sysroot}" ${target} || die + + save_config .config + + # remove files coming from kernel-headers + rm -rf "${sysroot}"/usr/include/{linux,asm*} + + # 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 + if is_crosscompile ; then + dosym usr/include /usr/${CTARGET}/sys-include + if ! just_headers && [[ -n $(get_opt HAVE_SHARED) ]] ; then + newbin utils/ldconfig.host ${CTARGET}-ldconfig || die + newbin utils/ldd.host ${CTARGET}-ldd || die + fi + return 0 + fi + + emake DESTDIR="${D}" install_utils || die + dobin extra/scripts/getent + dodoc Changelog* README TODO docs/*.txt DEDICATION.mjn3 +} + +pkg_postinst() { + is_crosscompile && return 0 + + if [ ! -e "${ROOT}"/etc/TZ ] ; then + ewarn "Please remember to set your timezone in /etc/TZ" + mkdir -p "${ROOT}"/etc + echo "UTC" > "${ROOT}"/etc/TZ + fi + [ "${ROOT}" != "/" ] && return 0 + # update cache before reloading init + ldconfig + # reload init ... + /sbin/telinit U 2>/dev/null +} |