summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-10 05:12:17 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-05-10 05:12:17 +0200
commit5e01a4852b31d537307994248869caf38b4023cc (patch)
tree769c60020afcb58437477f348dca58fb0c789f64 /configure.ac
parent766e109fd638ef1eac33717b52e04a351da46483 (diff)
Imported Upstream version 6.0.0upstream/6.0.0
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac87
1 files changed, 87 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e9926a4
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,87 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(onig, 6.0.0)
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([-Wno-portability 1.14])
+AC_CONFIG_HEADER(src/config.h)
+
+
+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 "${comb_expl_check}" = yes; 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 "${crnl_as_line_terminator}" = yes; 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
+AM_PROG_LIBTOOL
+LTVERSION="3:0:0"
+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)
+
+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 "$_cv_have_prototypes" = yes; 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);
+ return 0;
+}
+], [return foo(10, "", 3.14);],
+ _cv_stdarg=yes,
+ _cv_stdarg=no)])
+if test "$_cv_stdarg" = yes; then
+ AC_DEFINE(HAVE_STDARG_PROTOTYPES,1,[Define if compiler supports stdarg prototypes])
+fi
+
+
+AC_OUTPUT([Makefile src/Makefile test/Makefile sample/Makefile onig-config], [chmod +x onig-config])