diff options
Diffstat (limited to '0122-2-2-AC_RUN_IFELSE-replace.patch')
-rw-r--r-- | 0122-2-2-AC_RUN_IFELSE-replace.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/0122-2-2-AC_RUN_IFELSE-replace.patch b/0122-2-2-AC_RUN_IFELSE-replace.patch new file mode 100644 index 000000000000..e806c69d8085 --- /dev/null +++ b/0122-2-2-AC_RUN_IFELSE-replace.patch @@ -0,0 +1,53 @@ +From 91ea75c8a7e2c91fd1ba454f3522ac8f27989805 Mon Sep 17 00:00:00 2001 +From: Long Nguyen <nguyen.long.908132@gmail.com> +Date: Fri, 30 Jul 2021 16:34:41 +0700 +Subject: [PATCH 122/N] [2/2] AC_RUN_IFELSE replace + +Replace strtonum() with --non-decimal-data +--- + configure.ac | 28 +++++++++++++--------------- + 1 file changed, 13 insertions(+), 15 deletions(-) + +diff --git a/configure.ac b/configure.ac +index 14eb4b6..215dc75 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5959,22 +5959,20 @@ AC_MSG_RESULT(done) + case $host in + *-*-mingw*) + LIBS="$LIBS -lversion -lshlwapi" +- ++ AC_PROG_AWK ++ if test "$AWK" = "gawk"; then ++ awk_extra_flag="--non-decimal-data" ++ fi + AC_MSG_CHECKING([FIELD3]) +- SAVE_CFLAGS=$CFLAGS +- CFLAGS="-I $srcdir/Include" +- AC_RUN_IFELSE([AC_LANG_SOURCE([[ +- #include <stdio.h> +- #include "patchlevel.h" +- int main() { +- fprintf ( +- fopen ("conftest.out","w"), +- "%d", +- PY_MICRO_VERSION * 1000 + PY_RELEASE_LEVEL * 10 + PY_RELEASE_SERIAL); +- return 0; +- } +- ]])], [FIELD3=`cat conftest.out`]) +- CFLAGS=$SAVE_CFLAGS ++ FIELD3=$($AWK $awk_extra_flag '\ ++ /^#define PY_RELEASE_LEVEL_/ {levels[$2]=$3} \ ++ /^#define PY_MICRO_VERSION[[:space:]]+/ {micro=$3} \ ++ /^#define PY_RELEASE_LEVEL[[:space:]]+/ {level=levels[$3]} \ ++ /^#define PY_RELEASE_SERIAL[[:space:]]+/ {serial=$3} \ ++ END {print micro * 1000 + level * 10 + serial}' \ ++ $srcdir/Include/patchlevel.h ++ ) ++ + AC_MSG_RESULT([${FIELD3}]) + RCFLAGS="$RCFLAGS -DFIELD3=$FIELD3 -O COFF" + +-- +2.32.0 + |