Imported Upstream version 2.5.37
[platform/upstream/flex.git] / configure.in
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
27 AC_INIT([the fast lexical analyser generator], [2.5.37],
28 [flex-help@lists.sourceforge.net], [flex])
29 AC_CONFIG_SRCDIR([scan.l])
30 AM_INIT_AUTOMAKE([gnits dist-bzip2 1.10])
31 AC_CONFIG_HEADER([config.h:conf.in])
32 AC_CONFIG_LIBOBJ_DIR([lib])
33
34 # checks for programs
35
36 AM_GNU_GETTEXT([external])
37 AM_GNU_GETTEXT_VERSION(0.12)
38 AC_PROG_YACC
39 AM_PROG_LEX
40 AC_PROG_CC
41 AC_PROG_CXX
42 AM_PROG_CC_C_O
43 AC_PROG_LN_S
44 AC_PROG_RANLIB
45 AC_PROG_AWK
46 AC_PROG_INSTALL
47
48 AC_PATH_PROG(BISON, bison,bison)
49 AC_PATH_PROG(HELP2MAN, help2man, help2man)
50
51 # Check for a m4 that supports -P
52
53 AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4],
54 [AC_PATH_PROGS_FEATURE_CHECK([M4], [gm4 gnum4 m4],
55               [[m4out=`echo 'm''4_divnum' | $ac_path_M4 -P`]
56                 [test "x$m4out" = x0 \
57                 && ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
58               [AC_MSG_ERROR([could not find m4 that supports -P])])])
59 AC_SUBST([M4], [$ac_cv_path_M4])
60 AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.])
61
62 AC_PATH_PROG(INDENT, indent, indent)
63 # if INDENT is set to 'indent' then we didn't find indent
64 if test "$INDENT" != indent ; then
65    AC_MSG_CHECKING(if $INDENT is GNU indent)
66    if $INDENT --version 2>/dev/null | head -n 1|grep "GNU indent" > /dev/null ; then
67       AC_MSG_RESULT(yes)
68    else
69       AC_MSG_RESULT(no)
70       AC_MSG_WARN($INDENT does not appear to be GNU indent.)
71    fi
72 else
73    AC_MSG_WARN(no indent program found: make indent target will not function)
74 fi
75
76 # checks for headers
77
78 AC_HEADER_STDC
79 AC_HEADER_SYS_WAIT
80 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])
81
82 # checks for libraries
83
84 # The test test-pthread uses libpthread, so we check for it here, but
85 # all we need is the preprocessor symbol defined since we don't need
86 # LIBS to include libpthread for building flex.
87
88 AC_CHECK_LIB(pthread, pthread_mutex_lock,
89 AC_DEFINE([HAVE_LIBPTHREAD], 1, [pthread library] ),
90 AC_DEFINE([HAVE_LIBPTHREAD], 0, [pthread library] )
91 )
92 AC_CHECK_HEADERS([pthread.h])
93
94 AC_CHECK_LIB(m, log10)
95
96 # Checks for typedefs, structures, and compiler characteristics.
97
98 AC_HEADER_STDBOOL
99 AC_C_CONST
100 AC_TYPE_SIZE_T
101
102 # Checks for library functions.
103
104 AC_FUNC_ALLOCA
105 AC_FUNC_FORK
106 AC_FUNC_MALLOC
107 AC_FUNC_REALLOC
108 AC_CHECK_FUNCS([dup2 isascii memset pow regcomp setlocale strchr strtol])
109
110 AC_CONFIG_FILES(
111 Makefile
112 doc/Makefile
113 examples/Makefile
114 examples/fastwc/Makefile
115 examples/manual/Makefile
116 lib/Makefile
117 po/Makefile.in
118 tools/Makefile
119 tests/Makefile
120 tests/TEMPLATE/Makefile
121 tests/test-array-nr/Makefile
122 tests/test-array-r/Makefile
123 tests/test-basic-nr/Makefile
124 tests/test-basic-r/Makefile
125 tests/test-bison-yylloc/Makefile
126 tests/test-bison-yylval/Makefile
127 tests/test-c-cpp-nr/Makefile
128 tests/test-c-cpp-r/Makefile
129 tests/test-header-nr/Makefile
130 tests/test-header-r/Makefile
131 tests/test-include-by-buffer/Makefile
132 tests/test-include-by-push/Makefile
133 tests/test-include-by-reentrant/Makefile
134 tests/test-multiple-scanners-nr/Makefile
135 tests/test-multiple-scanners-r/Makefile
136 tests/test-noansi-nr/Makefile
137 tests/test-noansi-r/Makefile
138 tests/test-prefix-nr/Makefile
139 tests/test-prefix-r/Makefile
140 tests/test-pthread/Makefile
141 tests/test-string-nr/Makefile
142 tests/test-string-r/Makefile
143 tests/test-yyextra/Makefile
144 tests/test-alloc-extra/Makefile
145 tests/test-lineno-nr/Makefile
146 tests/test-lineno-r/Makefile
147 tests/test-linedir-r/Makefile
148 tests/test-debug-r/Makefile
149 tests/test-debug-nr/Makefile
150 tests/test-mem-nr/Makefile
151 tests/test-mem-r/Makefile
152 tests/test-posix/Makefile
153 tests/test-posixly-correct/Makefile
154 tests/test-table-opts/Makefile
155 tests/test-c++-basic/Makefile
156 tests/test-bison-nr/Makefile
157 tests/test-reject/Makefile
158 tests/test-c++-multiple-scanners/Makefile
159 tests/test-top/Makefile
160 tests/test-rescan-nr/Makefile
161 tests/test-rescan-r/Makefile
162 tests/test-quotes/Makefile
163 tests/test-ccl/Makefile
164 tests/test-extended/Makefile
165 tests/test-c++-yywrap/Makefile
166 tests/test-concatenated-options/Makefile
167 dnl --new-test-here-- This line is processed by tests/create-test.
168 )
169
170 AC_OUTPUT