blob: db1530530a8bf25a4b23e7a2894b6636a4f6c8e1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "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=17;md5=ee42fa7575dc40580a9e01c1b75fae96"
9
10BBCLASSEXTEND = "native nativesdk"
11
12SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
13 file://configure_fixes.patch \
14 file://cleanup.patch \
15 file://configfix.patch \
16 file://run-ptest \
17 file://upgrade-and-fix-1.5.1.patch \
18 file://Fix-packet-discards-HTTP-redirect.patch \
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050019 file://configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050020"
21
22SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"
23SRC_URI[sha256sum] = "7d03ed29c22a7152be45b8e50431063736df9e1daa1ddf93f6a547ba7a28f67a"
24
25inherit autotools-brokensep lib_package binconfig multilib_header ptest
26
27OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
28
29# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
30CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
31
32# Also suppress trying to use sctp.
33#
34CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
35
Patrick Williamsf1e5d692016-03-30 15:21:19 -050036# Otherwise libtool fails to compile apr-utils
37# x86_64-linux-libtool: compile: unable to infer tagged configuration
38# x86_64-linux-libtool: error: specify a tag with '--tag'
39CCACHE = ""
40
Patrick Williamsc124f4f2015-09-15 14:41:29 -050041do_configure_prepend() {
42 # Avoid absolute paths for grep since it causes failures
43 # when using sstate between different hosts with different
44 # install paths for grep.
45 export GREP="grep"
46
47 cd ${S}
48 ./buildconf
49}
50
51FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
52RDEPENDS_${PN}-dev += "bash"
53
54#for some reason, build/libtool.m4 handled by buildconf still be overwritten
55#when autoconf, so handle it again.
56do_configure_append() {
57 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
58 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
59}
60
61do_install_append() {
62 oe_multilib_header apr.h
63 install -d ${D}${datadir}/apr
Patrick Williamsf1e5d692016-03-30 15:21:19 -050064}
65
66do_install_append_class-target() {
67 sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
68 sed -i -e 's,${STAGING_DIR_HOST},,g' \
69 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
70 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
Patrick Williamsc124f4f2015-09-15 14:41:29 -050071}
72
73SSTATE_SCAN_FILES += "apr_rules.mk libtool"
74
75SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
76
77apr_sysroot_preprocess () {
78 d=${SYSROOT_DESTDIR}${datadir}/apr
79 install -d $d/
80 cp ${S}/build/apr_rules.mk $d/
81 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
82 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
83 sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
84 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
85 cp ${S}/build/mkdir.sh $d/
86 cp ${S}/build/make_exports.awk $d/
87 cp ${S}/build/make_var_export.awk $d/
Patrick Williamsf1e5d692016-03-30 15:21:19 -050088 cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
Patrick Williamsc124f4f2015-09-15 14:41:29 -050089}
90
91do_compile_ptest() {
92 cd ${S}/test
93 oe_runmake
94}
95
96do_install_ptest() {
97 t=${D}${PTEST_PATH}/test
98 mkdir -p $t/.libs
99 cp -r ${S}/test/data $t/
100 cp -r ${S}/test/.libs/*.so $t/.libs/
101 cp ${S}/test/proc_child $t/
102 cp ${S}/test/readchild $t/
103 cp ${S}/test/sockchild $t/
104 cp ${S}/test/sockperf $t/
105 cp ${S}/test/testall $t/
106 cp ${S}/test/tryread $t/
107}
108
109export CONFIG_SHELL="/bin/bash"