packages/libs/apr/Makefile
Sebastian Kemper 193c3913b6 apr: clean up the patches + enable LFS
- removes 001-autoconf-compat.patch:
  Looks like this was meant as a workaround for a libtool issue. But it
  doesn't appear to be needed anymore.
- removes 101-fix_apr_time_now.patch:
  Mentioned in https://dev.openwrt.org/ticket/9287, meant as a fix, but
  issue was fixed differently in the end (by activating LFS).
- removes 201-upgrade-and-fix-1.5.1.patch:
  This is a cross-compile fix. This patch gets replaced by
  001-cross-compile.patch from buildroot project. The latter was sent
  upstream by buildroot and is in line with the patch used by OpenWrt
  for the apache package.
- adds 002-sys-param-h.patch:
  Fix PATH_MAX detection by including sys/param.h if available. Also
  from buildroot.

Additionally configure variables found in buildroot package are added.
These also enable LFS support. This was previously done (in OpenWrt) by
defining _LARGEFILE64_SOURCE in TARGET_CPPFLAGS. But the configure
variable is cleaner (and easier to follow).

Signed-off-by: Sebastian Kemper <sebastian_ml@gmx.net>
2020-01-26 18:50:06 +01:00

89 lines
2.4 KiB
Makefile

#
# Copyright (C) 2007-2011 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=apr
PKG_VERSION:=1.6.5
PKG_RELEASE:=5
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=@APACHE/apr/
PKG_HASH:=a67ca9fcf9c4ff59bce7f428a323c8b5e18667fdea7b0ebad47d194371b0a105
PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
Sebastian Kemper <sebastian_ml@gmx.net>
PKG_LICENSE:=Apache-2.0
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:apache:apr
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/libapr
SECTION:=libs
CATEGORY:=Libraries
DEPENDS:=+libpthread +librt +libuuid
TITLE:=Apache Portable Runtime Library
URL:=https://apr.apache.org/
endef
CONFIGURE_ARGS += \
--with-devrandom=/dev/urandom \
$(call autoconf_bool,CONFIG_IPV6,ipv6)
# XXX: ac_cv_sizeof_struct_iovec=1 is just to trick configure
CONFIGURE_VARS += \
ac_cv_file__dev_zero=yes \
ac_cv_func_pthread_mutexattr_setpshared=yes \
ac_cv_func_sem_open=yes \
ac_cv_func_setpgrp_void=yes \
ac_cv_o_nonblock_inherited=no \
ac_cv_sizeof_struct_iovec=1 \
ac_cv_struct_rlimit=yes \
apr_cv_accept4=yes \
apr_cv_dup3=yes \
apr_cv_epoll=yes \
apr_cv_epoll_create1=yes \
apr_cv_mutex_recursive=yes \
apr_cv_mutex_robust_shared=yes \
apr_cv_process_shared_works=yes \
apr_cv_sock_cloexec=yes \
apr_cv_tcp_nodelay_with_cork=yes \
apr_cv_use_lfs64=yes
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/include/apr-1 \
$(1)/usr/lib/pkgconfig $(1)/usr/share/build-1
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apr-1-config \
$(1)/usr/bin
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apr-1/* \
$(1)/usr/include/apr-1
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.{la,a,so*} $(1)/usr/lib
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/apr-1.pc \
$(1)/usr/lib/pkgconfig
$(CP) $(PKG_INSTALL_DIR)/usr/share/build-1/* $(1)/usr/share/build-1
$(SED) '/^prefix=\|^exec_prefix=/s|/usr|$(STAGING_DIR)/usr|' \
$(1)/usr/bin/apr-1-config
$(SED) '/^datadir=/s|/usr|$$$${prefix}|' $(1)/usr/bin/apr-1-config
$(SED) 's,/usr/share/build-1,$(STAGING_DIR)/usr/share/build-1,g' \
$(1)/usr/share/build-1/apr_rules.mk
endef
define Package/libapr/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libapr-1.so.* $(1)/usr/lib
endef
$(eval $(call BuildPackage,libapr))