]> granicus.if.org Git - onig/blob - configure.ac
add -Wno-portability into AM_INIT_AUTOMAKE()
[onig] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(onig, 5.9.6)
3
4 AC_CONFIG_MACRO_DIR([m4])
5
6 AM_INIT_AUTOMAKE([-Wno-portability 1.14])
7 AC_CONFIG_HEADER(config.h)
8
9
10 dnl default value for RUBYDIR
11 RUBYDIR=".."
12 AC_ARG_WITH(rubydir,
13         [  --with-rubydir=RUBYDIR  specify value for RUBYDIR (default ..)], 
14         [ RUBYDIR=$withval ])
15 AC_SUBST(RUBYDIR)
16
17 dnl default value for STATISTICS
18 STATISTICS=""
19 AC_ARG_WITH(statistics,
20         [  --with-statistics       take matching time statistical data], 
21         [ STATISTICS=-DONIG_DEBUG_STATISTICS ])
22 AC_SUBST(STATISTICS)
23
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])
30 fi
31
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])
38 fi
39
40
41 dnl Checks for programs.
42 AC_PROG_CC
43 AM_PROG_LIBTOOL
44 LTVERSION="2:0:0"
45 AC_SUBST(LTVERSION)
46
47 AC_PROG_INSTALL
48 AC_PROG_MAKE_SET
49
50 dnl Checks for libraries.
51
52 dnl Checks for header files.
53 AC_HEADER_STDC
54 AC_CHECK_HEADERS(stdlib.h string.h strings.h sys/time.h unistd.h sys/times.h)
55
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)
60 AC_C_CONST
61 AC_HEADER_TIME
62
63 dnl Checks for library functions.
64 AC_FUNC_ALLOCA
65 AC_FUNC_MEMCMP
66
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])
73 fi
74
75 AC_CACHE_CHECK(for variable length prototypes and stdarg.h, _cv_stdarg,
76   [AC_TRY_COMPILE([
77 #include <stdarg.h>
78 int foo(int x, ...) {
79         va_list va;
80         va_start(va, x);
81         va_arg(va, int);
82         va_arg(va, char *);
83         va_arg(va, double);
84         return 0;
85 }
86 ], [return foo(10, "", 3.14);],
87         _cv_stdarg=yes,
88         _cv_stdarg=no)])
89 if test "$_cv_stdarg" = yes; then
90   AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
91 fi
92
93
94 AC_OUTPUT([Makefile onig-config sample/Makefile], [chmod +x onig-config])