1*4882a593SmuzhiyunSUMMARY = "Apache Portable Runtime (APR) library" 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunDESCRIPTION = "Create and maintain software libraries that provide a predictable \ 4*4882a593Smuzhiyunand consistent interface to underlying platform-specific implementations." 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunHOMEPAGE = "http://apr.apache.org/" 7*4882a593SmuzhiyunSECTION = "libs" 8*4882a593SmuzhiyunDEPENDS = "util-linux" 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunLICENSE = "Apache-2.0" 11*4882a593SmuzhiyunLIC_FILES_CHKSUM = "file://LICENSE;md5=4dfd4cd216828c8cae5de5a12f3844c8 \ 12*4882a593Smuzhiyun file://include/apr_lib.h;endline=15;md5=823b3d1a7225df8f7b68a69c3c2b4c71" 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunBBCLASSEXTEND = "native nativesdk" 15*4882a593Smuzhiyun 16*4882a593SmuzhiyunSRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \ 17*4882a593Smuzhiyun file://run-ptest \ 18*4882a593Smuzhiyun file://0002-apr-Remove-workdir-path-references-from-installed-ap.patch \ 19*4882a593Smuzhiyun file://0004-Fix-packet-discards-HTTP-redirect.patch \ 20*4882a593Smuzhiyun file://0005-configure.in-fix-LTFLAGS-to-make-it-work-with-ccache.patch \ 21*4882a593Smuzhiyun file://0007-explicitly-link-libapr-against-phtread-to-make-gold-.patch \ 22*4882a593Smuzhiyun file://libtoolize_check.patch \ 23*4882a593Smuzhiyun file://0001-Add-option-to-disable-timed-dependant-tests.patch \ 24*4882a593Smuzhiyun file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \ 25*4882a593Smuzhiyun " 26*4882a593Smuzhiyun 27*4882a593SmuzhiyunSRC_URI[sha256sum] = "75e77cc86776c030c0a5c408dfbd0bf2a0b75eed5351e52d5439fa1e5509a43e" 28*4882a593Smuzhiyun 29*4882a593Smuzhiyuninherit autotools-brokensep lib_package binconfig multilib_header ptest multilib_script 30*4882a593Smuzhiyun 31*4882a593SmuzhiyunOE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'" 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928 34*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes" 35*4882a593Smuzhiyun# Enable largefile 36*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "apr_cv_use_lfs64=yes" 37*4882a593Smuzhiyun# Additional AC_TRY_RUN tests which will need to be cached for cross compile 38*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "apr_cv_epoll=yes epoll_create1=yes apr_cv_sock_cloexec=yes \ 39*4882a593Smuzhiyun ac_cv_struct_rlimit=yes \ 40*4882a593Smuzhiyun ac_cv_func_sem_open=yes \ 41*4882a593Smuzhiyun apr_cv_process_shared_works=yes \ 42*4882a593Smuzhiyun apr_cv_mutex_robust_shared=yes \ 43*4882a593Smuzhiyun " 44*4882a593Smuzhiyun# Also suppress trying to use sctp. 45*4882a593Smuzhiyun# 46*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no" 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun# ac_cv_sizeof_struct_iovec is deduced using runtime check which will fail during cross-compile 49*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "${@['ac_cv_sizeof_struct_iovec=16','ac_cv_sizeof_struct_iovec=8'][d.getVar('SITEINFO_BITS') != '32']}" 50*4882a593Smuzhiyun 51*4882a593SmuzhiyunCACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes" 52*4882a593Smuzhiyun 53*4882a593SmuzhiyunCACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes" 54*4882a593SmuzhiyunPACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" 55*4882a593SmuzhiyunPACKAGECONFIG:append:libc-musl = " xsi-strerror" 56*4882a593SmuzhiyunPACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," 57*4882a593SmuzhiyunPACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests," 58*4882a593SmuzhiyunPACKAGECONFIG[xsi-strerror] = "ac_cv_strerror_r_rc_int=yes,ac_cv_strerror_r_rc_int=no," 59*4882a593Smuzhiyun 60*4882a593Smuzhiyundo_configure:prepend() { 61*4882a593Smuzhiyun # Avoid absolute paths for grep since it causes failures 62*4882a593Smuzhiyun # when using sstate between different hosts with different 63*4882a593Smuzhiyun # install paths for grep. 64*4882a593Smuzhiyun export GREP="grep" 65*4882a593Smuzhiyun 66*4882a593Smuzhiyun cd ${S} 67*4882a593Smuzhiyun # The "2" means libtool version 2. 68*4882a593Smuzhiyun ./buildconf 2 69*4882a593Smuzhiyun} 70*4882a593Smuzhiyun 71*4882a593SmuzhiyunMULTILIB_SCRIPTS = "${PN}-dev:${bindir}/apr-1-config \ 72*4882a593Smuzhiyun ${PN}-dev:${datadir}/build-1/apr_rules.mk" 73*4882a593Smuzhiyun 74*4882a593SmuzhiyunFILES:${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*" 75*4882a593SmuzhiyunRDEPENDS:${PN}-dev += "bash libtool" 76*4882a593Smuzhiyun 77*4882a593SmuzhiyunRDEPENDS:${PN}-ptest += "libgcc" 78*4882a593Smuzhiyun 79*4882a593Smuzhiyun#for some reason, build/libtool.m4 handled by buildconf still be overwritten 80*4882a593Smuzhiyun#when autoconf, so handle it again. 81*4882a593Smuzhiyundo_configure:append() { 82*4882a593Smuzhiyun sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4 83*4882a593Smuzhiyun sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk 84*4882a593Smuzhiyun} 85*4882a593Smuzhiyun 86*4882a593Smuzhiyundo_install:append() { 87*4882a593Smuzhiyun oe_multilib_header apr.h 88*4882a593Smuzhiyun install -d ${D}${datadir}/apr 89*4882a593Smuzhiyun} 90*4882a593Smuzhiyun 91*4882a593Smuzhiyundo_install:append:class-target() { 92*4882a593Smuzhiyun rm -f ${D}${datadir}/build-1/libtool 93*4882a593Smuzhiyun sed -i s,LIBTOOL=.*,LIBTOOL=libtool,g ${D}${datadir}/build-1/apr_rules.mk 94*4882a593Smuzhiyun sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \ 95*4882a593Smuzhiyun -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk 96*4882a593Smuzhiyun sed -i -e 's,${STAGING_DIR_HOST},,g' \ 97*4882a593Smuzhiyun -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \ 98*4882a593Smuzhiyun -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config 99*4882a593Smuzhiyun} 100*4882a593Smuzhiyun 101*4882a593SmuzhiyunSSTATE_SCAN_FILES += "apr_rules.mk libtool" 102*4882a593Smuzhiyun 103*4882a593SmuzhiyunSYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess" 104*4882a593Smuzhiyun 105*4882a593Smuzhiyunapr_sysroot_preprocess () { 106*4882a593Smuzhiyun d=${SYSROOT_DESTDIR}${datadir}/apr 107*4882a593Smuzhiyun install -d $d/ 108*4882a593Smuzhiyun cp ${S}/build/apr_rules.mk $d/ 109*4882a593Smuzhiyun sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk 110*4882a593Smuzhiyun sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk 111*4882a593Smuzhiyun sed -i s,LIBTOOL=.*,LIBTOOL=libtool,g $d/apr_rules.mk 112*4882a593Smuzhiyun sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk 113*4882a593Smuzhiyun cp ${S}/build/mkdir.sh $d/ 114*4882a593Smuzhiyun cp ${S}/build/make_exports.awk $d/ 115*4882a593Smuzhiyun cp ${S}/build/make_var_export.awk $d/ 116*4882a593Smuzhiyun cp ${S}/libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool 117*4882a593Smuzhiyun} 118*4882a593Smuzhiyun 119*4882a593Smuzhiyundo_compile_ptest() { 120*4882a593Smuzhiyun cd ${S}/test 121*4882a593Smuzhiyun oe_runmake 122*4882a593Smuzhiyun} 123*4882a593Smuzhiyun 124*4882a593Smuzhiyundo_install_ptest() { 125*4882a593Smuzhiyun t=${D}${PTEST_PATH}/test 126*4882a593Smuzhiyun mkdir -p $t/.libs 127*4882a593Smuzhiyun cp -r ${S}/test/data $t/ 128*4882a593Smuzhiyun cp -r ${S}/test/.libs/*.so $t/.libs/ 129*4882a593Smuzhiyun cp ${S}/test/proc_child $t/ 130*4882a593Smuzhiyun cp ${S}/test/readchild $t/ 131*4882a593Smuzhiyun cp ${S}/test/sockchild $t/ 132*4882a593Smuzhiyun cp ${S}/test/sockperf $t/ 133*4882a593Smuzhiyun cp ${S}/test/testall $t/ 134*4882a593Smuzhiyun cp ${S}/test/tryread $t/ 135*4882a593Smuzhiyun} 136*4882a593Smuzhiyun 137*4882a593Smuzhiyunexport CONFIG_SHELL="/bin/bash" 138