forked from k-takata/Onigmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
94 lines (77 loc) · 2.46 KB
/
configure.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
dnl Process this file with autoconf to produce a configure script.
AC_INIT(onig, 5.13.3)
AM_INIT_AUTOMAKE(foreign)
AC_CONFIG_HEADER(config.h)
dnl default value for RUBYDIR
RUBYDIR=".."
AC_ARG_WITH(rubydir,
[ --with-rubydir=RUBYDIR specify value for RUBYDIR (default ..)],
[ RUBYDIR=$withval ])
AC_SUBST(RUBYDIR)
dnl default value for STATISTICS
STATISTICS=""
AC_ARG_WITH(statistics,
[ --with-statistics take matching time statistical data],
[ STATISTICS=-DONIG_DEBUG_STATISTICS ])
AC_SUBST(STATISTICS)
dnl check for COMBINATION_EXPLOSION
AC_ARG_ENABLE(combination-explosion-check,
[ --enable-combination-explosion-check enable combination explosion check],
[comb_expl_check=$enableval])
if test x"$comb_expl_check" = xyes; then
AC_DEFINE(USE_COMBINATION_EXPLOSION_CHECK,1,[Define if combination explosion check])
fi
dnl check for CRNL_AS_LINE_TERMINATOR
AC_ARG_ENABLE(crnl-as-line-terminator,
[ --enable-crnl-as-line-terminator enable CR+NL as line terminator],
[crnl_as_line_terminator=$enableval])
if test x"$crnl_as_line_terminator" = xyes; then
AC_DEFINE(USE_CRNL_AS_LINE_TERMINATOR,1,[Define if enable CR+NL as line terminator])
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_LIBTOOL
AM_PROG_CC_C_O
LTVERSION="5:0:1"
AC_SUBST(LTVERSION)
AC_PROG_INSTALL
AC_PROG_MAKE_SET
dnl Checks for libraries.
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(stdlib.h string.h strings.h sys/time.h unistd.h sys/times.h stdint.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(long, 4)
AC_C_CONST
AC_HEADER_TIME
dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
AC_CACHE_CHECK(for prototypes, _cv_have_prototypes,
[AC_TRY_COMPILE([int foo(int x) { return 0; }], [return foo(10);],
_cv_have_prototypes=yes,
_cv_have_prototypes=no)])
if test x"$_cv_have_prototypes" = xyes; then
AC_DEFINE(HAVE_PROTOTYPES,1,[Define if compilerr supports prototypes])
fi
AC_CACHE_CHECK(for variable length prototypes and stdarg.h, _cv_stdarg,
[AC_TRY_COMPILE([
#include <stdarg.h>
int foo(int x, ...) {
va_list va;
va_start(va, x);
va_arg(va, int);
va_arg(va, char *);
va_arg(va, double);
va_end(va);
return 0;
}
], [return foo(10, "", 3.14);],
_cv_stdarg=yes,
_cv_stdarg=no)])
if test x"$_cv_stdarg" = xyes; then
AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
fi
AC_OUTPUT([Makefile onig-config sample/Makefile], [chmod +x onig-config])