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

Commit cab9437

Browse files
committed
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.
1 parent 1e970dc commit cab9437

File tree

17 files changed

+70
-29
lines changed

17 files changed

+70
-29
lines changed

contrib/cube/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1-
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $
1+
# $Header: /cvsroot/pgsql/contrib/cube/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
22

33
subdir = contrib/cube
44
top_builddir = ../..
55
include $(top_builddir)/src/Makefile.global
66

77
MODULE_big = cube
8-
OBJS= cube.o cubeparse.o cubescan.o buffer.o
8+
OBJS= cube.o cubeparse.o buffer.o
99

1010
DATA_built = cube.sql
1111
DOCS = README.cube
1212
REGRESS = cube
1313

1414

15+
# cubescan is compiled as part of cubeparse
16+
cubeparse.o: cubescan.c
17+
1518
cubeparse.c: cubeparse.h ;
1619

1720
cubeparse.h: cubeparse.y

contrib/cube/cubeparse.y

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,4 @@ static NDBOX * write_point_as_box(char *str, int dim)
276276
return(bp);
277277
}
278278

279+
#include "cubescan.c"

contrib/seg/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.6 2001/11/16 16:32:33 petere Exp $
1+
# $Header: /cvsroot/pgsql/contrib/seg/Makefile,v 1.7 2002/11/01 22:52:33 tgl Exp $
22

33
subdir = contrib/seg
44
top_builddir = ../..
55
include $(top_builddir)/src/Makefile.global
66

77
MODULE_big = seg
8-
OBJS = seg.o segparse.o segscan.o buffer.o
8+
OBJS = seg.o segparse.o buffer.o
99
DATA_built = seg.sql
1010
DOCS = README.seg
1111
REGRESS = seg
1212

1313

14+
# segscan is compiled as part of segparse
15+
segparse.o: segscan.c
16+
1417
segparse.c: segparse.h ;
1518

1619
segparse.h: segparse.y

contrib/seg/segparse.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,4 @@ int seg_yyerror ( char *msg ) {
179179
return 0;
180180
}
181181

182-
182+
#include "segscan.c"

contrib/tsearch/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.1 2001/10/12 23:19:09 tgl Exp $
1+
# $Header: /cvsroot/pgsql/contrib/tsearch/Attic/Makefile,v 1.2 2002/11/01 22:52:33 tgl Exp $
22

33
subdir = contrib/tsearch
44
top_builddir = ../..
55
include $(top_builddir)/src/Makefile.global
66

77
MODULE_big = tsearch
8-
OBJS = parser.o crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
8+
OBJS = crc32.o morph.o txtidx.o query.o gistidx.o rewrite.o
99

1010
DATA_built = tsearch.sql
1111
DOCS = README.tsearch
1212
REGRESS = tsearch
1313

14+
# parser is compiled as part of query
15+
query.o: parser.c
16+
1417
parser.c: parser.l
1518
ifdef FLEX
1619
$(FLEX) $(FLEXFLAGS) -8 -Ptsearch_yy -o'$@' $<

contrib/tsearch/query.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,3 +805,5 @@ querytree(PG_FUNCTION_ARGS)
805805

806806
PG_RETURN_POINTER(res);
807807
}
808+
809+
#include "parser.c"

src/backend/bootstrap/Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the bootstrap module
44
#
5-
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.30 2002/01/09 00:06:42 tgl Exp $
5+
# $Header: /cvsroot/pgsql/src/backend/bootstrap/Makefile,v 1.31 2002/11/01 22:52:33 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -14,9 +14,9 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
1414

1515
# qnx4's wlink currently crashes with bootstrap.o
1616
ifneq ($(PORTNAME), qnx4)
17-
OBJS= bootparse.o bootscanner.o bootstrap.o
17+
OBJS= bootparse.o bootstrap.o
1818
else
19-
OBJS= bootparse.o bootscanner.o
19+
OBJS= bootparse.o
2020
endif
2121

2222

@@ -27,8 +27,10 @@ SUBSYS.o: $(OBJS)
2727
$(LD) $(LDREL) $(LDOUT) $@ $^
2828

2929

30-
bootstrap.o bootscanner.o: $(srcdir)/bootstrap_tokens.h
30+
bootstrap.o bootparse.o: $(srcdir)/bootstrap_tokens.h
3131

32+
# bootscanner is compiled as part of bootparse
33+
bootparse.o: $(srcdir)/bootscanner.c
3234

3335
# `sed' rules to remove conflicts between bootstrap scanner and parser
3436
# and the SQL scanner and parser. For correctness' sake the rules that

src/backend/bootstrap/bootparse.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.52 2002/09/02 01:05:03 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootparse.y,v 1.53 2002/11/01 22:52:33 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -335,3 +335,5 @@ boot_ident :
335335
ID { $$=yylval.ival; }
336336
;
337337
%%
338+
339+
#include "bootscanner.c"

src/backend/bootstrap/bootscanner.l

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
%{
22
/*-------------------------------------------------------------------------
33
*
4-
* bootscanner.lex
4+
* bootscanner.l
55
* a lexical scanner for the bootstrap parser
66
*
77
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
*
1111
* IDENTIFICATION
12-
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.25 2002/07/30 16:33:08 tgl Exp $
12+
* $Header: /cvsroot/pgsql/src/backend/bootstrap/bootscanner.l,v 1.26 2002/11/01 22:52:33 tgl Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/

src/backend/parser/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,19 @@
22
#
33
# Makefile for parser
44
#
5-
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.37 2002/04/20 21:56:14 petere Exp $
5+
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.38 2002/11/01 22:52:33 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

99
subdir = src/backend/parser
1010
top_builddir = ../../..
1111
include $(top_builddir)/src/Makefile.global
1212

13+
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
14+
1315
OBJS= analyze.o gram.o keywords.o parser.o parse_agg.o parse_clause.o \
1416
parse_expr.o parse_func.o parse_node.o parse_oper.o parse_relation.o \
15-
parse_type.o parse_coerce.o parse_target.o scan.o scansup.o
17+
parse_type.o parse_coerce.o parse_target.o scansup.o
1618

1719
FLEXFLAGS = -CF
1820

@@ -23,6 +25,10 @@ SUBSYS.o: $(OBJS)
2325
$(LD) $(LDREL) $(LDOUT) $@ $^
2426

2527

28+
# scan is compiled as part of gram
29+
gram.o: $(srcdir)/scan.c
30+
31+
2632
# There is no correct way to write a rule that generates two files.
2733
# Rules with two targets don't have that meaning, they are merely
2834
# shorthand for two otherwise separate rules. To be safe for parallel
@@ -52,7 +58,7 @@ endif
5258

5359
# Force these dependencies to be known even without dependency info built:
5460

55-
keywords.o parse_clause.o parse_expr.o parser.o scan.o: $(srcdir)/parse.h
61+
keywords.o parse_clause.o parse_expr.o parser.o gram.o: $(srcdir)/parse.h
5662

5763

5864
# gram.c, parse.h, and scan.c are in the distribution tarball, so they

src/backend/parser/gram.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.371 2002/10/31 02:31:00 momjian Exp $
14+
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.372 2002/11/01 22:52:33 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -7777,3 +7777,5 @@ doNegateFloat(Value *v)
77777777
v->val.str = newval;
77787778
}
77797779
}
7780+
7781+
#include "scan.c"

src/backend/utils/misc/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.19 2000/10/20 21:03:55 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/backend/utils/misc/Makefile,v 1.20 2002/11/01 22:52:33 tgl Exp $
22

33
subdir = src/backend/utils/misc
44
top_builddir = ../../../..
55
include $(top_builddir)/src/Makefile.global
66

7-
OBJS = database.o superuser.o guc.o guc-file.o ps_status.o
7+
override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
8+
9+
OBJS = database.o superuser.o guc.o ps_status.o
810

911
# This location might depend on the installation directories. Therefore
1012
# we can't subsitute it into config.h.
@@ -18,6 +20,9 @@ all: SUBSYS.o
1820
SUBSYS.o: $(OBJS)
1921
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
2022

23+
# guc-file is compiled as part of guc
24+
guc.o: $(srcdir)/guc-file.c
25+
2126
$(srcdir)/guc-file.c: guc-file.l
2227
ifdef FLEX
2328
$(FLEX) $(FLEXFLAGS) $<

src/backend/utils/misc/guc.c

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

src/interfaces/ecpg/preproc/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.87 2002/10/21 18:05:24 petere Exp $
1+
# $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.88 2002/11/01 22:52:33 tgl Exp $
22

33
subdir = src/interfaces/ecpg/preproc
44
top_builddir = ../../../..
@@ -17,7 +17,7 @@ ifeq ($(GCC), yes)
1717
override CFLAGS += -Wno-error
1818
endif
1919

20-
OBJS=preproc.o pgc.o type.o ecpg.o ecpg_keywords.o output.o\
20+
OBJS=preproc.o type.o ecpg.o ecpg_keywords.o output.o\
2121
keywords.o c_keywords.o ../lib/typename.o descriptor.o variable.o
2222

2323

@@ -26,6 +26,9 @@ all: submake-libpgport ecpg
2626
ecpg: $(OBJS)
2727
$(CC) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) -o $@
2828

29+
# pgc is compiled as part of preproc
30+
preproc.o: $(srcdir)/pgc.c
31+
2932
$(srcdir)/preproc.c: $(srcdir)/preproc.h ;
3033

3134
$(srcdir)/preproc.h: preproc.y
@@ -44,7 +47,7 @@ else
4447
@$(missing) flex $< $@
4548
endif
4649

47-
c_keywords.o ecpg_keywords.o keywords.o pgc.o: preproc.h
50+
c_keywords.o ecpg_keywords.o keywords.o preproc.o: preproc.h
4851

4952

5053
distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c

src/interfaces/ecpg/preproc/preproc.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.199 2002/10/21 13:09:31 meskes Exp $ */
1+
/* $Header: /cvsroot/pgsql/src/interfaces/ecpg/preproc/Attic/preproc.y,v 1.200 2002/11/01 22:52:33 tgl Exp $ */
22

33
/* Copyright comment */
44
%{
@@ -5567,3 +5567,5 @@ void yyerror( char * error)
55675567
buf[sizeof(buf)-1]=0;
55685568
mmerror(PARSE_ERROR, ET_ERROR, buf);
55695569
}
5570+
5571+
#include "pgc.c"

src/pl/plpgsql/src/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# Makefile for the plpgsql shared object
44
#
5-
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.22 2002/09/05 18:28:46 petere Exp $
5+
# $Header: /cvsroot/pgsql/src/pl/plpgsql/src/Makefile,v 1.23 2002/11/01 22:52:34 tgl Exp $
66
#
77
#-------------------------------------------------------------------------
88

@@ -23,7 +23,7 @@ override CPPFLAGS := -I$(srcdir) $(CPPFLAGS)
2323
SHLIB_LINK = $(BE_DLLLIBS)
2424
rpath :=
2525

26-
OBJS = pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
26+
OBJS = pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o
2727

2828
ifneq ($(PORTNAME), qnx4)
2929
all: all-lib
@@ -59,7 +59,10 @@ installdirs:
5959
uninstall:
6060
rm -f $(DESTDIR)$(pkglibdir)/plpgsql$(DLSUFFIX)
6161

62-
pl_gram.o pl_scan.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
62+
pl_gram.o pl_handler.o pl_comp.o pl_exec.o pl_funcs.o: plpgsql.h $(srcdir)/pl.tab.h
63+
64+
# pl_scan is compiled as part of pl_gram
65+
pl_gram.o: $(srcdir)/pl_scan.c
6366

6467
# Note: Since the yacc and lex files are shipped in the distribution,
6568
# they must be generated in the srcdir (as opposed to builddir).

src/pl/plpgsql/src/gram.y

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* procedural language
55
*
66
* IDENTIFICATION
7-
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.38 2002/09/22 21:56:47 tgl Exp $
7+
* $Header: /cvsroot/pgsql/src/pl/plpgsql/src/gram.y,v 1.39 2002/11/01 22:52:34 tgl Exp $
88
*
99
* This software is copyrighted by Jan Wieck - Hamburg.
1010
*
@@ -1997,3 +1997,5 @@ check_assignable(PLpgSQL_datum *datum)
19971997
break;
19981998
}
19991999
}
2000+
2001+
#include "pl_scan.c"

0 commit comments

Comments
 (0)