configure.ac 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. AC_PREREQ(2.58) dnl 2.58 required for AS_HELP_STRING
  2. dnl Extract the version (sans LF) from .version, created at release-time.
  3. m4_define(ne_version, [m4_translit(m4_include(.version), [
  4. ])])
  5. AC_INIT(neon, ne_version, [[email protected]])
  6. AC_COPYRIGHT([Copyright 2000-2010 Joe Orton and others
  7. This configure script may be copied, distributed and modified under the
  8. terms of the GNU Library General Public license; see src/COPYING.LIB for
  9. more details.])
  10. AC_CONFIG_HEADER(config.h)
  11. AC_CONFIG_SRCDIR(src/ne_request.c)
  12. NEON_WITH_LIBS
  13. # Pass through initial LDFLAGS verbatim to neon-config, so that extra
  14. # libraries which are detected (e.g. OpenSSL) can still be found when
  15. # building using the --libs output of neon-config.
  16. user_LDFLAGS=$LDFLAGS
  17. # By default, allow 'make install' to work.
  18. ALLOW_INSTALL=yes
  19. AC_DEFINE([_GNU_SOURCE], 1, [Always defined to enable GNU extensions])
  20. AC_DEFINE([NEON_IS_LIBRARY], 1, [Defined when neon is built as a library])
  21. AH_BOTTOM([
  22. /* Enable leak-tracking versions of ne_*alloc when NEON_MEMLEAK is enabled */
  23. #ifdef NEON_MEMLEAK
  24. # include "memleak.h"
  25. #endif])
  26. AC_PROG_INSTALL
  27. AC_ARG_ENABLE(webdav,
  28. AS_HELP_STRING([--disable-webdav],[disable WebDAV support]))
  29. if test "$enable_webdav" = "no"; then
  30. NEON_WITHOUT_WEBDAV
  31. else
  32. # Yes, we do need an XML parser. The _BUNDLED macros handle
  33. # this normally.
  34. NEON_NEED_XML_PARSER=yes
  35. fi
  36. # The bundled macros also set this, which makes sure we recurse
  37. # into the 'src' directory.
  38. NEON_BUILD_BUNDLED=yes
  39. # Define NEON_VERSION etc and make the appropriate substitutions.
  40. NE_VERSIONS_BUNDLED
  41. LIBNEON_SOURCE_CHECKS
  42. dnl Avoid libtool 1.5 bug where configure fails if a C++ compiler
  43. dnl is not available.
  44. m4_ifdef([AC_LIBTOOL_TAGS], [AC_LIBTOOL_TAGS([])])
  45. AC_DISABLE_SHARED
  46. m4_ifdef([LT_INIT], [LT_INIT], [AC_PROG_LIBTOOL])
  47. AC_EXEEXT
  48. # Checks to compile test suite
  49. NEON_TEST
  50. # Use the libtool-type build.
  51. NEON_LIBTOOL_BUILD
  52. # Find an XML parser
  53. NEON_XML_PARSER
  54. # Internationalization support.
  55. NEON_I18N()
  56. # Extra checks for debugging, compiler warnings
  57. NEON_DEBUG
  58. # Leave till last to prevent CFLAGS affecting checks.
  59. NEON_WARNINGS
  60. CPPFLAGS="$CPPFLAGS -I\${top_builddir}"
  61. AC_ARG_ENABLE(memleak,
  62. AS_HELP_STRING([--enable-memleak],
  63. [for test builds only: enable memory leak checking]))
  64. if test "$enable_memleak" = "yes"; then
  65. CPPFLAGS="$CPPFLAGS -DNEON_MEMLEAK -I\$(top_srcdir)/src"
  66. # disable 'make install'
  67. ALLOW_INSTALL=memleak
  68. fi
  69. # Enable tests for optional features
  70. TESTS="\$(BASIC_TESTS)"
  71. HELPERS=""
  72. if test $NE_FLAG_SSL = yes; then
  73. # Only enable SSL tests if an openssl binary is found (needed to make
  74. # certs etc).
  75. AC_PATH_PROG(OPENSSL, openssl, notfound)
  76. if test "$OPENSSL" != "notfound"; then
  77. TESTS="$TESTS \$(SSL_TESTS)"
  78. HELPERS="$HELPERS \$(SSL_HELPERS)"
  79. else
  80. AC_MSG_WARN([no openssl binary in \$PATH: SSL tests disabled])
  81. fi
  82. AC_PATH_PROG(CERTUTIL, certutil, notfound)
  83. AC_PATH_PROG(PK12UTIL, pk12util, notfound)
  84. fi
  85. if test $NE_FLAG_ZLIB = yes; then
  86. TESTS="$TESTS \$(ZLIB_TESTS)"
  87. HELPERS="$HELPERS \$(ZLIB_HELPERS)"
  88. fi
  89. if test x$enable_webdav != xno; then
  90. TESTS="$TESTS \$(DAV_TESTS)"
  91. fi
  92. AC_ARG_ENABLE(tests-install,
  93. AS_HELP_STRING([--enable-tests-install],
  94. [enable installation of the test suite]),,
  95. [enable_tests_install=no])
  96. # If test suite installation is not required, it's more
  97. # efficient to link the test programs using -no-install:
  98. if test "$enable_tests_install" = "no"; then
  99. TEST_LDFLAGS="-no-install"
  100. fi
  101. AC_SUBST(TEST_LDFLAGS)
  102. AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  103. if test "$PKG_CONFIG" != "no"; then
  104. # pkg-config >= 0.18 will use "Libs.private" iff necessary,
  105. # older versions which don't recognize that field may always
  106. # need all libraries in Libs.
  107. if $PKG_CONFIG --atleast-pkgconfig-version=0.18; then :; else
  108. NEON_PC_LIBS=${NEON_LIBS}
  109. fi
  110. fi
  111. AC_SUBST(NEON_PC_LIBS)
  112. # Pass the interface version on to libtool when linking libneon.la
  113. NEON_LINK_FLAGS="-version-info ${NE_LIBTOOL_VERSINFO}"
  114. # If any non-default ABI variations are used, add them to the SONAME:
  115. ### disabled for backwards-compat with 0.27.x
  116. #if test "x${NE_LIBTOOL_RELEASE}y" != "xy"; then
  117. # NEON_LINK_FLAGS="${NEON_LINK_FLAGS} -release ${NE_LIBTOOL_RELEASE}"
  118. #fi
  119. gl_LD_VERSION_SCRIPT
  120. # If ld version scripts are supported, enable symbol versioning.
  121. # Otherwise, fall back to any libtool-supported symbol export
  122. # restrictions; ne__* symbols are not exported.
  123. if test "x$have_ld_version_script" = "xyes"; then
  124. NEON_LINK_FLAGS="$NEON_LINK_FLAGS -Wl,--version-script=\$(top_srcdir)/src/neon.vers"
  125. else
  126. NEON_LINK_FLAGS="$NEON_LINK_FLAGS -export-symbols-regex '^ne_[[^_]]'"
  127. fi
  128. if test x${enable_shared}${pic_mode}z = xnodefaultz; then
  129. CFLAGS="$CFLAGS -prefer-pic"
  130. AC_MSG_NOTICE([Using PIC for static library build])
  131. fi
  132. if test x${enable_shared} = xno; then
  133. # Defining NE_PRIVATE as the empty string would work; using a
  134. # non-empty but redundant string 'extern' avoids any possible cpp
  135. # confusion with from an empty macro.
  136. CPPFLAGS="$CPPFLAGS -DNE_PRIVATE=extern"
  137. AC_MSG_NOTICE([Private symbol suppression disabled for static library build])
  138. fi
  139. # Bundled language catalogs
  140. ALL_LINGUAS="cs de fr ja nn pl ru tr zh_CN"
  141. AC_SUBST(ALL_LINGUAS)
  142. AC_CONFIG_FILES([neon-config], [chmod +x neon-config])
  143. AC_CONFIG_FILES([Makefile src/Makefile test/Makefile neon.pc])
  144. AC_CONFIG_FILES([test/makekeys:test/makekeys.sh], [chmod +x test/makekeys])
  145. AC_SUBST(NEON_VERSION)
  146. AC_SUBST(NEON_BUILD_BUNDLED)
  147. AC_SUBST(top_builddir)
  148. AC_SUBST(user_LDFLAGS)
  149. AC_SUBST(HELPERS)
  150. AC_SUBST(TESTS)
  151. AC_SUBST(ALLOW_INSTALL)
  152. AC_OUTPUT
  153. # for VPATH builds:
  154. test -d test/common || mkdir test/common
  155. AC_MSG_NOTICE([Configured to build AC_PACKAGE_STRING:
  156. Install prefix: ${prefix}
  157. Compiler: ${CC}
  158. XML Parser: ${neon_xml_parser_message}
  159. SSL library: ${ne_SSL_message}
  160. zlib support: ${ne_ZLIB_message}
  161. Build libraries: Shared=${enable_shared}, Static=${enable_static}
  162. ])
  163. case $ALLOW_INSTALL in
  164. memleak)
  165. AC_MSG_NOTICE([Configured with development-only flags:
  166. WARNING: This copy of neon has been configured with memory leak checking
  167. WARNING: enabled, which should only be used in a development build of neon.
  168. WARNING: This neon library should not be installed for use by applications.
  169. ]);;
  170. esac