Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a1cd982

Browse files
committed
meson: Add dependencies to perl modules to various script invocations
Eventually it is likely worth trying to deal with this in a more expansive way, by generating dependency files generated within the scripts. But it's not entirely obvious how to do that in perl and is work more suitable for 17 anyway. Reported-by: Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> Reviewed-by: Tristan Partin <tristan@neon.tech> Discussion: https://postgr.es/m/87v8g7s6bf.fsf@wibble.ilmari.org
1 parent b9e3f80 commit a1cd982

File tree

8 files changed

+30
-21
lines changed

8 files changed

+30
-21
lines changed

meson.build

+14
Original file line numberDiff line numberDiff line change
@@ -2681,6 +2681,20 @@ gen_export_kwargs = {
26812681

26822682

26832683

2684+
###
2685+
### Helpers for custom targets used across the tree
2686+
###
2687+
2688+
catalog_pm = files('src/backend/catalog/Catalog.pm')
2689+
perfect_hash_pm = files('src/tools/PerfectHash.pm')
2690+
gen_kwlist_deps = [perfect_hash_pm]
2691+
gen_kwlist_cmd = [
2692+
perl, '-I', '@SOURCE_ROOT@/src/tools',
2693+
files('src/tools/gen_keywordlist.pl'),
2694+
'--output', '@OUTDIR@', '@INPUT@']
2695+
2696+
2697+
26842698
###
26852699
### windows resources related stuff
26862700
###

src/common/meson.build

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ endif
5454
common_kwlist = custom_target('kwlist',
5555
input: files('../include/parser/kwlist.h'),
5656
output: 'kwlist_d.h',
57-
command: [perl, '-I', '@SOURCE_ROOT@/src/tools', files('../tools/gen_keywordlist.pl'),
58-
'--extern', '--output', '@OUTDIR@', '@INPUT@'])
57+
depend_files: gen_kwlist_deps,
58+
command: [gen_kwlist_cmd, '--extern'])
5959
generated_sources += common_kwlist
6060
common_sources += common_kwlist
6161

src/common/unicode/meson.build

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ update_unicode_targets += \
2828
custom_target('unicode_norm_table.h',
2929
input: [unicode_data['UnicodeData.txt'], unicode_data['CompositionExclusions.txt']],
3030
output: ['unicode_norm_table.h', 'unicode_norm_hashfunc.h'],
31+
depend_files: perfect_hash_pm,
3132
command: [
3233
perl, files('generate-unicode_norm_table.pl'),
3334
'--outdir', '@OUTDIR@', '@INPUT@'],
@@ -38,6 +39,7 @@ update_unicode_targets += \
3839
custom_target('unicode_nonspacing_table.h',
3940
input: [unicode_data['UnicodeData.txt']],
4041
output: ['unicode_nonspacing_table.h'],
42+
depend_files: perfect_hash_pm,
4143
command: [perl, files('generate-unicode_nonspacing_table.pl'), '@INPUT@'],
4244
build_by_default: false,
4345
capture: true,
@@ -56,6 +58,7 @@ update_unicode_targets += \
5658
custom_target('unicode_normprops_table.h',
5759
input: [unicode_data['DerivedNormalizationProps.txt']],
5860
output: ['unicode_normprops_table.h'],
61+
depend_files: perfect_hash_pm,
5962
command: [perl, files('generate-unicode_normprops_table.pl'), '@INPUT@'],
6063
build_by_default: false,
6164
capture: true,

src/include/catalog/meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ generated_catalog_headers = custom_target('generated_catalog_headers',
111111
output: output_files,
112112
install_dir: output_install,
113113
input: input,
114-
depend_files: bki_data_f,
114+
depend_files: bki_data_f + catalog_pm,
115115
build_by_default: true,
116116
install: true,
117117
command: [

src/include/nodes/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ node_support_install = [
5050
generated_nodes = custom_target('nodetags.h',
5151
input: node_support_input,
5252
output: node_support_output,
53+
depend_files: catalog_pm,
5354
command: [
5455
perl, files('../../backend/nodes/gen_node_support.pl'),
5556
'-o', '@OUTDIR@',

src/include/utils/meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ fmgrtab_output = ['fmgroids.h', 'fmgrprotos.h', 'fmgrtab.c']
4444
fmgrtab_target = custom_target('fmgrtab',
4545
input: '../catalog/pg_proc.dat',
4646
output : fmgrtab_output,
47+
depend_files: catalog_pm,
4748
command: [perl, '-I', '@SOURCE_ROOT@/src/backend/catalog/', files('../../backend/utils/Gen_fmgrtab.pl'), '--include-path=@SOURCE_ROOT@/src/include', '--output=@OUTDIR@', '@INPUT@'],
4849
install: true,
4950
install_dir: [dir_include_server / 'utils', dir_include_server / 'utils', false],

src/interfaces/ecpg/preproc/meson.build

+4-15
Original file line numberDiff line numberDiff line change
@@ -69,28 +69,17 @@ c_kwlist = custom_target('c_kwlist_d.h',
6969
input: ['c_kwlist.h'],
7070
output: ['c_kwlist_d.h'],
7171
depends: check_rules,
72-
command: [
73-
perl,
74-
'-I', '@SOURCE_ROOT@/src/tools',
75-
'@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
76-
'--output', '@OUTDIR@',
77-
'--varname', 'ScanCKeywords',
78-
'--no-case-fold', '@INPUT0@',
79-
],
72+
depend_files: gen_kwlist_deps,
73+
command: [gen_kwlist_cmd, '--varname', 'ScanCKeywords', '--no-case-fold'],
8074
)
8175
generated_sources += c_kwlist
8276
ecpg_sources += c_kwlist
8377

8478
ecpg_kwlist = custom_target('ecpg_kwlist_d.h',
8579
input: ['ecpg_kwlist.h'],
8680
output: ['ecpg_kwlist_d.h'],
87-
command: [
88-
perl, '-I',
89-
'@SOURCE_ROOT@/src/tools',
90-
'@SOURCE_ROOT@/src/tools/gen_keywordlist.pl',
91-
'--output', '@OUTDIR@',
92-
'--varname', 'ScanECPGKeywords', '@INPUT0@',
93-
]
81+
depend_files: gen_kwlist_deps,
82+
command: [gen_kwlist_cmd, '--varname', 'ScanECPGKeywords'],
9483
)
9584
generated_sources += ecpg_kwlist
9685
ecpg_sources += ecpg_kwlist

src/pl/plpgsql/src/meson.build

+4-3
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,20 @@ pl_errcodes = custom_target('plerrcodes',
2525
generated_sources += pl_errcodes
2626
plpgsql_sources += pl_errcodes
2727

28-
gen_keywordlist = files('../../../../src/tools/gen_keywordlist.pl')
2928
pl_reserved = custom_target('pl_reserved_kwlist',
3029
input: ['pl_reserved_kwlist.h'],
3130
output: ['pl_reserved_kwlist_d.h'],
32-
command: [perl, '-I', '@SOURCE_ROOT@/src/tools', gen_keywordlist, '--output', '@OUTDIR@', '--varname', 'ReservedPLKeywords', '@INPUT@']
31+
depend_files: gen_kwlist_deps,
32+
command: [gen_kwlist_cmd, '--varname', 'ReservedPLKeywords'],
3333
)
3434
generated_sources += pl_reserved
3535
plpgsql_sources += pl_reserved
3636

3737
pl_unreserved = custom_target('pl_unreserved_kwlist',
3838
input: ['pl_unreserved_kwlist.h'],
3939
output: ['pl_unreserved_kwlist_d.h'],
40-
command: [perl, '-I', '@SOURCE_ROOT@/src/tools', gen_keywordlist, '--output', '@OUTDIR@', '--varname', 'UnreservedPLKeywords', '@INPUT@']
40+
depend_files: gen_kwlist_deps,
41+
command: [gen_kwlist_cmd, '--varname', 'UnreservedPLKeywords'],
4142
)
4243
generated_sources += pl_unreserved
4344
plpgsql_sources += pl_unreserved

0 commit comments

Comments
 (0)