1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-05 23:38:41 +03:00
Files
postgres/src/timezone/Makefile
Tom Lane 1c1a7cbd6a Sync our copy of the timezone library with IANA release tzcode2016c.
We hadn't done this in about six years, which proves to have been a mistake
because there's been a lot of code churn upstream, making the merge rather
painful.  But putting it off any further isn't going to lessen the pain,
and there are at least two incompatible changes that we need to absorb
before someone starts complaining that --with-system-tzdata doesn't work
at all on their platform, or we get blindsided by a tzdata release that
our out-of-date zic can't compile.  Last week's "time zone abbreviation
differs from POSIX standard" mess was a wake-up call in that regard.

This is a sufficiently large patch that I'm afraid to back-patch it
immediately, though the foregoing considerations imply that we probably
should do so eventually.  For the moment, just put it in HEAD so that
it can get some testing.  Maybe we can wait till the end of the 9.6
beta cycle before deeming it okay.
2016-03-28 15:10:17 -04:00

77 lines
1.9 KiB
Makefile

#-------------------------------------------------------------------------
#
# Makefile
# Makefile for the timezone library
# IDENTIFICATION
# src/timezone/Makefile
#
#-------------------------------------------------------------------------
PGFILEDESC = "zic - time zone compiler"
PGAPPICON = win32
subdir = src/timezone
top_builddir = ../..
include $(top_builddir)/src/Makefile.global
# files to build into backend
OBJS= localtime.o strftime.o pgtz.o
# files needed to build zic utility program
ZICOBJS= zic.o $(WIN32RES)
# timezone data files
TZDATA = africa antarctica asia australasia europe northamerica southamerica \
pacificnew etcetera factory backward systemv
TZDATAFILES = $(TZDATA:%=$(srcdir)/data/%)
# which zone should determine the DST rules (not the specific UTC offset!)
# for POSIX-style timezone specs
POSIXRULES = US/Eastern
# use system timezone data?
ifneq (,$(with_system_tzdata))
override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
endif
include $(top_srcdir)/src/backend/common.mk
ifeq (,$(with_system_tzdata))
all: zic
endif
# We could do this test in the action section:
# $(if $(ZIC),$(ZIC),./zic)
# but GNU make versions <= 3.78.1 or perhaps later have a bug
# that causes a segfault; GNU make 3.81 or later fixes this.
ifeq (,$(ZIC))
ZIC= ./zic
endif
zic: $(ZICOBJS) | submake-libpgport
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $@$(X)
install: all installdirs
ifeq (,$(with_system_tzdata))
$(ZIC) -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
endif
$(MAKE) -C tznames $@
abbrevs.txt: zic $(TZDATAFILES)
mkdir junkdir
$(ZIC) -P -d junkdir -p '$(POSIXRULES)' $(TZDATAFILES) | LANG=C sort | uniq >abbrevs.txt
rm -rf junkdir
installdirs:
$(MKDIR_P) '$(DESTDIR)$(datadir)'
uninstall:
ifeq (,$(with_system_tzdata))
rm -rf '$(DESTDIR)$(datadir)/timezone'
endif
$(MAKE) -C tznames $@
clean distclean maintainer-clean:
rm -f zic$(X) $(ZICOBJS) abbrevs.txt