/vendor/pcre/configure.ac

http://github.com/feyeleanor/RubyGoLightly · m4 · 641 lines · 463 code · 98 blank · 80 comment · 0 complexity · df5b63bdbc01dd8dd892d2b5163980c1 MD5 · raw file

  1. dnl Process this file with autoconf to produce a configure script.
  2. dnl NOTE FOR MAINTAINERS: Do not use major or minor version numbers with
  3. dnl leading zeros, because they may be treated as octal constants. The
  4. dnl PCRE_PRERELEASE feature is for identifying release candidates. It might
  5. dnl be defined as -RC2, for example. For real releases, it should be defined
  6. dnl empty.
  7. m4_define(pcre_major, [7])
  8. m4_define(pcre_minor, [8])
  9. m4_define(pcre_prerelease, [])
  10. m4_define(pcre_date, [2008-09-05])
  11. # Libtool shared library interface versions (current:revision:age)
  12. m4_define(libpcre_version, [0:1:0])
  13. m4_define(libpcreposix_version, [0:0:0])
  14. m4_define(libpcrecpp_version, [0:0:0])
  15. AC_PREREQ(2.57)
  16. AC_INIT(PCRE, pcre_major.pcre_minor[]pcre_prerelease, , pcre)
  17. AC_CONFIG_SRCDIR([pcre.h.in])
  18. AM_INIT_AUTOMAKE([dist-bzip2 dist-zip])
  19. AC_CONFIG_HEADERS(config.h)
  20. # The default CFLAGS and CXXFLAGS in Autoconf are "-g -O2" for gcc and just
  21. # "-g" for any other compiler. There doesn't seem to be a standard way of
  22. # getting rid of the -g (which I don't think is needed for a production
  23. # library). This fudge seems to achieve the necessary. First, we remember the
  24. # externally set values of CFLAGS and CXXFLAGS. Then call the AC_PROG_CC and
  25. # AC_PROG_CXX macros to find the compilers - if CFLAGS and CXXFLAGS are not
  26. # set, they will be set to Autoconf's defaults. Afterwards, if the original
  27. # values were not set, remove the -g from the Autoconf defaults.
  28. # (PH 02-May-07)
  29. remember_set_CFLAGS="$CFLAGS"
  30. remember_set_CXXFLAGS="$CXXFLAGS"
  31. AC_PROG_CC
  32. AC_PROG_CXX
  33. if test "x$remember_set_CFLAGS" = "x"
  34. then
  35. if test "$CFLAGS" = "-g -O2"
  36. then
  37. CFLAGS="-O2"
  38. elif test "$CFLAGS" = "-g"
  39. then
  40. CFLAGS=""
  41. fi
  42. fi
  43. if test "x$remember_set_CXXFLAGS" = "x"
  44. then
  45. if test "$CXXFLAGS" = "-g -O2"
  46. then
  47. CXXFLAGS="-O2"
  48. elif test "$CXXFLAGS" = "-g"
  49. then
  50. CXXFLAGS=""
  51. fi
  52. fi
  53. # AC_PROG_CXX will return "g++" even if no c++ compiler is installed.
  54. # Check for that case, and just disable c++ code if g++ doesn't run.
  55. AC_LANG_PUSH(C++)
  56. AC_COMPILE_IFELSE(AC_LANG_PROGRAM([],[]),, CXX=""; CXXCP=""; CXXFLAGS="")
  57. AC_LANG_POP
  58. AC_PROG_INSTALL
  59. AC_LIBTOOL_WIN32_DLL
  60. AC_PROG_LIBTOOL
  61. AC_PROG_LN_S
  62. PCRE_MAJOR="pcre_major"
  63. PCRE_MINOR="pcre_minor"
  64. PCRE_PRERELEASE="pcre_prerelease"
  65. PCRE_DATE="pcre_date"
  66. AC_SUBST(PCRE_MAJOR)
  67. AC_SUBST(PCRE_MINOR)
  68. AC_SUBST(PCRE_PRERELEASE)
  69. AC_SUBST(PCRE_DATE)
  70. # Set a more sensible default value for $(htmldir).
  71. if test "x$htmldir" = 'x${docdir}'
  72. then
  73. htmldir='${docdir}/html'
  74. fi
  75. # Handle --disable-cpp
  76. AC_ARG_ENABLE(cpp,
  77. AS_HELP_STRING([--disable-cpp],
  78. [disable C++ support]),
  79. , enable_cpp=yes)
  80. # Handle --enable-rebuild-chartables
  81. AC_ARG_ENABLE(rebuild-chartables,
  82. AS_HELP_STRING([--enable-rebuild-chartables],
  83. [rebuild character tables in current locale]),
  84. , enable_rebuild_chartables=no)
  85. # Handle --enable-utf8 (disabled by default)
  86. AC_ARG_ENABLE(utf8,
  87. AS_HELP_STRING([--enable-utf8],
  88. [enable UTF-8 support]),
  89. , enable_utf8=unset)
  90. # Handle --enable-unicode-properties
  91. AC_ARG_ENABLE(unicode-properties,
  92. AS_HELP_STRING([--enable-unicode-properties],
  93. [enable Unicode properties support (implies --enable-utf8)]),
  94. , enable_unicode_properties=no)
  95. # Handle --enable-newline=NL
  96. dnl AC_ARG_ENABLE(newline,
  97. dnl AS_HELP_STRING([--enable-newline=NL],
  98. dnl [use NL as newline (lf, cr, crlf, anycrlf, any; default=lf)]),
  99. dnl , enable_newline=lf)
  100. # Separate newline options
  101. ac_pcre_newline=lf
  102. AC_ARG_ENABLE(newline-is-cr,
  103. AS_HELP_STRING([--enable-newline-is-cr],
  104. [use CR as newline character]),
  105. ac_pcre_newline=cr)
  106. AC_ARG_ENABLE(newline-is-lf,
  107. AS_HELP_STRING([--enable-newline-is-lf],
  108. [use LF as newline character (default)]),
  109. ac_pcre_newline=lf)
  110. AC_ARG_ENABLE(newline-is-crlf,
  111. AS_HELP_STRING([--enable-newline-is-crlf],
  112. [use CRLF as newline sequence]),
  113. ac_pcre_newline=crlf)
  114. AC_ARG_ENABLE(newline-is-anycrlf,
  115. AS_HELP_STRING([--enable-newline-is-anycrlf],
  116. [use CR, LF, or CRLF as newline sequence]),
  117. ac_pcre_newline=anycrlf)
  118. AC_ARG_ENABLE(newline-is-any,
  119. AS_HELP_STRING([--enable-newline-is-any],
  120. [use any valid Unicode newline sequence]),
  121. ac_pcre_newline=any)
  122. enable_newline="$ac_pcre_newline"
  123. # Handle --enable-bsr-anycrlf
  124. AC_ARG_ENABLE(bsr-anycrlf,
  125. AS_HELP_STRING([--enable-bsr-anycrlf],
  126. [\R matches only CR, LF, CRLF by default]),
  127. , enable_bsr_anycrlf=no)
  128. # Handle --enable-ebcdic
  129. AC_ARG_ENABLE(ebcdic,
  130. AS_HELP_STRING([--enable-ebcdic],
  131. [assume EBCDIC coding rather than ASCII; use this only in (uncommon) EBCDIC environments; it implies --enable-rebuild-chartables]),
  132. , enable_ebcdic=no)
  133. # Handle --disable-stack-for-recursion
  134. AC_ARG_ENABLE(stack-for-recursion,
  135. AS_HELP_STRING([--disable-stack-for-recursion],
  136. [don't use stack recursion when matching]),
  137. , enable_stack_for_recursion=yes)
  138. # Handle --enable-pcregrep-libz
  139. AC_ARG_ENABLE(pcregrep-libz,
  140. AS_HELP_STRING([--enable-pcregrep-libz],
  141. [link pcregrep with libz to handle .gz files]),
  142. , enable_pcregrep_libz=no)
  143. # Handle --enable-pcregrep-libbz2
  144. AC_ARG_ENABLE(pcregrep-libbz2,
  145. AS_HELP_STRING([--enable-pcregrep-libbz2],
  146. [link pcregrep with libbz2 to handle .bz2 files]),
  147. , enable_pcregrep_libbz2=no)
  148. # Handle --enable-pcretest-libreadline
  149. AC_ARG_ENABLE(pcretest-libreadline,
  150. AS_HELP_STRING([--enable-pcretest-libreadline],
  151. [link pcretest with libreadline]),
  152. , enable_pcretest_libreadline=no)
  153. # Handle --with-posix-malloc-threshold=NBYTES
  154. AC_ARG_WITH(posix-malloc-threshold,
  155. AS_HELP_STRING([--with-posix-malloc-threshold=NBYTES],
  156. [threshold for POSIX malloc usage (default=10)]),
  157. , with_posix_malloc_threshold=10)
  158. # Handle --with-link-size=N
  159. AC_ARG_WITH(link-size,
  160. AS_HELP_STRING([--with-link-size=N],
  161. [internal link size (2, 3, or 4 allowed; default=2)]),
  162. , with_link_size=2)
  163. # Handle --with-match-limit=N
  164. AC_ARG_WITH(match-limit,
  165. AS_HELP_STRING([--with-match-limit=N],
  166. [default limit on internal looping (default=10000000)]),
  167. , with_match_limit=10000000)
  168. # Handle --with-match-limit_recursion=N
  169. #
  170. # Note: In config.h, the default is to define MATCH_LIMIT_RECURSION
  171. # symbolically as MATCH_LIMIT, which in turn is defined to be some numeric
  172. # value (e.g. 10000000). MATCH_LIMIT_RECURSION can otherwise be set to some
  173. # different numeric value (or even the same numeric value as MATCH_LIMIT,
  174. # though no longer defined in terms of the latter).
  175. #
  176. AC_ARG_WITH(match-limit-recursion,
  177. AS_HELP_STRING([--with-match-limit-recursion=N],
  178. [default limit on internal recursion (default=MATCH_LIMIT)]),
  179. , with_match_limit_recursion=MATCH_LIMIT)
  180. # Make sure that if enable_unicode_properties was set, that UTF-8 support
  181. # is enabled.
  182. #
  183. if test "x$enable_unicode_properties" = "xyes"
  184. then
  185. if test "x$enable_utf8" = "xno"
  186. then
  187. AC_MSG_ERROR([support for Unicode properties requires UTF-8 support])
  188. fi
  189. enable_utf8=yes
  190. fi
  191. if test "x$enable_utf8" = "xunset"
  192. then
  193. enable_utf8=no
  194. fi
  195. # Make sure that if enable_ebcdic is set, rebuild_chartables is also enabled.
  196. #
  197. if test "x$enable_ebcdic" = "xyes"
  198. then
  199. enable_rebuild_chartables=yes
  200. fi
  201. # Convert the newline identifier into the appropriate integer value.
  202. case "$enable_newline" in
  203. lf) ac_pcre_newline_value=10 ;;
  204. cr) ac_pcre_newline_value=13 ;;
  205. crlf) ac_pcre_newline_value=3338 ;;
  206. anycrlf) ac_pcre_newline_value=-2 ;;
  207. any) ac_pcre_newline_value=-1 ;;
  208. *)
  209. AC_MSG_ERROR([invalid argument \"$enable_newline\" to --enable-newline option])
  210. ;;
  211. esac
  212. # Check argument to --with-link-size
  213. case "$with_link_size" in
  214. 2|3|4) ;;
  215. *)
  216. AC_MSG_ERROR([invalid argument \"$with_link_size\" to --with-link-size option])
  217. ;;
  218. esac
  219. AH_TOP([
  220. /* On Unix-like systems config.h.in is converted by "configure" into config.h.
  221. Some other environments also support the use of "configure". PCRE is written in
  222. Standard C, but there are a few non-standard things it can cope with, allowing
  223. it to run on SunOS4 and other "close to standard" systems.
  224. If you are going to build PCRE "by hand" on a system without "configure" you
  225. should copy the distributed config.h.generic to config.h, and then set up the
  226. macro definitions the way you need them. You must then add -DHAVE_CONFIG_H to
  227. all of your compile commands, so that config.h is included at the start of
  228. every source.
  229. Alternatively, you can avoid editing by using -D on the compiler command line
  230. to set the macro values. In this case, you do not have to set -DHAVE_CONFIG_H.
  231. PCRE uses memmove() if HAVE_MEMMOVE is set to 1; otherwise it uses bcopy() if
  232. HAVE_BCOPY is set to 1. If your system has neither bcopy() nor memmove(), set
  233. them both to 0; an emulation function will be used. */])
  234. # Checks for header files.
  235. AC_HEADER_STDC
  236. AC_CHECK_HEADERS(limits.h sys/types.h sys/stat.h dirent.h windows.h)
  237. # The files below are C++ header files.
  238. pcre_have_type_traits="0"
  239. pcre_have_bits_type_traits="0"
  240. if test "x$enable_cpp" = "xyes" -a -n "$CXX"
  241. then
  242. AC_LANG_PUSH(C++)
  243. # Older versions of pcre defined pcrecpp::no_arg, but in new versions
  244. # it's called pcrecpp::RE::no_arg. For backwards ABI compatibility,
  245. # we want to make one an alias for the other. Different systems do
  246. # this in different ways. Some systems, for instance, can do it via
  247. # a linker flag: -alias (for os x 10.5) or -i (for os x <=10.4).
  248. OLD_LDFLAGS="$LDFLAGS"
  249. for flag in "-alias,__ZN7pcrecpp2RE6no_argE,__ZN7pcrecpp6no_argE" \
  250. "-i__ZN7pcrecpp6no_argE:__ZN7pcrecpp2RE6no_argE"; do
  251. AC_MSG_CHECKING([for alias support in the linker])
  252. LDFLAGS="$OLD_LDFLAGS -Wl,$flag"
  253. # We try to run the linker with this new ld flag. If the link fails,
  254. # we give up and remove the new flag from LDFLAGS.
  255. AC_LINK_IFELSE(AC_LANG_PROGRAM([namespace pcrecpp {
  256. class RE { static int no_arg; };
  257. int RE::no_arg;
  258. }],
  259. []),
  260. [AC_MSG_RESULT([yes]);
  261. EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS -Wl,$flag";
  262. break;],
  263. AC_MSG_RESULT([no]))
  264. done
  265. LDFLAGS="$OLD_LDFLAGS"
  266. # We could be more clever here, given we're doing AC_SUBST with this
  267. # (eg set a var to be the name of the include file we want). But we're not
  268. # so it's easy to change back to 'regular' autoconf vars if we needed to.
  269. AC_CHECK_HEADERS(string, [pcre_have_cpp_headers="1"],
  270. [pcre_have_cpp_headers="0"])
  271. AC_CHECK_HEADERS(bits/type_traits.h, [pcre_have_bits_type_traits="1"],
  272. [pcre_have_bits_type_traits="0"])
  273. AC_CHECK_HEADERS(type_traits.h, [pcre_have_type_traits="1"],
  274. [pcre_have_type_traits="0"])
  275. AC_LANG_POP
  276. fi
  277. # Using AC_SUBST eliminates the need to include config.h in a public .h file
  278. AC_SUBST(pcre_have_type_traits)
  279. AC_SUBST(pcre_have_bits_type_traits)
  280. # Conditional compilation
  281. AM_CONDITIONAL(WITH_PCRE_CPP, test "x$enable_cpp" = "xyes")
  282. AM_CONDITIONAL(WITH_REBUILD_CHARTABLES, test "x$enable_rebuild_chartables" = "xyes")
  283. # Checks for typedefs, structures, and compiler characteristics.
  284. AC_C_CONST
  285. AC_TYPE_SIZE_T
  286. pcre_have_strotolonglong=0
  287. AC_CHECK_FUNCS(strtoq strtoll _strtoi64, [pcre_have_strotolonglong="1"; break])
  288. # If we can't convert a string to a long long, pretend we don't even
  289. # have a long long.
  290. if test $pcre_have_strotolonglong = "0"; then
  291. pcre_have_long_long="0"
  292. pcre_have_ulong_long="0"
  293. else
  294. AC_CHECK_TYPES([long long],
  295. [pcre_have_long_long="1"],
  296. [pcre_have_long_long="0"])
  297. AC_CHECK_TYPES([unsigned long long],
  298. [pcre_have_ulong_long="1"],
  299. [pcre_have_ulong_long="0"])
  300. fi
  301. AC_SUBST(pcre_have_long_long)
  302. AC_SUBST(pcre_have_ulong_long)
  303. # Checks for library functions.
  304. AC_CHECK_FUNCS(bcopy memmove strerror)
  305. # Check for the availability of libz (aka zlib)
  306. AC_CHECK_HEADERS([zlib.h], [HAVE_ZLIB_H=1])
  307. AC_CHECK_LIB([z], [gzopen], [HAVE_LIBZ=1])
  308. # Check for the availability of libbz2
  309. AC_CHECK_HEADERS([bzlib.h], [HAVE_BZLIB_H=1])
  310. AC_CHECK_LIB([bz2], [BZ2_bzopen], [HAVE_LIBBZ2=1])
  311. # Check for the availabiity of libreadline
  312. AC_CHECK_HEADERS([readline/readline.h], [HAVE_READLINE_H=1])
  313. AC_CHECK_HEADERS([readline/history.h], [HAVE_HISTORY_H=1])
  314. AC_CHECK_LIB([readline], [readline], [HAVE_LIB_READLINE=1])
  315. # This facilitates -ansi builds under Linux
  316. dnl AC_DEFINE([_GNU_SOURCE], [], [Enable GNU extensions in glibc])
  317. if test "x$enable_shared" = "xno" ; then
  318. AC_DEFINE([PCRE_STATIC], [1], [
  319. Define if linking statically (TODO: make nice with Libtool)])
  320. fi
  321. # Here is where pcre specific defines are handled
  322. if test "$enable_utf8" = "yes"; then
  323. AC_DEFINE([SUPPORT_UTF8], [], [
  324. Define to enable support for the UTF-8 Unicode encoding.])
  325. fi
  326. if test "$enable_unicode_properties" = "yes"; then
  327. AC_DEFINE([SUPPORT_UCP], [], [
  328. Define to enable support for Unicode properties])
  329. fi
  330. if test "$enable_stack_for_recursion" = "no"; then
  331. AC_DEFINE([NO_RECURSE], [], [
  332. PCRE uses recursive function calls to handle backtracking while
  333. matching. This can sometimes be a problem on systems that have
  334. stacks of limited size. Define NO_RECURSE to get a version that
  335. doesn't use recursion in the match() function; instead it creates
  336. its own stack by steam using pcre_recurse_malloc() to obtain memory
  337. from the heap. For more detail, see the comments and other stuff
  338. just above the match() function. On systems that support it,
  339. "configure" can be used to set this in the Makefile
  340. (use --disable-stack-for-recursion).])
  341. fi
  342. if test "$enable_pcregrep_libz" = "yes"; then
  343. AC_DEFINE([SUPPORT_LIBZ], [], [
  344. Define to allow pcregrep to be linked with libz, so that it is
  345. able to handle .gz files.])
  346. fi
  347. if test "$enable_pcregrep_libbz2" = "yes"; then
  348. AC_DEFINE([SUPPORT_LIBBZ2], [], [
  349. Define to allow pcregrep to be linked with libbz2, so that it is
  350. able to handle .bz2 files.])
  351. fi
  352. if test "$enable_pcretest_libreadline" = "yes"; then
  353. AC_DEFINE([SUPPORT_LIBREADLINE], [], [
  354. Define to allow pcretest to be linked with libreadline.])
  355. fi
  356. AC_DEFINE_UNQUOTED([NEWLINE], [$ac_pcre_newline_value], [
  357. The value of NEWLINE determines the newline character sequence. On
  358. systems that support it, "configure" can be used to override the
  359. default, which is 10. The possible values are 10 (LF), 13 (CR),
  360. 3338 (CRLF), -1 (ANY), or -2 (ANYCRLF).])
  361. if test "$enable_bsr_anycrlf" = "yes"; then
  362. AC_DEFINE([BSR_ANYCRLF], [], [
  363. By default, the \R escape sequence matches any Unicode line ending
  364. character or sequence of characters. If BSR_ANYCRLF is defined, this is
  365. changed so that backslash-R matches only CR, LF, or CRLF. The build-
  366. time default can be overridden by the user of PCRE at runtime. On
  367. systems that support it, "configure" can be used to override the
  368. default.])
  369. fi
  370. AC_DEFINE_UNQUOTED([LINK_SIZE], [$with_link_size], [
  371. The value of LINK_SIZE determines the number of bytes used to store
  372. links as offsets within the compiled regex. The default is 2, which
  373. allows for compiled patterns up to 64K long. This covers the vast
  374. majority of cases. However, PCRE can also be compiled to use 3 or 4
  375. bytes instead. This allows for longer patterns in extreme cases. On
  376. systems that support it, "configure" can be used to override this default.])
  377. AC_DEFINE_UNQUOTED([POSIX_MALLOC_THRESHOLD], [$with_posix_malloc_threshold], [
  378. When calling PCRE via the POSIX interface, additional working storage
  379. is required for holding the pointers to capturing substrings because
  380. PCRE requires three integers per substring, whereas the POSIX
  381. interface provides only two. If the number of expected substrings is
  382. small, the wrapper function uses space on the stack, because this is
  383. faster than using malloc() for each call. The threshold above which
  384. the stack is no longer used is defined by POSIX_MALLOC_THRESHOLD. On
  385. systems that support it, "configure" can be used to override this
  386. default.])
  387. AC_DEFINE_UNQUOTED([MATCH_LIMIT], [$with_match_limit], [
  388. The value of MATCH_LIMIT determines the default number of times the
  389. internal match() function can be called during a single execution of
  390. pcre_exec(). There is a runtime interface for setting a different
  391. limit. The limit exists in order to catch runaway regular
  392. expressions that take for ever to determine that they do not match.
  393. The default is set very large so that it does not accidentally catch
  394. legitimate cases. On systems that support it, "configure" can be
  395. used to override this default default.])
  396. AC_DEFINE_UNQUOTED([MATCH_LIMIT_RECURSION], [$with_match_limit_recursion], [
  397. The above limit applies to all calls of match(), whether or not they
  398. increase the recursion depth. In some environments it is desirable
  399. to limit the depth of recursive calls of match() more strictly, in
  400. order to restrict the maximum amount of stack (or heap, if
  401. NO_RECURSE is defined) that is used. The value of
  402. MATCH_LIMIT_RECURSION applies only to recursive calls of match(). To
  403. have any useful effect, it must be less than the value of
  404. MATCH_LIMIT. The default is to use the same value as MATCH_LIMIT.
  405. There is a runtime method for setting a different limit. On systems
  406. that support it, "configure" can be used to override the default.])
  407. AC_DEFINE([MAX_NAME_SIZE], [32], [
  408. This limit is parameterized just in case anybody ever wants to
  409. change it. Care must be taken if it is increased, because it guards
  410. against integer overflow caused by enormously large patterns.])
  411. AC_DEFINE([MAX_NAME_COUNT], [10000], [
  412. This limit is parameterized just in case anybody ever wants to
  413. change it. Care must be taken if it is increased, because it guards
  414. against integer overflow caused by enormously large patterns.])
  415. AH_VERBATIM([PCRE_EXP_DEFN], [
  416. /* If you are compiling for a system other than a Unix-like system or
  417. Win32, and it needs some magic to be inserted before the definition
  418. of a function that is exported by the library, define this macro to
  419. contain the relevant magic. If you do not define this macro, it
  420. defaults to "extern" for a C compiler and "extern C" for a C++
  421. compiler on non-Win32 systems. This macro apears at the start of
  422. every exported function that is part of the external API. It does
  423. not appear on functions that are "external" in the C sense, but
  424. which are internal to the library. */
  425. #undef PCRE_EXP_DEFN])
  426. if test "$enable_ebcdic" = "yes"; then
  427. AC_DEFINE_UNQUOTED([EBCDIC], [], [
  428. If you are compiling for a system that uses EBCDIC instead of ASCII
  429. character codes, define this macro as 1. On systems that can use
  430. "configure", this can be done via --enable-ebcdic.])
  431. fi
  432. # Platform specific issues
  433. NO_UNDEFINED=
  434. EXPORT_ALL_SYMBOLS=
  435. case $host_os in
  436. cygwin* | mingw* )
  437. if test X"$enable_shared" = Xyes; then
  438. NO_UNDEFINED="-no-undefined"
  439. EXPORT_ALL_SYMBOLS="-Wl,--export-all-symbols"
  440. fi
  441. ;;
  442. esac
  443. # The extra LDFLAGS for each particular library
  444. # (Note: The libpcre*_version bits are m4 variables, assigned above)
  445. EXTRA_LIBPCRE_LDFLAGS="$EXTRA_LIBPCRE_LDFLAGS \
  446. $NO_UNDEFINED -version-info libpcre_version"
  447. EXTRA_LIBPCREPOSIX_LDFLAGS="$EXTRA_LIBPCREPOSIX_LDFLAGS \
  448. $NO_UNDEFINED -version-info libpcreposix_version"
  449. EXTRA_LIBPCRECPP_LDFLAGS="$EXTRA_LIBPCRECPP_LDFLAGS \
  450. $NO_UNDEFINED -version-info libpcrecpp_version \
  451. $EXPORT_ALL_SYMBOLS"
  452. AC_SUBST(EXTRA_LIBPCRE_LDFLAGS)
  453. AC_SUBST(EXTRA_LIBPCREPOSIX_LDFLAGS)
  454. AC_SUBST(EXTRA_LIBPCRECPP_LDFLAGS)
  455. # When we run 'make distcheck', use these arguments.
  456. DISTCHECK_CONFIGURE_FLAGS="--enable-cpp --enable-unicode-properties"
  457. AC_SUBST(DISTCHECK_CONFIGURE_FLAGS)
  458. # Check that, if --enable-pcregrep-libz or --enable-pcregrep-libbz2 is
  459. # specified, the relevant library is available. If so, add it to LIBS.
  460. if test "$enable_pcregrep_libz" = "yes"; then
  461. if test "$HAVE_ZLIB_H" != "1"; then
  462. echo "** Cannot --enable-pcregrep-libz because zlib.h was not found"
  463. exit 1
  464. fi
  465. if test "$HAVE_LIBZ" != "1"; then
  466. echo "** Cannot --enable-pcregrep-libz because libz was not found"
  467. exit 1
  468. fi
  469. if test "$LIBS" = ""; then LIBS=-lz; else LIBS="$LIBS -lz"; fi
  470. fi
  471. if test "$enable_pcregrep_libbz2" = "yes"; then
  472. if test "$HAVE_BZLIB_H" != "1"; then
  473. echo "** Cannot --enable-pcregrep-libbz2 because bzlib.h was not found"
  474. exit 1
  475. fi
  476. if test "$HAVE_LIBBZ2" != "1"; then
  477. echo "** Cannot --enable-pcregrep-libbz2 because libbz2 was not found"
  478. exit 1
  479. fi
  480. if test "$LIBS" = ""; then LIBS=-lbz2; else LIBS="$LIBS -lbz2"; fi
  481. fi
  482. # Similarly for --enable-pcretest-readline
  483. if test "$enable_pcretest_libreadline" = "yes"; then
  484. if test "$HAVE_READLINE_H" != "1"; then
  485. echo "** Cannot --enable-pcretest-readline because readline/readline.h was not found."
  486. exit 1
  487. fi
  488. if test "$HAVE_HISTORY_H" != "1"; then
  489. echo "** Cannot --enable-pcretest-readline because readline/history.h was not found."
  490. exit 1
  491. fi
  492. if test "$LIBS" = ""; then LIBS=-lreadline; else LIBS="$LIBS -lreadline"; fi
  493. fi
  494. # Produce these files, in addition to config.h.
  495. AC_CONFIG_FILES(
  496. Makefile
  497. libpcre.pc
  498. libpcrecpp.pc
  499. pcre-config
  500. pcre.h
  501. pcre_stringpiece.h
  502. pcrecpparg.h
  503. )
  504. # Make the generated script files executable.
  505. AC_CONFIG_COMMANDS([script-chmod], [chmod a+x pcre-config])
  506. # Make sure that pcre_chartables.c is removed in case the method for
  507. # creating it was changed by reconfiguration.
  508. AC_CONFIG_COMMANDS([delete-old-chartables], [rm -f pcre_chartables.c])
  509. AC_OUTPUT
  510. # Print out a nice little message after configure is run displaying your
  511. # chosen options.
  512. cat <<EOF
  513. $PACKAGE-$VERSION configuration summary:
  514. Install prefix .................. : ${prefix}
  515. C preprocessor .................. : ${CPP}
  516. C compiler ...................... : ${CC}
  517. C++ preprocessor ................ : ${CXXCPP}
  518. C++ compiler .................... : ${CXX}
  519. Linker .......................... : ${LD}
  520. C preprocessor flags ............ : ${CPPFLAGS}
  521. C compiler flags ................ : ${CFLAGS}
  522. C++ compiler flags .............. : ${CXXFLAGS}
  523. Linker flags .................... : ${LDFLAGS}
  524. Extra libraries ................. : ${LIBS}
  525. Build C++ library ............... : ${enable_cpp}
  526. Enable UTF-8 support ............ : ${enable_utf8}
  527. Unicode properties .............. : ${enable_unicode_properties}
  528. Newline char/sequence ........... : ${enable_newline}
  529. \R matches only ANYCRLF ......... : ${enable_bsr_anycrlf}
  530. EBCDIC coding ................... : ${enable_ebcdic}
  531. Rebuild char tables ............. : ${enable_rebuild_chartables}
  532. Use stack recursion ............. : ${enable_stack_for_recursion}
  533. POSIX mem threshold ............. : ${with_posix_malloc_threshold}
  534. Internal link size .............. : ${with_link_size}
  535. Match limit ..................... : ${with_match_limit}
  536. Match limit recursion ........... : ${with_match_limit_recursion}
  537. Build shared libs ............... : ${enable_shared}
  538. Build static libs ............... : ${enable_static}
  539. Link pcregrep with libz ......... : ${enable_pcregrep_libz}
  540. Link pcregrep with libbz2 ....... : ${enable_pcregrep_libbz2}
  541. Link pcretest with libreadline .. : ${enable_pcretest_libreadline}
  542. EOF
  543. dnl end configure.ac