perlopt = get_option('plperl')
perl_dep = not_found_dep
+perl_includespec = ''
perlversion = ''
if not perlopt.disabled()
perl_may_work = true
useshrplib = run_command(perl_conf_cmd, 'useshrplib', check: true).stdout()
perl_inc_dir = '@0@/CORE'.format(archlibexp)
+ perl_includespec = '-I@0@'.format(perl_inc_dir)
if perlversion.version_compare('< 5.14')
perl_may_work = false
if not fs.is_file('@0@/perl.h'.format(perl_inc_dir)) and \
fs.is_file('@0@@1@/perl.h'.format(pg_sysroot, perl_inc_dir))
perl_ccflags = ['-iwithsysroot', perl_inc_dir]
+ perl_includespec = '-iwithsysroot @0@/CORE'.format(archlibexp)
endif
# check compiler finds header
pyopt = get_option('plpython')
python3_dep = not_found_dep
+python_includespec = ''
if not pyopt.disabled()
pm = import('python')
python3_inst = pm.find_installation(python.full_path(), required: pyopt)
python3_dep = not_found_dep
endif
endif
+
+ if python3_dep.found()
+ command = [python, '-c', 'import sysconfig; print("-I" + sysconfig.get_config_var("INCLUDEPY"))']
+ python_includespec = run_command(command, check: true).stdout().strip()
+ endif
endif
'STRIP_STATIC_LIB': ' '.join(strip_static_cmd),
'STRIP_SHARED_LIB': ' '.join(strip_shared_cmd),
+ 'perl_includespec': perl_includespec,
+ 'python_includespec': python_includespec,
+
# these seem to be standard these days
'MKDIR_P': 'mkdir -p',
'LN_S': 'ln -s',
'PG_TEST_EXTRA',
'DTRACEFLAGS', # only server has dtrace probes
- 'perl_archlibexp', 'perl_embed_ccflags', 'perl_embed_ldflags', 'perl_includespec', 'perl_privlibexp',
- 'python_additional_libs', 'python_includespec', 'python_libdir', 'python_libspec', 'python_majorversion', 'python_version',
+ 'perl_archlibexp', 'perl_embed_ccflags', 'perl_embed_ldflags', 'perl_privlibexp',
+ 'python_additional_libs', 'python_libdir', 'python_libspec', 'python_majorversion', 'python_version',
# possible that some of these are referenced explicitly in pgxs makefiles?
# For now not worth it.