1# -*- Autoconf -*- 2# Process this file with autoconf to produce a configure script. 3 4# This file is part of flex. 5 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions 8# are met: 9 10# 1. Redistributions of source code must retain the above copyright 11# notice, this list of conditions and the following disclaimer. 12# 2. Redistributions in binary form must reproduce the above copyright 13# notice, this list of conditions and the following disclaimer in the 14# documentation and/or other materials provided with the distribution. 15 16# Neither the name of the University nor the names of its contributors 17# may be used to endorse or promote products derived from this software 18# without specific prior written permission. 19 20# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 21# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 22# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23# PURPOSE. 24 25# autoconf requirements and initialization 26 27AC_INIT([the fast lexical analyser generator], [2.5.39], 28[flex-help@lists.sourceforge.net], [flex]) 29SHARED_VERSION_INFO="2:0:0" 30AC_SUBST(SHARED_VERSION_INFO) 31 32AC_CONFIG_SRCDIR([scan.l]) 33AM_INIT_AUTOMAKE([gnu check-news std-options dist-bzip2 dist-xz 1.10]) 34AC_CONFIG_HEADER([config.h:conf.in]) 35AC_CONFIG_LIBOBJ_DIR([lib]) 36 37# checks for programs 38 39AM_GNU_GETTEXT([external]) 40AM_GNU_GETTEXT_VERSION([0.18.1]) 41AC_PROG_YACC 42AM_PROG_LEX 43AC_PROG_CC 44AC_PROG_CXX 45AM_PROG_CC_C_O 46AC_PROG_LN_S 47LT_INIT 48AC_PROG_AWK 49AC_PROG_INSTALL 50 51AC_PATH_PROG(BISON, bison,bison) 52AC_PATH_PROG(HELP2MAN, help2man, help2man) 53 54# Check for a m4 that supports -P 55 56AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4], 57[AC_PATH_PROGS_FEATURE_CHECK([M4], [gm4 gnum4 m4], 58 [[m4out=`echo 'm''4_divnum' | $ac_path_M4 -P`] 59 [test "x$m4out" = x0 \ 60 && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], 61 [AC_MSG_ERROR([could not find m4 that supports -P])])]) 62AC_SUBST([M4], [$ac_cv_path_M4]) 63AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.]) 64 65AC_PATH_PROG(INDENT, indent, indent) 66# if INDENT is set to 'indent' then we didn't find indent 67if test "$INDENT" != indent ; then 68 AC_MSG_CHECKING(if $INDENT is GNU indent) 69 if $INDENT --version 2>/dev/null | head -n 1|grep "GNU indent" > /dev/null ; then 70 AC_MSG_RESULT(yes) 71 else 72 AC_MSG_RESULT(no) 73 AC_MSG_WARN($INDENT does not appear to be GNU indent.) 74 fi 75else 76 AC_MSG_WARN(no indent program found: make indent target will not function) 77fi 78 79# checks for headers 80 81AC_HEADER_STDC 82AC_HEADER_SYS_WAIT 83AC_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]) 84 85# checks for libraries 86 87# The test test-pthread uses libpthread, so we check for it here, but 88# all we need is the preprocessor symbol defined since we don't need 89# LIBS to include libpthread for building flex. 90 91AC_CHECK_LIB(pthread, pthread_mutex_lock, 92AC_DEFINE([HAVE_LIBPTHREAD], 1, [pthread library] ), 93AC_DEFINE([HAVE_LIBPTHREAD], 0, [pthread library] ) 94) 95AC_CHECK_HEADERS([pthread.h]) 96 97AC_CHECK_LIB(m, log10) 98 99# Checks for typedefs, structures, and compiler characteristics. 100 101AC_HEADER_STDBOOL 102AC_C_CONST 103AC_TYPE_SIZE_T 104 105# Checks for library functions. 106 107AC_FUNC_ALLOCA 108AC_FUNC_FORK 109AC_FUNC_MALLOC 110AC_FUNC_REALLOC 111AC_CHECK_FUNCS([dup2 isascii memset pow regcomp setlocale strchr strtol]) 112 113AC_CONFIG_FILES( 114Makefile 115doc/Makefile 116examples/Makefile 117examples/fastwc/Makefile 118examples/manual/Makefile 119lib/Makefile 120po/Makefile.in 121tests/Makefile 122tests/TEMPLATE/Makefile 123tests/test-array-nr/Makefile 124tests/test-array-r/Makefile 125tests/test-basic-nr/Makefile 126tests/test-basic-r/Makefile 127tests/test-bison-yylloc/Makefile 128tests/test-bison-yylval/Makefile 129tests/test-c-cpp-nr/Makefile 130tests/test-c-cpp-r/Makefile 131tests/test-header-nr/Makefile 132tests/test-header-r/Makefile 133tests/test-include-by-buffer/Makefile 134tests/test-include-by-push/Makefile 135tests/test-include-by-reentrant/Makefile 136tests/test-multiple-scanners-nr/Makefile 137tests/test-multiple-scanners-r/Makefile 138tests/test-noansi-nr/Makefile 139tests/test-noansi-r/Makefile 140tests/test-prefix-nr/Makefile 141tests/test-prefix-r/Makefile 142tests/test-pthread/Makefile 143tests/test-string-nr/Makefile 144tests/test-string-r/Makefile 145tests/test-yyextra/Makefile 146tests/test-alloc-extra/Makefile 147tests/test-lineno-nr/Makefile 148tests/test-lineno-trailing/Makefile 149tests/test-lineno-r/Makefile 150tests/test-linedir-r/Makefile 151tests/test-debug-r/Makefile 152tests/test-debug-nr/Makefile 153tests/test-mem-nr/Makefile 154tests/test-mem-r/Makefile 155tests/test-posix/Makefile 156tests/test-posixly-correct/Makefile 157tests/test-table-opts/Makefile 158tests/test-c++-basic/Makefile 159tests/test-bison-nr/Makefile 160tests/test-reject/Makefile 161tests/test-c++-multiple-scanners/Makefile 162tests/test-top/Makefile 163tests/test-rescan-nr/Makefile 164tests/test-rescan-r/Makefile 165tests/test-quotes/Makefile 166tests/test-ccl/Makefile 167tests/test-extended/Makefile 168tests/test-c++-yywrap/Makefile 169tests/test-concatenated-options/Makefile 170dnl --new-test-here-- This line is processed by tests/create-test. 171) 172 173AC_OUTPUT 174