1 # Copyright (c) 2022-2024, PostgreSQL Global Development Group
3 if not perl_dep.found()
7 plperl_sources = files(
11 subppdir = run_command(perl, '-e', 'use List::Util qw(first); print first { -r "$_/ExtUtils/xsubpp" } @INC',
13 xsubpp = '@0@/ExtUtils/xsubpp'.format(subppdir)
14 typemap = '@0@/ExtUtils/typemap'.format(privlibexp)
16 plperl_sources += custom_target('perlchunks.h',
17 input: files('plc_perlboot.pl', 'plc_trusted.pl'),
18 output: 'perlchunks.h',
20 command: [perl, files('text2macro.pl'), '@INPUT@']
23 plperl_sources += custom_target('plperl_opmask.h',
24 input: files('plperl_opmask.pl'),
25 output: 'plperl_opmask.h',
26 command: [perl, '@INPUT@', '@OUTPUT@']
29 foreach n : ['SPI', 'Util']
32 xs_c = custom_target(xs_c_name,
35 command: [perl, xsubpp, '-typemap', typemap, '-output', '@OUTPUT@', '@INPUT@']
37 plperl_sources += xs_c
40 plperl_inc = include_directories('.')
42 if host_system == 'windows'
43 plperl_sources += rc_lib_gen.process(win32ver_rc, extra_args: [
45 '--FILEDESC', 'PL/Perl - procedural language',])
48 plperl = shared_module('plperl',
50 c_pch: pch_postgres_h,
51 include_directories: [plperl_inc, postgres_inc],
52 kwargs: pg_mod_args + {
53 'dependencies': [perl_dep, pg_mod_args['dependencies']],
54 'install_rpath': ':'.join(mod_install_rpaths + ['@0@/CORE'.format(archlibexp)]),
55 'build_rpath': '@0@/CORE'.format(archlibexp),
63 install_dir: dir_data_extension,
69 install_dir: dir_data_extension,
76 install_dir: dir_include_server,
81 'sd': meson.current_source_dir(),
82 'bd': meson.current_build_dir(),
99 'regress_args': ['--dlpath', meson.build_root() / 'src/test/regress'],
103 subdir('po', if_found: libintl)