blob: 1c61e84e536271ecb9ab9f600a4091135e7920bb [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 \
19"
20
21SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"
22SRC_URI[sha256sum] = "7d03ed29c22a7152be45b8e50431063736df9e1daa1ddf93f6a547ba7a28f67a"
23
24inherit autotools-brokensep lib_package binconfig multilib_header ptest
25
26OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
27
28# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
29CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
30
31# Also suppress trying to use sctp.
32#
33CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
34
Patrick Williamsf1e5d692016-03-30 15:21:19 -050035# Otherwise libtool fails to compile apr-utils
36# x86_64-linux-libtool: compile: unable to infer tagged configuration
37# x86_64-linux-libtool: error: specify a tag with '--tag'
38CCACHE = ""
39
Patrick Williamsc124f4f2015-09-15 14:41:29 -050040do_configure_prepend() {
41 # Avoid absolute paths for grep since it causes failures
42 # when using sstate between different hosts with different
43 # install paths for grep.
44 export GREP="grep"
45
46 cd ${S}
47 ./buildconf
48}
49
50FILES_${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*"
51RDEPENDS_${PN}-dev += "bash"
52
53#for some reason, build/libtool.m4 handled by buildconf still be overwritten
54#when autoconf, so handle it again.
55do_configure_append() {
56 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4
57 sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk
58}
59
60do_install_append() {
61 oe_multilib_header apr.h
62 install -d ${D}${datadir}/apr
Patrick Williamsf1e5d692016-03-30 15:21:19 -050063}
64
65do_install_append_class-target() {
66 sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk
67 sed -i -e 's,${STAGING_DIR_HOST},,g' \
68 -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \
69 -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config
Patrick Williamsc124f4f2015-09-15 14:41:29 -050070}
71
72SSTATE_SCAN_FILES += "apr_rules.mk libtool"
73
74SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess"
75
76apr_sysroot_preprocess () {
77 d=${SYSROOT_DESTDIR}${datadir}/apr
78 install -d $d/
79 cp ${S}/build/apr_rules.mk $d/
80 sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk
81 sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk
82 sed -i s,LIBTOOL=.*,LIBTOOL=${HOST_SYS}-libtool,g $d/apr_rules.mk
83 sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk
84 cp ${S}/build/mkdir.sh $d/
85 cp ${S}/build/make_exports.awk $d/
86 cp ${S}/build/make_var_export.awk $d/
Patrick Williamsf1e5d692016-03-30 15:21:19 -050087 cp ${S}/${HOST_SYS}-libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool
Patrick Williamsc124f4f2015-09-15 14:41:29 -050088}
89
90do_compile_ptest() {
91 cd ${S}/test
92 oe_runmake
93}
94
95do_install_ptest() {
96 t=${D}${PTEST_PATH}/test
97 mkdir -p $t/.libs
98 cp -r ${S}/test/data $t/
99 cp -r ${S}/test/.libs/*.so $t/.libs/
100 cp ${S}/test/proc_child $t/
101 cp ${S}/test/readchild $t/
102 cp ${S}/test/sockchild $t/
103 cp ${S}/test/sockperf $t/
104 cp ${S}/test/testall $t/
105 cp ${S}/test/tryread $t/
106}
107
108export CONFIG_SHELL="/bin/bash"