blob: d322629b66f384437ee029f27d032c7ffd7b2568 [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 \
Brad Bishopc342db32019-05-15 21:57:59 -040019 file://0004-Fix-packet-discards-HTTP-redirect.patch \
20 file://0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040021 file://0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch \
Brad Bishop00e122a2019-10-05 11:10:57 -040022 file://libtoolize_check.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050023 file://0001-Add-option-to-disable-timed-dependant-tests.patch \
Patrick Williams92b42cb2022-09-03 06:53:57 -050024 file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \
Patrick Williams2a254922023-08-11 09:48:11 -050025 file://autoconf-2.73.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040026 file://0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch \
Brad Bishopc342db32019-05-15 21:57:59 -040027 "
28
Patrick Williams520786c2023-06-25 16:20:36 -050029SRC_URI[sha256sum] = "fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577"
Brad Bishopc342db32019-05-15 21:57:59 -040030
Andrew Geissler82c905d2020-04-13 13:39:40 -050031inherit autotools-brokensep lib_package binconfig multilib_header ptest multilib_script
Brad Bishopc342db32019-05-15 21:57:59 -040032
33OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
34
35# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
36CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
Patrick Williams92b42cb2022-09-03 06:53:57 -050037# Enable largefile
38CACHED_CONFIGUREVARS += "apr_cv_use_lfs64=yes"
39# Additional AC_TRY_RUN tests which will need to be cached for cross compile
40CACHED_CONFIGUREVARS += "apr_cv_epoll=yes epoll_create1=yes apr_cv_sock_cloexec=yes \
41 ac_cv_struct_rlimit=yes \
42 ac_cv_func_sem_open=yes \
43 apr_cv_process_shared_works=yes \
44 apr_cv_mutex_robust_shared=yes \
45 "
Brad Bishopc342db32019-05-15 21:57:59 -040046# Also suppress trying to use sctp.
47#
48CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
49
Patrick Williams92b42cb2022-09-03 06:53:57 -050050# ac_cv_sizeof_struct_iovec is deduced using runtime check which will fail during cross-compile
51CACHED_CONFIGUREVARS += "${@['ac_cv_sizeof_struct_iovec=16','ac_cv_sizeof_struct_iovec=8'][d.getVar('SITEINFO_BITS') != '32']}"
52
Brad Bishopc342db32019-05-15 21:57:59 -040053CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
54
Patrick Williams92b42cb2022-09-03 06:53:57 -050055CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes"
Brad Bishopc342db32019-05-15 21:57:59 -040056PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
Patrick Williams92b42cb2022-09-03 06:53:57 -050057PACKAGECONFIG:append:libc-musl = " xsi-strerror"
Brad Bishopc342db32019-05-15 21:57:59 -040058PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
Andrew Geissler82c905d2020-04-13 13:39:40 -050059PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests,"
Patrick Williams92b42cb2022-09-03 06:53:57 -050060PACKAGECONFIG[xsi-strerror] = "ac_cv_strerror_r_rc_int=yes,ac_cv_strerror_r_rc_int=no,"
Brad Bishopc342db32019-05-15 21:57:59 -040061
Patrick Williams213cb262021-08-07 19:21:33 -050062do_configure:prepend() {
Brad Bishopc342db32019-05-15 21:57:59 -040063 # Avoid absolute paths for grep since it causes failures
64 # when using sstate between different hosts with different
65 # install paths for grep.
66 export GREP="grep"
67
68 cd ${S}
Brad Bishop00e122a2019-10-05 11:10:57 -040069 # The "2" means libtool version 2.
70 ./buildconf 2
Brad Bishopc342db32019-05-15 21:57:59 -040071}
72
Andrew Geissler82c905d2020-04-13 13:39:40 -050073MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/apr-1-config \
74 ${PN}-dev:${datadir}/build-1/apr_rules.mk"
75
Patrick Williams213cb262021-08-07 19:21:33 -050076FILES:${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
Andrew Geissler595f6302022-01-24 19:11:47 +000077RDEPENDS:${PN}-dev += "bash libtool"
Brad Bishopc342db32019-05-15 21:57:59 -040078
Patrick Williams213cb262021-08-07 19:21:33 -050079RDEPENDS:${PN}-ptest += "libgcc"
Brad Bishop393846f2019-05-20 12:24:11 -040080
Brad Bishopc342db32019-05-15 21:57:59 -040081#for some reason, build/libtool.m4 handled by buildconf still be overwritten
82#when autoconf, so handle it again.
Patrick Williams213cb262021-08-07 19:21:33 -050083do_configure:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040084 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
85 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
86}
87
Patrick Williams213cb262021-08-07 19:21:33 -050088do_install:append() {
Brad Bishopc342db32019-05-15 21:57:59 -040089 oe_multilib_header apr.h
90 install -d ${D}${datadir}/apr
91}
92
Patrick Williams213cb262021-08-07 19:21:33 -050093do_install:append:class-target() {
Andrew Geissler595f6302022-01-24 19:11:47 +000094 rm -f ${D}${datadir}/build-1/libtool
95 sed -i s,LIBTOOL=.*,LIBTOOL=libtool,g ${D}${datadir}/build-1/apr_rules.mk
Brad Bishopc342db32019-05-15 21:57:59 -040096 sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \
97 -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
98 sed -i -e 's,${STAGING_DIR_HOST},,g' \
99 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
100 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
101}
102
103SSTATE_SCAN_FILES += "apr_rules.mk libtool"
104
105SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
106
107apr_sysroot_preprocess () {
108 d=${SYSROOT_DESTDIR}${datadir}/apr
109 install -d $d/
110 cp ${S}/build/apr_rules.mk $d/
111 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
112 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
Andrew Geissler595f6302022-01-24 19:11:47 +0000113 sed -i s,LIBTOOL=.*,LIBTOOL=libtool,g $d/apr_rules.mk
Brad Bishopc342db32019-05-15 21:57:59 -0400114 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
115 cp ${S}/build/mkdir.sh $d/
116 cp ${S}/build/make_exports.awk $d/
117 cp ${S}/build/make_var_export.awk $d/
Andrew Geissler595f6302022-01-24 19:11:47 +0000118 cp ${S}/libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
Brad Bishopc342db32019-05-15 21:57:59 -0400119}
120
121do_compile_ptest() {
122 cd ${S}/test
123 oe_runmake
124}
125
126do_install_ptest() {
127 t=${D}${PTEST_PATH}/test
128 mkdir -p $t/.libs
129 cp -r ${S}/test/data $t/
130 cp -r ${S}/test/.libs/*.so $t/.libs/
131 cp ${S}/test/proc_child $t/
132 cp ${S}/test/readchild $t/
133 cp ${S}/test/sockchild $t/
134 cp ${S}/test/sockperf $t/
135 cp ${S}/test/testall $t/
136 cp ${S}/test/tryread $t/
137}
138
139export CONFIG_SHELL="/bin/bash"