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 \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 25 | file://autoconf-2.73.patch \ |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 26 | file://0001-dso-Check-for-NULL-handle-in-apr_dso_sym.patch \ |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 27 | " |
| 28 | |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 29 | SRC_URI[sha256sum] = "fc648de983f3a2a6c9e78dea1f180639bd2fad6c06d556d4367a701fe5c35577" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 30 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 31 | inherit autotools-brokensep lib_package binconfig multilib_header ptest multilib_script |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 32 | |
| 33 | OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'" |
| 34 | |
| 35 | # Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928 |
| 36 | CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 37 | # Enable largefile |
| 38 | CACHED_CONFIGUREVARS += "apr_cv_use_lfs64=yes" |
| 39 | # Additional AC_TRY_RUN tests which will need to be cached for cross compile |
| 40 | CACHED_CONFIGUREVARS += "apr_cv_epoll=yes epoll_create1=yes apr_cv_sock_cloexec=yes \ |
| 41 | ac_cv_struct_rlimit=yes \ |
| 42 | ac_cv_func_sem_open=yes \ |
| 43 | apr_cv_process_shared_works=yes \ |
| 44 | apr_cv_mutex_robust_shared=yes \ |
| 45 | " |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 46 | # Also suppress trying to use sctp. |
| 47 | # |
| 48 | CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no" |
| 49 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 50 | # ac_cv_sizeof_struct_iovec is deduced using runtime check which will fail during cross-compile |
| 51 | CACHED_CONFIGUREVARS += "${@['ac_cv_sizeof_struct_iovec=16','ac_cv_sizeof_struct_iovec=8'][d.getVar('SITEINFO_BITS') != '32']}" |
| 52 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 53 | CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes" |
| 54 | |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 55 | CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 56 | PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}" |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 57 | PACKAGECONFIG:append:libc-musl = " xsi-strerror" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 58 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 59 | PACKAGECONFIG[timed-tests] = "--enable-timed-tests,--disable-timed-tests," |
Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 60 | 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] | 61 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 62 | do_configure:prepend() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 63 | # Avoid absolute paths for grep since it causes failures |
| 64 | # when using sstate between different hosts with different |
| 65 | # install paths for grep. |
| 66 | export GREP="grep" |
| 67 | |
| 68 | cd ${S} |
Brad Bishop | 00e122a | 2019-10-05 11:10:57 -0400 | [diff] [blame] | 69 | # The "2" means libtool version 2. |
| 70 | ./buildconf 2 |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 71 | } |
| 72 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 73 | MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/apr-1-config \ |
| 74 | ${PN}-dev:${datadir}/build-1/apr_rules.mk" |
| 75 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 76 | FILES:${PN}-dev += "${libdir}/apr.exp ${datadir}/build-1/*" |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 77 | RDEPENDS:${PN}-dev += "bash libtool" |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 78 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 79 | RDEPENDS:${PN}-ptest += "libgcc" |
Brad Bishop | 393846f | 2019-05-20 12:24:11 -0400 | [diff] [blame] | 80 | |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 81 | #for some reason, build/libtool.m4 handled by buildconf still be overwritten |
| 82 | #when autoconf, so handle it again. |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 83 | do_configure:append() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 84 | sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/libtool.m4 |
| 85 | sed -i -e 's/LIBTOOL=\(.*\)top_build/LIBTOOL=\1apr_build/' ${S}/build/apr_rules.mk |
| 86 | } |
| 87 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 88 | do_install:append() { |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 89 | oe_multilib_header apr.h |
| 90 | install -d ${D}${datadir}/apr |
| 91 | } |
| 92 | |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 93 | do_install:append:class-target() { |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 94 | rm -f ${D}${datadir}/build-1/libtool |
| 95 | 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] | 96 | sed -i -e 's,${DEBUG_PREFIX_MAP},,g' \ |
| 97 | -e 's,${STAGING_DIR_HOST},,g' ${D}${datadir}/build-1/apr_rules.mk |
| 98 | sed -i -e 's,${STAGING_DIR_HOST},,g' \ |
| 99 | -e 's,APR_SOURCE_DIR=.*,APR_SOURCE_DIR=,g' \ |
| 100 | -e 's,APR_BUILD_DIR=.*,APR_BUILD_DIR=,g' ${D}${bindir}/apr-1-config |
| 101 | } |
| 102 | |
| 103 | SSTATE_SCAN_FILES += "apr_rules.mk libtool" |
| 104 | |
| 105 | SYSROOT_PREPROCESS_FUNCS += "apr_sysroot_preprocess" |
| 106 | |
| 107 | apr_sysroot_preprocess () { |
| 108 | d=${SYSROOT_DESTDIR}${datadir}/apr |
| 109 | install -d $d/ |
| 110 | cp ${S}/build/apr_rules.mk $d/ |
| 111 | sed -i s,apr_builddir=.*,apr_builddir=,g $d/apr_rules.mk |
| 112 | sed -i s,apr_builders=.*,apr_builders=,g $d/apr_rules.mk |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 113 | sed -i s,LIBTOOL=.*,LIBTOOL=libtool,g $d/apr_rules.mk |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 114 | sed -i s,\$\(apr_builders\),${STAGING_DATADIR}/apr/,g $d/apr_rules.mk |
| 115 | cp ${S}/build/mkdir.sh $d/ |
| 116 | cp ${S}/build/make_exports.awk $d/ |
| 117 | cp ${S}/build/make_var_export.awk $d/ |
Andrew Geissler | 595f630 | 2022-01-24 19:11:47 +0000 | [diff] [blame] | 118 | cp ${S}/libtool ${SYSROOT_DESTDIR}${datadir}/build-1/libtool |
Brad Bishop | c342db3 | 2019-05-15 21:57:59 -0400 | [diff] [blame] | 119 | } |
| 120 | |
| 121 | do_compile_ptest() { |
| 122 | cd ${S}/test |
| 123 | oe_runmake |
| 124 | } |
| 125 | |
| 126 | do_install_ptest() { |
| 127 | t=${D}${PTEST_PATH}/test |
| 128 | mkdir -p $t/.libs |
| 129 | cp -r ${S}/test/data $t/ |
| 130 | cp -r ${S}/test/.libs/*.so $t/.libs/ |
| 131 | cp ${S}/test/proc_child $t/ |
| 132 | cp ${S}/test/readchild $t/ |
| 133 | cp ${S}/test/sockchild $t/ |
| 134 | cp ${S}/test/sockperf $t/ |
| 135 | cp ${S}/test/testall $t/ |
| 136 | cp ${S}/test/tryread $t/ |
| 137 | } |
| 138 | |
| 139 | export CONFIG_SHELL="/bin/bash" |