Commit 26608036 authored by Peter Eisentraut's avatar Peter Eisentraut

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.)
parent 20edc4af
...@@ -5,16 +5,16 @@ ...@@ -5,16 +5,16 @@
# behavior when certain utility programs are missing. # behavior when certain utility programs are missing.
case $1 in case $1 in
flex) flex|bison)
# `missing flex <input> <output>' # `missing flex|bison <input> <output>'
input=$2 input=$2
output=$3 output=$3
if test -f "$output"; then if test -f "$output"; then
echo "\ 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. 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" echo "touch $output"
touch "$output" touch "$output"
...@@ -22,10 +22,10 @@ You can get flex from a GNU mirror site. ...@@ -22,10 +22,10 @@ You can get flex from a GNU mirror site.
else # ! test -f $output else # ! test -f $output
echo "\ echo "\
*** ***
ERROR: \`flex' is missing on your system. It is needed to create the ERROR: \`$1' is missing on your system. It is needed to create the
file \`$output'. You can either get flex from a GNU mirror site file \`$output'. You can either get $1 from a GNU mirror site
or download an official distribution of PostgreSQL, which contains or download an official distribution of PostgreSQL, which contains
pre-packaged flex output. pre-packaged $1 output.
***" ***"
exit 1 exit 1
fi fi
......
# $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 # PGAC_PATH_FLEX
...@@ -46,19 +46,16 @@ fi ...@@ -46,19 +46,16 @@ fi
if test x"$pgac_cv_path_flex" = x"no"; then if test x"$pgac_cv_path_flex" = x"no"; then
if test -n "$pgac_broken_flex"; then if test -n "$pgac_broken_flex"; then
AC_MSG_WARN([ AC_MSG_WARN([
*** *** The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You
The Flex version 2.5.3 you have at $pgac_broken_flex contains a bug. You *** should get version 2.5.4 or later.])
should get version 2.5.4 or later.
###])
fi fi
AC_MSG_WARN([ AC_MSG_WARN([
*** *** Without Flex you will not be able to build PostgreSQL from CVS or
Without Flex you won't be able to build PostgreSQL from scratch, or change *** change any of the scanner definition files. You can obtain Flex from
any of the scanner definition files. You can obtain Flex from a GNU mirror *** a GNU mirror site. (If you are using the official distribution of
site. (If you are using the official distribution of PostgreSQL then you *** PostgreSQL then you do not need to worry about this because the Flex
do not need to worry about this because the lexer files are pre-generated.) *** output is pre-generated.)])
***])
fi fi
if test x"$pgac_cv_path_flex" = x"no"; then if test x"$pgac_cv_path_flex" = x"no"; then
......
This diff is collapsed.
...@@ -641,8 +641,20 @@ AC_PROG_RANLIB ...@@ -641,8 +641,20 @@ AC_PROG_RANLIB
AC_CHECK_PROGS(LORDER, lorder) AC_CHECK_PROGS(LORDER, lorder)
AC_PATH_PROG(TAR, tar) AC_PATH_PROG(TAR, tar)
AC_CHECK_PROGS(PERL, perl) 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) AC_SUBST(YFLAGS)
if test "$with_tk" = yes; then if test "$with_tk" = yes; then
AC_PATH_PROG(WISH, wish) AC_PATH_PROG(WISH, wish)
test -z "$WISH" && AC_MSG_ERROR(['wish' is required for Tk support]) test -z "$WISH" && AC_MSG_ERROR(['wish' is required for Tk support])
......
# #
# $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 subdir = contrib/cube
...@@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib ...@@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib
cubeparse.c cubeparse.h: cubeparse.y cubeparse.c cubeparse.h: cubeparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p cube_yy $< $(YACC) -d $(YFLAGS) -p cube_yy $<
mv -f y.tab.c cubeparse.c mv -f y.tab.c cubeparse.c
mv -f y.tab.h cubeparse.h mv -f y.tab.h cubeparse.h
else
@$(missing) bison $< $@
endif
cubescan.c: cubescan.l cubescan.c: cubescan.l
ifdef FLEX ifdef FLEX
......
# #
# $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 subdir = contrib/seg
...@@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib ...@@ -25,9 +25,13 @@ include $(top_srcdir)/src/Makefile.shlib
segparse.c segparse.h: segparse.y segparse.c segparse.h: segparse.y
ifdef YACC
$(YACC) -d $(YFLAGS) -p seg_yy $< $(YACC) -d $(YFLAGS) -p seg_yy $<
mv -f y.tab.c segparse.c mv -f y.tab.c segparse.c
mv -f y.tab.h segparse.h mv -f y.tab.h segparse.h
else
@$(missing) bison $< $@
endif
segscan.c: segscan.l segscan.c: segscan.l
ifdef FLEX ifdef FLEX
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for the bootstrap module # 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 ...@@ -42,10 +42,14 @@ endef
$(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile $(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
ifdef YACC
$(YACC) -d $(YFLAGS) $< $(YACC) -d $(YFLAGS) $<
$(sed-magic) < y.tab.c > $(srcdir)/bootparse.c $(sed-magic) < y.tab.c > $(srcdir)/bootparse.c
$(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h $(sed-magic) < y.tab.h > $(srcdir)/bootstrap_tokens.h
rm -f y.tab.c y.tab.h rm -f y.tab.c y.tab.h
else
@$(missing) bison $< $@
endif
$(srcdir)/bootscanner.c: bootscanner.l Makefile $(srcdir)/bootscanner.c: bootscanner.l Makefile
ifdef FLEX ifdef FLEX
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for parser # 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) ...@@ -25,9 +25,13 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^ $(LD) $(LDREL) $(LDOUT) $@ $^
$(srcdir)/gram.c $(srcdir)/parse.h: gram.y $(srcdir)/gram.c $(srcdir)/parse.h: gram.y
ifdef YACC
$(YACC) -d $(YFLAGS) $< $(YACC) -d $(YFLAGS) $<
mv y.tab.c $(srcdir)/gram.c mv y.tab.c $(srcdir)/gram.c
mv y.tab.h $(srcdir)/parse.h mv y.tab.h $(srcdir)/parse.h
else
@$(missing) bison $< $@
endif
$(srcdir)/scan.c: scan.l $(srcdir)/scan.c: scan.l
ifdef FLEX ifdef FLEX
......
# $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 subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../.. top_builddir = ../../../..
...@@ -29,9 +29,13 @@ ecpg: $(OBJS) ...@@ -29,9 +29,13 @@ ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@ $(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
$(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y $(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
ifdef YACC
$(YACC) -d $(YFLAGS) $< $(YACC) -d $(YFLAGS) $<
mv y.tab.c $(srcdir)/preproc.c mv y.tab.c $(srcdir)/preproc.c
mv y.tab.h $(srcdir)/preproc.h mv y.tab.h $(srcdir)/preproc.h
else
@$(missing) bison $< $@
endif
$(srcdir)/pgc.c: pgc.l $(srcdir)/pgc.c: pgc.l
ifdef FLEX ifdef FLEX
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# #
# Makefile for the plpgsql shared object # 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 ...@@ -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). # they must be generated in the srcdir (as opposed to builddir).
$(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
ifdef YACC
$(YACC) -d $(YFLAGS) $< $(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.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 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 rm -f y.tab.c y.tab.h
else
@$(missing) bison $< $@
endif
$(srcdir)/pl_scan.c: scan.l $(srcdir)/pl_scan.c: scan.l
ifdef FLEX ifdef FLEX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment