Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit f03fc94

Browse files
committed
New configure test for flex, which recognizes only flex but does so in all
incarnations (I hope). When an acceptable flex version is not found, print instructive error messages from both configure and the makefiles, so that users can continue building anyway.
1 parent 4c8d2f7 commit f03fc94

File tree

11 files changed

+593
-705
lines changed

11 files changed

+593
-705
lines changed

aclocal.m4

+77-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.5 2000/08/27 19:00:00 petere Exp $
1+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
22
# This comes from the official Autoconf macro archive at
33
# <http://research.cys.de/autoconf-archive/>
44
# (I removed the $ before the Id CVS keyword below.)
@@ -65,7 +65,7 @@ extern accept ($ac_cv_func_accept_arg1, $ac_cv_func_accept_arg2, $ac_cv_func_acc
6565
AC_DEFINE_UNQUOTED(ACCEPT_TYPE_ARG3,$ac_cv_func_accept_arg3)
6666
])
6767
# Macros to detect C compiler features
68-
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.5 2000/08/27 19:00:00 petere Exp $
68+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
6969

7070

7171

@@ -154,7 +154,7 @@ undefine([AC_TYPE_NAME])dnl
154154
undefine([AC_CV_NAME])dnl
155155
])# PGAC_CHECK_ALIGNOF
156156
# Macros that test various C library quirks
157-
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.5 2000/08/27 19:00:00 petere Exp $
157+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
158158

159159

160160
# PGAC_VAR_INT_TIMEZONE
@@ -233,7 +233,7 @@ fi
233233
HAVE_POSIX_SIGNALS=$pgac_cv_func_posix_signals
234234
AC_SUBST(HAVE_POSIX_SIGNALS)])# PGAC_FUNC_POSIX_SIGNALS
235235
# Macros to detect certain C++ features
236-
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.5 2000/08/27 19:00:00 petere Exp $
236+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
237237

238238

239239
# PGAC_CLASS_STRING
@@ -299,10 +299,82 @@ AC_LANG_RESTORE])
299299
if test $pgac_cv_cxx_namespace_std = yes ; then
300300
AC_DEFINE(HAVE_NAMESPACE_STD, 1, [Define to 1 if the C++ compiler understands `using namespace std'])
301301
fi])# PGAC_CXX_NAMESPACE_STD
302+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
303+
304+
305+
# PGAC_PATH_FLEX
306+
# --------------
307+
# Look for Flex, set the output variable FLEX to its path if found.
308+
# Avoid the buggy version 2.5.3. Also find Flex if its installed
309+
# under `lex', but do not accept other Lex programs.
310+
311+
AC_DEFUN([PGAC_PATH_FLEX],
312+
[AC_CACHE_CHECK([for flex], pgac_cv_path_flex,
313+
[# Let the user override the test
314+
if test -n "$FLEX"; then
315+
pgac_cv_path_flex=$FLEX
316+
else
317+
pgac_save_IFS=$IFS
318+
IFS=:
319+
for pgac_dir in $PATH; do
320+
if test -z "$pgac_dir" || test x"$pgac_dir" = x"."; then
321+
pgac_dir=`pwd`
322+
fi
323+
for pgac_prog in flex lex; do
324+
pgac_candidate="$pgac_dir/$pgac_prog"
325+
if test -f "$pgac_candidate" \
326+
&& $pgac_candidate --version >/dev/null 2>&1
327+
then
328+
echo '%%' > conftest.l
329+
if $pgac_candidate -t conftest.l 2>/dev/null | grep FLEX_SCANNER >/dev/null 2>&1; then
330+
if $pgac_candidate --version | grep '2\.5\.3' >/dev/null 2>&1; then
331+
pgac_broken_flex=$pgac_candidate
332+
continue
333+
fi
334+
335+
pgac_cv_path_flex=$pgac_candidate
336+
break 2
337+
fi
338+
fi
339+
done
340+
done
341+
IFS=$pgac_save_IFS
342+
rm -f conftest.l
343+
: ${pgac_cv_path_flex=no}
344+
fi
345+
])[]dnl AC_CACHE_CHECK
346+
347+
if test x"$pgac_cv_path_flex" = x"no"; then
348+
if test -n "$pgac_broken_flex"; then
349+
AC_MSG_WARN([
350+
***
351+
The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
352+
should get version 2.5.4 or later.
353+
###])
354+
fi
355+
356+
AC_MSG_WARN([
357+
***
358+
Without Flex you won't be able to build PostgreSQL from scratch, or change
359+
any of the scanner definition files. You can obtain Flex from a GNU mirror
360+
site. (If you are using the official distribution of PostgreSQL then you
361+
do not need to worry about this because the lexer files are pre-generated.)
362+
***])
363+
fi
364+
365+
if test x"$pgac_cv_path_flex" = x"no"; then
366+
FLEX=
367+
else
368+
FLEX=$pgac_cv_path_flex
369+
fi
370+
371+
AC_SUBST(FLEX)
372+
AC_SUBST(FLEXFLAGS)
373+
])# PGAC_PATH_FLEX
302374
#
303375
# Autoconf macros for configuring the build of Python extension modules
304376
#
305-
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.5 2000/08/27 19:00:00 petere Exp $
377+
# $Header: /cvsroot/pgsql/aclocal.m4,v 1.6 2000/08/28 11:53:12 petere Exp $
306378
#
307379

308380
# PGAC_PROG_PYTHON

0 commit comments

Comments
 (0)