summaryrefslogtreecommitdiffstats
path: root/src/pl/plperl/meson.build
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 13:44:03 +0000
commit293913568e6a7a86fd1479e1cff8e2ecb58d6568 (patch)
treefc3b469a3ec5ab71b36ea97cc7aaddb838423a0c /src/pl/plperl/meson.build
parentInitial commit. (diff)
downloadpostgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.tar.xz
postgresql-16-293913568e6a7a86fd1479e1cff8e2ecb58d6568.zip
Adding upstream version 16.2.upstream/16.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/pl/plperl/meson.build')
-rw-r--r--src/pl/plperl/meson.build101
1 files changed, 101 insertions, 0 deletions
diff --git a/src/pl/plperl/meson.build b/src/pl/plperl/meson.build
new file mode 100644
index 0000000..182e0fe
--- /dev/null
+++ b/src/pl/plperl/meson.build
@@ -0,0 +1,101 @@
+# Copyright (c) 2022-2023, PostgreSQL Global Development Group
+
+if not perl_dep.found()
+ subdir_done()
+endif
+
+plperl_sources = files(
+ 'plperl.c',
+)
+
+subppdir = run_command(perl, '-e', 'use List::Util qw(first); print first { -r "$_/ExtUtils/xsubpp" } @INC',
+ check: true).stdout()
+xsubpp = '@0@/ExtUtils/xsubpp'.format(subppdir)
+typemap = '@0@/ExtUtils/typemap'.format(privlibexp)
+
+plperl_sources += custom_target('perlchunks.h',
+ input: files('plc_perlboot.pl', 'plc_trusted.pl'),
+ output: 'perlchunks.h',
+ capture: true,
+ command: [perl, files('text2macro.pl'), '--strip=^(\#.*|\s*)$', '@INPUT@']
+)
+
+plperl_sources += custom_target('plperl_opmask.h',
+ input: files('plperl_opmask.pl'),
+ output: 'plperl_opmask.h',
+ command: [perl, '@INPUT@', '@OUTPUT@']
+)
+
+foreach n : ['SPI', 'Util']
+ xs = files(n + '.xs')
+ xs_c_name = n + '.c'
+ xs_c = custom_target(xs_c_name,
+ input: xs,
+ output: xs_c_name,
+ command: [perl, xsubpp, '-typemap', typemap, '-output', '@OUTPUT@', '@INPUT@']
+ )
+ plperl_sources += xs_c
+endforeach
+
+plperl_inc = include_directories('.')
+
+if host_system == 'windows'
+ plperl_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
+ '--NAME', 'plperl',
+ '--FILEDESC', 'PL/Perl - procedural language',])
+endif
+
+plperl = shared_module('plperl',
+ plperl_sources,
+ c_pch: pch_postgres_h,
+ include_directories: [plperl_inc, postgres_inc],
+ kwargs: pg_mod_args + {
+ 'dependencies': [perl_dep, pg_mod_args['dependencies']],
+ 'install_rpath': ':'.join(mod_install_rpaths + ['@0@/CORE'.format(archlibexp)]),
+ 'build_rpath': '@0@/CORE'.format(archlibexp),
+ },
+)
+pl_targets += plperl
+
+install_data(
+ 'plperl.control',
+ 'plperl--1.0.sql',
+ install_dir: dir_data_extension,
+)
+
+install_data(
+ 'plperlu.control',
+ 'plperlu--1.0.sql',
+ install_dir: dir_data_extension,
+)
+
+install_headers(
+ 'plperl.h',
+ 'plperl_system.h',
+ 'ppport.h',
+ install_dir: dir_include_server,
+)
+
+tests += {
+ 'name': 'plperl',
+ 'sd': meson.current_source_dir(),
+ 'bd': meson.current_build_dir(),
+ 'regress': {
+ 'sql': [
+ 'plperl_setup',
+ 'plperl',
+ 'plperl_lc',
+ 'plperl_trigger',
+ 'plperl_shared',
+ 'plperl_elog',
+ 'plperl_util',
+ 'plperl_init',
+ 'plperlu',
+ 'plperl_array',
+ 'plperl_call',
+ 'plperl_transaction',
+ ],
+ },
+}
+
+subdir('po', if_found: libintl)