blob: 4e183ca3749fc8ec72bf60923f50d063737e7be7 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001SUMMARY = "Apache Portable Runtime (APR) companion library"
2HOMEPAGE = "http://apr.apache.org/"
3SECTION = "libs"
Andrew Geisslerd25ed322020-06-27 00:28:28 -05004DEPENDS = "apr expat"
Brad Bishop316dfdd2018-06-25 12:45:53 -04005
6BBCLASSEXTEND = "native nativesdk"
7
8LICENSE = "Apache-2.0"
9LIC_FILES_CHKSUM = "file://LICENSE;md5=158aa0b1efe0c12f23d4b007ddb9a5db \
Brad Bishopc4ea0752018-11-15 14:30:15 -080010 file://include/apu_version.h;endline=15;md5=823b3d1a7225df8f7b68a69c3c2b4c71"
Brad Bishop316dfdd2018-06-25 12:45:53 -040011
12SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.gz \
13 file://configfix.patch \
14 file://configure_fixes.patch \
15 file://run-ptest \
Brad Bishopbba38f32018-08-23 16:11:46 +080016 file://0001-Fix-error-handling-in-gdbm.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040017"
18
19SRC_URI[md5sum] = "bd502b9a8670a8012c4d90c31a84955f"
20SRC_URI[sha256sum] = "b65e40713da57d004123b6319828be7f1273fbc6490e145874ee1177e112c459"
21
Andrew Geisslerd1e89492021-02-12 15:35:20 -060022EXTRA_OECONF = "--with-apr=${STAGING_BINDIR_CROSS}/apr-1-config \
Brad Bishop316dfdd2018-06-25 12:45:53 -040023 --without-odbc \
24 --without-pgsql \
Brad Bishop316dfdd2018-06-25 12:45:53 -040025 --without-sqlite2 \
26 --with-expat=${STAGING_DIR_HOST}${prefix}"
27
28
Andrew Geissler82c905d2020-04-13 13:39:40 -050029inherit autotools lib_package binconfig multilib_script
30
31MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/apu-1-config"
Brad Bishop316dfdd2018-06-25 12:45:53 -040032
33OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
34
35do_configure_append() {
36 if [ "${CLASSOVERRIDE}" = "class-target" ]; then
37 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${B}/build/rules.mk
Andrew Geissler90fd73c2021-03-05 15:25:55 -060038 sed -i -e 's#^CFLAGS=.*#CFLAGS=${TARGET_CFLAGS}#g' ${B}/build/rules.mk
Brad Bishop316dfdd2018-06-25 12:45:53 -040039 fi
40}
41do_configure_prepend_class-native() {
42 mkdir ${B}/build
43 cp ${STAGING_DATADIR_NATIVE}/apr/apr_rules.mk ${B}/build/rules.mk
44}
45do_configure_append_class-native() {
46 sed -i "s#LIBTOOL=\$(SHELL) \$(apr_builddir)#LIBTOOL=\$(SHELL) ${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
47 # sometimes there isn't SHELL
48 sed -i "s#LIBTOOL=\$(apr_builddir)#LIBTOOL=${STAGING_BINDIR_NATIVE}#" ${B}/build/rules.mk
49}
50
51do_configure_prepend_class-nativesdk() {
52 cp ${STAGING_DATADIR}/apr/apr_rules.mk ${S}/build/rules.mk
Andrew Geissler90fd73c2021-03-05 15:25:55 -060053 sed -i -e 's#^CFLAGS=.*#CFLAGS=${TARGET_CFLAGS}#g' ${S}/build/rules.mk
Brad Bishop316dfdd2018-06-25 12:45:53 -040054}
55
56do_configure_append_class-nativesdk() {
57 sed -i "s#\(apr_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
58 sed -i "s#\(apr_builders\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
59 sed -i "s#\(top_builddir\)=.*#\1=${STAGING_DATADIR}/build-1#" ${B}/build/rules.mk
60 sed -i "s#\(LIBTOOL=\$(apr_builddir)\).*#\1/libtool#" ${B}/build/rules.mk
61}
62
63do_install_append_class-target() {
64 sed -i -e 's,${STAGING_DIR_HOST},,g' \
65 -e 's,APU_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
66 -e 's,APU_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apu-1-config
67}
68
Andrew Geisslerd25ed322020-06-27 00:28:28 -050069PACKAGECONFIG ??= "crypto gdbm"
Brad Bishop316dfdd2018-06-25 12:45:53 -040070PACKAGECONFIG[ldap] = "--with-ldap,--without-ldap,openldap"
71PACKAGECONFIG[crypto] = "--with-openssl=${STAGING_DIR_HOST}${prefix} --with-crypto,--without-crypto,openssl"
72PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_DIR_HOST}${prefix},--without-sqlite3,sqlite3"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060073PACKAGECONFIG[gdbm] = "--with-dbm=gdbm --with-gdbm=${STAGING_DIR_HOST}${prefix},--without-gdbm,gdbm"
Brad Bishop316dfdd2018-06-25 12:45:53 -040074
75#files ${libdir}/apr-util-1/*.so are not symlinks but loadable modules thus they are packaged in ${PN}
76FILES_${PN} += "${libdir}/apr-util-1/apr*${SOLIBS} ${libdir}/apr-util-1/apr*${SOLIBSDEV}"
77FILES_${PN}-dev += "${libdir}/aprutil.exp ${libdir}/apr-util-1/*.la"
78FILES_${PN}-staticdev += "${libdir}/apr-util-1/*.a"
79
80INSANE_SKIP_${PN} += "dev-so"
81
82inherit ptest
83
84RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-iso8859-1 glibc-gconv-iso8859-2 glibc-gconv-utf-7"
Brad Bishop393846f2019-05-20 12:24:11 -040085RDEPENDS_${PN}-ptest += "libgcc"
Brad Bishop316dfdd2018-06-25 12:45:53 -040086
87do_compile_ptest() {
88 cd ${B}/test
89 oe_runmake
90}
91
92do_install_ptest() {
93 t=${D}${PTEST_PATH}/test
94 mkdir $t
95 for i in testall data; do \
96 cp -r ${B}/test/$i $t; \
97 done
98}