1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_MACRO_DIR([m4])
6 AM_INIT_AUTOMAKE([-Wno-portability 1.14])
7 AC_CONFIG_HEADER(src/config.h)
10 dnl default value for STATISTICS
12 AC_ARG_WITH(statistics,
13 [ --with-statistics take matching time statistical data],
14 [ STATISTICS=-DONIG_DEBUG_STATISTICS ])
17 dnl check for COMBINATION_EXPLOSION
18 AC_ARG_ENABLE(combination-explosion-check,
19 [ --enable-combination-explosion-check enable combination explosion check],
20 [comb_expl_check=$enableval])
21 if test "${comb_expl_check}" = yes; then
22 AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])
25 dnl check for CRNL_AS_LINE_TERMINATOR
26 AC_ARG_ENABLE(crnl-as-line-terminator,
27 [ --enable-crnl-as-line-terminator enable CR+NL as line terminator],
28 [crnl_as_line_terminator=$enableval])
29 if test "${crnl_as_line_terminator}" = yes; then
30 AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])
34 dnl Checks for programs.
43 dnl Checks for libraries.
45 dnl Checks for header files.
47 AC_CHECK_HEADERS(stdlib.h string.h strings.h sys/time.h unistd.h sys/times.h)
49 dnl Checks for typedefs, structures, and compiler characteristics.
50 AC_CHECK_SIZEOF(int, 4)
51 AC_CHECK_SIZEOF(short, 2)
52 AC_CHECK_SIZEOF(long, 4)
56 dnl Checks for library functions.
60 AC_CACHE_CHECK(for prototypes, _cv_have_prototypes,
61 [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
62 _cv_have_prototypes=yes,
63 _cv_have_prototypes=no)])
64 if test "$_cv_have_prototypes" = yes; then
65 AC_DEFINE(HAVE_PROTOTYPES,1,[Define if compilerr supports prototypes])
68 AC_CACHE_CHECK(for variable length prototypes and stdarg.h, _cv_stdarg,
79 ], [return foo(10, "", 3.14);],
82 if test "$_cv_stdarg" = yes; then
83 AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
87 AC_OUTPUT([Makefile src/Makefile test/Makefile sample/Makefile onig-config], [chmod +x onig-config])