| 1 |
# Copyright (c) 2022-2025, PostgreSQL Global Development Group |
| 2 |
|
| 3 |
psql_sources = files( |
| 4 |
'command.c', |
| 5 |
'common.c', |
| 6 |
'copy.c', |
| 7 |
'crosstabview.c', |
| 8 |
'describe.c', |
| 9 |
'help.c', |
| 10 |
'input.c', |
| 11 |
'large_obj.c', |
| 12 |
'mainloop.c', |
| 13 |
'prompt.c', |
| 14 |
'startup.c', |
| 15 |
'stringutils.c', |
| 16 |
'variables.c', |
| 17 |
) |
| 18 |
|
| 19 |
psqlscanslash = custom_target('psqlscanslash', |
| 20 |
input: 'psqlscanslash.l', |
| 21 |
output: 'psqlscanslash.c', |
| 22 |
command: [flex_cmd, '--no-backup', '--', '-Cfe', '-p', '-p']) |
| 23 |
generated_sources += psqlscanslash |
| 24 |
psql_sources += psqlscanslash |
| 25 |
|
| 26 |
tabcomplete = custom_target('tabcomplete', |
| 27 |
input: 'tab-complete.in.c', |
| 28 |
output: 'tab-complete.c', |
| 29 |
command: [ |
| 30 |
perl, files('gen_tabcomplete.pl'), '@INPUT@', |
| 31 |
'--outfile', '@OUTPUT@', |
| 32 |
], |
| 33 |
) |
| 34 |
generated_sources += tabcomplete |
| 35 |
psql_sources += tabcomplete |
| 36 |
|
| 37 |
sql_help = custom_target('psql_help', |
| 38 |
output: ['sql_help.c', 'sql_help.h'], |
| 39 |
depfile: 'sql_help.dep', |
| 40 |
command: [ |
| 41 |
perl, files('create_help.pl'), |
| 42 |
'--docdir', '@SOURCE_ROOT@/doc/src/sgml/ref', |
| 43 |
'--depfile', '@DEPFILE@', |
| 44 |
'--outdir', '@OUTDIR@', |
| 45 |
'--basename', 'sql_help', |
| 46 |
], |
| 47 |
) |
| 48 |
generated_sources += sql_help.to_list() |
| 49 |
psql_sources += sql_help |
| 50 |
|
| 51 |
if host_system == 'windows' |
| 52 |
psql_sources += rc_bin_gen.process(win32ver_rc, extra_args: [ |
| 53 |
'--NAME', 'psql', |
| 54 |
'--FILEDESC', 'psql - the PostgreSQL interactive terminal',]) |
| 55 |
endif |
| 56 |
|
| 57 |
psql = executable('psql', |
| 58 |
psql_sources, |
| 59 |
c_pch: pch_postgres_fe_h, |
| 60 |
include_directories: include_directories('.'), |
| 61 |
dependencies: [frontend_code, libpq, readline], |
| 62 |
kwargs: default_bin_args, |
| 63 |
) |
| 64 |
bin_targets += psql |
| 65 |
|
| 66 |
install_data('psqlrc.sample', |
| 67 |
install_dir: dir_data, |
| 68 |
) |
| 69 |
|
| 70 |
tests += { |
| 71 |
'name': 'psql', |
| 72 |
'sd': meson.current_source_dir(), |
| 73 |
'bd': meson.current_build_dir(), |
| 74 |
'tap': { |
| 75 |
'env': {'with_readline': readline.found() ? 'yes' : 'no'}, |
| 76 |
'tests': [ |
| 77 |
't/001_basic.pl', |
| 78 |
't/010_tab_completion.pl', |
| 79 |
't/020_cancel.pl', |
| 80 |
], |
| 81 |
}, |
| 82 |
} |
| 83 |
|
| 84 |
subdir('po', if_found: libintl) |