Commit Graph

45 Commits

Author SHA1 Message Date
Alvaro Herrera 3e9744465d
Add -Wimplicit-fallthrough to CFLAGS and CXXFLAGS
Use it at level 4, a bit more restrictive than the default level, and
tweak our commanding comments to FALLTHROUGH.

(However, leave zic.c alone, since it's external code; to avoid the
warnings that would appear there, change CFLAGS for that file in the
Makefile.)

Author: Julien Rouhaud <rjuju123@gmail.com>
Author: Álvaro Herrera <alvherre@alvh.no-ip.org>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/20200412081825.qyo5vwwco3fv4gdo@nol
Discussion: https://postgr.es/m/flat/E1fDenm-0000C8-IJ@gemulon.postgresql.org
2020-05-12 16:07:30 -04:00
Andres Freund 01368e5d9d Split all OBJS style lines in makefiles into one-line-per-entry style.
When maintaining or merging patches, one of the most common sources
for conflicts are the list of objects in makefiles. Especially when
the split across lines has been changed on both sides, which is
somewhat common due to attempting to stay below 80 columns, those
conflicts are unnecessarily laborious to resolve.

By splitting, and alphabetically sorting, OBJS style lines into one
object per line, conflicts should be less frequent, and easier to
resolve when they still occur.

Author: Andres Freund
Discussion: https://postgr.es/m/20191029200901.vww4idgcxv74cwes@alap3.anarazel.de
2019-11-05 14:41:07 -08:00
Tom Lane a120791096 Use zic's new "-b slim" option to generate smaller timezone files.
IANA tzcode release 2019b adds an option that tells zic not to emit
the old 32-bit section of the timezone files, and to skip some other
space-wasting hacks needed for compatibility with old timezone client
libraries.  Since we only expect our own code to use the timezone data
we install, and our code is up-to-date with 2019b, there's no apparent
reason not to generate the smallest possible files.

Unfortunately, while the individual zone files do get significantly
smaller in many cases, they were not that big to begin with; which
means that no real space savings ensues on filesystems that don't
optimize small files.  (For instance, on ext4 with 4K block size,
"du" says the installed timezone tree is the same size as before.)
Still, it seems worth making the change, if only because this is
presumably the wave of the future.  At the very least, we'll save
some cycles while reading a zone file.

But given the marginal value and the fact that this is a new code
path, it doesn't seem worth the risk of back-patching this change
into stable branches.  Hence, unlike most of our timezone-related
changes, apply to HEAD only.

Discussion: https://postgr.es/m/24998.1563403327@sss.pgh.pa.us
2019-08-19 13:17:02 -04:00
Tom Lane acb897b806 Sync our copy of the timezone library with IANA release tzcode2019a.
This corrects a small bug in zic that caused it to output an incorrect
year-2440 transition in the Africa/Casablanca zone.

More interestingly, zic has grown a "-r" option that limits the range of
zone transitions that it will put into the output files.  That might be
useful to people who don't like the weird GMT offsets that tzdb likes
to use for very old dates.  It appears that for dates before the cutoff
time specified with -r, zic will use the zone's standard-time offset
as of the cutoff time.  So for example one might do

	make install ZIC_OPTIONS='-r @-1893456000'

to cause all dates before 1910-01-01 to be treated as though 1910
standard time prevailed indefinitely far back.  (Don't blame me for
the unfriendly way of specifying the cutoff time --- it's seconds
since or before the Unix epoch.  You can use extract(epoch ...)
to calculate it.)

As usual, back-patch to all supported branches.
2019-04-26 19:46:26 -04:00
Tom Lane 7cce222c96 Replace raw timezone source data with IANA's new compact format.
Traditionally IANA has distributed their timezone data in pure source
form, replete with extensive historical comments.  As of release 2017c,
they've added a compact single-file format that omits comments and
abbreviates command keywords.  This form is way shorter than the pure
source, even before considering its allegedly better compressibility.
Hence, let's distribute the data in that form rather than pure source.

I'm pushing this now, rather than at the next timezone database update,
so that it's easy to confirm that this data file produces compiled zic
output that's identical to what we were getting before.

Discussion: https://postgr.es/m/1915.1511210334@sss.pgh.pa.us
2017-11-25 15:30:11 -05:00
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
Noah Misch ee9569e4df Finish adding file version information to installed Windows binaries.
In support of this, have the MSVC build follow GNU make in preferring
GNUmakefile over Makefile when a directory contains both.

Michael Paquier, reviewed by MauMau.
2014-08-18 22:59:53 -04:00
Tom Lane 1c5143a0b5 Ooops, forgot to remove solar87 and friends from src/timezone/Makefile.
Per buildfarm.
2014-02-14 23:20:08 -05:00
Bruce Momjian 2fc80e8e83 Rename 'gmake' to 'make' in docs and recommended commands
This simplifies the docs and makes it easier to cut/paste command lines.
2014-02-12 17:29:19 -05:00
Tom Lane 6960277270 Semi-automatically detect changes in timezone abbreviations.
Add an option to zic.c to dump out all non-obsolete timezone abbreviations
defined in the Olson database.  Comparing this list to its previous state
will clue us in when something happens that we may need to account for in
the tznames/ time zone abbreviation lists.  The README file's previous
exhortation to "just grep for differences" was completely useless advice,
in my now-considerable experience; but maybe this will be a bit more
useful.  As a starting point I built the same list from the tzdata files
as they existed in 2006, which is committed here as known_abbrevs.txt.
Comparison indeed turned up quite a few changes we had neglected to account
for, which I will commit separately.
2013-03-23 19:17:44 -04:00
Peter Eisentraut 19e231bbda Improved parallel make support
Replace for loops in makefiles with proper dependencies.  Parallel
make can now span across directories.  Also, make -k and make -q work
properly.

GNU make 3.80 or newer is now required.
2010-11-12 22:15:16 +02:00
Magnus Hagander 9f2e211386 Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
Tom Lane 291a957745 Split the LDFLAGS make variable into two parts: LDFLAGS is now used for
linking both executables and shared libraries, and we add on LDFLAGS_EX when
linking executables or LDFLAGS_SL when linking shared libraries.  This
provides a significantly cleaner way of dealing with link-time switches than
the former behavior.  Also, make sure that the various platform-specific
%.so: %.o rules incorporate LDFLAGS and LDFLAGS_SL; most of them missed that
before.  (I did not add these variables for the platforms that invoke $(LD)
directly, however.  It's not clear if we can do that safely, since for the
most part we assume these variables use CC command-line syntax.)

Per gripe from Aaron Swenson and subsequent investigation.
2010-07-05 18:54:38 +00:00
Peter Eisentraut 9d182ef002 Update of install-sh, mkinstalldirs, and associated configury
Update install-sh to that from Autoconf 2.63, plus our Darwin-specific
changes (which I simplified a bit).  install-sh is now able to install
multiple files in one run, so we could simplify our makefiles sometime.

install-sh also now has a -d option to create directories, so we don't need
mkinstalldirs anymore.

Use AC_PROG_MKDIR_P in configure.in, so we can use mkdir -p when available
instead of install-sh -d.  For consistency with the rest of the world,
the corresponding make variable has been renamed from $(mkinstalldirs) to
$(MKDIR_P).
2009-08-26 22:24:44 +00:00
Bruce Momjian eaa088e8ee Fix new timezone cross-compile rule to avoid a bug in gmake 3.78.1;
document change.
2009-01-06 02:25:29 +00:00
Peter Eisentraut c63b9b1ddc When cross-compiling, allow and require an external zic program to be used
when --with-system-tzdata is not used.

initial patch by Richard Evans
2009-01-05 10:25:59 +00:00
Peter Eisentraut c7054a6c14 More refactoring, so that the SUBSYS.o rules are now all in one place. 2008-02-19 15:29:58 +00:00
Tom Lane 75d5f6fe79 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.
2007-08-25 20:29:25 +00:00
Peter Eisentraut 4e94d1f952 Add configure option --with-system-tzdata to use operating system time zone
database.
2007-08-20 08:53:12 +00:00
Tom Lane 0169c354bf Arrange to install a "posixrules" entry in our timezone database, so that
POSIX-style timezone specs that don't exactly match any database entry will
be treated as having correct USA DST rules.  Also, document that this can
be changed if you want to use some other DST rules with a POSIX zone spec.

We could consider changing localtime.c's TZDEFRULESTRING, but since that
facility can only deal with one DST transition rule, it seems fairly useless
now; might as well just plan to override it using a "posixrules" entry.

Backpatch as far as 8.0.  There isn't much we can do in 7.x ... either your
libc gets it right, or it doesn't.
2007-03-14 17:38:06 +00:00
Peter Eisentraut c138b966d4 Replace useless uses of := by = in makefiles. 2007-02-09 15:56:00 +00:00
Tom Lane d8b5c95ca8 Remove hard-wired lists of timezone abbreviations in favor of providing
configuration files that can be altered by a DBA.  The australian_timezones
GUC setting disappears, replaced by a timezone_abbreviations setting (set this
to 'Australia' to get the effect of australian_timezones).  The list of zone
names defined by default has undergone a bit of cleanup, too.  Documentation
still needs some work --- in particular, should we fix Table B-4, or just get
rid of it?  Joachim Wieland, with some editorializing by moi.
2006-07-25 03:51:23 +00:00
Peter Eisentraut a29c04a541 Allow installation into directories containing spaces in the name. 2005-12-09 21:19:36 +00:00
Bruce Momjian 970bb03c3c Complete zic patch backout by removing NO_PGPORT workaround. 2005-07-06 21:40:09 +00:00
Bruce Momjian 261ffd03f7 Reverse out because the lack of using pgport in timezone/ is causing
problems:

---------------------------------------------------------------------------

Support cross compilation by compiling "zic" with a native compiler.
This relies on the output of zic being platform independent, but that is
currently the case.
2005-07-06 21:04:14 +00:00
Bruce Momjian 4f979e8bac Restructure zic #define fprintf checks to use a NO_PGPORT macro instead. 2005-07-04 19:54:51 +00:00
Neil Conway 3f39cbdce1 Fix build break for out of tree (vpath) builds, induced by recent zic
changes.
2005-07-04 02:55:59 +00:00
Peter Eisentraut 85884cb1de Support cross compilation by compiling "zic" with a native compiler. This
relies on the output of zic being platform independent, but that is
currently the case.
2005-07-03 18:54:28 +00:00
Tom Lane 0686fe331f make clean must remove zic$(X) for Windows, per Magnus. 2004-12-31 19:01:54 +00:00
Bruce Momjian 24201b4bc6 Make libpgport be front-end only and make libpgport_srv be a backend
library that uses palloc, ereport, etc.  This simplifies the makefiles
for client applications.
2004-10-04 13:43:59 +00:00
Bruce Momjian 8120ff636b More Win32 zic build cleanups now that we have symlinks, it needs help. 2004-08-08 05:19:44 +00:00
Bruce Momjian 988d84f4a7 Another zic cleanup . 2004-08-08 04:53:41 +00:00
Bruce Momjian 68993b650f Link in dirmod specially for zic so it works on Win32. 2004-08-08 03:57:35 +00:00
Tom Lane 37da0ba0e0 Seems we forgot the installdirs target in this makefile. 2004-05-28 03:53:33 +00:00
Tom Lane 323a45099a Fix to install correctly in vpath build case. 2004-05-22 21:02:32 +00:00
Tom Lane 63bd0db121 Integrate src/timezone library for all platforms. There is more we can
and should do now that we control our own destiny for timezone handling,
but this commit gets the bulk of the picayune diffs in place.
Magnus Hagander and Tom Lane.
2004-05-21 05:08:06 +00:00
Bruce Momjian f3f8d36a57 Update Makefile dependencies for Win32 timezones, per Claudio. 2004-05-18 04:10:33 +00:00
Bruce Momjian 3febb477e6 Reorganize code to allow path-relative installs.
Create new get_* functions to access compiled-in paths and adjust if
relative installs are to be used.

Clean up substitute_libpath_macro() code.
2004-05-17 14:35:34 +00:00
Bruce Momjian 85b7e8351f Fix zic compiler to use pg version.
Move timezone database to share/timezone.
2004-04-30 20:23:28 +00:00
Bruce Momjian 04d426ba70 Allow build of timezone database on unix. 2004-04-30 20:01:39 +00:00
Bruce Momjian 1360fe4096 More timezone build adjustments. 2004-04-30 17:52:07 +00:00
Bruce Momjian 82700281d0 More cleanups for USE_PGTZ. 2004-04-30 16:08:01 +00:00
Bruce Momjian a640845c88 Allow timezone to compile under Unix by blocking 'timezone' conflict with
system headers.

Allow system to find timezone database by pasing pkglibdir into the
binary via a define.
2004-04-30 14:24:14 +00:00
Bruce Momjian 7146eb0bc3 Integrate timezone library to be called only from Win32.
Timezone code backend integration done by Magnus Hagander.
2004-04-30 04:31:52 +00:00
Bruce Momjian 6a2b75c2c8 Add Olson's public domain timezone library to src/timezone. 2004-04-30 04:09:23 +00:00