blob: 7bfb69855aefbd22a54a95da0ff5f2b3bb6ae2c6 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -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 \
Brad Bishopc4ea0752018-11-15 14:30:15 -08008 file://include/apr_lib.h;endline=15;md5=823b3d1a7225df8f7b68a69c3c2b4c71"
Brad Bishop316dfdd2018-06-25 12:45:53 -04009
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 \
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080021 file://0008-apr-fix-ptest-hang-in-teststr.patch \
Brad Bishop316dfdd2018-06-25 12:45:53 -040022"
23
24SRC_URI[md5sum] = "12f2a349483ad6f12db49ba01fbfdbfa"
25SRC_URI[sha256sum] = "131f06d16d7aabd097fa992a33eec2b6af3962f93e6d570a9bd4d85e95993172"
26
27inherit autotools-brokensep lib_package binconfig multilib_header ptest
28
29OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
30
31# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
32CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
33
34# Also suppress trying to use sctp.
35#
36CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
37
38CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes"
39CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
40
41# Otherwise libtool fails to compile apr-utils
42# x86_64-linux-libtool: compile: unable to infer tagged configuration
43# x86_64-linux-libtool: error: specify a tag with '--tag'
44CCACHE = ""
45
46PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
47PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
48
49do_configure_prepend() {
50 # Avoid absolute paths for grep since it causes failures
51 # when using sstate between different hosts with different
52 # install paths for grep.
53 export GREP="grep"
54
55 cd ${S}
56 libtool='${HOST_SYS}-libtool' ./buildconf
57}
58
59FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
60RDEPENDS_${PN}-dev += "bash"
61
62#for some reason, build/libtool.m4 handled by buildconf still be overwritten
63#when autoconf, so handle it again.
64do_configure_append() {
65 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
66 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
67}
68
69do_install_append() {
70 oe_multilib_header apr.h
71 install -d ${D}${datadir}/apr
72}
73
74do_install_append_class-target() {
75 sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \
76 -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
77 sed -i -e 's,${STAGING_DIR_HOST},,g' \
78 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
79 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
80}
81
82SSTATE_SCAN_FILES += "apr_rules.mk libtool"
83
84SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
85
86apr_sysroot_preprocess () {
87 d=${SYSROOT_DESTDIR}${datadir}/apr
88 install -d $d/
89 cp ${S}/build/apr_rules.mk $d/
90 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
91 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
92 sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
93 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
94 cp ${S}/build/mkdir.sh $d/
95 cp ${S}/build/make_exports.awk $d/
96 cp ${S}/build/make_var_export.awk $d/
97 cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
98}
99
100do_compile_ptest() {
101 cd ${S}/test
102 oe_runmake
103}
104
105do_install_ptest() {
106 t=${D}${PTEST_PATH}/test
107 mkdir -p $t/.libs
108 cp -r ${S}/test/data $t/
109 cp -r ${S}/test/.libs/*.so $t/.libs/
110 cp ${S}/test/proc_child $t/
111 cp ${S}/test/readchild $t/
112 cp ${S}/test/sockchild $t/
113 cp ${S}/test/sockperf $t/
114 cp ${S}/test/testall $t/
115 cp ${S}/test/tryread $t/
116}
117
118export CONFIG_SHELL="/bin/bash"