| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
# files to build into backend |
| 4 |
timezone_sources = files( |
| 5 |
'localtime.c', |
| 6 |
'pgtz.c', |
| 7 |
'strftime.c', |
| 8 |
) |
| 9 |
|
| 10 |
|
| 11 |
timezone_inc = include_directories('.') |
| 12 |
|
| 13 |
timezone_localtime_source = files('localtime.c') |
| 14 |
|
| 15 |
# files needed to build zic utility program |
| 16 |
zic_sources = files( |
| 17 |
'zic.c' |
| 18 |
) |
| 19 |
|
| 20 |
# we now distribute the timezone data as a single file |
| 21 |
tzdata = files( |
| 22 |
'data/tzdata.zi' |
| 23 |
) |
| 24 |
|
| 25 |
|
| 26 |
if get_option('system_tzdata') == '' |
| 27 |
# FIXME: For cross builds, it would need a native built libpgport/pgcommon to |
| 28 |
# build our zic. But for that we'd need to run a good chunk of the configure |
| 29 |
# tests both natively and cross. Unclear if it's worth it. |
| 30 |
if meson.is_cross_build() |
| 31 |
zic = find_program(get_option('ZIC'), native: true, required: true) |
| 32 |
else |
| 33 |
if host_system == 'windows' |
| 34 |
zic_sources += rc_bin_gen.process(win32ver_rc, extra_args: [ |
| 35 |
'--NAME', 'zic', |
| 36 |
'--FILEDESC', 'zic - time zone compiler',]) |
| 37 |
endif |
| 38 |
|
| 39 |
zic = executable('zic', zic_sources, |
| 40 |
dependencies: [frontend_code], |
| 41 |
kwargs: default_bin_args + {'install': false} |
| 42 |
) |
| 43 |
endif |
| 44 |
|
| 45 |
tzdata = custom_target('tzdata', |
| 46 |
input: tzdata, |
| 47 |
output: ['timezone'], |
| 48 |
command: [zic, '-d', '@OUTPUT@', '@INPUT@'], |
| 49 |
install: true, |
| 50 |
install_dir: dir_data, |
| 51 |
) |
| 52 |
|
| 53 |
bin_targets += tzdata |
| 54 |
endif |
| 55 |
|
| 56 |
subdir('tznames') |