configure.in 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. dnl configuration script for expat
  2. dnl Process this file with autoconf to produce a configure script.
  3. dnl
  4. dnl Copyright 2000 Clark Cooper
  5. dnl
  6. dnl This file is part of EXPAT.
  7. dnl
  8. dnl EXPAT is free software; you can redistribute it and/or modify it
  9. dnl under the terms of the License (based on the MIT/X license) contained
  10. dnl in the file COPYING that comes with this distribution.
  11. dnl
  12. dnl Ensure that Expat is configured with autoconf 2.52 or newer
  13. AC_PREREQ(2.52)
  14. dnl Get the version number of Expat, using m4's esyscmd() command to run
  15. dnl the command at m4-generation time. This allows us to create an m4
  16. dnl symbol holding the correct version number. AC_INIT() requires the
  17. dnl version number at m4-time, rather than when ./configure is run, so
  18. dnl all this must happen as part of m4, not as part of the shell code
  19. dnl contained in ./configure.
  20. dnl
  21. dnl NOTE: esyscmd() is a GNU M4 extension. Thus, we wrap it in an appropriate
  22. dnl test. I believe this test will work, but I don't have a place with non-
  23. dnl GNU M4 to test it right now.
  24. define([expat_version], ifdef([__gnu__],
  25. [esyscmd(conftools/get-version.sh lib/expat.h)],
  26. [2.0.x]))
  27. AC_INIT(expat, expat_version, expat-bugs@libexpat.org)
  28. undefine([expat_version])
  29. AC_CONFIG_SRCDIR(Makefile.in)
  30. AC_CONFIG_AUX_DIR(conftools)
  31. dnl
  32. dnl Increment LIBREVISION if source code has changed at all
  33. dnl
  34. dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
  35. dnl
  36. dnl If the API changes compatibly (i.e. simply adding a new function
  37. dnl without changing or removing earlier interfaces), then increment LIBAGE.
  38. dnl
  39. dnl If the API changes incompatibly set LIBAGE back to 0
  40. dnl
  41. LIBCURRENT=6
  42. LIBREVISION=2
  43. LIBAGE=5
  44. AC_CONFIG_HEADER(expat_config.h)
  45. sinclude(conftools/libtool.m4)
  46. sinclude(conftools/ac_c_bigendian_cross.m4)
  47. AC_LIBTOOL_WIN32_DLL
  48. AC_PROG_LIBTOOL
  49. AC_SUBST(LIBCURRENT)
  50. AC_SUBST(LIBREVISION)
  51. AC_SUBST(LIBAGE)
  52. dnl Checks for programs.
  53. AC_PROG_CC
  54. AC_PROG_INSTALL
  55. if test "$GCC" = yes ; then
  56. dnl
  57. dnl Be careful about adding the -fexceptions option; some versions of
  58. dnl GCC don't support it and it causes extra warnings that are only
  59. dnl distracting; avoid.
  60. dnl
  61. OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
  62. CFLAGS="$OLDCFLAGS -fexceptions"
  63. AC_MSG_CHECKING(whether $CC accepts -fexceptions)
  64. AC_TRY_LINK( , ,
  65. AC_MSG_RESULT(yes),
  66. AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS")
  67. CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'`
  68. fi
  69. dnl Checks for header files.
  70. AC_HEADER_STDC
  71. dnl Checks for typedefs, structures, and compiler characteristics.
  72. dnl Note: Avoid using AC_C_BIGENDIAN because it does not
  73. dnl work in a cross compile.
  74. AC_C_BIGENDIAN_CROSS
  75. AC_C_CONST
  76. AC_TYPE_SIZE_T
  77. AC_CHECK_FUNCS(memmove bcopy)
  78. dnl Only needed for xmlwf:
  79. AC_CHECK_HEADERS(fcntl.h unistd.h)
  80. AC_TYPE_OFF_T
  81. AC_FUNC_MMAP
  82. if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
  83. FILEMAP=unixfilemap
  84. else
  85. FILEMAP=readfilemap
  86. fi
  87. AC_SUBST(FILEMAP)
  88. dnl Needed for the test support code; this was found at
  89. dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html
  90. # AC_CPP_FUNC
  91. # ------------------ #
  92. # Checks to see if ANSI C99 CPP variable __func__ works.
  93. # If not, perhaps __FUNCTION__ works instead.
  94. # If not, we'll just define __func__ to "".
  95. AC_DEFUN([AC_CPP_FUNC],
  96. [AC_REQUIRE([AC_PROG_CC_STDC])dnl
  97. AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func,
  98. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  99. [[char *foo = __func__;]])],
  100. [ac_cv_cpp_func=yes],
  101. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  102. [[char *foo = __FUNCTION__;]])],
  103. [ac_cv_cpp_func=__FUNCTION__],
  104. [ac_cv_cpp_func=no])])])
  105. if test $ac_cv_cpp_func = __FUNCTION__; then
  106. AC_DEFINE(__func__,__FUNCTION__,
  107. [Define to __FUNCTION__ or "" if `__func__' does not conform to
  108. ANSI C.])
  109. elif test $ac_cv_cpp_func = no; then
  110. AC_DEFINE(__func__,"",
  111. [Define to __FUNCTION__ or "" if `__func__' does not conform to
  112. ANSI C.])
  113. fi
  114. ])# AC_CPP_FUNC
  115. AC_CPP_FUNC
  116. dnl Some basic configuration:
  117. AC_DEFINE([XML_NS], 1,
  118. [Define to make XML Namespaces functionality available.])
  119. AC_DEFINE([XML_DTD], 1,
  120. [Define to make parameter entity parsing functionality available.])
  121. AC_DEFINE([XML_CONTEXT_BYTES], 1024,
  122. [Define to specify how much context to retain around the current parse point.])
  123. AC_CONFIG_FILES(Makefile)
  124. AC_OUTPUT
  125. abs_srcdir="`cd $srcdir && pwd`"
  126. abs_builddir="`pwd`"
  127. if test "$abs_srcdir" != "$abs_builddir"; then
  128. make mkdir-init
  129. fi