blob: 09a65bfdd68e77c7c54a0001fd78b8ee3f546837 [file] [log] [blame]
Brad Bishopc342db32019-05-15 21:57:59 -04001SUMMARY = "Apache Portable Runtime (APR) library"
2HOMEPAGE = "http://apr.apache.org/"
3SECTION = "libs"
4DEPENDS = "util-linux"
5
6LICENSE = "Apache-2.0"
7LIC_FILES_CHKSUM = "file://LICENSE;md5=4dfd4cd216828c8cae5de5a12f3844c8 \
8 file://include/apr_lib.h;endline=15;md5=823b3d1a7225df8f7b68a69c3c2b4c71"
9
10BBCLASSEXTEND = "native nativesdk"
11
12SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
13 file://run-ptest \
14 file://0001-build-buildcheck.sh-improve-libtool-detection.patch \
15 file://0002-apr-Remove-workdir-path-references-from-installed-ap.patch \
16 file://0003-Makefile.in-configure.in-support-cross-compiling.patch \
17 file://0004-Fix-packet-discards-HTTP-redirect.patch \
18 file://0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
19 file://0006-apr-fix-off_t-size-doesn-t-match-in-glibc-when-cross.patch \
20 file://0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch \
21 "
22
23SRC_URI[md5sum] = "7a14a83d664e87599ea25ff4432e48a7"
24SRC_URI[sha256sum] = "e2e148f0b2e99b8e5c6caa09f6d4fb4dd3e83f744aa72a952f94f5a14436f7ea"
25
26inherit autotools-brokensep lib_package binconfig multilib_header ptest
27
28OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
29
30# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
31CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
32
33# Also suppress trying to use sctp.
34#
35CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
36
37CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
38CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
39
40PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
41PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
42
43do_configure_prepend() {
44 # Avoid absolute paths for grep since it causes failures
45 # when using sstate between different hosts with different
46 # install paths for grep.
47 export GREP="grep"
48
49 cd ${S}
50 libtool='${HOST_SYS}-libtool' ./buildconf
51}
52
53FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
54RDEPENDS_${PN}-dev += "bash"
55
Brad Bishop393846f2019-05-20 12:24:11 -040056RDEPENDS_${PN}-ptest += "libgcc"
57
Brad Bishopc342db32019-05-15 21:57:59 -040058#for some reason, build/libtool.m4 handled by buildconf still be overwritten
59#when autoconf, so handle it again.
60do_configure_append() {
61 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
62 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
63}
64
65do_install_append() {
66 oe_multilib_header apr.h
67 install -d ${D}${datadir}/apr
68}
69
70do_install_append_class-target() {
71 sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \
72 -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
73 sed -i -e 's,${STAGING_DIR_HOST},,g' \
74 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
75 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
76}
77
78SSTATE_SCAN_FILES += "apr_rules.mk libtool"
79
80SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
81
82apr_sysroot_preprocess () {
83 d=${SYSROOT_DESTDIR}${datadir}/apr
84 install -d $d/
85 cp ${S}/build/apr_rules.mk $d/
86 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
87 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
88 sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
89 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
90 cp ${S}/build/mkdir.sh $d/
91 cp ${S}/build/make_exports.awk $d/
92 cp ${S}/build/make_var_export.awk $d/
93 cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
94}
95
96do_compile_ptest() {
97 cd ${S}/test
98 oe_runmake
99}
100
101do_install_ptest() {
102 t=${D}${PTEST_PATH}/test
103 mkdir -p $t/.libs
104 cp -r ${S}/test/data $t/
105 cp -r ${S}/test/.libs/*.so $t/.libs/
106 cp ${S}/test/proc_child $t/
107 cp ${S}/test/readchild $t/
108 cp ${S}/test/sockchild $t/
109 cp ${S}/test/sockperf $t/
110 cp ${S}/test/testall $t/
111 cp ${S}/test/tryread $t/
112}
113
114export CONFIG_SHELL="/bin/bash"