@@ -1600,6 +1600,7 @@ function pyconf_parse_args( i, arg, key, val, opt_key, eq_pos, config_args) {
16001600 # --prefix, --exec-prefix, --bindir, etc.
16011601 } else if (key == " srcdir" ) {
16021602 _pyconf_srcdir = val
1603+ pyconf__srcdir_arg = val
16031604 } else if (key == " help" || key == " h" ) {
16041605 _pyconf_help_requested = 1
16051606 } else {
@@ -1796,12 +1797,18 @@ function _pyconf_write_pyconfig_h( f, inf, line, name, val, indent, rest, out
17961797 close (outf)
17971798}
17981799
1799- function _pyconf_process_config_files ( i , inf , outf , outdir , saved_abs_srcdir , saved_abs_builddir , slash_pos ) {
1800+ function _pyconf_process_config_files ( i , inf , outf , outdir , saved_abs_srcdir , saved_abs_builddir , slash_pos , sd ) {
1801+ # Determine srcdir: prefer the transpiled pyconf_srcdir (set by
1802+ # u_setup_source_dirs), fall back to _pyconf_srcdir (from --srcdir arg).
1803+ sd = _pyconf_srcdir
1804+ if (pyconf_srcdir != " " && pyconf_srcdir != " ." )
1805+ sd = pyconf_srcdir
18001806 for (i = 1 ; i <= _pyconf_config_file_count; i++ ) {
18011807 outf = CONFIG_FILES[ i]
1802- inf = outf " .in"
1803- if (inf == " " )
1804- continue
1808+ if (sd != " " && sd != " ." )
1809+ inf = sd " /" outf " .in"
1810+ else
1811+ inf = outf " .in"
18051812 # Skip if template does not exist (mirrors pyconf.py behaviour)
18061813 if (system (" test -f " _shell_quote(inf)) != 0 ) {
18071814 pyconf_warn(" config file template not found: " inf)
0 commit comments