Skip to content

Commit 43eb0e9

Browse files
committed
Cross-compilation fixes for AWK version.
Add checks to pyconf_run_check() and pyconf_run_program_output().
1 parent 1025279 commit 43eb0e9

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Tools/configure/transpiler/pyconf.awk

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,11 @@ function pyconf_compile_link_check(desc, source, extra_flags, compiler, rc, resu
558558

559559
function pyconf_run_check(desc, source, extra_cflags, extra_libs, rc, result) {
560560
if (desc != "") pyconf_checking(desc)
561+
# AC_RUN_IFELSE equivalent: skip when cross-compiling (return false)
562+
if (pyconf_cross_compiling == "yes" || pyconf_cross_compiling == "maybe") {
563+
if (desc != "") pyconf_result("no")
564+
return 0
565+
}
561566
result = _pyconf_run_test(source, extra_cflags " " extra_libs, 1)
562567
rc = _pyconf_run_test_rc
563568
if (desc != "") {
@@ -571,6 +576,11 @@ function pyconf_run_check(desc, source, extra_cflags, extra_libs, rc, result) {
571576

572577
function pyconf_run_program_output(desc, source, extra_flags, result) {
573578
if (desc != "") pyconf_checking(desc)
579+
# Skip when cross-compiling (return empty string)
580+
if (pyconf_cross_compiling == "yes" || pyconf_cross_compiling == "maybe") {
581+
if (desc != "") pyconf_result("")
582+
return ""
583+
}
574584
result = _pyconf_run_test(source, extra_flags, 1)
575585
if (desc != "") pyconf_result(result != "" ? result : "failed")
576586
return result

configure-new

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,11 @@ function pyconf_compile_link_check(desc, source, extra_flags, compiler, rc, resu
593593

594594
function pyconf_run_check(desc, source, extra_cflags, extra_libs, rc, result) {
595595
if (desc != "") pyconf_checking(desc)
596+
# AC_RUN_IFELSE equivalent: skip when cross-compiling (return false)
597+
if (pyconf_cross_compiling == "yes" || pyconf_cross_compiling == "maybe") {
598+
if (desc != "") pyconf_result("no")
599+
return 0
600+
}
596601
result = _pyconf_run_test(source, extra_cflags " " extra_libs, 1)
597602
rc = _pyconf_run_test_rc
598603
if (desc != "") {
@@ -606,6 +611,11 @@ function pyconf_run_check(desc, source, extra_cflags, extra_libs, rc, result) {
606611

607612
function pyconf_run_program_output(desc, source, extra_flags, result) {
608613
if (desc != "") pyconf_checking(desc)
614+
# Skip when cross-compiling (return empty string)
615+
if (pyconf_cross_compiling == "yes" || pyconf_cross_compiling == "maybe") {
616+
if (desc != "") pyconf_result("")
617+
return ""
618+
}
609619
result = _pyconf_run_test(source, extra_flags, 1)
610620
if (desc != "") pyconf_result(result != "" ? result : "failed")
611621
return result

0 commit comments

Comments
 (0)