1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-14 08:21:07 +03:00

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.
This commit is contained in:
Peter Eisentraut
2000-08-28 11:53:23 +00:00
parent 4c8d2f7f7b
commit f03fc94e7d
11 changed files with 600 additions and 712 deletions

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.90 2000/07/22 01:48:53 petere Exp $
# $Header: /cvsroot/pgsql/src/Makefile.global.in,v 1.91 2000/08/28 11:53:14 petere Exp $
#
# NOTES
# Essentially all Postgres make files include this file and use the
@ -165,6 +165,7 @@ INSTALL_DATA = @INSTALL_DATA@
INSTALL_SHLIB = @INSTALL_SHLIB@
mkinstalldirs = @mkinstalldirs@
missing = $(top_srcdir)/config/missing
RANLIB= @RANLIB@
@ -175,7 +176,8 @@ CC= @CC@
CPP= @CPP@
YACC= @YACC@
YFLAGS = @YFLAGS@
LEX= @LEX@
FLEX = @FLEX@
FLEXFLAGS = @FLEXFLAGS@ $(LFLAGS)
AROPT= @AROPT@
CPPFLAGS = @CPPFLAGS@
CFLAGS = -I$(SRCDIR)/include $(CPPFLAGS) @CFLAGS@

View File

@ -2,7 +2,7 @@
#
# Makefile for the bootstrap module
#
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.24 2000/07/19 16:29:47 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.25 2000/08/28 11:53:17 petere Exp $
#
#-------------------------------------------------------------------------
@ -48,9 +48,13 @@ $(srcdir)/bootparse.c $(srcdir)/bootstrap_tokens.h: bootparse.y Makefile
rm -f y.tab.c y.tab.h
$(srcdir)/bootscanner.c: bootscanner.l Makefile
$(LEX) $(LFLAGS) $<
$(sed-magic) < lex.yy.c > $@
ifdef FLEX
$(FLEX) $(FLEXFLAGS) $<
$(sed-magic) lex.yy.c > $@
rm -f lex.yy.c
else
@$(missing) flex $< $@
endif
clean:
rm -f SUBSYS.o $(OBJS) bootstrap.o

View File

@ -2,7 +2,7 @@
#
# Makefile for parser
#
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.28 2000/07/19 16:29:50 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.29 2000/08/28 11:53:19 petere Exp $
#
#-------------------------------------------------------------------------
@ -30,8 +30,11 @@ $(srcdir)/gram.c $(srcdir)/parse.h: gram.y
mv y.tab.h $(srcdir)/parse.h
$(srcdir)/scan.c: scan.l
$(LEX) $(LFLAGS) $<
mv lex.yy.c $@
ifdef FLEX
$(FLEX) $(FLEXFLAGS) -o'$@' $<
else
@$(missing) flex $< $@
endif
analyze.o keywords.o parse_clause.o parse_expr.o scan.o: $(srcdir)/parse.h

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.17 2000/08/25 10:00:31 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.18 2000/08/28 11:53:20 petere Exp $
subdir = src/backend/utils/misc
top_builddir = ../../../..
@ -19,18 +19,19 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
guc-file.c: guc-file.l
$(LEX) $(LFLAGS) $<
sed -e 's/lex\.yy\.c/guc-file\.c/g' \
-e 's/^yy/GUC_yy/g' \
-e 's/\([^a-zA-Z0-9_]\)yy/\1GUC_yy/g' < lex.yy.c > $@
ifdef FLEX
$(FLEX) $(FLEXFLAGS) $<
sed -e 's/^yy/GUC_yy/g' -e 's/\([^a-zA-Z0-9_]\)yy/\1GUC_yy/g' lex.yy.c > $@
rm -f lex.yy.c
else
@$(missing) flex $< $@
endif
# Note: guc-file.c is not deleted by 'make clean',
# since we want to ship it in distribution tarballs.
clean:
rm -f SUBSYS.o $(OBJS) lex.yy.c
rm -f SUBSYS.o $(OBJS)
@rm -f lex.yy.c
depend dep:
$(CC) -MM $(CFLAGS) *.c >depend

View File

@ -32,8 +32,11 @@ $(srcdir)/preproc.c $(srcdir)/preproc.h: preproc.y
mv y.tab.h $(srcdir)/preproc.h
$(srcdir)/pgc.c: pgc.l
$(LEX) $(LFLAGS) $<
mv lex.yy.c $@
ifdef FLEX
$(FLEX) $(FLEXFLAGS) -o'$@' $<
else
@$(missing) flex $< $@
endif
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c
@ -49,7 +52,7 @@ uninstall:
clean distclean:
rm -f *.o ecpg$(X)
# garbage from partial builds
rm -f y.tab.c y.tab.h lex.yy.c
@rm -f y.tab.c y.tab.h
# garbage from development
@rm -f core a.out *~ *.output *.tab.c

View File

@ -2,7 +2,7 @@
#
# Makefile for the plpgsql shared object
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.5 2000/07/19 16:30:24 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.6 2000/08/28 11:53:23 petere Exp $
#
#-------------------------------------------------------------------------
@ -60,12 +60,14 @@ $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h: gram.y
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
# Assuming flex here for -i and -l options, since scan.l requires flex anyway.
$(srcdir)/pl_scan.c: scan.l
$(LEX) $(LFLAGS) -i -l $<
ifdef FLEX
$(FLEX) -i -l $(FLEXFLAGS) $<
sed -e 's/yy/plpgsql_yy/g' -e 's/YY/PLPGSQL_YY/g' < lex.yy.c > $@
rm -f lex.yy.c
else
@$(missing) flex $< $@
endif
distprep: $(srcdir)/pl_scan.c $(srcdir)/pl.tab.h $(srcdir)/pl_gram.c
@ -74,7 +76,8 @@ mklang.sql: mklang.sql.in
clean distclean: clean-lib
rm -f *.o y.tab.c y.tab.h lex.yy.c mklang.sql
rm -f $(OBJS) mklang.sql
@rm -f y.tab.c y.tab.h lex.yy.c
maintainer-clean: clean
rm -f $(srcdir)/pl_gram.c $(srcdir)/pl.tab.h $(srcdir)/pl_scan.c