0001-cross-compile.patch 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. Fix cross-compilation
  2. Fetched httpd-2.4.x-cross_compile.diff from upstream bugtracker:
  3. https://issues.apache.org/bugzilla/show_bug.cgi?id=51257#c6
  4. which is a bundle of upstream revisions:
  5. http://svn.apache.org/viewvc?view=revision&revision=1327907
  6. http://svn.apache.org/viewvc?view=revision&revision=1328390
  7. http://svn.apache.org/viewvc?view=revision&revision=1328714
  8. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  9. Index: server/Makefile.in
  10. ===================================================================
  11. --- a/server/Makefile.in (revision 1328714)
  12. +++ b/server/Makefile.in (working copy)
  13. @@ -22,9 +22,14 @@
  14. include $(top_builddir)/build/rules.mk
  15. include $(top_srcdir)/build/library.mk
  16. +ifdef CC_FOR_BUILD
  17. +gen_test_char: gen_test_char.c
  18. + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
  19. +else
  20. gen_test_char_OBJECTS = gen_test_char.lo
  21. gen_test_char: $(gen_test_char_OBJECTS)
  22. $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
  23. +endif
  24. test_char.h: gen_test_char
  25. ./gen_test_char > test_char.h
  26. Index: configure.in
  27. ===================================================================
  28. --- a/configure.in (revision 1328714)
  29. +++ b/configure.in (working copy)
  30. @@ -193,6 +193,14 @@
  31. dnl Try to get c99 support for variadic macros
  32. ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])
  33. +dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
  34. +dnl we got already CC_FOR_BUILD from environment.
  35. +if test "x${build_alias}" != "x${host_alias}"; then
  36. + if test "x${CC_FOR_BUILD}" = "x"; then
  37. + CC_FOR_BUILD=cc
  38. + fi
  39. +fi
  40. +
  41. if test "x${cache_file}" = "x/dev/null"; then
  42. # Likewise, ensure that CC and CPP are passed through to the pcre
  43. # configure script iff caching is disabled (the autoconf 2.5x default).
  44. Index: acinclude.m4
  45. ===================================================================
  46. --- a/acinclude.m4 (revision 1328714)
  47. +++ ab/cinclude.m4 (working copy)
  48. @@ -53,6 +53,8 @@
  49. APACHE_SUBST(CPPFLAGS)
  50. APACHE_SUBST(CFLAGS)
  51. APACHE_SUBST(CXXFLAGS)
  52. + APACHE_SUBST(CC_FOR_BUILD)
  53. + APACHE_SUBST(CFLAGS_FOR_BUILD)
  54. APACHE_SUBST(LTFLAGS)
  55. APACHE_SUBST(LDFLAGS)
  56. APACHE_SUBST(LT_LDFLAGS)