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

Commit 7c31742

Browse files
committed
Remove all traces that suggest that a non-Bison yacc might be supported, 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.
1 parent a279462 commit 7c31742

28 files changed

+144
-185
lines changed

config/programs.m4

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,41 @@
1-
# $PostgreSQL: pgsql/config/programs.m4,v 1.23 2008/05/27 22:18:04 tgl Exp $
1+
# $PostgreSQL: pgsql/config/programs.m4,v 1.24 2008/08/29 13:02:32 petere Exp $
22

33

4-
# PGAC_PATH_YACC
5-
# --------------
6-
# Look for Bison, set the output variable YACC to its path if found.
4+
# PGAC_PATH_BISON
5+
# ---------------
6+
# Look for Bison, set the output variable BISON to its path if found.
77
# Reject versions before 1.875 (they have bugs or capacity limits).
88
# Note we do not accept other implementations of yacc.
99

10-
AC_DEFUN([PGAC_PATH_YACC],
10+
AC_DEFUN([PGAC_PATH_BISON],
1111
[# Let the user override the search
12-
if test -z "$YACC"; then
13-
AC_CHECK_PROGS(YACC, ['bison -y'])
12+
if test -z "$BISON"; then
13+
AC_CHECK_PROGS(BISON, bison)
1414
fi
1515
16-
if test "$YACC"; then
17-
pgac_yacc_version=`$YACC --version 2>/dev/null | sed q`
18-
AC_MSG_NOTICE([using $pgac_yacc_version])
19-
if echo "$pgac_yacc_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
16+
if test "$BISON"; then
17+
pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
18+
AC_MSG_NOTICE([using $pgac_bison_version])
19+
if echo "$pgac_bison_version" | $AWK '{ if ([$]4 < 1.875) exit 0; else exit 1;}'
2020
then
2121
AC_MSG_WARN([
2222
*** The installed version of Bison is too old to use with PostgreSQL.
2323
*** Bison version 1.875 or later is required.])
24-
YACC=""
24+
BISON=""
2525
fi
2626
fi
2727
28-
if test -z "$YACC"; then
28+
if test -z "$BISON"; then
2929
AC_MSG_WARN([
3030
*** Without Bison you will not be able to build PostgreSQL from CVS nor
3131
*** change any of the parser definition files. You can obtain Bison from
3232
*** a GNU mirror site. (If you are using the official distribution of
3333
*** PostgreSQL then you do not need to worry about this, because the Bison
34-
*** output is pre-generated.) To use a different yacc program (possible,
35-
*** but not recommended), set the environment variable YACC before running
36-
*** 'configure'.])
34+
*** output is pre-generated.)])
3735
fi
38-
# We don't need AC_SUBST(YACC) because AC_PATH_PROG did it
39-
AC_SUBST(YFLAGS)
40-
])# PGAC_PATH_YACC
36+
# We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
37+
AC_SUBST(BISONFLAGS)
38+
])# PGAC_PATH_BISON
4139

4240

4341

configure

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ STRIP_SHARED_LIB
718718
TAR
719719
LN_S
720720
AWK
721-
YACC
722-
YFLAGS
721+
BISON
722+
BISONFLAGS
723723
FLEX
724724
FLEXFLAGS
725725
PERL
@@ -5952,18 +5952,18 @@ done
59525952

59535953

59545954
# Let the user override the search
5955-
if test -z "$YACC"; then
5956-
for ac_prog in 'bison -y'
5955+
if test -z "$BISON"; then
5956+
for ac_prog in bison
59575957
do
59585958
# Extract the first word of "$ac_prog", so it can be a program name with args.
59595959
set dummy $ac_prog; ac_word=$2
59605960
{ echo "$as_me:$LINENO: checking for $ac_word" >&5
59615961
echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
5962-
if test "${ac_cv_prog_YACC+set}" = set; then
5962+
if test "${ac_cv_prog_BISON+set}" = set; then
59635963
echo $ECHO_N "(cached) $ECHO_C" >&6
59645964
else
5965-
if test -n "$YACC"; then
5966-
ac_cv_prog_YACC="$YACC" # Let the user override the test.
5965+
if test -n "$BISON"; then
5966+
ac_cv_prog_BISON="$BISON" # Let the user override the test.
59675967
else
59685968
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
59695969
for as_dir in $PATH
@@ -5972,7 +5972,7 @@ do
59725972
test -z "$as_dir" && as_dir=.
59735973
for ac_exec_ext in '' $ac_executable_extensions; do
59745974
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
5975-
ac_cv_prog_YACC="$ac_prog"
5975+
ac_cv_prog_BISON="$ac_prog"
59765976
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
59775977
break 2
59785978
fi
@@ -5982,56 +5982,52 @@ IFS=$as_save_IFS
59825982

59835983
fi
59845984
fi
5985-
YACC=$ac_cv_prog_YACC
5986-
if test -n "$YACC"; then
5987-
{ echo "$as_me:$LINENO: result: $YACC" >&5
5988-
echo "${ECHO_T}$YACC" >&6; }
5985+
BISON=$ac_cv_prog_BISON
5986+
if test -n "$BISON"; then
5987+
{ echo "$as_me:$LINENO: result: $BISON" >&5
5988+
echo "${ECHO_T}$BISON" >&6; }
59895989
else
59905990
{ echo "$as_me:$LINENO: result: no" >&5
59915991
echo "${ECHO_T}no" >&6; }
59925992
fi
59935993

59945994

5995-
test -n "$YACC" && break
5995+
test -n "$BISON" && break
59965996
done
59975997

59985998
fi
59995999

6000-
if test "$YACC"; then
6001-
pgac_yacc_version=`$YACC --version 2>/dev/null | sed q`
6002-
{ echo "$as_me:$LINENO: using $pgac_yacc_version" >&5
6003-
echo "$as_me: using $pgac_yacc_version" >&6;}
6004-
if echo "$pgac_yacc_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
6000+
if test "$BISON"; then
6001+
pgac_bison_version=`$BISON --version 2>/dev/null | sed q`
6002+
{ echo "$as_me:$LINENO: using $pgac_bison_version" >&5
6003+
echo "$as_me: using $pgac_bison_version" >&6;}
6004+
if echo "$pgac_bison_version" | $AWK '{ if ($4 < 1.875) exit 0; else exit 1;}'
60056005
then
60066006
{ echo "$as_me:$LINENO: WARNING:
60076007
*** The installed version of Bison is too old to use with PostgreSQL.
60086008
*** Bison version 1.875 or later is required." >&5
60096009
echo "$as_me: WARNING:
60106010
*** The installed version of Bison is too old to use with PostgreSQL.
60116011
*** Bison version 1.875 or later is required." >&2;}
6012-
YACC=""
6012+
BISON=""
60136013
fi
60146014
fi
60156015

6016-
if test -z "$YACC"; then
6016+
if test -z "$BISON"; then
60176017
{ echo "$as_me:$LINENO: WARNING:
60186018
*** Without Bison you will not be able to build PostgreSQL from CVS nor
60196019
*** change any of the parser definition files. You can obtain Bison from
60206020
*** a GNU mirror site. (If you are using the official distribution of
60216021
*** PostgreSQL then you do not need to worry about this, because the Bison
6022-
*** output is pre-generated.) To use a different yacc program (possible,
6023-
*** but not recommended), set the environment variable YACC before running
6024-
*** 'configure'." >&5
6022+
*** output is pre-generated.)" >&5
60256023
echo "$as_me: WARNING:
60266024
*** Without Bison you will not be able to build PostgreSQL from CVS nor
60276025
*** change any of the parser definition files. You can obtain Bison from
60286026
*** a GNU mirror site. (If you are using the official distribution of
60296027
*** PostgreSQL then you do not need to worry about this, because the Bison
6030-
*** output is pre-generated.) To use a different yacc program (possible,
6031-
*** but not recommended), set the environment variable YACC before running
6032-
*** 'configure'." >&2;}
6028+
*** output is pre-generated.)" >&2;}
60336029
fi
6034-
# We don't need AC_SUBST(YACC) because AC_PATH_PROG did it
6030+
# We don't need AC_SUBST(BISON) because AC_PATH_PROG did it
60356031

60366032

60376033
{ echo "$as_me:$LINENO: checking for flex" >&5
@@ -26600,8 +26596,8 @@ for ac_last_try in false false false false false :; do
2660026596
TAR!$TAR$ac_delim
2660126597
LN_S!$LN_S$ac_delim
2660226598
AWK!$AWK$ac_delim
26603-
YACC!$YACC$ac_delim
26604-
YFLAGS!$YFLAGS$ac_delim
26599+
BISON!$BISON$ac_delim
26600+
BISONFLAGS!$BISONFLAGS$ac_delim
2660526601
FLEX!$FLEX$ac_delim
2660626602
FLEXFLAGS!$FLEXFLAGS$ac_delim
2660726603
PERL!$PERL$ac_delim

configure.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.564 2008/08/19 19:17:40 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.565 2008/08/29 13:02:32 petere Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -783,7 +783,7 @@ AC_PATH_PROG(TAR, tar)
783783
AC_PROG_LN_S
784784
AC_PROG_AWK
785785

786-
PGAC_PATH_YACC
786+
PGAC_PATH_BISON
787787
PGAC_PATH_FLEX
788788

789789
PGAC_PATH_PERL

contrib/cube/.cvsignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
cubeparse.c
2-
cubeparse.h
32
cubescan.c

contrib/cube/Makefile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.21 2007/11/10 23:59:50 momjian Exp $
1+
# $PostgreSQL: pgsql/contrib/cube/Makefile,v 1.22 2008/08/29 13:02:32 petere Exp $
22

33
MODULE_big = cube
44
OBJS= cube.o cubeparse.o
@@ -26,15 +26,9 @@ endif
2626
# cubescan is compiled as part of cubeparse
2727
cubeparse.o: $(srcdir)/cubescan.c
2828

29-
# See notes in src/backend/parser/Makefile about the following two rules
30-
31-
$(srcdir)/cubeparse.c: $(srcdir)/cubeparse.h ;
32-
33-
$(srcdir)/cubeparse.h: cubeparse.y
34-
ifdef YACC
35-
$(YACC) -d $(YFLAGS) $<
36-
mv -f y.tab.c $(srcdir)/cubeparse.c
37-
mv -f y.tab.h $(srcdir)/cubeparse.h
29+
$(srcdir)/cubeparse.c: cubeparse.y
30+
ifdef BISON
31+
$(BISON) $(BISONFLAGS) -o $@ $<
3832
else
3933
@$(missing) bison $< $@
4034
endif
@@ -46,7 +40,7 @@ else
4640
@$(missing) flex $< $@
4741
endif
4842

49-
distprep: $(srcdir)/cubeparse.c $(srcdir)/cubeparse.h $(srcdir)/cubescan.c
43+
distprep: $(srcdir)/cubeparse.c $(srcdir)/cubescan.c
5044

5145
maintainer-clean:
52-
rm -f $(srcdir)/cubeparse.c $(srcdir)/cubeparse.h $(srcdir)/cubescan.c
46+
rm -f $(srcdir)/cubeparse.c $(srcdir)/cubescan.c

contrib/seg/.cvsignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
segparse.c
2-
segparse.h
32
segscan.c

contrib/seg/Makefile

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.20 2007/11/10 23:59:51 momjian Exp $
1+
# $PostgreSQL: pgsql/contrib/seg/Makefile,v 1.21 2008/08/29 13:02:32 petere Exp $
22

33
MODULE_big = seg
44
OBJS = seg.o segparse.o
@@ -23,15 +23,9 @@ endif
2323
# segscan is compiled as part of segparse
2424
segparse.o: $(srcdir)/segscan.c
2525

26-
# See notes in src/backend/parser/Makefile about the following two rules
27-
28-
$(srcdir)/segparse.c: $(srcdir)/segparse.h ;
29-
30-
$(srcdir)/segparse.h: segparse.y
31-
ifdef YACC
32-
$(YACC) -d $(YFLAGS) $<
33-
mv -f y.tab.c $(srcdir)/segparse.c
34-
mv -f y.tab.h $(srcdir)/segparse.h
26+
$(srcdir)/segparse.c: segparse.y
27+
ifdef BISON
28+
$(BISON) $(BISONFLAGS) -o $@ $<
3529
else
3630
@$(missing) bison $< $@
3731
endif
@@ -43,7 +37,7 @@ else
4337
@$(missing) flex $< $@
4438
endif
4539

46-
distprep: $(srcdir)/segparse.c $(srcdir)/segparse.h $(srcdir)/segscan.c
40+
distprep: $(srcdir)/segparse.c $(srcdir)/segscan.c
4741

4842
maintainer-clean:
49-
rm -f $(srcdir)/segparse.c $(srcdir)/segparse.h $(srcdir)/segscan.c
43+
rm -f $(srcdir)/segparse.c $(srcdir)/segscan.c

doc/src/sgml/installation.sgml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.311 2008/07/23 17:07:50 petere Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.312 2008/08/29 13:02:32 petere Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -276,6 +276,9 @@ su - postgres
276276
<indexterm>
277277
<primary>flex</primary>
278278
</indexterm>
279+
<indexterm>
280+
<primary>lex</primary>
281+
</indexterm>
279282
<indexterm>
280283
<primary>bison</primary>
281284
</indexterm>
@@ -287,10 +290,8 @@ su - postgres
287290
are needed to build a CVS checkout or if you changed the actual
288291
scanner and parser definition files. If you need them, be sure
289292
to get <application>Flex</> 2.5.4 or later and
290-
<application>Bison</> 1.875 or later. Other <application>yacc</>
291-
programs can sometimes be used, but doing so requires extra
292-
effort and is not recommended. Other <application>lex</>
293-
programs will definitely not work.
293+
<application>Bison</> 1.875 or later. Other <application>lex</>
294+
and <application>yacc</> programs cannot be used.
294295
</para>
295296
</listitem>
296297
</itemizedlist>
@@ -1341,6 +1342,15 @@ su - postgres
13411342
this manner:
13421343

13431344
<variablelist>
1345+
<varlistentry>
1346+
<term><envar>BISON</envar></term>
1347+
<listitem>
1348+
<para>
1349+
Bison program
1350+
</para>
1351+
</listitem>
1352+
</varlistentry>
1353+
13441354
<varlistentry>
13451355
<term><envar>CC</envar></term>
13461356
<listitem>
@@ -1395,6 +1405,15 @@ su - postgres
13951405
</listitem>
13961406
</varlistentry>
13971407

1408+
<varlistentry>
1409+
<term><envar>FLEX</envar></term>
1410+
<listitem>
1411+
<para>
1412+
Flex program
1413+
</para>
1414+
</listitem>
1415+
</varlistentry>
1416+
13981417
<varlistentry>
13991418
<term><envar>LDFLAGS</envar></term>
14001419
<listitem>
@@ -1462,15 +1481,6 @@ su - postgres
14621481
</para>
14631482
</listitem>
14641483
</varlistentry>
1465-
1466-
<varlistentry>
1467-
<term><envar>YACC</envar></term>
1468-
<listitem>
1469-
<para>
1470-
Yacc program (<literal>bison -y</literal> if using Bison)
1471-
</para>
1472-
</listitem>
1473-
</varlistentry>
14741484
</variablelist>
14751485
</para>
14761486
</step>

src/Makefile.global.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*-makefile-*-
2-
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.241 2008/02/17 16:36:43 petere Exp $
2+
# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.242 2008/08/29 13:02:32 petere Exp $
33

44
#------------------------------------------------------------------------------
55
# All PostgreSQL makefiles include this file and use the variables it sets,
@@ -216,8 +216,8 @@ CFLAGS = @CFLAGS@
216216

217217
# Kind-of compilers
218218

219-
YACC = @YACC@
220-
YFLAGS = @YFLAGS@
219+
BISON = @BISON@
220+
BISONFLAGS = @BISONFLAGS@ $(YFLAGS)
221221
FLEX = @FLEX@
222222
FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
223223
DTRACE = @DTRACE@

0 commit comments

Comments
 (0)