packages/libs/apr/patches/001-cross-compile.patch
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

56 lines
1.7 KiB
Diff

Fix cross-compilation
Patch was backported from Apache httpd:
http://svn.apache.org/viewvc?view=revision&revision=1327907
http://svn.apache.org/viewvc?view=revision&revision=1328390
http://svn.apache.org/viewvc?view=revision&revision=1328714
Patch submitted upstream:
https://issues.apache.org/bugzilla/show_bug.cgi?id=57058
Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
--- a/configure.in
+++ b/configure.in
@@ -118,6 +118,16 @@ AC_CANONICAL_SYSTEM
echo "Configuring APR library"
echo "Platform: $host"
+dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
+dnl we got already CC_FOR_BUILD from environment.
+if test "x${build_alias}" != "x${host_alias}"; then
+ if test "x${CC_FOR_BUILD}" = "x"; then
+ CC_FOR_BUILD=cc
+ fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+AC_SUBST(CFLAGS_FOR_BUILD)
+
dnl Some initial steps for configuration. We setup the default directory
dnl and which files are to be configured.
--- a/Makefile.in
+++ b/Makefile.in
@@ -8,6 +8,8 @@ top_blddir=@apr_builddir@
# APR (Apache Portable Runtime) library Makefile.
#
CPP = @CPP@
+CC_FOR_BUILD = @CC_FOR_BUILD@
+CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@
# get substituted into some targets
APR_MAJOR_VERSION=@APR_MAJOR_VERSION@
@@ -137,8 +139,13 @@ tools/gen_test_char.lo: tools/gen_test_c
$(APR_MKDIR) tools
$(LT_COMPILE)
+ifdef CC_FOR_BUILD
+tools/gen_test_char@EXEEXT@: tools/gen_test_char.c $(LOCAL_LIBS)
+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
+else
tools/gen_test_char@EXEEXT@: $(OBJECTS_gen_test_char)
$(LINK_PROG) $(OBJECTS_gen_test_char) $(ALL_LIBS)
+endif
include/private/apr_escape_test_char.h: tools/gen_test_char@EXEEXT@
$(APR_MKDIR) include/private