Skip to content

Commit 314ed5d

Browse files
committed
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
1 parent 77c166b commit 314ed5d

File tree

15 files changed

+28
-34
lines changed

15 files changed

+28
-34
lines changed

src/bin/initdb/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.52 2007/01/05 22:19:47 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/initdb/Makefile,v 1.53 2007/09/27 19:53:43 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -14,7 +14,7 @@ subdir = src/bin/initdb
1414
top_builddir = ../../..
1515
include $(top_builddir)/src/Makefile.global
1616

17-
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
17+
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
1818

1919
OBJS= initdb.o $(WIN32RES)
2020

src/bin/pg_config/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2007, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.18 2007/01/05 22:19:48 momjian Exp $
7+
# $PostgreSQL: pgsql/src/bin/pg_config/Makefile,v 1.19 2007/09/27 19:53:43 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -19,7 +19,6 @@ OBJS= pg_config.o $(WIN32RES)
1919
STD_CPPFLAGS := $(filter-out -I$(top_srcdir)/src/include -I$(top_builddir)/src/include,$(CPPFLAGS))
2020
STD_LDFLAGS := $(filter-out -L$(top_builddir)/src/port,$(LDFLAGS))
2121

22-
override CPPFLAGS += -DFRONTEND
2322
override CPPFLAGS += -DVAL_CONFIGURE="\"$(configure_args)\""
2423
override CPPFLAGS += -DVAL_CC="\"$(CC)\""
2524
override CPPFLAGS += -DVAL_CPPFLAGS="\"$(STD_CPPFLAGS)\""

src/bin/pg_controldata/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2007, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.15 2007/01/05 22:19:48 momjian Exp $
7+
# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.16 2007/09/27 19:53:43 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,6 @@ subdir = src/bin/pg_controldata
1313
top_builddir = ../../..
1414
include $(top_builddir)/src/Makefile.global
1515

16-
override CPPFLAGS += -DFRONTEND
17-
1816
OBJS= pg_controldata.o pg_crc.o $(WIN32RES)
1917

2018
all: submake-libpgport pg_controldata

src/bin/pg_ctl/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.23 2007/01/05 22:19:48 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/pg_ctl/Makefile,v 1.24 2007/09/27 19:53:43 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -14,7 +14,7 @@ subdir = src/bin/pg_ctl
1414
top_builddir = ../../..
1515
include $(top_builddir)/src/Makefile.global
1616

17-
override CPPFLAGS := -DFRONTEND -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
17+
override CPPFLAGS := -DDEF_PGPORT=$(DEF_PGPORT) -I$(libpq_srcdir) $(CPPFLAGS)
1818

1919
OBJS= pg_ctl.o $(WIN32RES)
2020

src/bin/pg_dump/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.63 2007/01/05 22:19:48 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.64 2007/09/27 19:53:43 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -14,7 +14,7 @@ subdir = src/bin/pg_dump
1414
top_builddir = ../../..
1515
include $(top_builddir)/src/Makefile.global
1616

17-
override CPPFLAGS := -DFRONTEND -I$(libpq_srcdir) $(CPPFLAGS)
17+
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS)
1818

1919
OBJS= pg_backup_archiver.o pg_backup_db.o pg_backup_custom.o \
2020
pg_backup_files.o pg_backup_null.o pg_backup_tar.o \

src/bin/pg_resetxlog/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1998-2007, PostgreSQL Global Development Group
66
#
7-
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.17 2007/01/05 22:19:48 momjian Exp $
7+
# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.18 2007/09/27 19:53:43 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -13,8 +13,6 @@ subdir = src/bin/pg_resetxlog
1313
top_builddir = ../../..
1414
include $(top_builddir)/src/Makefile.global
1515

16-
override CPPFLAGS += -DFRONTEND
17-
1816
OBJS= pg_resetxlog.o pg_crc.o $(WIN32RES)
1917

2018
all: submake-libpgport pg_resetxlog

src/bin/psql/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.58 2007/01/05 22:19:48 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/psql/Makefile,v 1.59 2007/09/27 19:53:43 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -17,7 +17,7 @@ include $(top_builddir)/src/Makefile.global
1717

1818
REFDOCDIR= $(top_srcdir)/doc/src/sgml/ref
1919

20-
override CPPFLAGS := -DFRONTEND -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
20+
override CPPFLAGS := -I$(srcdir) -I$(libpq_srcdir) -I$(top_srcdir)/src/bin/pg_dump $(CPPFLAGS)
2121

2222
OBJS= command.o common.o help.o input.o stringutils.o mainloop.o copy.o \
2323
startup.o prompt.o variables.o large_obj.o print.o describe.o \

src/bin/scripts/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
66
# Portions Copyright (c) 1994, Regents of the University of California
77
#
8-
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.37 2007/01/05 22:19:50 momjian Exp $
8+
# $PostgreSQL: pgsql/src/bin/scripts/Makefile,v 1.38 2007/09/27 19:53:44 tgl Exp $
99
#
1010
#-------------------------------------------------------------------------
1111

@@ -16,7 +16,7 @@ include $(top_builddir)/src/Makefile.global
1616

1717
PROGRAMS = createdb createlang createuser dropdb droplang dropuser clusterdb vacuumdb reindexdb
1818

19-
override CPPFLAGS := -DFRONTEND -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
19+
override CPPFLAGS := -I$(top_srcdir)/src/bin/pg_dump -I$(top_srcdir)/src/bin/psql -I$(libpq_srcdir) $(CPPFLAGS)
2020

2121
all: submake-libpq submake-backend $(PROGRAMS)
2222

src/include/postgres_fe.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,17 @@
1111
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1995, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/include/postgres_fe.h,v 1.12 2007/01/05 22:19:50 momjian Exp $
14+
* $PostgreSQL: pgsql/src/include/postgres_fe.h,v 1.13 2007/09/27 19:53:44 tgl Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
1818
#ifndef POSTGRES_FE_H
1919
#define POSTGRES_FE_H
2020

21+
#ifndef FRONTEND
22+
#define FRONTEND 1
23+
#endif
24+
2125
#include "c.h"
2226

2327
#endif /* POSTGRES_FE_H */

src/interfaces/ecpg/ecpglib/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.47 2007/08/14 10:01:52 meskes Exp $
7+
# $PostgreSQL: pgsql/src/interfaces/ecpg/ecpglib/Makefile,v 1.48 2007/09/27 19:53:44 tgl Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -17,8 +17,7 @@ SO_MAJOR_VERSION= 6
1717
SO_MINOR_VERSION= 0
1818
DLTYPE= library
1919

20-
override CPPFLAGS := -DFRONTEND \
21-
-I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
20+
override CPPFLAGS := -I../include -I$(top_srcdir)/src/interfaces/ecpg/include \
2221
-I$(libpq_srcdir) -I$(top_builddir)/src/port $(CPPFLAGS)
2322
override CFLAGS += $(PTHREAD_CFLAGS)
2423

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy