$NetBSD: patch-configure,v 1.2 2021/12/07 09:31:09 adam Exp $

Use gnu99 instead of c99 to avoid "alloca() undefined" problems.
Fix linking on Darwin; don't use -stack_size.
Changes for consistency across pkgsrc platforms.
Simplify _sysconfigdata to include only platform name.
detect netcan/can.h on NetBSD

--- configure.orig	2021-12-06 18:23:39.000000000 +0000
+++ configure
@@ -7040,7 +7040,7 @@ UNIVERSAL_ARCH_FLAGS=
 # tweak BASECFLAGS based on compiler and platform
 case $GCC in
 yes)
-    CFLAGS_NODIST="$CFLAGS_NODIST -std=c99"
+    CFLAGS_NODIST="$CFLAGS_NODIST -std=gnu99"
 
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wextra" >&5
 $as_echo_n "checking for -Wextra... " >&6; }
@@ -8664,6 +8664,17 @@ if test "x$ac_cv_type___uint128_t" = xye
 $as_echo "#define HAVE_GCC_UINT128_T 1" >>confdefs.h
 
 fi
+ac_fn_c_check_header_compile "$LINENO" "netcan/can.h" "ac_cv_header_netcan_can_h" "
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+
+"
+if test "x$ac_cv_header_netcan_can_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_NETCAN_CAN_H 1" >>confdefs.h
+
+fi
 
 
 # Sizes and alignments of various common basic types
@@ -9884,13 +9895,12 @@ then
 		# small for the default recursion limit. Increase the stack size
 		# to ensure that tests don't crash
     stack_size="1000000"  # 16 MB
-    if test "$with_ubsan" == "yes"
+    if test "$with_ubsan" = "yes"
     then
         # Undefined behavior sanitizer requires an even deeper stack
         stack_size="4000000"  # 64 MB
     fi
 
-    LINKFORSHARED="-Wl,-stack_size,$stack_size $LINKFORSHARED"
 
 
 cat >>confdefs.h <<_ACEOF
@@ -14751,10 +14761,10 @@ _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
 
 
-if grep noonsees conftest.$ac_objext >/dev/null ; then
+if strings -a conftest.$ac_objext | grep noonsees >/dev/null ; then
   ax_cv_c_float_words_bigendian=yes
 fi
-if grep seesnoon conftest.$ac_objext >/dev/null ; then
+if strings -a conftest.$ac_objext | grep seesnoon >/dev/null ; then
   if test "$ax_cv_c_float_words_bigendian" = unknown; then
     ax_cv_c_float_words_bigendian=no
   else
@@ -15655,7 +15665,7 @@ _ACEOF
 fi
 
 
-EXT_SUFFIX=.${SOABI}${SHLIB_SUFFIX}
+EXT_SUFFIX=${SHLIB_SUFFIX}
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking LDVERSION" >&5
 $as_echo_n "checking LDVERSION... " >&6; }
@@ -15708,11 +15718,7 @@ fi
 
 
 
-if test x$PLATFORM_TRIPLET = x; then
-  LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
-else
-  LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
-fi
+LIBPL='$(prefix)'"/${PLATLIBDIR}/python${VERSION}/config-${LDVERSION}"
 
 
 # Check for --with-wheel-pkg-dir=PATH
