From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 138F41381F3 for ; Thu, 20 Jun 2013 12:20:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7E1F0E0A7E; Thu, 20 Jun 2013 12:20:30 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A583EE0A53 for ; Thu, 20 Jun 2013 12:20:29 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3311D33E65F for ; Thu, 20 Jun 2013 12:20:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id D15F0E5459 for ; Thu, 20 Jun 2013 12:20:26 +0000 (UTC) From: "Yuta SATOH" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Yuta SATOH" Message-ID: <1371727331.79ade579b06d6538986dde07ed226b9944feb58a.yuta_satoh@gentoo> Subject: [gentoo-commits] proj/gentoo-bsd:master commit in: sys-freebsd/freebsd-lib/ X-VCS-Repository: proj/gentoo-bsd X-VCS-Files: sys-freebsd/freebsd-lib/Manifest sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild X-VCS-Directories: sys-freebsd/freebsd-lib/ X-VCS-Committer: yuta_satoh X-VCS-Committer-Name: Yuta SATOH X-VCS-Revision: 79ade579b06d6538986dde07ed226b9944feb58a X-VCS-Branch: master Date: Thu, 20 Jun 2013 12:20:26 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b6d32601-566a-452e-815a-6351403c2d91 X-Archives-Hash: 18c102ef8770de48c4e1b9f0d9eaa63f commit: 79ade579b06d6538986dde07ed226b9944feb58a Author: Yuta SATOH gentoo gr jp> AuthorDate: Thu Jun 20 11:22:11 2013 +0000 Commit: Yuta SATOH 0x100 com> CommitDate: Thu Jun 20 11:22:11 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-bsd.git;a=commit;h=79ade579 freebsd-lib-9.9999: sync to 9.1-r8 ebuild. --- sys-freebsd/freebsd-lib/Manifest | 2 +- sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild | 174 +++++++++++++++------- 2 files changed, 125 insertions(+), 51 deletions(-) diff --git a/sys-freebsd/freebsd-lib/Manifest b/sys-freebsd/freebsd-lib/Manifest index a7713e5..3e86b2c 100644 --- a/sys-freebsd/freebsd-lib/Manifest +++ b/sys-freebsd/freebsd-lib/Manifest @@ -18,4 +18,4 @@ AUX freebsd-sources-9.0-sysctluint.patch 403 SHA256 884fbc5d6d3766ea3d4609946f56 AUX libmap.conf 201 SHA256 36a1bd56965f171cbb058f6e1762801e3b92c083fe36f6fe046bd669beed9742 SHA512 abc358dff495fe96b9ed549bacb5278577ca4da46b89b87e9211a2f6acdd455111df02ba11b797287f839af6cc22f8810e8ac1dc52154acc8b22364e667b3c49 WHIRLPOOL 0827a0ea9b8a2faed019d13356a793b2b572e54d6f8ebf32a9f12214759153433e21f7d8fdedf43e038ac1925432c1f4843441db47d29895eda51781f1fedb5e AUX libusb-1.0.pc.in 207 SHA256 edf35e887cbfed2df288825434c467e0a946eeb21e0d631f55940bb177c2ba15 SHA512 93289cecfc298a31fd4fd0848bf25a63048a7549bd81792d7bd158731246221c24ec9f469a918430da56873a0936fb2b372cedaaa32a38ccd5323de0f9a89b93 WHIRLPOOL 7c81b0df4548a9391b4e1420186f1e970aa9e2e73a89e817adbff9de52b8797cbd8a4d8b3ca01f782f86e4b1e48fad72a08b5bff49d5ee6ffaa5135c015ca5ae AUX libusb.pc.in 208 SHA256 9bfe398a335f8b9b1c3dd167ab0c9206fe3bdd4e1da318ece977e20f3c2d7c56 SHA512 e9c6d5f04057cf8c13f69a3d8e07bdd517fdb01d572a69a1beb397766311b3c53894b108caaaea740bfc27b227a9620621dac5846bff1a367fbf9954f38bb40c WHIRLPOOL e80e76a8a564655d924a7148a841c7c7cf0be0ea3bdbd76e95e5004124543826e5d925dfe791f4b040e042a10923865bb517499d9f5be39611fedbcceebe32d8 -EBUILD freebsd-lib-9.9999.ebuild 17168 SHA256 c6e4d4a9f368780e1ff048c247adbdd6be7ee8590a6eb1735a4b59940c970c46 SHA512 58a4880172244ca80fc3eb65d3e35e98596c5a0c7b29e36a3fe11ab9846814091265a2cf91d4edd61d9b31ed32bfc38cc6be5a1a5b7a33019bee0a2de4b306ff WHIRLPOOL eb33b5f83268283a35af775dee2dd6cd7c476920c1b93b76fe300a3383424a482417652789a0b8909e5c04d72f8fde14ddfc1308ea8f3264f9a190396de214e7 +EBUILD freebsd-lib-9.9999.ebuild 18396 SHA256 08454010461a8c0de7b98e8c48c93cc3e0b61fe11b58f53a7e99a1752149a20d SHA512 cfa5b4214b95fdd84f91360c2bb26068f51d339720803070679374e5b022dcd7b6648946b0a5c6dd289f41cecff5578c07de46ad337a2b03c51400a373c5d4e3 WHIRLPOOL 3d48d0514a5b3cef7cd6f940f05a92f858094e89360c023e1faa2ba813efecf796a4a171bb93c805d2d7d0d744935c6263c21ea9a046cb0bddddf43967b3f59b diff --git a/sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild b/sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild index 7a712d7..91741db 100644 --- a/sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild +++ b/sys-freebsd/freebsd-lib/freebsd-lib-9.9999.ebuild @@ -39,8 +39,7 @@ if [ "${CATEGORY#*cross-}" = "${CATEGORY}" ]; then !sys-freebsd/freebsd-headers" DEPEND="${RDEPEND} >=sys-devel/flex-2.5.31-r2 - =sys-freebsd/freebsd-sources-${RV}* - !bootstrap? ( app-arch/bzip2 )" + =sys-freebsd/freebsd-sources-${RV}*" else SRC_URI="${SRC_URI} mirror://gentoo/${SYS}.tar.bz2" @@ -58,7 +57,7 @@ if [ "${CTARGET}" = "${CHOST}" -a "${CATEGORY#*cross-}" != "${CATEGORY}" ]; then fi IUSE="atm bluetooth ssl hesiod ipv6 kerberos usb netware - build bootstrap crosscompile_opts_headers-only zfs + build crosscompile_opts_headers-only zfs userland_GNU userland_BSD multilib" pkg_setup() { @@ -106,6 +105,8 @@ PATCHES=( # - archiving libraries (have their own ebuild) # - sendmail libraries (they are installed by sendmail) # - SNMP library and dependency (have their own ebuilds) +# - libstand: static library, 32bits on amd64 used for boot0, we build it from +# boot0 instead. # # The rest are libraries we already have somewhere else because # they are contribution. @@ -119,7 +120,8 @@ REMOVE_SUBDIRS="ncurses \ libbegemot libbsnmp \ libpam libpcap bind libwrap libmagic \ libcom_err libtelnet - libelf libedit" + libelf libedit + libstand" # For doing multilib over multibuild.eclass MULTIBUILD_VARIANTS=( $(get_all_abis) ) @@ -191,16 +193,9 @@ src_prepare() { sed -i.bak -e 's:${INSTALL} -C:${INSTALL}:' "${WORKDIR}/include/Makefile" fi - # Let arch-specific includes to be found - local machine - machine=$(tc-arch-kernel ${CTARGET}) - ln -s "${WORKDIR}/sys/${machine}/include" "${WORKDIR}/include/machine" || \ - die "Couldn't make ${machine}/include symlink." - - cd "${S}" - use bootstrap && dummy_mk libstand # Try to fix sed calls for GNU sed. Do it only with GNU userland and force # BSD's sed on BSD. + cd "${S}" if use userland_GNU; then find . -name Makefile -exec sed -ibak 's/sed -i /sed -i/' {} \; fi @@ -257,9 +252,12 @@ bootstrap_libgcc() { append-ldflags "-L${MAKEOBJDIRPREFIX}/${WORKDIR}/gnu/lib/libgcc" } -# What to build for a non-native build: cross-compiler, non-native abi in -# multilib. We also need the csu but this has to be handled separately. -NON_NATIVE_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil" +# What to build for a cross-compiler. +# We also need the csu but this has to be handled separately. +CROSS_SUBDIRS="lib/libc lib/msun gnu/lib/libssp/libssp_nonshared lib/libthr lib/libutil" + +# What to build for non-default ABIs. +NON_NATIVE_SUBDIRS="${CROSS_SUBDIRS} gnu/lib/csu lib/libcompiler_rt gnu/lib/libgcc lib/libmd lib/libcrypt" # Subdirs for a native build: NATIVE_SUBDIRS="lib gnu/lib/libssp/libssp_nonshared gnu/lib/libregex gnu/lib/csu gnu/lib/libgcc" @@ -273,7 +271,7 @@ is_native_abi() { # Do we need to bootstrap the csu and libssp_nonshared? need_bootstrap() { - is_crosscompile || use build || ! is_native_abi || has_version "<${CATEGORY}/${P}" || [[ ${PV} == *9999* ]] + is_crosscompile || use build || { ! is_native_abi && ! has_version '>=sys-freebsd/freebsd-lib-9.1-r8[multilib]' ; } || has_version "<${CATEGORY}/${P}" || [[ ${PV} == *9999* ]] } # Get the subdirs we are building. @@ -284,27 +282,16 @@ get_subdirs() { ret="${NATIVE_SUBDIRS}" elif is_crosscompile ; then # With a cross-compiler we only build the very core parts. - ret="${NON_NATIVE_SUBDIRS}" + ret="${CROSS_SUBDIRS}" if [ "${EBUILD_PHASE}" = "install" ]; then # Add the csu dir first when installing. We treat it separately for # compiling. ret="$(get_csudir $(tc-arch-kernel ${CTARGET})) ${ret}" fi - elif use build ; then + else # For the non-native ABIs we only build the csu parts and very core # libraries for now. - ret="gnu/lib/libssp/libssp_nonshared gnu/lib/csu" - if [ "${EBUILD_PHASE}" = "install" ]; then - ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}" - fi - else - # Finally, with a non-native ABI without USE=build, we build the most - # important libraries. - ret="${NON_NATIVE_SUBDIRS} gnu/lib/csu lib/libcompiler_rt gnu/lib/libgcc lib/libmd lib/libcrypt" - - if [ "${EBUILD_PHASE}" = "install" ]; then - ret="$(get_csudir $(tc-arch-kernel ${CHOST})) ${ret}" - fi + ret="${NON_NATIVE_SUBDIRS} $(get_csudir $(tc-arch-kernel ${CHOST}))" fi echo "${ret}" } @@ -334,9 +321,14 @@ do_compile() { # Bootstrap if needed, otherwise assume the system headers are in # /usr/include. if need_bootstrap ; then - [[ "$(tc-getCC)" == *gcc* ]] && export COMPILER_TYPE="gcc" - [[ "$(tc-getCC)" == *clang* ]] && export COMPILER_TYPE="clang" + # Need set COMPILER_TYPE in FreeBSD 9.2 or later version. + case $(tc-getCC) in + *gcc*) export COMPILER_TYPE="gcc";; + *clang*) export COMPILER_TYPE="clang";; + esac do_bootstrap + else + CFLAGS="${CFLAGS} -isystem /usr/include" fi export RAW_LDFLAGS=$(raw-ldflags) @@ -422,25 +414,114 @@ GROUP ( /$1/libc.so.7 /$3/libssp_nonshared.a ) END_LDSCRIPT } +header_list="" + +move_header() { + local dirname=$(dirname ${1}) + local filename=$(basename ${1}) + + if [ ! -d "${dirname}/${ABI}" ] ; then + mkdir "${dirname}/${ABI}" || die + fi + + mv "${1}" "${dirname}/${ABI}/" || die + + export header_list="${header_list} ${1}" +} + +make_header_template() { + cat <<-END_HEADER +/* + * Wrapped header for multilib support. + * See the real headers included below. + */ + +#if defined(__x86_64__) + @ABI_amd64_fbsd@ +#elif defined(__i386__) + @ABI_x86_fbsd@ +#else + @ABI_${DEFAULT_ABI}@ +#endif +END_HEADER +} + +wrap_header() { + local dirname=$(dirname ${1}) + local filename=$(basename ${1}) + + if [ -n "${dirname#.}" ] ; then + dirname="${dirname}/${2}" + else + dirname="${2}" + fi + + if [ -f "${dirname}/${filename}" ] ; then + sed -e "s:@ABI_${2}@:#include <${dirname}/${filename}>:" ${1} + else + cat ${1} + fi +} + +wrap_header_end() { + sed -e "s:@ABI_.*@:#error \"Sorry, no support for your ABI.\":" ${1} +} + do_install() { + INCLUDEDIR="/usr/include" + dodir ${INCLUDEDIR} + CTARGET="${CHOST}" \ + install_includes ${INCLUDEDIR} + for i in $(get_subdirs) ; do einfo "Installing in ${i}..." cd "${WORKDIR}/${i}/" || die "missing ${i}." freebsd_src_install || die "Install ${i} failed" done + + if ! is_crosscompile ; then + if use multilib && [ "${ABI}" != "${DEFAULT_ABI}" ] ; then + gen_libc_ldscript "usr/$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)" + else + dodir "$(get_libdir)" + gen_libc_ldscript "$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)" + fi + else + CHOST=${CTARGET} gen_libc_ldscript "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" + fi + + if use multilib ; then + cd "${D}/usr/include" + for i in machine/*.h fenv.h ; do + move_header ${i} + done + if [ "${ABI}" = "${DEFAULT_ABI}" ] ; then + # Supposedly the last one! + local uniq_headers="$(echo ${header_list} | tr ' ' '\n' | sort | uniq | tr '\n' ' ')" + for j in ${uniq_headers} ; do + make_header_template > ${j} + for i in $(get_all_abis) ; do + wrap_header ${j} ${i} > ${j}.new + cp ${j}.new ${j} + rm -f ${j}.new + done + wrap_header_end ${j} > ${j}.new + cp ${j}.new ${j} + rm -f ${j}.new + done + fi + fi } src_install() { - [ "${CTARGET}" = "${CHOST}" ] \ - && INCLUDEDIR="/usr/include" \ - || INCLUDEDIR="/usr/${CTARGET}/usr/include" - dodir ${INCLUDEDIR} - einfo "Installing for ${CTARGET} in ${CHOST}.." - install_includes ${INCLUDEDIR} + if is_crosscompile ; then + einfo "Installing for ${CTARGET} in ${CHOST}.." + INCLUDEDIR="/usr/${CTARGET}/usr/include" + dodir ${INCLUDEDIR} + install_includes ${INCLUDEDIR} - use crosscompile_opts_headers-only && return 0 + use crosscompile_opts_headers-only && return 0 - if is_crosscompile ; then mymakeopts="${mymakeopts} NO_MAN= \ INCLUDEDIR=/usr/${CTARGET}/usr/include \ SHLIBDIR=/usr/${CTARGET}/usr/lib \ @@ -448,19 +529,14 @@ src_install() { dosym "usr/include" "/usr/${CTARGET}/sys-include" do_install - else - export STRIP_MASK="*/usr/lib*/*crt*.o" - multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_install - fi - # Don't install the rest of the configuration files if crosscompiling - if is_crosscompile ; then # This is to get it stripped with the correct tools, otherwise it gets # stripped with the host strip. - # And also get the correct OUTPUT_FORMAT in the libc ldscript. export CHOST=${CTARGET} - gen_libc_ldscript "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" "usr/${CTARGET}/usr/lib" return 0 + else + export STRIP_MASK="*/usr/lib*/*crt*.o" + multibuild_foreach_variant freebsd_multilib_multibuild_wrapper do_install fi cd "${WORKDIR}/etc/" @@ -475,8 +551,6 @@ src_install() { gen_usr_ldscript -a alias cam geom ipsec jail kiconv \ kvm m md procstat sbuf thr ufs util - gen_libc_ldscript "$(get_libdir)" "usr/$(get_libdir)" "usr/$(get_libdir)" - # Install a libusb.pc for better compat with Linux's libusb if use usb ; then dodir /usr/$(get_libdir)/pkgconfig