1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools libtool multilib toolchain-funcs
8 DESCRIPTION="Apache Portable Runtime Library"
9 HOMEPAGE="https://apr.apache.org/"
10 SRC_URI="mirror://apache/apr/${P}.tar.bz2"
14 KEYWORDS="alpha amd64 arm arm64 ~hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
15 IUSE="doc elibc_FreeBSD older-kernels-compatibility selinux static-libs +urandom"
17 CDEPEND="elibc_glibc? ( >=sys-apps/util-linux-2.16 )
18 elibc_mintlib? ( >=sys-apps/util-linux-2.18 )"
20 selinux? ( sec-policy/selinux-apache )"
22 >=sys-devel/libtool-2.4.2
23 doc? ( app-doc/doxygen )"
25 DOCS=( CHANGES NOTICE README )
28 "${FILESDIR}"/${PN}-1.5.0-mint.patch
29 "${FILESDIR}"/${PN}-1.5.0-libtool.patch
30 "${FILESDIR}"/${PN}-1.5.0-cross-types.patch
31 "${FILESDIR}"/${PN}-1.5.0-sysroot.patch #385775
32 "${FILESDIR}"/${PN}-1.6.3-fix-overflow-check-in-overflow_strfsize.patch
33 "${FILESDIR}"/${PN}-1.6.3-skip-known-failing-tests.patch
39 mv configure.in configure.ac || die
40 AT_M4DIR="build" eautoreconf
43 eapply "${FILESDIR}/config.layout.patch"
48 --enable-layout=gentoo
49 --enable-nonportable-atomics
52 $(use_enable static-libs static)
53 --with-installbuilddir=/usr/share/${PN}/build
56 [[ ${CHOST} == *-mint* ]] && export ac_cv_func_poll=no
58 if use older-kernels-compatibility; then
59 local apr_cv_accept4 apr_cv_dup3 apr_cv_epoll_create1 apr_cv_sock_cloexec
60 export apr_cv_accept4="no"
61 export apr_cv_dup3="no"
62 export apr_cv_epoll_create1="no"
63 export apr_cv_sock_cloexec="no"
65 if tc-is-cross-compiler; then
66 # The apache project relies heavily on AC_TRY_RUN and doesn't
67 # have any sane cross-compiling fallback logic.
69 ac_cv_file__dev_zero="yes" \
70 ac_cv_func_sem_open="yes" \
71 ac_cv_negative_eai="yes" \
72 ac_cv_o_nonblock_inherited="no" \
73 ac_cv_struct_rlimit="yes" \
74 ap_cv_atomic_builtins="yes" \
75 apr_cv_accept4="yes" \
78 apr_cv_epoll_create1="yes" \
79 apr_cv_gai_addrconfig="yes" \
80 apr_cv_mutex_recursive="yes" \
81 apr_cv_mutex_robust_shared="yes" \
82 apr_cv_process_shared_works="yes" \
83 apr_cv_pthreads_lib="-pthread" \
84 apr_cv_sock_cloexec="yes" \
85 apr_cv_tcp_nodelay_with_cork="yes"
89 myconf+=( --with-devrandom=/dev/urandom )
90 elif (( ${CHOST#*-hpux11.} <= 11 )); then
91 : # no /dev/*random on hpux11.11 and before, $PN detects this.
93 myconf+=( --with-devrandom=/dev/random )
96 tc-is-static-only && myconf+=( --disable-dso )
98 # shl_load does not search runpath, but hpux11 supports dlopen
99 [[ ${CHOST} == *-hpux11* ]] && myconf+=( --enable-dso=dlfcn )
101 if [[ ${CHOST} == *-solaris2.10 ]]; then
102 case $(<$([[ ${CHOST} != ${CBUILD} ]] && echo "${EPREFIX}/usr/${CHOST}")/usr/include/atomic.h) in
105 elog "You do not have Solaris Patch ID "$(
106 [[ ${CHOST} == sparc* ]] && echo 118884 || echo 118885
107 )" (Problem 4954703) installed on your host ($(hostname)),"
108 elog "using generic atomic operations instead."
109 myconf+=( --disable-nonportable-atomics )
118 if tc-is-cross-compiler; then
119 # This header is the same across targets, so use the build compiler.
120 emake tools/gen_test_char
121 tc-export_build_env BUILD_CC
122 ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_CPPFLAGS} ${BUILD_LDFLAGS} \
123 tools/gen_test_char.c -o tools/gen_test_char || die
134 # Building tests in parallel is broken
141 # Prallel install breaks since apr-1.5.1
142 #make -j1 DESTDIR="${D}" install || die
144 if ! use static-libs; then
145 find "${ED%/}" -name '*.la' -delete || die
150 dodoc -r docs/dox/html/*
153 # This file is only used on AIX systems, which Gentoo is not,
154 # and causes collisions between the SLOTs, so remove it.
155 # Even in Prefix, we don't need this on AIX.
156 rm -f "${ED%/}/usr/$(get_libdir)/apr.exp"