configure.in 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.58 or newer
  13. AC_PREREQ(2.58)
  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.1.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. AC_CONFIG_MACRO_DIR([m4])
  32. dnl
  33. dnl Increment LIBREVISION if source code has changed at all
  34. dnl
  35. dnl If the API has changed, increment LIBCURRENT and set LIBREVISION to 0
  36. dnl
  37. dnl If the API changes compatibly (i.e. simply adding a new function
  38. dnl without changing or removing earlier interfaces), then increment LIBAGE.
  39. dnl
  40. dnl If the API changes incompatibly set LIBAGE back to 0
  41. dnl
  42. LIBCURRENT=7
  43. LIBREVISION=0
  44. LIBAGE=6
  45. AC_CONFIG_HEADER(expat_config.h)
  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_CXX
  55. AC_PROG_INSTALL
  56. if test "$GCC" = yes ; then
  57. dnl
  58. dnl Be careful about adding the -fexceptions option; some versions of
  59. dnl GCC don't support it and it causes extra warnings that are only
  60. dnl distracting; avoid.
  61. dnl
  62. OLDCFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes"
  63. CFLAGS="$OLDCFLAGS -fexceptions"
  64. AC_MSG_CHECKING(whether $CC accepts -fexceptions)
  65. AC_TRY_LINK( , ,
  66. AC_MSG_RESULT(yes),
  67. AC_MSG_RESULT(no); CFLAGS="$OLDCFLAGS")
  68. CXXFLAGS=`echo "$CFLAGS" | sed 's/ -Wmissing-prototypes -Wstrict-prototypes//'`
  69. fi
  70. dnl Checks for header files.
  71. AC_HEADER_STDC
  72. dnl Checks for typedefs, structures, and compiler characteristics.
  73. dnl Note: Avoid using AC_C_BIGENDIAN because it does not
  74. dnl work in a cross compile.
  75. AC_C_BIGENDIAN_CROSS
  76. AC_C_CONST
  77. AC_TYPE_SIZE_T
  78. AC_CHECK_FUNCS(memmove bcopy)
  79. dnl Only needed for xmlwf:
  80. AC_CHECK_HEADERS(fcntl.h unistd.h)
  81. AC_TYPE_OFF_T
  82. AC_FUNC_MMAP
  83. if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
  84. FILEMAP=unixfilemap
  85. else
  86. FILEMAP=readfilemap
  87. fi
  88. AC_SUBST(FILEMAP)
  89. dnl Needed for the test support code; this was found at
  90. dnl http://lists.gnu.org/archive/html/bug-autoconf/2002-07/msg00028.html
  91. # AC_CPP_FUNC
  92. # ------------------ #
  93. # Checks to see if ANSI C99 CPP variable __func__ works.
  94. # If not, perhaps __FUNCTION__ works instead.
  95. # If not, we'll just define __func__ to "".
  96. AC_DEFUN([AC_CPP_FUNC],
  97. [AC_REQUIRE([AC_PROG_CC_STDC])dnl
  98. AC_CACHE_CHECK([for an ANSI C99-conforming __func__], ac_cv_cpp_func,
  99. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  100. [[char *foo = __func__;]])],
  101. [ac_cv_cpp_func=yes],
  102. [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],
  103. [[char *foo = __FUNCTION__;]])],
  104. [ac_cv_cpp_func=__FUNCTION__],
  105. [ac_cv_cpp_func=no])])])
  106. if test $ac_cv_cpp_func = __FUNCTION__; then
  107. AC_DEFINE(__func__,__FUNCTION__,
  108. [Define to __FUNCTION__ or "" if `__func__' does not conform to
  109. ANSI C.])
  110. elif test $ac_cv_cpp_func = no; then
  111. AC_DEFINE(__func__,"",
  112. [Define to __FUNCTION__ or "" if `__func__' does not conform to
  113. ANSI C.])
  114. fi
  115. ])# AC_CPP_FUNC
  116. AC_CPP_FUNC
  117. dnl Some basic configuration:
  118. AC_DEFINE([XML_NS], 1,
  119. [Define to make XML Namespaces functionality available.])
  120. AC_DEFINE([XML_DTD], 1,
  121. [Define to make parameter entity parsing functionality available.])
  122. AC_DEFINE([XML_CONTEXT_BYTES], 1024,
  123. [Define to specify how much context to retain around the current parse point.])
  124. AC_CONFIG_FILES([Makefile expat.pc])
  125. AC_OUTPUT
  126. abs_srcdir="`cd $srcdir && pwd`"
  127. abs_builddir="`pwd`"
  128. if test "$abs_srcdir" != "$abs_builddir"; then
  129. make mkdir-init
  130. fi