From 04d426ba7065301f65227259209ecc9e5a314551 Mon Sep 17 00:00:00 2001
From: Bruce Momjian <bruce@momjian.us>
Date: Fri, 30 Apr 2004 20:01:39 +0000
Subject: [PATCH] Allow build of timezone database on unix.

---
 src/bin/pg_controldata/Makefile | 4 +++-
 src/bin/pg_dump/Makefile        | 4 +++-
 src/bin/pg_resetxlog/Makefile   | 4 ++--
 src/timezone/Makefile           | 4 ++--
 src/timezone/pgtz.h             | 1 +
 src/timezone/private.h          | 5 +++++
 6 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/bin/pg_controldata/Makefile b/src/bin/pg_controldata/Makefile
index 7c0a5dc93f1..0ec0705da37 100644
--- a/src/bin/pg_controldata/Makefile
+++ b/src/bin/pg_controldata/Makefile
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1998-2002, PostgreSQL Global Development Group
 #
-# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.6 2004/04/26 17:40:48 momjian Exp $
+# $PostgreSQL: pgsql/src/bin/pg_controldata/Makefile,v 1.7 2004/04/30 20:01:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -12,6 +12,8 @@ subdir = src/bin/pg_controldata
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
+override CPPFLAGS += -DFRONTEND
+
 OBJS= pg_controldata.o pg_crc.o
 
 all: submake-libpgport pg_controldata
diff --git a/src/bin/pg_dump/Makefile b/src/bin/pg_dump/Makefile
index 516b3d7a764..59722363a5d 100644
--- a/src/bin/pg_dump/Makefile
+++ b/src/bin/pg_dump/Makefile
@@ -5,7 +5,7 @@
 # Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
 #
-# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.45 2004/04/26 17:40:48 momjian Exp $
+# $PostgreSQL: pgsql/src/bin/pg_dump/Makefile,v 1.46 2004/04/30 20:01:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -13,6 +13,8 @@ subdir = src/bin/pg_dump
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
+override CPPFLAGS += -DFRONTEND
+
 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 \
 	dumputils.o
diff --git a/src/bin/pg_resetxlog/Makefile b/src/bin/pg_resetxlog/Makefile
index 1f36ed65c80..e59217ba68e 100644
--- a/src/bin/pg_resetxlog/Makefile
+++ b/src/bin/pg_resetxlog/Makefile
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1998-2002, PostgreSQL Global Development Group
 #
-# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.7 2004/04/26 17:40:48 momjian Exp $
+# $PostgreSQL: pgsql/src/bin/pg_resetxlog/Makefile,v 1.8 2004/04/30 20:01:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -12,7 +12,7 @@ subdir = src/bin/pg_resetxlog
 top_builddir = ../../..
 include $(top_builddir)/src/Makefile.global
 
-override CPPFLAGS := $(CPPFLAGS) -DFRONTEND
+override CPPFLAGS += -DFRONTEND
 
 OBJS= pg_resetxlog.o pg_crc.o \
       $(filter dirmod.o, $(LIBOBJS))
diff --git a/src/timezone/Makefile b/src/timezone/Makefile
index 22639a4e4a6..d0e7490d655 100644
--- a/src/timezone/Makefile
+++ b/src/timezone/Makefile
@@ -4,7 +4,7 @@
 #    Makefile for the timezone library
 
 # IDENTIFICATION
-#    $PostgreSQL: pgsql/src/timezone/Makefile,v 1.5 2004/04/30 17:52:07 momjian Exp $
+#    $PostgreSQL: pgsql/src/timezone/Makefile,v 1.6 2004/04/30 20:01:39 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -30,7 +30,7 @@ zic: $(ZICOBJS)
 	$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
 
 install: zic
-	zic -d $(pkglibdir)/../timezone $(TZDATAFILES)
+	./zic -d $(pkglibdir)/../timezone $(TZDATAFILES)
 
 clean distclean maintainer-clean:
 	rm -f SUBSYS.o $(OBJS) $(ZICOBJS)
diff --git a/src/timezone/pgtz.h b/src/timezone/pgtz.h
index 6be10367c46..09205a5ee47 100644
--- a/src/timezone/pgtz.h
+++ b/src/timezone/pgtz.h
@@ -4,6 +4,7 @@
 #define HAVE_SYMLINK 0
 #endif
 
+
 #define NOID
 #define TZDIR pgwin32_TZDIR()
 
diff --git a/src/timezone/private.h b/src/timezone/private.h
index c8f45486837..d71c58b6acb 100644
--- a/src/timezone/private.h
+++ b/src/timezone/private.h
@@ -88,7 +88,12 @@ static char	privatehid[] = "@(#)private.h	7.53";
 #include "errno.h"
 #include "string.h"
 #include "limits.h"	/* for CHAR_BIT */
+
+#define save_timezone pg_timezone
+#undef timezone
 #include "time.h"
+#define timezone save_timezone
+
 #include "stdlib.h"
 
 #if HAVE_GETTEXT - 0
-- 
GitLab