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