1 dnl Process this file with autoconf to produce a configure script.
4 AC_CONFIG_MACRO_DIR([m4])
7 AC_CONFIG_HEADER(config.h)
10 dnl default value for RUBYDIR
13 [ --with-rubydir=RUBYDIR specify value for RUBYDIR (default ..)],
17 dnl default value for STATISTICS
19 AC_ARG_WITH(statistics,
20 [ --with-statistics take matching time statistical data],
21 [ STATISTICS=-DONIG_DEBUG_STATISTICS ])
24 dnl check for COMBINATION_EXPLOSION
25 AC_ARG_ENABLE(combination-explosion-check,
26 [ --enable-combination-explosion-check enable combination explosion check],
27 [comb_expl_check=$enableval])
28 if test "${comb_expl_check}" = yes; then
29 AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])
32 dnl check for CRNL_AS_LINE_TERMINATOR
33 AC_ARG_ENABLE(crnl-as-line-terminator,
34 [ --enable-crnl-as-line-terminator enable CR+NL as line terminator],
35 [crnl_as_line_terminator=$enableval])
36 if test "${crnl_as_line_terminator}" = yes; then
37 AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])
41 dnl Checks for programs.
50 dnl Checks for libraries.
52 dnl Checks for header files.
54 AC_CHECK_HEADERS(stdlib.h string.h strings.h sys/time.h unistd.h sys/times.h)
56 dnl Checks for typedefs, structures, and compiler characteristics.
57 AC_CHECK_SIZEOF(int, 4)
58 AC_CHECK_SIZEOF(short, 2)
59 AC_CHECK_SIZEOF(long, 4)
63 dnl Checks for library functions.
67 AC_CACHE_CHECK(for prototypes, _cv_have_prototypes,
68 [AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
69 _cv_have_prototypes=yes,
70 _cv_have_prototypes=no)])
71 if test "$_cv_have_prototypes" = yes; then
72 AC_DEFINE(HAVE_PROTOTYPES,1,[Define if compilerr supports prototypes])
75 AC_CACHE_CHECK(for variable length prototypes and stdarg.h, _cv_stdarg,
86 ], [return foo(10, "", 3.14);],
89 if test "$_cv_stdarg" = yes; then
90 AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
94 AC_OUTPUT([Makefile onig-config sample/Makefile], [chmod +x onig-config])