Only look for bison as YACC; other yaccs need to be selected explicitly.

When no suitable YACC is configured, supply useful informational messages
to users.  (Same way flex has been handled for a while.)
This commit is contained in:
Peter Eisentraut 2001-02-10 22:31:42 +00:00
parent 20edc4afd2
commit 2660803697
10 changed files with 388 additions and 347 deletions

View File

@ -5,16 +5,16 @@
# behavior when certain utility programs are missing.
case $1 in
flex)
# `missing flex <input> <output>'
flex|bison)
# `missing flex|bison <input> <output>'
input=$2
output=$3
if test -f "$output"; then
echo "\
***
WARNING: \`flex' is missing on your system. You should only need it
WARNING: \`$1' is missing on your system. You should only need it
if you changed the file \`$input'; these changes will not take effect.
You can get flex from a GNU mirror site.
You can get $1 from a GNU mirror site.
***"
echo "touch $output"
touch "$output"
@ -22,10 +22,10 @@ You can get flex from a GNU mirror site.
else # ! test -f $output
echo "\
***
ERROR: \`flex' is missing on your system. It is needed to create the
file \`$output'. You can either get flex from a GNU mirror site
ERROR: \`$1' is missing on your system. It is needed to create the
file \`$output'. You can either get $1 from a GNU mirror site
or download an official distribution of PostgreSQL, which contains
pre-packaged flex output.
pre-packaged $1 output.
***"
exit 1
fi

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.3 2001/02/06 19:20:16 petere Exp $
# $Header: /cvsroot/pgsql/config/programs.m4,v 1.4 2001/02/10 22:31:42 petere Exp $
# PGAC_PATH_FLEX
@ -46,19 +46,16 @@ fi
if test x"$pgac_cv_path_flex" = x"no"; then
if test -n "$pgac_broken_flex"; then
AC_MSG_WARN([
***
The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
should get version 2.5.4 or later.
###])
*** The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
*** should get version 2.5.4 or later.])
fi
AC_MSG_WARN([
***
Without Flex you won't be able to build PostgreSQL from scratch, or change
any of the scanner definition files. You can obtain Flex from a GNU mirror
site. (If you are using the official distribution of PostgreSQL then you
do not need to worry about this because the lexer files are pre-generated.)
***])
*** Without Flex you will not be able to build PostgreSQL from CVS or
*** change any of the scanner definition files. You can obtain Flex from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Flex
*** output is pre-generated.)])
fi
if test x"$pgac_cv_path_flex" = x"no"; then

652
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -641,8 +641,20 @@ AC_PROG_RANLIB
AC_CHECK_PROGS(LORDER, lorder)
AC_PATH_PROG(TAR, tar)
AC_CHECK_PROGS(PERL, perl)
AC_PROG_YACC
AC_CHECK_PROGS(YACC, ['bison -y'])
if test -z "$YACC"; then
AC_MSG_WARN([
*** Without Bison you will not be able to build PostgreSQL from CVS or
*** change any of the parser definition files. You can obtain Bison from
*** a GNU mirror site. (If you are using the official distribution of
*** PostgreSQL then you do not need to worry about this because the Bison
*** output is pre-generated.) To use a different yacc program (possible,
*** but not recommended), set the environment variable YACC before running
*** 'configure'.])
fi
AC_SUBST(YFLAGS)
if test "$with_tk" = yes; then
AC_PATH_PROG(WISH, wish)
test -z "$WISH" && AC_MSG_ERROR(['wish' is required for Tk support])

View File

@ -1,5 +1,5 @@
#
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.1 2000/12/11 20:39:14 tgl Exp $
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.2 2001/02/10 22:31:42 petere Exp $
#
subdir = contrib/cube
@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib
cubeparse.c cubeparse.h: cubeparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p cube_yy $<
mv -f y.tab.c cubeparse.c
mv -f y.tab.h cubeparse.h
else
@$(missing) bison $< $@
endif
cubescan.c: cubescan.l
ifdef FLEX

View File

@ -1,5 +1,5 @@
#
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.1 2000/12/11 20:40:33 tgl Exp $
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.2 2001/02/10 22:31:42 petere Exp $
#
subdir = contrib/seg
@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib
segparse.c segparse.h: segparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p seg_yy $<
mv -f y.tab.c segparse.c
mv -f y.tab.h segparse.h
else
@$(missing) bison $< $@
endif
segscan.c: segscan.l
ifdef FLEX

View File

@ -2,7 +2,7 @@
#
# Makefile for the bootstrap module
#
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.26 2000/10/20 21:03:41 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.27 2001/02/10 22:31:42 petere Exp $
#
#-------------------------------------------------------------------------
@ -42,10 +42,14 @@ endef
$(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
ifdef YACC
$(YACC) -d $(YFLAGS) $<
$(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
$(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
rm -f y.tab.c y.tab.h
else
@$(missing) bison $< $@
endif
$(srcdir)/bootscanner.c: bootscanner.l Makefile
ifdef FLEX

View File

@ -2,7 +2,7 @@
#
# Makefile for parser
#
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.31 2000/10/20 21:03:44 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.32 2001/02/10 22:31:42 petere Exp $
#
#-------------------------------------------------------------------------
@ -25,9 +25,13 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
$(srcdir)/gram.c $(srcdir)/parse.h: gram.y
ifdef YACC
$(YACC) -d $(YFLAGS) $<
mv y.tab.c $(srcdir)/gram.c
mv y.tab.h $(srcdir)/parse.h
else
@$(missing) bison $< $@
endif
$(srcdir)/scan.c: scan.l
ifdef FLEX

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.72 2000/11/30 20:36:13 petere Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.73 2001/02/10 22:31:42 petere Exp $
subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../..
@ -29,9 +29,13 @@ ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
ifdef YACC
$(YACC) -d $(YFLAGS) $<
mv y.tab.c $(srcdir)/preproc.c
mv y.tab.h $(srcdir)/preproc.h
else
@$(missing) bison $< $@
endif
$(srcdir)/pgc.c: pgc.l
ifdef FLEX

View File

@ -2,7 +2,7 @@
#
# Makefile for the plpgsql shared object
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.10 2001/02/09 01:05:42 tgl Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.11 2001/02/10 22:31:42 petere Exp $
#
#-------------------------------------------------------------------------
@ -55,10 +55,14 @@ pl_parse.o: $(srcdir)/pl_gram.c $(srcdir)/pl_scan.c plpgsql.h
# they must be generated in the srcdir (as opposed to builddir).
$(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
ifdef YACC
$(YACC) -d $(YFLAGS) $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.c > $(srcdir)/pl_gram.c
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < y.tab.h > $(srcdir)/pl.tab.h
rm -f y.tab.c y.tab.h
else
@$(missing) bison $< $@
endif
$(srcdir)/pl_scan.c: scan.l
ifdef FLEX