summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2007-09-27 19:53:44 +0000
committerTom Lane2007-09-27 19:53:44 +0000
commit1ee4d409bc85f1cb519512fd935a6349d9a976b6 (patch)
tree7a4d17d15477a84b2210fb73cbbc426bb2d50b9c
parent5faf7ea3c5ae6d486051e12399087211b90c6f8a (diff)
Define the FRONTEND symbol in postgres_fe.h, which allows us to eliminate
duplicative -DFRONTEND flags from many Makefiles. We still need Makefile control of the symbol in a few places that compile frontend-or-backend src/port/ files, but it's a lot cleaner than before. Hiroshi Saito
-rw-r--r--src/bin/initdb/Makefile2
-rw-r--r--src/bin/pg_config/Makefile1
-rw-r--r--src/bin/pg_controldata/Makefile2
-rw-r--r--src/bin/pg_ctl/Makefile2
-rw-r--r--src/bin/pg_dump/Makefile2
-rw-r--r--src/bin/pg_resetxlog/Makefile2
-rw-r--r--src/bin/psql/Makefile2
-rw-r--r--src/bin/scripts/Makefile2
-rw-r--r--src/include/postgres_fe.h4
-rw-r--r--src/interfaces/ecpg/ecpglib/Makefile3
-rw-r--r--src/interfaces/ecpg/include/Makefile3
-rw-r--r--src/interfaces/ecpg/pgtypeslib/Makefile3
-rw-r--r--src/tools/findoidjoins/Makefile2
-rw-r--r--src/tools/fsync/Makefile2
-rw-r--r--src/tools/msvc/Mkvcbuild.pm2
15 files changed, 14 insertions, 20 deletions
diff --git a/src/bin/initdb/Makefile b/src/bin/initdb/Makefile
index 22ce5d2fdf..6401a50e13 100644
--- a/src/bin/initdb/Makefile
+++ b/src/bin/initdb/Makefile
@@ -14,7 +14,7 @@ subdir = src/bin/initdb
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= initdb.o $(WIN32RES)
diff --git a/src/bin/pg_config/Makefile b/src/bin/pg_config/Makefile
index d7af3ded95..7a89a557b4 100644
--- a/src/bin/pg_config/Makefile
+++ b/src/bin/pg_config/Makefile
@@ -19,7 +19,6 @@ OBJS= pg_config.o $(WIN32RES)
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/port,$(LDFLAGS))
-override CPPFLAGS += -DFRONTEND
override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
override CPPFLAGS += -DVAL_CC="\"$(CC)\""
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""
diff --git a/src/bin/pg_controldata/Makefile b/src/bin/pg_controldata/Makefile
index f7115c34fe..d61a1027b3 100644
--- a/src/bin/pg_controldata/Makefile
+++ b/src/bin/pg_controldata/Makefile
@@ -13,8 +13,6 @@ subdir = src/bin/pg_controldata
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS += -DFRONTEND
-
OBJS= pg_controldata.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_controldata
diff --git a/src/bin/pg_ctl/Makefile b/src/bin/pg_ctl/Makefile
index 09e3633f90..bbfe1b1454 100644
--- a/src/bin/pg_ctl/Makefile
+++ b/src/bin/pg_ctl/Makefile
@@ -14,7 +14,7 @@ subdir = src/bin/pg_ctl
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pg_ctl.o $(WIN32RES)
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index 28bd49a7c9..c6f98ba9a9 100644
--- a/src/bin/pg_dump/Makefile
+++ b/src/bin/pg_dump/Makefile
@@ -14,7 +14,7 @@ subdir = src/bin/pg_dump
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
pg_backup_files.o pg_backup_null.o pg_backup_tar.o \
diff --git a/src/bin/pg_resetxlog/Makefile b/src/bin/pg_resetxlog/Makefile
index c0bd755837..1759ad8347 100644
--- a/src/bin/pg_resetxlog/Makefile
+++ b/src/bin/pg_resetxlog/Makefile
@@ -13,8 +13,6 @@ subdir = src/bin/pg_resetxlog
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS += -DFRONTEND
-
OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES)
all: submake-libpgport pg_resetxlog
diff --git a/src/bin/psql/Makefile b/src/bin/psql/Makefile
index 6fb374845f..87af9d1c89 100644
--- a/src/bin/psql/Makefile
+++ b/src/bin/psql/Makefile
@@ -17,7 +17,7 @@ include $(top_builddir)/src/Makefile.global
REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
-override CPPFLAGS := -DFRONTEND -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
+override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
startup.o prompt.o variables.o large_obj.o print.o describe.o \
diff --git a/src/bin/scripts/Makefile b/src/bin/scripts/Makefile
index ff8d669a0d..56787254a3 100644
--- a/src/bin/scripts/Makefile
+++ b/src/bin/scripts/Makefile
@@ -16,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb reindexdb
-override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
all: submake-libpq submake-backend $(PROGRAMS)
diff --git a/src/include/postgres_fe.h b/src/include/postgres_fe.h
index efcc8faaa7..3dc1ac8d79 100644
--- a/src/include/postgres_fe.h
+++ b/src/include/postgres_fe.h
@@ -18,6 +18,10 @@
#ifndef POSTGRES_FE_H
#define POSTGRES_FE_H
+#ifndef FRONTEND
+#define FRONTEND 1
+#endif
+
#include "c.h"
#endif /* POSTGRES_FE_H */
diff --git a/src/interfaces/ecpg/ecpglib/Makefile b/src/interfaces/ecpg/ecpglib/Makefile
index 498949518f..a7582eafe0 100644
--- a/src/interfaces/ecpg/ecpglib/Makefile
+++ b/src/interfaces/ecpg/ecpglib/Makefile
@@ -17,8 +17,7 @@ SO_MAJOR_VERSION= 6
SO_MINOR_VERSION= 0
DLTYPE= library
-override CPPFLAGS := -DFRONTEND \
- -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
+override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/src/interfaces/ecpg/include/Makefile b/src/interfaces/ecpg/include/Makefile
index 2e587aac6b..a77c5c7e23 100644
--- a/src/interfaces/ecpg/include/Makefile
+++ b/src/interfaces/ecpg/include/Makefile
@@ -2,8 +2,7 @@ subdir = src/interfaces/ecpg/include
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND \
- -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
+override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
informix_esql_dir = $(pkgincludedir)/informix/esql
diff --git a/src/interfaces/ecpg/pgtypeslib/Makefile b/src/interfaces/ecpg/pgtypeslib/Makefile
index 6a5d448d4b..0f3f750bac 100644
--- a/src/interfaces/ecpg/pgtypeslib/Makefile
+++ b/src/interfaces/ecpg/pgtypeslib/Makefile
@@ -17,8 +17,7 @@ SO_MAJOR_VERSION= 2
SO_MINOR_VERSION= 3
DLTYPE= library
-override CPPFLAGS := -DFRONTEND \
- -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
+override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
-I$(top_srcdir)/src/include/utils -I$(libpq_srcdir) $(CPPFLAGS)
override CFLAGS += $(PTHREAD_CFLAGS)
diff --git a/src/tools/findoidjoins/Makefile b/src/tools/findoidjoins/Makefile
index 87e28a3505..14e3a8089d 100644
--- a/src/tools/findoidjoins/Makefile
+++ b/src/tools/findoidjoins/Makefile
@@ -12,7 +12,7 @@ subdir = src/tools/findoidjoins
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= findoidjoins.o
diff --git a/src/tools/fsync/Makefile b/src/tools/fsync/Makefile
index 23492dd538..b966b806dd 100644
--- a/src/tools/fsync/Makefile
+++ b/src/tools/fsync/Makefile
@@ -12,7 +12,7 @@ subdir = src/tools/fsync
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
-override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
+override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
OBJS= test_fsync.o
diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm
index b7feea8f73..e23e6b7e21 100644
--- a/src/tools/msvc/Mkvcbuild.pm
+++ b/src/tools/msvc/Mkvcbuild.pm
@@ -341,7 +341,6 @@ sub mkvcbuild
$pgregress->AddFile('src\test\regress\pg_regress_main.c');
$pgregress->AddIncludeDir('src\port');
$pgregress->AddDefine('HOST_TUPLE="i686-pc-win32vc"');
- $pgregress->AddDefine('FRONTEND');
$pgregress->AddReference($libpgport);
$solution->Save();
@@ -359,7 +358,6 @@ sub AddSimpleFrontend
my $p = $solution->AddProject($n,'exe','bin');
$p->AddDir('src\bin\\' . $n);
- $p->AddDefine('FRONTEND');
$p->AddReference($libpgport);
if ($uselibpq)
{