configure.ac 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. dnl Process this with autoconf to create configure
  2. AC_INIT([zlib], [1.1.4])
  3. AC_CONFIG_SRCDIR([zlib.h])
  4. if test -n "${with_target_subdir}"; then
  5. AM_ENABLE_MULTILIB(, ..)
  6. fi
  7. AC_CANONICAL_SYSTEM
  8. # This works around an automake problem.
  9. mkinstalldirs="`cd $ac_aux_dir && ${PWDCMD-pwd}`/mkinstalldirs"
  10. AC_SUBST(mkinstalldirs)
  11. AM_INIT_AUTOMAKE
  12. AM_MAINTAINER_MODE
  13. dnl We use these options to decide which functions to include.
  14. AC_ARG_WITH(target-subdir,
  15. [ --with-target-subdir=SUBDIR
  16. configuring in a subdirectory])
  17. if test -z "$with_target_subdir" || test "$with_target_subdir" = "."; then
  18. COMPPATH=.
  19. else
  20. COMPPATH=..
  21. fi
  22. AC_SUBST(COMPPATH)
  23. AC_ARG_WITH(cross-host,
  24. [ --with-cross-host=HOST configuring with a cross compiler])
  25. dnl Default to --enable-multilib
  26. AC_ARG_ENABLE(multilib,
  27. [ --enable-multilib build many library versions (default)],
  28. [case "${enableval}" in
  29. yes) multilib=yes ;;
  30. no) multilib=no ;;
  31. *) AC_MSG_ERROR(bad value ${enableval} for multilib option) ;;
  32. esac], [test -z "$with_target_subdir" && multilib=no || multilib=yes])dnl
  33. AC_ARG_WITH(system-zlib,
  34. [ --with-system-zlib use installed libz])
  35. # Make sure we don't test executables when making cross-tools.
  36. GCC_NO_EXECUTABLES
  37. # The same as in boehm-gc and libstdc++. Have to borrow it from there.
  38. # We must force CC to /not/ be precious variables; otherwise
  39. # the wrong, non-multilib-adjusted value will be used in multilibs.
  40. # As a side effect, we have to subst CFLAGS ourselves.
  41. m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
  42. m4_define([_AC_ARG_VAR_PRECIOUS],[])
  43. AC_PROG_CC
  44. m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
  45. AC_SUBST(CFLAGS)
  46. # Add CET specific flags if CET is enabled
  47. GCC_CET_FLAGS(CET_FLAGS)
  48. AC_SUBST(CET_FLAGS)
  49. AC_PROG_LIBTOOL
  50. # Find CPP now so that any conditional tests below won't do it and
  51. # thereby make the resulting definitions conditional.
  52. AC_PROG_CPP
  53. if test -n "$with_cross_host"; then
  54. # We are being configured with a cross compiler. AC_REPLACE_FUNCS
  55. # may not work correctly, because the compiler may not be able to
  56. # link executables.
  57. # We assume newlib. This lets us hard-code the functions we know
  58. # we'll have.
  59. AC_DEFINE(HAVE_MEMCPY)
  60. AC_DEFINE(HAVE_STRERROR)
  61. else
  62. AC_FUNC_MMAP
  63. AC_CHECK_FUNCS(memcpy strerror)
  64. fi
  65. AC_CHECK_HEADERS(unistd.h)
  66. GCC_WITH_TOOLEXECLIBDIR
  67. if test -n "$with_cross_host" &&
  68. test x"$with_cross_host" != x"no"; then
  69. toolexecdir='$(exec_prefix)/$(target_alias)'
  70. case ${with_toolexeclibdir} in
  71. no)
  72. toolexeclibdir='$(toolexecdir)/lib'
  73. ;;
  74. *)
  75. toolexeclibdir=${with_toolexeclibdir}
  76. ;;
  77. esac
  78. else
  79. toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
  80. toolexeclibdir='$(libdir)'
  81. fi
  82. if test "$GCC" = yes && $CC -print-multi-os-directory > /dev/null 2>&1; then
  83. multiosdir=/`$CC -print-multi-os-directory`
  84. case $multiosdir in
  85. /.) multiosdir= ;; # Avoid trailing /.
  86. esac
  87. else
  88. multiosdir=
  89. fi
  90. toolexeclibdir=${toolexeclibdir}${multiosdir}
  91. AC_SUBST(toolexecdir)
  92. AC_SUBST(toolexeclibdir)
  93. AM_CONDITIONAL(TARGET_LIBRARY, test -n "$with_target_subdir")
  94. if test "${multilib}" = "yes"; then
  95. multilib_arg="--enable-multilib"
  96. else
  97. multilib_arg=
  98. fi
  99. AC_ARG_ENABLE(host-shared,
  100. [AS_HELP_STRING([--enable-host-shared],
  101. [build host code as shared libraries])],
  102. [PICFLAG=-fPIC], [PICFLAG=])
  103. AC_SUBST(PICFLAG)
  104. AC_CONFIG_FILES([Makefile])
  105. AC_OUTPUT