You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.8 KiB

  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. --- a/server/Makefile.in
  10. +++ b/server/Makefile.in
  11. @@ -24,9 +24,14 @@ TARGETS = delete-exports $(LTLIBRARY_NAM
  12. include $(top_builddir)/build/rules.mk
  13. include $(top_srcdir)/build/library.mk
  14. +ifdef CC_FOR_BUILD
  15. +gen_test_char: gen_test_char.c
  16. + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -DCROSS_COMPILE -o $@ $<
  17. +else
  18. gen_test_char_OBJECTS = gen_test_char.lo
  19. gen_test_char: $(gen_test_char_OBJECTS)
  20. $(LINK) $(EXTRA_LDFLAGS) $(gen_test_char_OBJECTS) $(EXTRA_LIBS)
  21. +endif
  22. test_char.h: gen_test_char
  23. ./gen_test_char > test_char.h
  24. --- a/configure.in
  25. +++ b/configure.in
  26. @@ -206,6 +206,14 @@ AC_PROG_CPP
  27. dnl Try to get c99 support for variadic macros
  28. ifdef([AC_PROG_CC_C99], [AC_PROG_CC_C99])
  29. +dnl In case of cross compilation we set CC_FOR_BUILD to cc unless
  30. +dnl we got already CC_FOR_BUILD from environment.
  31. +if test "x${build_alias}" != "x${host_alias}"; then
  32. + if test "x${CC_FOR_BUILD}" = "x"; then
  33. + CC_FOR_BUILD=cc
  34. + fi
  35. +fi
  36. +
  37. if test "x${cache_file}" = "x/dev/null"; then
  38. # Likewise, ensure that CC and CPP are passed through to the pcre
  39. # configure script iff caching is disabled (the autoconf 2.5x default).
  40. --- a/acinclude.m4
  41. +++ b/acinclude.m4
  42. @@ -55,6 +55,8 @@ AC_DEFUN([APACHE_GEN_CONFIG_VARS],[
  43. APACHE_SUBST(CPPFLAGS)
  44. APACHE_SUBST(CFLAGS)
  45. APACHE_SUBST(CXXFLAGS)
  46. + APACHE_SUBST(CC_FOR_BUILD)
  47. + APACHE_SUBST(CFLAGS_FOR_BUILD)
  48. APACHE_SUBST(LTFLAGS)
  49. APACHE_SUBST(LDFLAGS)
  50. APACHE_SUBST(LT_LDFLAGS)