summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorSlava Barinov <v.barinov@samsung.com>2018-08-28 15:03:50 +0300
committerSlava Barinov <v.barinov@samsung.com>2018-08-28 15:03:50 +0300
commit0ab4f68428380e6fb079ba8f410e9eef8ccad611 (patch)
tree22dbef6e18ad76c91be20301ca2e5f9a39a98915 /configure.ac
parent2b8d32c7857a9ebd3a0b99e7d285687bde162b0f (diff)
downloadflex-0ab4f68428380e6fb079ba8f410e9eef8ccad611.tar.gz
flex-0ab4f68428380e6fb079ba8f410e9eef8ccad611.tar.bz2
flex-0ab4f68428380e6fb079ba8f410e9eef8ccad611.zip
Imported Upstream version 2.6.4upstream/2.6.4upstream
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac175
1 files changed, 93 insertions, 82 deletions
diff --git a/configure.ac b/configure.ac
index 871082f..55e774b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,32 +24,74 @@
# autoconf requirements and initialization
-AC_INIT([the fast lexical analyser generator], [2.5.39],
-[flex-help@lists.sourceforge.net], [flex])
+AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
+AC_CONFIG_SRCDIR([src/scan.l])
+AC_CONFIG_AUX_DIR([build-aux])
+LT_INIT
+AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign check-news std-options dist-lzip parallel-tests subdir-objects])
+AC_CONFIG_HEADER([src/config.h])
+AC_CONFIG_LIBOBJ_DIR([lib])
+AC_CONFIG_MACRO_DIR([m4])
SHARED_VERSION_INFO="2:0:0"
AC_SUBST(SHARED_VERSION_INFO)
-AC_CONFIG_SRCDIR([scan.l])
-AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz 1.10])
-AC_CONFIG_HEADER([config.h:conf.in])
-AC_CONFIG_LIBOBJ_DIR([lib])
-
# checks for programs
AM_GNU_GETTEXT([external])
-AM_GNU_GETTEXT_VERSION([0.18.1])
+AM_GNU_GETTEXT_VERSION([0.18])
AC_PROG_YACC
+AS_IF([test "$YACC" != 'bison -y'], [
+ YACC="\${top_srcdir}/build-aux/missing bison -y"
+ AC_MSG_NOTICE(no bison program found: only required for maintainers)
+ ])
+AM_CONDITIONAL([HAVE_BISON], [test "$YACC" = 'bison -y'])
AM_PROG_LEX
AC_PROG_CC
+AX_PROG_CC_FOR_BUILD
AC_PROG_CXX
AM_PROG_CC_C_O
AC_PROG_LN_S
-LT_INIT
AC_PROG_AWK
AC_PROG_INSTALL
-AC_PATH_PROG(BISON, bison,bison)
-AC_PATH_PROG(HELP2MAN, help2man, help2man)
+# allow passing a variable `WARNINGFLAGS',
+# either when invoking `configure', or when invoking `make'
+# default to something useful if GCC was detected
+
+AC_ARG_ENABLE([warnings],
+ [AS_HELP_STRING([--enable-warnings],
+ [enable a bunch of compiler warning flags (defaults to GCC warning flags).])],
+ [AS_IF([test "x$GCC" = xyes],
+ [ : ${WARNINGFLAGS="-Wall -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs -Wold-style-definition -Wredundant-decls -Wconversion -Wno-unused-but-set-variable"} ])])
+
+AC_SUBST([WARNINGFLAGS])
+
+AC_ARG_ENABLE([libfl],
+ [AS_HELP_STRING([--disable-libfl],
+ [do not build -lfl runtime support library])],
+ [], [enable_libfl=yes])
+AM_CONDITIONAL([ENABLE_LIBFL], [test "x$enable_libfl" = xyes])
+
+# --disable-bootstrap is intended only to workaround problems with bootstrap
+# (e.g. when cross-compiling flex or when bootstrapping has bugs).
+# Ideally we should be able to bootstrap even when cross-compiling.
+AC_ARG_ENABLE([bootstrap],
+ [AS_HELP_STRING([--disable-bootstrap],
+ [don't perform a bootstrap when building flex])],
+ [], [enable_bootstrap=yes])
+AM_CONDITIONAL([ENABLE_BOOTSTRAP], [test "x$enable_bootstrap" = xyes])
+
+AM_CONDITIONAL([CROSS], [test "x$cross_compiling" = xyes])
+
+AC_PATH_PROG([HELP2MAN], help2man, [\${top_srcdir}/build-aux/missing help2man])
+ AS_IF([test "$HELP2MAN" = "\${top_srcdir}/build-aux/missing help2man"],
+ AC_MSG_WARN(help2man: program not found: building man page will not work)
+ )
+
+AC_PATH_PROGS([TEXI2DVI], [gtexi2dvi texi2dvi], [\${top_srcdir}/build-aux/missing texi2dvi])
+ AS_IF([test "$TEXI2DVI" = "\${top_srcdir}/build-aux/missing texi2dvi"],
+ AC_MSG_WARN(texi2dvi: program not found: building pdf version of manual will not work)
+ )
# Check for a m4 that supports -P
@@ -62,25 +104,20 @@ AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4],
AC_SUBST([M4], [$ac_cv_path_M4])
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.])
-AC_PATH_PROG(INDENT, indent, indent)
-# if INDENT is set to 'indent' then we didn't find indent
-if test "$INDENT" != indent ; then
- AC_MSG_CHECKING(if $INDENT is GNU indent)
- if $INDENT --version 2>/dev/null | head -n 1|grep "GNU indent" > /dev/null ; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
- AC_MSG_WARN($INDENT does not appear to be GNU indent.)
- fi
-else
- AC_MSG_WARN(no indent program found: make indent target will not function)
-fi
+AC_PATH_PROG([INDENT], indent, [\${top_srcdir}/build-aux/missing indent])
+ AC_MSG_CHECKING(if $INDENT is GNU indent)
+ AS_IF([$INDENT --version 2>/dev/null | head -n 1 | grep "GNU indent" >/dev/null],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_MSG_WARN($INDENT does not appear to be GNU indent; 'make indent' may not function properly)
+ ])
# checks for headers
-AC_HEADER_STDC
-AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h regex.h stddef.h stdlib.h string.h strings.h unistd.h])
+AC_CHECK_HEADERS([regex.h strings.h sys/stat.h sys/wait.h unistd.h], [],
+ [AC_MSG_ERROR(required header not found on your system)])
+
+AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h])
# checks for libraries
@@ -88,11 +125,12 @@ AC_CHECK_HEADERS([inttypes.h libintl.h limits.h locale.h malloc.h netinet/in.h r
# all we need is the preprocessor symbol defined since we don't need
# LIBS to include libpthread for building flex.
+LIBPTHREAD=''
AC_CHECK_LIB(pthread, pthread_mutex_lock,
-AC_DEFINE([HAVE_LIBPTHREAD], 1, [pthread library] ),
-AC_DEFINE([HAVE_LIBPTHREAD], 0, [pthread library] )
-)
-AC_CHECK_HEADERS([pthread.h])
+ [AC_CHECK_HEADERS([pthread.h], [LIBPTHREAD=-lpthread],
+ [AC_MSG_WARN([pthread tests will be skipped])])],
+ [AC_MSG_WARN([pthread tests will be skipped])])
+AC_SUBST([LIBPTHREAD])
AC_CHECK_LIB(m, log10)
@@ -106,9 +144,30 @@ AC_TYPE_SIZE_T
AC_FUNC_ALLOCA
AC_FUNC_FORK
+dnl Autoconf bug: AC_FUNC_MALLOC and AC_FUNC_REALLOC might not warn of cross
+dnl compilation. Workaround this.
AC_FUNC_MALLOC
+AS_IF([test "$cross_compiling" = yes],
+ AC_MSG_WARN([result $ac_cv_func_malloc_0_nonnull guessed because of cross compilation]))
AC_FUNC_REALLOC
-AC_CHECK_FUNCS([dup2 isascii memset pow regcomp setlocale strchr strtol])
+AS_IF([test "$cross_compiling" = yes],
+ AC_MSG_WARN([result $ac_cv_func_realloc_0_nonnull guessed because of cross compilation]))
+
+AC_CHECK_FUNCS([dup2 dnl
+memset dnl
+regcomp dnl
+strcasecmp dnl
+strchr dnl
+strdup dnl
+strtol dnl
+], [], [AC_MSG_ERROR(required library function not found on your system)])
+
+# Optional library functions
+AC_CHECK_FUNCS([dnl
+pow dnl Used only by "examples/manual/expr"
+setlocale dnl Needed only if NLS is enabled
+reallocarray dnl OpenBSD function. We have replacement if not available.
+])
AC_CONFIG_FILES(
Makefile
@@ -116,58 +175,10 @@ doc/Makefile
examples/Makefile
examples/fastwc/Makefile
examples/manual/Makefile
-lib/Makefile
po/Makefile.in
+src/Makefile
+tools/Makefile
tests/Makefile
-tests/TEMPLATE/Makefile
-tests/test-array-nr/Makefile
-tests/test-array-r/Makefile
-tests/test-basic-nr/Makefile
-tests/test-basic-r/Makefile
-tests/test-bison-yylloc/Makefile
-tests/test-bison-yylval/Makefile
-tests/test-c-cpp-nr/Makefile
-tests/test-c-cpp-r/Makefile
-tests/test-header-nr/Makefile
-tests/test-header-r/Makefile
-tests/test-include-by-buffer/Makefile
-tests/test-include-by-push/Makefile
-tests/test-include-by-reentrant/Makefile
-tests/test-multiple-scanners-nr/Makefile
-tests/test-multiple-scanners-r/Makefile
-tests/test-noansi-nr/Makefile
-tests/test-noansi-r/Makefile
-tests/test-prefix-nr/Makefile
-tests/test-prefix-r/Makefile
-tests/test-pthread/Makefile
-tests/test-string-nr/Makefile
-tests/test-string-r/Makefile
-tests/test-yyextra/Makefile
-tests/test-alloc-extra/Makefile
-tests/test-lineno-nr/Makefile
-tests/test-lineno-trailing/Makefile
-tests/test-lineno-r/Makefile
-tests/test-linedir-r/Makefile
-tests/test-debug-r/Makefile
-tests/test-debug-nr/Makefile
-tests/test-mem-nr/Makefile
-tests/test-mem-r/Makefile
-tests/test-posix/Makefile
-tests/test-posixly-correct/Makefile
-tests/test-table-opts/Makefile
-tests/test-c++-basic/Makefile
-tests/test-bison-nr/Makefile
-tests/test-reject/Makefile
-tests/test-c++-multiple-scanners/Makefile
-tests/test-top/Makefile
-tests/test-rescan-nr/Makefile
-tests/test-rescan-r/Makefile
-tests/test-quotes/Makefile
-tests/test-ccl/Makefile
-tests/test-extended/Makefile
-tests/test-c++-yywrap/Makefile
-tests/test-concatenated-options/Makefile
-dnl --new-test-here-- This line is processed by tests/create-test.
)
AC_OUTPUT