Permalink
Browse files

Remove all traces that suggest that a non-Bison yacc might be support…

…ed, and

change build system to use only Bison.  Simplify build rules, make file names
uniform.  Don't build the token table header file where it is not needed.
  • Loading branch information...
petere committed Aug 29, 2008
1 parent 96e993f commit 62e0977105fc149f50fe9fbce387e325775b55ad
View
@@ -1,43 +1,41 @@
# $PostgreSQL$
-# PGAC_PATH_YACC
-# --------------
-# Look for Bison, set the output variable YACC to its path if found.
+# PGAC_PATH_BISON
+# ---------------
+# Look for Bison, set the output variable BISON to its path if found.
# Reject versions before 1.875 (they have bugs or capacity limits).
# Note we do not accept other implementations of yacc.
-AC_DEFUN([PGAC_PATH_YACC],
+AC_DEFUN([PGAC_PATH_BISON],
[# Let the user override the search
-if test -z "$YACC"; then
- AC_CHECK_PROGS(YACC, ['bison -y'])
+if test -z "$BISON"; then
+ AC_CHECK_PROGS(BISON, bison)
fi
-if test "$YACC"; then
- pgac_yacc_version=`$YACC --version 2>/dev/null | sed q`
- AC_MSG_NOTICE([using $pgac_yacc_version])
- if echo "$pgac_yacc_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
+if test "$BISON"; then
+ pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
+ AC_MSG_NOTICE([using $pgac_bison_version])
+ if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
then
AC_MSG_WARN([
*** The installed version of Bison is too old to use with PostgreSQL.
*** Bison version 1.875 or later is required.])
- YACC=""
+ BISON=""
fi
fi
-if test -z "$YACC"; then
+if test -z "$BISON"; then
AC_MSG_WARN([
*** Without Bison you will not be able to build PostgreSQL from CVS nor
*** 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'.])
+*** output is pre-generated.)])
fi
-# We don't need AC_SUBST(YACC) because AC_PATH_PROG did it
-AC_SUBST(YFLAGS)
-])# PGAC_PATH_YACC
+# We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
+AC_SUBST(BISONFLAGS)
+])# PGAC_PATH_BISON
View
@@ -718,8 +718,8 @@ STRIP_SHARED_LIB
TAR
LN_S
AWK
-YACC
-YFLAGS
+BISON
+BISONFLAGS
FLEX
FLEXFLAGS
PERL
@@ -5952,18 +5952,18 @@ done
# Let the user override the search
-if test -z "$YACC"; then
- for ac_prog in 'bison -y'
+if test -z "$BISON"; then
+ for ac_prog in bison
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
-if test "${ac_cv_prog_YACC+set}" = set; then
+if test "${ac_cv_prog_BISON+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$YACC"; then
- ac_cv_prog_YACC="$YACC" # Let the user override the test.
+ if test -n "$BISON"; then
+ ac_cv_prog_BISON="$BISON" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
@@ -5972,7 +5972,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
- ac_cv_prog_YACC="$ac_prog"
+ ac_cv_prog_BISON="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -5982,56 +5982,52 @@ IFS=$as_save_IFS
fi
fi
-YACC=$ac_cv_prog_YACC
-if test -n "$YACC"; then
- { echo "$as_me:$LINENO: result: $YACC" >&5
-echo "${ECHO_T}$YACC" >&6; }
+BISON=$ac_cv_prog_BISON
+if test -n "$BISON"; then
+ { echo "$as_me:$LINENO: result: $BISON" >&5
+echo "${ECHO_T}$BISON" >&6; }
else
{ echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6; }
fi
- test -n "$YACC" && break
+ test -n "$BISON" && break
done
fi
-if test "$YACC"; then
- pgac_yacc_version=`$YACC --version 2>/dev/null | sed q`
- { echo "$as_me:$LINENO: using $pgac_yacc_version" >&5
-echo "$as_me: using $pgac_yacc_version" >&6;}
- if echo "$pgac_yacc_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
+if test "$BISON"; then
+ pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
+ { echo "$as_me:$LINENO: using $pgac_bison_version" >&5
+echo "$as_me: using $pgac_bison_version" >&6;}
+ if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
then
{ echo "$as_me:$LINENO: WARNING:
*** The installed version of Bison is too old to use with PostgreSQL.
*** Bison version 1.875 or later is required." >&5
echo "$as_me: WARNING:
*** The installed version of Bison is too old to use with PostgreSQL.
*** Bison version 1.875 or later is required." >&2;}
- YACC=""
+ BISON=""
fi
fi
-if test -z "$YACC"; then
+if test -z "$BISON"; then
{ echo "$as_me:$LINENO: WARNING:
*** Without Bison you will not be able to build PostgreSQL from CVS nor
*** 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'." >&5
+*** output is pre-generated.)" >&5
echo "$as_me: WARNING:
*** Without Bison you will not be able to build PostgreSQL from CVS nor
*** 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'." >&2;}
+*** output is pre-generated.)" >&2;}
fi
-# We don't need AC_SUBST(YACC) because AC_PATH_PROG did it
+# We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
{ echo "$as_me:$LINENO: checking for flex" >&5
@@ -26600,8 +26596,8 @@ for ac_last_try in false false false false false :; do
TAR!$TAR$ac_delim
LN_S!$LN_S$ac_delim
AWK!$AWK$ac_delim
-YACC!$YACC$ac_delim
-YFLAGS!$YFLAGS$ac_delim
+BISON!$BISON$ac_delim
+BISONFLAGS!$BISONFLAGS$ac_delim
FLEX!$FLEX$ac_delim
FLEXFLAGS!$FLEXFLAGS$ac_delim
PERL!$PERL$ac_delim
View
@@ -783,7 +783,7 @@ AC_PATH_PROG(TAR, tar)
AC_PROG_LN_S
AC_PROG_AWK
-PGAC_PATH_YACC
+PGAC_PATH_BISON
PGAC_PATH_FLEX
PGAC_PATH_PERL
View
@@ -1,3 +1,2 @@
cubeparse.c
-cubeparse.h
cubescan.c
View
@@ -26,15 +26,9 @@ endif
# cubescan is compiled as part of cubeparse
cubeparse.o: $(srcdir)/cubescan.c
-# See notes in src/backend/parser/Makefile about the following two rules
-
-$(srcdir)/cubeparse.c: $(srcdir)/cubeparse.h ;
-
-$(srcdir)/cubeparse.h: cubeparse.y
-ifdef YACC
- $(YACC) -d $(YFLAGS) $<
- mv -f y.tab.c $(srcdir)/cubeparse.c
- mv -f y.tab.h $(srcdir)/cubeparse.h
+$(srcdir)/cubeparse.c: cubeparse.y
+ifdef BISON
+ $(BISON) $(BISONFLAGS) -o $@ $<
else
@$(missing) bison $< $@
endif
@@ -46,7 +40,7 @@ else
@$(missing) flex $< $@
endif
-distprep: $(srcdir)/cubeparse.c $(srcdir)/cubeparse.h $(srcdir)/cubescan.c
+distprep: $(srcdir)/cubeparse.c $(srcdir)/cubescan.c
maintainer-clean:
- rm -f $(srcdir)/cubeparse.c $(srcdir)/cubeparse.h $(srcdir)/cubescan.c
+ rm -f $(srcdir)/cubeparse.c $(srcdir)/cubescan.c
View
@@ -1,3 +1,2 @@
segparse.c
-segparse.h
segscan.c
View
@@ -23,15 +23,9 @@ endif
# segscan is compiled as part of segparse
segparse.o: $(srcdir)/segscan.c
-# See notes in src/backend/parser/Makefile about the following two rules
-
-$(srcdir)/segparse.c: $(srcdir)/segparse.h ;
-
-$(srcdir)/segparse.h: segparse.y
-ifdef YACC
- $(YACC) -d $(YFLAGS) $<
- mv -f y.tab.c $(srcdir)/segparse.c
- mv -f y.tab.h $(srcdir)/segparse.h
+$(srcdir)/segparse.c: segparse.y
+ifdef BISON
+ $(BISON) $(BISONFLAGS) -o $@ $<
else
@$(missing) bison $< $@
endif
@@ -43,7 +37,7 @@ else
@$(missing) flex $< $@
endif
-distprep: $(srcdir)/segparse.c $(srcdir)/segparse.h $(srcdir)/segscan.c
+distprep: $(srcdir)/segparse.c $(srcdir)/segscan.c
maintainer-clean:
- rm -f $(srcdir)/segparse.c $(srcdir)/segparse.h $(srcdir)/segscan.c
+ rm -f $(srcdir)/segparse.c $(srcdir)/segscan.c
@@ -276,6 +276,9 @@ su - postgres
<indexterm>
<primary>flex</primary>
</indexterm>
+ <indexterm>
+ <primary>lex</primary>
+ </indexterm>
<indexterm>
<primary>bison</primary>
</indexterm>
@@ -287,10 +290,8 @@ su - postgres
are needed to build a CVS checkout or if you changed the actual
scanner and parser definition files. If you need them, be sure
to get <application>Flex</> 2.5.4 or later and
- <application>Bison</> 1.875 or later. Other <application>yacc</>
- programs can sometimes be used, but doing so requires extra
- effort and is not recommended. Other <application>lex</>
- programs will definitely not work.
+ <application>Bison</> 1.875 or later. Other <application>lex</>
+ and <application>yacc</> programs cannot be used.
</para>
</listitem>
</itemizedlist>
@@ -1341,6 +1342,15 @@ su - postgres
this manner:
<variablelist>
+ <varlistentry>
+ <term><envar>BISON</envar></term>
+ <listitem>
+ <para>
+ Bison program
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><envar>CC</envar></term>
<listitem>
@@ -1395,6 +1405,15 @@ su - postgres
</listitem>
</varlistentry>
+ <varlistentry>
+ <term><envar>FLEX</envar></term>
+ <listitem>
+ <para>
+ Flex program
+ </para>
+ </listitem>
+ </varlistentry>
+
<varlistentry>
<term><envar>LDFLAGS</envar></term>
<listitem>
@@ -1462,15 +1481,6 @@ su - postgres
</para>
</listitem>
</varlistentry>
-
- <varlistentry>
- <term><envar>YACC</envar></term>
- <listitem>
- <para>
- Yacc program (<literal>bison -y</literal> if using Bison)
- </para>
- </listitem>
- </varlistentry>
</variablelist>
</para>
</step>
View
@@ -216,8 +216,8 @@ CFLAGS = @CFLAGS@
# Kind-of compilers
-YACC = @YACC@
-YFLAGS = @YFLAGS@
+BISON = @BISON@
+BISONFLAGS = @BISONFLAGS@ $(YFLAGS)
FLEX = @FLEX@
FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
DTRACE = @DTRACE@
Oops, something went wrong.

0 comments on commit 62e0977

Please sign in to comment.