From d82e7c84fa01cef4e3e230a03abd3044dcb01c56 Mon Sep 17 00:00:00 2001 From: Michael Meskes Date: Wed, 21 May 2008 19:51:01 +0000 Subject: [PATCH] Link in keywords file instead of copying it. Use #define/#ifdef instead of sed to fix include files, this should work on Windows too. --- src/backend/parser/keywords.c | 7 +++++-- src/interfaces/ecpg/preproc/Makefile | 6 +++--- src/tools/msvc/Mkvcbuild.pm | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/backend/parser/keywords.c b/src/backend/parser/keywords.c index 46b306b98d..edb7659662 100644 --- a/src/backend/parser/keywords.c +++ b/src/backend/parser/keywords.c @@ -11,7 +11,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.196 2008/05/16 23:36:05 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.197 2008/05/21 19:51:01 meskes Exp $ * *------------------------------------------------------------------------- */ @@ -29,8 +29,11 @@ #define YYSTYPE int #include "parser/keywords.h" +#ifndef ECPG_COMPILE #include "parser/parse.h" - +#else +#include "preproc.h" +#endif /* * List of keyword (name, token-value, category) entries. diff --git a/src/interfaces/ecpg/preproc/Makefile b/src/interfaces/ecpg/preproc/Makefile index b719192158..6fb55dc8d8 100644 --- a/src/interfaces/ecpg/preproc/Makefile +++ b/src/interfaces/ecpg/preproc/Makefile @@ -4,7 +4,7 @@ # # Copyright (c) 1998-2008, PostgreSQL Global Development Group # -# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.134 2008/05/21 00:26:26 meskes Exp $ +# $PostgreSQL: pgsql/src/interfaces/ecpg/preproc/Makefile,v 1.135 2008/05/21 19:51:01 meskes Exp $ # #------------------------------------------------------------------------- @@ -22,7 +22,7 @@ override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \ -DMINOR_VERSION=$(MINOR_VERSION) -DPATCHLEVEL=$(PATCHLEVEL) \ $(CPPFLAGS) -override CFLAGS += $(PTHREAD_CFLAGS) +override CFLAGS += $(PTHREAD_CFLAGS) -DECPG_COMPILE OBJS= preproc.o type.o ecpg.o output.o parser.o \ keywords.o c_keywords.o ecpg_keywords.o ../ecpglib/typename.o descriptor.o variable.o \ @@ -59,7 +59,7 @@ ecpg_keywords.o c_keywords.o keywords.o preproc.o parser.o: preproc.h # instead of maintaining our own list, take the one from the backend # we cannot just link it in, but must copy and make some minor changes keywords.c: % : $(top_srcdir)/src/backend/parser/% - sed -e 's/#include "parser\/parse.h"/#include "preproc.h"/' $< > $@ + rm -f $@ && $(LN_S) $< . distprep: $(srcdir)/preproc.c $(srcdir)/preproc.h $(srcdir)/pgc.c diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm index f0271353ce..17023d7030 100644 --- a/src/tools/msvc/Mkvcbuild.pm +++ b/src/tools/msvc/Mkvcbuild.pm @@ -3,7 +3,7 @@ package Mkvcbuild; # # Package that generates build files for msvc build # -# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.30 2008/05/21 18:15:29 mha Exp $ +# $PostgreSQL: pgsql/src/tools/msvc/Mkvcbuild.pm,v 1.31 2008/05/21 19:51:01 meskes Exp $ # use Carp; use Win32; @@ -162,12 +162,12 @@ sub mkvcbuild my $ecpg = $solution->AddProject('ecpg','exe','interfaces','src\interfaces\ecpg\preproc'); $ecpg->AddIncludeDir('src\interfaces\ecpg\include'); $ecpg->AddIncludeDir('src\interfaces\libpq'); - $ecpg->AddIncludeDir('src\backend'); # needed for parse.h $ecpg->AddPrefixInclude('src\interfaces\ecpg\preproc'); $ecpg->AddFiles('src\interfaces\ecpg\preproc','pgc.l','preproc.y'); $ecpg->AddDefine('MAJOR_VERSION=4'); $ecpg->AddDefine('MINOR_VERSION=2'); $ecpg->AddDefine('PATCHLEVEL=1'); + $ecpg->AddDefine('ECPG_COMPILE'); $ecpg->AddReference($libpgport); my $pgregress_ecpg = $solution->AddProject('pg_regress_ecpg','exe','misc'); -- 2.40.0