Use #define/#ifdef instead of sed to fix include files, this should work on Windows too.
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
#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.
#
# 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 $
#
#-------------------------------------------------------------------------
-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 \
# 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
#
# 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;
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');