Skip to content

Commit 86027a6

Browse files
committed
Display "unknown" on error
1 parent fd078ac commit 86027a6

2 files changed

Lines changed: 19 additions & 13 deletions

File tree

configure

Lines changed: 9 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2464,7 +2464,7 @@ AS_CASE([$ac_sys_system],
24642464

24652465
dnl On Linux, check the thread stack size. musl (ex: Alpine Linux) uses
24662466
dnl a default thread stack size of 128 kB, whereas the glibc uses 8 MiB.
2467-
dnl Python uses at least 1 MiB.
2467+
dnl Python needs at least 1 MiB.
24682468
if test "$ac_sys_system" = "Linux" -a "$cross_compiling" = no; then
24692469
AC_CACHE_CHECK([for thread stack size], [ac_cv_thread_stack_size], [
24702470
cat > conftest.c <<EOF
@@ -2492,17 +2492,20 @@ int main()
24922492
}
24932493
EOF
24942494
2495-
ac_cv_thread_stack_size="default"
2495+
ac_cv_thread_stack_size=unknown
24962496
if $CC -pthread $CFLAGS conftest.c -o conftest &>/dev/null; then
2497-
./conftest &>/dev/null
2498-
if test $? -eq 1; then
2499-
ac_cv_thread_stack_size=1048576
2500-
fi
2497+
./conftest &>/dev/null
2498+
exitcode=$?
2499+
if test $exitcode -eq 1; then
2500+
ac_cv_thread_stack_size=1048576
2501+
elif test $exitcode -eq 0; then
2502+
ac_cv_thread_stack_size="default"
2503+
fi
25012504
fi
25022505
rm -f conftest.c conftest
25032506
])
25042507

2505-
if test "$ac_cv_thread_stack_size" != "default"; then
2508+
if test "$ac_cv_thread_stack_size" != "default" -a "$ac_cv_thread_stack_size" != "unknown"; then
25062509
LDFLAGS="$LDFLAGS -Wl,-z,stack-size=$ac_cv_thread_stack_size"
25072510
fi
25082511
fi

0 commit comments

Comments
 (0)