mirror of
https://github.com/postgres/postgres.git
synced 2025-06-25 01:02:05 +03:00
Adjust with-system-tzdata patch to not attempt to install a symlink,
but just hardwire the specified timezone database path into the executable. Per discussion, this avoids some packaging disadvantages of using a symlink.
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
# Makefile for the timezone library
|
||||
|
||||
# IDENTIFICATION
|
||||
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.27 2007/08/20 08:53:12 petere Exp $
|
||||
# $PostgreSQL: pgsql/src/timezone/Makefile,v 1.28 2007/08/25 20:29:25 tgl Exp $
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
@ -27,21 +27,26 @@ TZDATAFILES = $(TZDATA:%=$(srcdir)/data/%)
|
||||
# for POSIX-style timezone specs
|
||||
POSIXRULES = US/Eastern
|
||||
|
||||
all: SUBSYS.o submake-libpgport zic
|
||||
# use system timezone data?
|
||||
ifneq (,$(with_system_tzdata))
|
||||
override CPPFLAGS += '-DSYSTEMTZDIR="$(with_system_tzdata)"'
|
||||
endif
|
||||
|
||||
all: SUBSYS.o
|
||||
|
||||
ifeq (,$(with_system_tzdata))
|
||||
all: submake-libpgport zic
|
||||
endif
|
||||
|
||||
SUBSYS.o: $(OBJS)
|
||||
$(LD) $(LDREL) $(LDOUT) SUBSYS.o $(OBJS)
|
||||
|
||||
ifeq (,$(with_system_tzdata))
|
||||
zic: $(ZICOBJS)
|
||||
$(CC) $(CFLAGS) $(ZICOBJS) $(LDFLAGS) $(LIBS) -o $@$(X)
|
||||
endif
|
||||
|
||||
install: all installdirs
|
||||
ifeq (,$(with_system_tzdata))
|
||||
./zic -d '$(DESTDIR)$(datadir)/timezone' -p '$(POSIXRULES)' $(TZDATAFILES)
|
||||
else
|
||||
ln -s '$(with_system_tzdata)' '$(DESTDIR)$(datadir)/timezone'
|
||||
endif
|
||||
$(MAKE) -C tznames $@
|
||||
|
||||
@ -49,7 +54,9 @@ installdirs:
|
||||
$(mkinstalldirs) '$(DESTDIR)$(datadir)'
|
||||
|
||||
uninstall:
|
||||
ifeq (,$(with_system_tzdata))
|
||||
rm -rf '$(DESTDIR)$(datadir)/timezone'
|
||||
endif
|
||||
$(MAKE) -C tznames $@
|
||||
|
||||
clean distclean maintainer-clean:
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2007, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.53 2007/08/04 19:29:25 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.54 2007/08/25 20:29:25 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -38,9 +38,6 @@ pg_tz *gmt_timezone = NULL;
|
||||
static pg_tz gmt_timezone_data;
|
||||
|
||||
|
||||
static char tzdir[MAXPGPATH];
|
||||
static bool done_tzdir = false;
|
||||
|
||||
static bool scan_directory_ci(const char *dirname,
|
||||
const char *fname, int fnamelen,
|
||||
char *canonname, int canonnamelen);
|
||||
@ -52,9 +49,14 @@ static pg_tz *select_default_timezone(void);
|
||||
/*
|
||||
* Return full pathname of timezone data directory
|
||||
*/
|
||||
static char *
|
||||
static const char *
|
||||
pg_TZDIR(void)
|
||||
{
|
||||
#ifndef SYSTEMTZDIR
|
||||
/* normal case: timezone stuff is under our share dir */
|
||||
static bool done_tzdir = false;
|
||||
static char tzdir[MAXPGPATH];
|
||||
|
||||
if (done_tzdir)
|
||||
return tzdir;
|
||||
|
||||
@ -63,6 +65,10 @@ pg_TZDIR(void)
|
||||
|
||||
done_tzdir = true;
|
||||
return tzdir;
|
||||
#else
|
||||
/* we're configured to use system's timezone database */
|
||||
return SYSTEMTZDIR;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user