blob: 5f8fd6a4618996238d4731eece3589a82747051b [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Apache Portable Runtime (APR) library"
Andrew Geissler90fd73c2021-03-05 15:25:55 -06002
3DESCRIPTION = "Create and maintain software libraries that provide a predictable \
4and consistent interface to underlying platform-specific implementations."
5
Brad Bishopc342db32019-05-15 21:57:59 -04006HOMEPAGE = "http://apr.apache.org/"
7SECTION = "libs"
8DEPENDS = "util-linux"
9
10LICENSE = "Apache-2.0"
11LIC_FILES_CHKSUM = "file://LICENSE;md5=4dfd4cd216828c8cae5de5a12f3844c8 \
12 file://include/apr_lib.h;endline=15;md5=823b3d1a7225df8f7b68a69c3c2b4c71"
13
14BBCLASSEXTEND = "native nativesdk"
15
16SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
17 file://run-ptest \
Brad Bishopc342db32019-05-15 21:57:59 -040018 file://0002-apr-Remove-workdir-path-references-from-installed-ap.patch \
19 file://0003-Makefile.in-configure.in-support-cross-compiling.patch \
20 file://0004-Fix-packet-discards-HTTP-redirect.patch \
21 file://0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
22 file://0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch \
23 file://0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch \
Brad Bishop00e122a2019-10-05 11:10:57 -040024 file://libtoolize_check.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 file://0001-Add-option-to-disable-timed-dependant-tests.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060026 file://autoconf270.patch \
Andrew Geissler5199d832021-09-24 16:47:35 -050027 file://CVE-2021-35940.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040028 "
29
30SRC_URI[md5sum] = "7a14a83d664e87599ea25ff4432e48a7"
31SRC_URI[sha256sum] = "e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea"
32
Andrew Geissler82c905d2020-04-13 13:39:40 -050033inherit autotools-brokensep lib_package binconfig multilib_header ptest multilib_script
Brad Bishopc342db32019-05-15 21:57:59 -040034
35OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
36
37# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
38CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
39
40# Also suppress trying to use sctp.
41#
42CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
43
44CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
45CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
46
47PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
48PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050049PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests,"
Brad Bishopc342db32019-05-15 21:57:59 -040050
Patrick Williams213cb262021-08-07 19:21:33 -050051do_configure:prepend() {
Brad Bishopc342db32019-05-15 21:57:59 -040052 # Avoid absolute paths for grep since it causes failures
53 # when using sstate between different hosts with different
54 # install paths for grep.
55 export GREP="grep"
56
57 cd ${S}
Brad Bishop00e122a2019-10-05 11:10:57 -040058 # The "2" means libtool version 2.
59 ./buildconf 2
Brad Bishopc342db32019-05-15 21:57:59 -040060}
61
Andrew Geissler82c905d2020-04-13 13:39:40 -050062MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/apr-1-config \
63 ${PN}-dev:${datadir}/build-1/apr_rules.mk"
64
Patrick Williams213cb262021-08-07 19:21:33 -050065FILES:${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
66RDEPENDS:${PN}-dev += "bash"
Brad Bishopc342db32019-05-15 21:57:59 -040067
Patrick Williams213cb262021-08-07 19:21:33 -050068RDEPENDS:${PN}-ptest += "libgcc"
Brad Bishop393846f2019-05-20 12:24:11 -040069
Brad Bishopc342db32019-05-15 21:57:59 -040070#for some reason, build/libtool.m4 handled by buildconf still be overwritten
71#when autoconf, so handle it again.
Patrick Williams213cb262021-08-07 19:21:33 -050072do_configure:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040073 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
74 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
75}
76
Patrick Williams213cb262021-08-07 19:21:33 -050077do_install:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040078 oe_multilib_header apr.h
79 install -d ${D}${datadir}/apr
80}
81
Patrick Williams213cb262021-08-07 19:21:33 -050082do_install:append:class-target() {
Brad Bishopc342db32019-05-15 21:57:59 -040083 sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \
84 -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
85 sed -i -e 's,${STAGING_DIR_HOST},,g' \
86 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
87 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
88}
89
90SSTATE_SCAN_FILES += "apr_rules.mk libtool"
91
92SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
93
94apr_sysroot_preprocess () {
95 d=${SYSROOT_DESTDIR}${datadir}/apr
96 install -d $d/
97 cp ${S}/build/apr_rules.mk $d/
98 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
99 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
100 sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
101 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
102 cp ${S}/build/mkdir.sh $d/
103 cp ${S}/build/make_exports.awk $d/
104 cp ${S}/build/make_var_export.awk $d/
105 cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
106}
107
108do_compile_ptest() {
109 cd ${S}/test
110 oe_runmake
111}
112
113do_install_ptest() {
114 t=${D}${PTEST_PATH}/test
115 mkdir -p $t/.libs
116 cp -r ${S}/test/data $t/
117 cp -r ${S}/test/.libs/*.so $t/.libs/
118 cp ${S}/test/proc_child $t/
119 cp ${S}/test/readchild $t/
120 cp ${S}/test/sockchild $t/
121 cp ${S}/test/sockperf $t/
122 cp ${S}/test/testall $t/
123 cp ${S}/test/tryread $t/
124}
125
126export CONFIG_SHELL="/bin/bash"