Tue Nov 7 11:36:57 2023 UTC ()
Default to python 3.10 if compiler lacks c11 support.


(nia)
diff -r1.156 -r1.157 pkgsrc/lang/python/pyversion.mk
diff -r1.264 -r1.265 pkgsrc/mk/compiler/gcc.mk

cvs diff -r1.156 -r1.157 pkgsrc/lang/python/pyversion.mk (expand / switch to context diff)
--- pkgsrc/lang/python/pyversion.mk 2023/10/02 20:10:38 1.156
+++ pkgsrc/lang/python/pyversion.mk 2023/11/07 11:36:57 1.157
@@ -1,4 +1,4 @@
-# $NetBSD: pyversion.mk,v 1.156 2023/10/02 20:10:38 adam Exp $
+# $NetBSD: pyversion.mk,v 1.157 2023/11/07 11:36:57 nia Exp $
 
 # This file should be included by packages as a way to depend on
 # python when none of the other methods are appropriate, e.g. a
@@ -102,7 +102,11 @@
 BUILD_DEFS+=		PYTHON_VERSION_DEFAULT
 BUILD_DEFS_EFFECTS+=	PYPACKAGE
 
+.if ${COMPILER_HAS_C11:Uyes} != "no"
 PYTHON_VERSION_DEFAULT?=		311
+.else
+PYTHON_VERSION_DEFAULT?=		310
+.endif
 PYTHON_VERSIONS_ACCEPTED?=		312 311 310 39 38 27
 PYTHON_VERSIONS_INCOMPATIBLE?=		# empty by default
 

cvs diff -r1.264 -r1.265 pkgsrc/mk/compiler/gcc.mk (expand / switch to context diff)
--- pkgsrc/mk/compiler/gcc.mk 2023/11/07 09:54:49 1.264
+++ pkgsrc/mk/compiler/gcc.mk 2023/11/07 11:36:57 1.265
@@ -1,4 +1,4 @@
-# $NetBSD: gcc.mk,v 1.264 2023/11/07 09:54:49 nia Exp $
+# $NetBSD: gcc.mk,v 1.265 2023/11/07 11:36:57 nia Exp $
 #
 # This is the compiler definition for the GNU Compiler Collection.
 #
@@ -333,6 +333,12 @@
 #
 # Note that pkgsrc also sets this flag itself for Darwin+clang.
 BUILDLINK_TRANSFORM+=	rm:-Wno-error=implicit-function-declaration
+.endif
+
+.if !empty(_GCC_VERSION:M[23]\..*) || !empty(_GCC_VERSION:M4.[0-8]\..*)
+COMPILER_HAS_C11?=	no
+.else
+COMPILER_HAS_C11?=	yes
 .endif
 
 .for _version_ in ${_C_STD_VERSIONS}