@@ -602,7 +602,7 @@ function _pyconf_ac_includes_default( result) {
602602 return result
603603}
604604
605- function pyconf_check_header(header, prologue, default_inc, define, cache_key, source, cv, rc) {
605+ function pyconf_check_header(header, prologue, default_inc, define, cache_key, extra_cflags, source, cv, rc) {
606606 if (define == "") define = _pyconf_header_to_define(header)
607607 if (cache_key == "") cache_key = "ac_cv_header_" header
608608 gsub(/-/, "_dash_", cache_key)
@@ -618,7 +618,7 @@ function pyconf_check_header(header, prologue, default_inc, define, cache_key, s
618618 source = _pyconf_confdefs() "\n" default_inc "\n#include <" header ">\nint main(void) { return 0; }"
619619 else
620620 source = _pyconf_confdefs() "\n" _pyconf_ac_includes_default() "#include <" header ">\nint main(void) { return 0; }"
621- rc = _pyconf_compile_test(source, "" )
621+ rc = _pyconf_compile_test(source, extra_cflags )
622622 CACHE[cache_key] = rc ? "yes" : "no"
623623 V[cache_key] = rc ? "yes" : "no"
624624 pyconf_result(rc ? "yes" : "no")
@@ -936,7 +936,7 @@ function pyconf_check_decl(name, includes, define, source, inc, cv, rc, _darr, _
936936 }
937937
938938 pyconf_checking("whether " name " is declared")
939- inc = _pyconf_ac_includes_default()
939+ inc = ""
940940 if (includes != "") {
941941 _dn = split(includes, _darr, " ")
942942 for (_di = 1; _di <= _dn; _di++)
@@ -1428,7 +1428,10 @@ function pyconf_arg_with(name, default_val, help_text, metavar, var, false_is, k
14281428}
14291429
14301430function pyconf_env_var(name, help_text) {
1431- # Record environment variable documentation
1431+ # Seed V[name] from the environment if not already set, mirroring
1432+ # Python's Vars.__getattr__ fallback to os.environ.
1433+ if (!(name in V) && name in ENV)
1434+ V[name] = ENV[name]
14321435}
14331436
14341437function pyconf_option_value(key) {
@@ -3218,7 +3221,7 @@ function u_detect_sqlite3( _i_f, _n_f, check_cflags, enable_loadable_sqlite_e
32183221 sqlite_inc = " -I" pyconf_srcdir "/Modules/_sqlite"
32193222 check_cflags = V["LIBSQLITE3_CFLAGS"] sqlite_inc
32203223 V["LIBSQLITE3_CFLAGS"] = V["LIBSQLITE3_CFLAGS"] " -I$(srcdir)/Modules/_sqlite"
3221- if (pyconf_check_header("sqlite3.h", "")) {
3224+ if (pyconf_check_header("sqlite3.h", "", "", "", "", check_cflags )) {
32223225 V["have_sqlite3"] = "yes"
32233226 if (pyconf_compile_check("", "#include <sqlite3.h>\n#if SQLITE_VERSION_NUMBER < 3015002\n# error \"SQLite 3.15.2 or higher required\"\n#endif\nint main(void) { return 0; }", check_cflags)) {
32243227 V["have_supported_sqlite3"] = "yes"
@@ -3890,13 +3893,17 @@ function u_setup_platform_defines() {
38903893 pyconf_define("_DARWIN_C_SOURCE", 1, 0, "Define on Darwin to activate all library features")
38913894}
38923895
3893- function u_setup_source_dirs( builddir, out_of_tree, srcdir_abs, srcdir_raw, srcdir_rel ) {
3896+ function u_setup_source_dirs( builddir, out_of_tree, srcdir, srcdir_abs, srcdir_raw ) {
38943897 srcdir_raw = ((pyconf__srcdir_arg != "") ? pyconf__srcdir_arg : ((V["srcdir"] != "") ? V["srcdir"] : "."))
38953898 srcdir_abs = pyconf_abspath(srcdir_raw)
38963899 builddir = pyconf_abspath(".")
38973900 out_of_tree = ((srcdir_abs != builddir) ? "yes" : "no")
3898- srcdir_rel = (((out_of_tree != "") && (out_of_tree != "no")) ? pyconf_relpath(srcdir_abs, builddir) : ".")
3899- V["srcdir"] = srcdir_rel
3901+ if (((out_of_tree != "") && (out_of_tree != "no"))) {
3902+ srcdir = srcdir_raw
3903+ } else {
3904+ srcdir = "."
3905+ }
3906+ V["srcdir"] = srcdir
39003907 v_export("srcdir")
39013908 V["abs_srcdir"] = srcdir_abs
39023909 v_export("abs_srcdir")
@@ -4240,7 +4247,7 @@ function u_setup_framework( ac_default_prefix, fw_raw, val) {
42404247 if ((V["ac_sys_system"] == "Darwin")) {
42414248 val = "/Library/Frameworks"
42424249 } else if ((V["ac_sys_system"] == "iOS")) {
4243- val = "Apple/iOS/Frameworks/$(MULTIARCH)"
4250+ val = "Platforms/ Apple/iOS/Frameworks/$(MULTIARCH)"
42444251 } else {
42454252 pyconf_error("error: Unknown platform for framework build")
42464253 }
@@ -4320,9 +4327,9 @@ function u__setup_framework_ios() {
43204327 V["INSTALLTARGETS"] = "libinstall inclinstall sharedinstall"
43214328 V["prefix"] = V["PYTHONFRAMEWORKPREFIX"]
43224329 V["PYTHONFRAMEWORKINSTALLNAMEPREFIX"] = "@rpath/" V["PYTHONFRAMEWORKDIR"]
4323- V["RESSRCDIR"] = "Apple/iOS/Resources"
4330+ V["RESSRCDIR"] = "Platforms/ Apple/iOS/Resources"
43244331 delete _va33
4325- _va33[1] = "Apple/iOS/Resources/Info.plist"
4332+ _va33[1] = "Platforms/ Apple/iOS/Resources/Info.plist"
43264333 _va33[0] = 1
43274334 pyconf_config_files(_va33)
43284335}
@@ -5939,11 +5946,11 @@ function u_setup_machdep( SUNOS_VERSION, ac_md_release, ac_md_system, _split_
59395946
59405947function u_setup_host_prefix() {
59415948 if ((!((V["host_prefix"] != "") && (V["host_prefix"] != "no")))) {
5942- V["host_prefix"] = ((( V["ac_sys_system"] == "Emscripten") || (V["ac_sys_system"] == "WASI") ) ? "/" : "${prefix}")
5949+ V["host_prefix"] = ((V["ac_sys_system"] == "Emscripten") ? "/" : "${prefix}")
59435950 v_export("host_prefix")
59445951 }
59455952 if ((!((V["host_exec_prefix"] != "") && (V["host_exec_prefix"] != "no")))) {
5946- V["host_exec_prefix"] = ((( V["ac_sys_system"] == "Emscripten") || (V["ac_sys_system"] == "WASI") ) ? V["host_prefix"] : "${exec_prefix}")
5953+ V["host_exec_prefix"] = ((V["ac_sys_system"] == "Emscripten") ? V["host_prefix"] : "${exec_prefix}")
59475954 }
59485955 v_export("host_exec_prefix")
59495956}
@@ -7323,7 +7330,7 @@ function u_detect_gdbm() {
73237330 V["have_gdbm"] = "no"
73247331 pyconf_env_var("GDBM_CFLAGS", "C compiler flags for gdbm")
73257332 pyconf_env_var("GDBM_LIBS", "additional linker flags for gdbm")
7326- if (pyconf_check_header("gdbm.h", "")) {
7333+ if (pyconf_check_header("gdbm.h", "", "", "", "", V["GDBM_CFLAGS"] )) {
73277334 if (pyconf_check_lib("gdbm", "gdbm_open", V["GDBM_CFLAGS"], V["GDBM_LIBS"])) {
73287335 V["have_gdbm"] = "yes"
73297336 V["GDBM_LIBS"] = ((V["GDBM_LIBS"] != "") ? V["GDBM_LIBS"] : "-lgdbm")
0 commit comments