Arrange to compile flex output files as inclusions into other files

(usually bison output files), not as standalone files.  This hack
works around flex's insistence on including <stdio.h> before we are
able to include postgres.h; postgres.h will already be read before
the compiler starts to read the flex output file.  Needed for largefile
support on some platforms.
This commit is contained in:
Tom Lane 2002-11-01 22:52:34 +00:00
parent 1e970dcee8
commit cab9437a43
17 changed files with 70 additions and 29 deletions

View File

@ -1,17 +1,20 @@
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
subdir = contrib/cube
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
MODULE_big = cube
OBJS= cube.o cubeparse.o cubescan.o buffer.o
OBJS= cube.o cubeparse.o buffer.o
DATA_built = cube.sql
DOCS = README.cube
REGRESS = cube
# cubescan is compiled as part of cubeparse
cubeparse.o: cubescan.c
cubeparse.c: cubeparse.h ;
cubeparse.h: cubeparse.y

View File

@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim)
return(bp);
}
#include "cubescan.c"

View File

@ -1,16 +1,19 @@
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
subdir = contrib/seg
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
MODULE_big = seg
OBJS = seg.o segparse.o segscan.o buffer.o
OBJS = seg.o segparse.o buffer.o
DATA_built = seg.sql
DOCS = README.seg
REGRESS = seg
# segscan is compiled as part of segparse
segparse.o: segscan.c
segparse.c: segparse.h ;
segparse.h: segparse.y

View File

@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) {
return 0;
}
#include "segscan.c"

View File

@ -1,16 +1,19 @@
# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.1 2001/10/12 23:19:09 tgl Exp $
# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.2 2002/11/01 22:52:33 tgl Exp $
subdir = contrib/tsearch
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
MODULE_big = tsearch
OBJS = parser.o crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
DATA_built = tsearch.sql
DOCS = README.tsearch
REGRESS = tsearch
# parser is compiled as part of query
query.o: parser.c
parser.c: parser.l
ifdef FLEX
$(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $<

View File

@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS)
PG_RETURN_POINTER(res);
}
#include "parser.c"

View File

@ -2,7 +2,7 @@
#
# Makefile for the bootstrap module
#
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.30 2002/01/09 00:06:42 tgl Exp $
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.31 2002/11/01 22:52:33 tgl Exp $
#
#-------------------------------------------------------------------------
@ -14,9 +14,9 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
# qnx4's wlink currently crashes with bootstrap.o
ifneq ($(PORTNAME), qnx4)
OBJS= bootparse.o bootscanner.o bootstrap.o
OBJS= bootparse.o bootstrap.o
else
OBJS= bootparse.o bootscanner.o
OBJS= bootparse.o
endif
@ -27,8 +27,10 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
bootstrap.o bootscanner.o: $(srcdir)/bootstrap_tokens.h
bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
# bootscanner is compiled as part of bootparse
bootparse.o: $(srcdir)/bootscanner.c
# `sed' rules to remove conflicts between bootstrap scanner and parser
# and the SQL scanner and parser. For correctness' sake the rules that

View File

@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.52 2002/09/02 01:05:03 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.53 2002/11/01 22:52:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -335,3 +335,5 @@ boot_ident :
ID { $$=yylval.ival; }
;
%%
#include "bootscanner.c"

View File

@ -1,7 +1,7 @@
%{
/*-------------------------------------------------------------------------
*
* bootscanner.lex
* bootscanner.l
* a lexical scanner for the bootstrap parser
*
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.25 2002/07/30 16:33:08 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.26 2002/11/01 22:52:33 tgl Exp $
*
*-------------------------------------------------------------------------
*/

View File

@ -2,7 +2,7 @@
#
# Makefile for parser
#
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.37 2002/04/20 21:56:14 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.38 2002/11/01 22:52:33 tgl Exp $
#
#-------------------------------------------------------------------------
@ -10,9 +10,11 @@ subdir = src/backend/parser
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \
parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
parse_type.o parse_coerce.o parse_target.o scan.o scansup.o
parse_type.o parse_coerce.o parse_target.o scansup.o
FLEXFLAGS = -CF
@ -23,6 +25,10 @@ SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) $@ $^
# scan is compiled as part of gram
gram.o: $(srcdir)/scan.c
# There is no correct way to write a rule that generates two files.
# Rules with two targets don't have that meaning, they are merely
# shorthand for two otherwise separate rules. To be safe for parallel
@ -52,7 +58,7 @@ endif
# Force these dependencies to be known even without dependency info built:
keywords.o parse_clause.o parse_expr.o parser.o scan.o: $(srcdir)/parse.h
keywords.o parse_clause.o parse_expr.o parser.o gram.o: $(srcdir)/parse.h
# gram.c, parse.h, and scan.c are in the distribution tarball, so they

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.371 2002/10/31 02:31:00 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.372 2002/11/01 22:52:33 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -7777,3 +7777,5 @@ doNegateFloat(Value *v)
v->val.str = newval;
}
}
#include "scan.c"

View File

@ -1,10 +1,12 @@
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.19 2000/10/20 21:03:55 petere Exp $
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.20 2002/11/01 22:52:33 tgl Exp $
subdir = src/backend/utils/misc
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
OBJS = database.o superuser.o guc.o guc-file.o ps_status.o
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
OBJS = database.o superuser.o guc.o ps_status.o
# This location might depend on the installation directories. Therefore
# we can't subsitute it into config.h.
@ -18,6 +20,9 @@ all: SUBSYS.o
SUBSYS.o: $(OBJS)
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
# guc-file is compiled as part of guc
guc.o: $(srcdir)/guc-file.c
$(srcdir)/guc-file.c: guc-file.l
ifdef FLEX
$(FLEX) $(FLEXFLAGS) $<

View File

@ -5,7 +5,7 @@
* command, configuration file, and command line options.
* See src/backend/utils/misc/README for more information.
*
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.98 2002/10/31 21:34:17 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/misc/guc.c,v 1.99 2002/11/01 22:52:33 tgl Exp $
*
* Copyright 2000 by PostgreSQL Global Development Group
* Written by Peter Eisentraut <peter_e@gmx.net>.
@ -3014,3 +3014,5 @@ assign_msglvl(int *var, const char *newval, bool doit, bool interactive)
return NULL; /* fail */
return newval; /* OK */
}
#include "guc-file.c"

View File

@ -1,4 +1,4 @@
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.87 2002/10/21 18:05:24 petere Exp $
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.88 2002/11/01 22:52:33 tgl Exp $
subdir = src/interfaces/ecpg/preproc
top_builddir = ../../../..
@ -17,7 +17,7 @@ ifeq ($(GCC), yes)
override CFLAGS += -Wno-error
endif
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
@ -26,6 +26,9 @@ all: submake-libpgport ecpg
ecpg: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
# pgc is compiled as part of preproc
preproc.o: $(srcdir)/pgc.c
$(srcdir)/preproc.c: $(srcdir)/preproc.h ;
$(srcdir)/preproc.h: preproc.y
@ -44,7 +47,7 @@ else
@$(missing) flex $< $@
endif
c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h
c_keywords.o ecpg_keywords.o keywords.o preproc.o: preproc.h
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c

View File

@ -1,4 +1,4 @@
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.199 2002/10/21 13:09:31 meskes Exp $ */
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.200 2002/11/01 22:52:33 tgl Exp $ */
/* Copyright comment */
%{
@ -5567,3 +5567,5 @@ void yyerror( char * error)
buf[sizeof(buf)-1]=0;
mmerror(PARSE_ERROR, ET_ERROR, buf);
}
#include "pgc.c"

View File

@ -2,7 +2,7 @@
#
# Makefile for the plpgsql shared object
#
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.22 2002/09/05 18:28:46 petere Exp $
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.23 2002/11/01 22:52:34 tgl Exp $
#
#-------------------------------------------------------------------------
@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
SHLIB_LINK = $(BE_DLLLIBS)
rpath :=
OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
OBJS = pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
ifneq ($(PORTNAME), qnx4)
all: all-lib
@ -59,7 +59,10 @@ installdirs:
uninstall:
rm -f $(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX)
pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
# pl_scan is compiled as part of pl_gram
pl_gram.o: $(srcdir)/pl_scan.c
# Note: Since the yacc and lex files are shipped in the distribution,
# they must be generated in the srcdir (as opposed to builddir).

View File

@ -4,7 +4,7 @@
* procedural language
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.38 2002/09/22 21:56:47 tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.39 2002/11/01 22:52:34 tgl Exp $
*
* This software is copyrighted by Jan Wieck - Hamburg.
*
@ -1997,3 +1997,5 @@ check_assignable(PLpgSQL_datum *datum)
break;
}
}
#include "pl_scan.c"