git: 34d37f18628a - 2021Q4 - lang/mono5.20: Invoke CPU_COUNT properly

From: Cy Schubert <cy_at_FreeBSD.org>
Date: Fri, 10 Dec 2021 04:42:14 UTC
The branch 2021Q4 has been updated by cy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=34d37f18628a1dbdfe15bc7e0f31c60ce8cbcd01

commit 34d37f18628a1dbdfe15bc7e0f31c60ce8cbcd01
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2021-12-09 19:19:26 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2021-12-10 04:40:46 +0000

    lang/mono5.20: Invoke CPU_COUNT properly
    
    6017a183afd1d58656a75f72277f0cd5111cc0e6 did not include a patch to
    configure.ac that allowed it to properly detect CPU_COUNT.
    
    Fixes:          6017a183afd1d58656a75f72277f0cd5111cc0e6
    
    (cherry picked from commit 6e22c3c3fd29ac31c0611e29e6068b62c1e89b43)
---
 lang/mono5.20/files/patch-configure.ac | 54 ++++++++++++++++++++++++++++++++--
 1 file changed, 51 insertions(+), 3 deletions(-)

diff --git a/lang/mono5.20/files/patch-configure.ac b/lang/mono5.20/files/patch-configure.ac
index 6e81b846c43a..d798710c3e41 100644
--- a/lang/mono5.20/files/patch-configure.ac
+++ b/lang/mono5.20/files/patch-configure.ac
@@ -1,6 +1,6 @@
---- configure.ac.orig	2021-01-07 15:31:48 UTC
-+++ configure.ac
-@@ -203,6 +203,12 @@ case "$host" in
+--- configure.ac.orig	2019-07-16 11:21:42.000000000 -0700
++++ configure.ac	2021-12-09 10:42:53.117495000 -0800
+@@ -203,6 +203,12 @@
  		libdl=
  		libgc_threads=pthreads
  		use_sigposix=yes
@@ -13,3 +13,51 @@
  		has_dtrace=yes
  		with_sgen_default_concurrent=yes
  		;;
+@@ -1947,7 +1953,8 @@
+ 	dnl *** won't always indicate the interface sched_affinity has.  ***
+ 	dnl ****************************************************************
+ 	AC_MSG_CHECKING(for sched_setaffinity from glibc < 2.3.4)
+-	AC_TRY_COMPILE([#include <sched.h>], [
++	AC_TRY_COMPILE([#define _WITH_CPU_SET_T
++#include <sched.h>], [
+             int mask = 1; 
+             sched_setaffinity(0, &mask);
+ 	], [
+@@ -1958,8 +1965,9 @@
+ 		# We have the new, three-parameter version
+ 		AC_MSG_RESULT(no)
+ 	])
+-	AC_TRY_COMPILE([#include <sched.h>], [
+-	     CPU_COUNT((void *) 0);
++	AC_TRY_COMPILE([#define _WITH_CPU_SET_T
++#include <sched.h>], [
++	     CPU_COUNT((cpuset_t *) 0);
+ 	], [
+ 		AC_MSG_RESULT(yes)
+ 		AC_DEFINE(GLIBC_HAS_CPU_COUNT, 1, [GLIBC has CPU_COUNT macro in sched.h])
+@@ -4001,13 +4009,10 @@
+ 		;;
+ 	macppc-*-openbsd* | powerpc*-*-linux* | powerpc-*-openbsd* | \
+         powerpc-*-sysv* | powerpc-*-darwin* | powerpc-*-netbsd* | \
+-        powerpc-*-freebsd* | powerpc*-*-aix* | powerpc*-*-os400* )
++        powerpc*-*-freebsd* | powerpc*-*-aix* | powerpc*-*-os400* )
+ 		if test "x$ac_cv_sizeof_void_p" = "x8"; then
+ 			TARGET=POWERPC64;
+ 			CPPFLAGS="$CPPFLAGS -D__mono_ppc__ -D__mono_ppc64__"
+-			if ! (echo $CC | grep -q -- 'clang'); then
+-				CFLAGS="$CFLAGS -mminimal-toc"
+-			fi
+ 		else
+ 			TARGET=POWERPC;
+ 			CPPFLAGS="$CPPFLAGS -D__mono_ppc__"
+@@ -4022,6 +4027,10 @@
+ 			dnl we may hardcode 64-bit names at times, but we don't do 32-bit AIX, so
+ 			LIBC="libc.a(shr_64.o)"
+ 			INTL="libintl.a(libintl.so.8)"
++			;;
++		  freebsd*)
++			BTLS_SUPPORTED=yes
++			BTLS_PLATFORM=powerpc
+ 			;;
+ 		  linux*)
+ 			BTLS_SUPPORTED=yes