Define the FRONTEND symbol in postgres_fe.h, which allows us to eliminate
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Sep 2007 19:53:44 +0000 (19:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 27 Sep 2007 19:53:44 +0000 (19:53 +0000)
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

15 files changed:
src/bin/initdb/Makefile
src/bin/pg_config/Makefile
src/bin/pg_controldata/Makefile
src/bin/pg_ctl/Makefile
src/bin/pg_dump/Makefile
src/bin/pg_resetxlog/Makefile
src/bin/psql/Makefile
src/bin/scripts/Makefile
src/include/postgres_fe.h
src/interfaces/ecpg/ecpglib/Makefile
src/interfaces/ecpg/include/Makefile
src/interfaces/ecpg/pgtypeslib/Makefile
src/tools/findoidjoins/Makefile
src/tools/fsync/Makefile
src/tools/msvc/Mkvcbuild.pm

index 22ce5d2fdf37673cede28accf1390442ffd2032a..6401a50e133cdb7d1d760256cfeaac1152042c50 100644 (file)
@@ -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)
 
index d7af3ded9570958e505b9a382808c630edb6468a..7a89a557b4bf3d59d75ea3c17bc0fcff2f48710c 100644 (file)
@@ -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)\""
index f7115c34fe016c85cbd0aeef02eb78834164e968..d61a1027b38b84ab2ad67b2c6a94f6a75cc7fbd1 100644 (file)
@@ -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
index 09e3633f9073c422ec7fe18996c7cf1285e9fd10..bbfe1b1454bb227ad0dd0a1f30a9e2a71bd21d35 100644 (file)
@@ -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)
 
index 28bd49a7c944c949872960c90655a78a27cb274c..c6f98ba9a9a8e0139e8818a505702cdba8074c61 100644 (file)
@@ -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 \
index c0bd75583730ced221c660257a6394431a89316d..1759ad834742f9978288a585bcf589b4da0619f0 100644 (file)
@@ -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
index 6fb374845f0d3ea33e513b6213a4a248bdbf3568..87af9d1c890048f469414b31409becda90438939 100644 (file)
@@ -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 \
index ff8d669a0d89d264bb927dbfc1cef9b5aa4c4339..56787254a3c31ed35bebf5e7d3c68b3af00ff389 100644 (file)
@@ -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)
 
index efcc8faaa751ac1b33603e283eb72ec66a653d30..3dc1ac8d7906369d8da6a3e75b6059ee49be6fb6 100644 (file)
 #ifndef POSTGRES_FE_H
 #define POSTGRES_FE_H
 
+#ifndef FRONTEND
+#define FRONTEND 1
+#endif
+
 #include "c.h"
 
 #endif   /* POSTGRES_FE_H */
index 498949518f02cb19a016708f851c90e63eeb0b76..a7582eafe0b5666eedaccb07ca086626c9a03776 100644 (file)
@@ -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)
 
index 2e587aac6b5e7d1e4b5cf07333fd43d24e3c5dcf..a77c5c7e23dc7a4fc80e0658f893ee323a2e7bba 100644 (file)
@@ -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
index 6a5d448d4b85b31f5fea4b42e683f89a5e0abf14..0f3f750bac573c715bab4e9c2780e28505dd247b 100644 (file)
@@ -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)
 
index 87e28a35059c27a9a320c79977a7d0694505c80d..14e3a8089d9f78616b3585a1d4717750036a4994 100644 (file)
@@ -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
 
index 23492dd538c5cb386885c14041f9a16af94b935e..b966b806ddbf06d6fd691434ee5528356ea09678 100644 (file)
@@ -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
 
index b7feea8f7309efdc23d68094beaa5c917cd3514f..e23e6b7e217ef347f8dc73f3aa25f435d10ba5e3 100644 (file)
@@ -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)
     {