git: bd22c2827968 - main - lang/ruby3[0-2]: Fix build with certain CPUTYPE

From: Jung-uk Kim <jkim_at_FreeBSD.org>
Date: Sat, 23 Apr 2022 03:12:39 UTC
The branch main has been updated by jkim:

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

commit bd22c2827968b0ef6ef36dd853b31259c6ba3125
Author:     Jung-uk Kim <jkim@FreeBSD.org>
AuthorDate: 2022-04-23 03:04:46 +0000
Commit:     Jung-uk Kim <jkim@FreeBSD.org>
CommitDate: 2022-04-23 03:04:46 +0000

    lang/ruby3[0-2]: Fix build with certain CPUTYPE
    
    When CPUTYPE is set and the CPU supports lzcnt instruction, it fails to
    build because x86intrin.h is not included.  Fix the test to make it work
    on FreeBSD.
    
    PR:             260791
    Approved by:    ruby (maintainer timeout)
---
 lang/ruby30/files/patch-configure.ac | 17 +++++++++++++----
 lang/ruby31/files/patch-configure.ac | 15 ++++++++++++---
 lang/ruby32/files/patch-configure.ac | 15 ++++++++++++---
 3 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/lang/ruby30/files/patch-configure.ac b/lang/ruby30/files/patch-configure.ac
index 170a9f3a9fe8..3571a89e5cec 100644
--- a/lang/ruby30/files/patch-configure.ac
+++ b/lang/ruby30/files/patch-configure.ac
@@ -1,6 +1,15 @@
---- configure.ac.orig	2018-12-28 12:03:09 UTC
-+++ configure.ac
-@@ -2678,7 +2678,7 @@ AS_IF([test "$with_dln_a_out" != yes], [
+--- configure.ac.orig	2022-04-12 11:48:55 UTC
++++ configure.ac	2022-04-23
+@@ -1231,7 +1231,7 @@ AC_CHECK_HEADERS(utime.h)
+ AC_CHECK_HEADERS(time.h)
+ AC_CHECK_HEADERS(ucontext.h)
+ AC_CHECK_HEADERS(utime.h)
+-AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
++AS_CASE("$target_cpu", [amd64|x64|x86_64|i[3-6]86*], [
+   AC_CHECK_HEADERS(x86intrin.h)
+ ])
+ 
+@@ -2825,7 +2825,7 @@ AS_IF([test "$with_dln_a_out" != yes], [
  			: ${LDSHARED='$(CC) -shared'}
  			AS_IF([test "$rb_cv_binary_elf" = yes], [
  			    LDFLAGS="$LDFLAGS -rdynamic"
@@ -9,7 +18,7 @@
  			], [
  			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
  			])
-@@ -3163,6 +3163,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3324,6 +3324,7 @@ AS_CASE("$enable_shared", [yes], [
      [freebsd*|dragonfly*], [
  	LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
  	LIBRUBY_SONAME='$(LIBRUBY_SO)'
diff --git a/lang/ruby31/files/patch-configure.ac b/lang/ruby31/files/patch-configure.ac
index 170a9f3a9fe8..620b24f62202 100644
--- a/lang/ruby31/files/patch-configure.ac
+++ b/lang/ruby31/files/patch-configure.ac
@@ -1,6 +1,15 @@
---- configure.ac.orig	2018-12-28 12:03:09 UTC
+--- configure.ac.orig	2022-04-12 11:11:15 UTC
 +++ configure.ac
-@@ -2678,7 +2678,7 @@ AS_IF([test "$with_dln_a_out" != yes], [
+@@ -1304,7 +1304,7 @@ AC_CHECK_HEADERS(utime.h)
+ AC_CHECK_HEADERS(time.h)
+ AC_CHECK_HEADERS(ucontext.h)
+ AC_CHECK_HEADERS(utime.h)
+-AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
++AS_CASE("$target_cpu", [amd64|x64|x86_64|i[3-6]86*], [
+   AC_CHECK_HEADERS(x86intrin.h)
+ ])
+ RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
+@@ -2982,7 +2982,7 @@ STATIC=
  			: ${LDSHARED='$(CC) -shared'}
  			AS_IF([test "$rb_cv_binary_elf" = yes], [
  			    LDFLAGS="$LDFLAGS -rdynamic"
@@ -9,7 +18,7 @@
  			], [
  			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
  			])
-@@ -3163,6 +3163,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3458,6 +3458,7 @@ AS_CASE("$enable_shared", [yes], [
      [freebsd*|dragonfly*], [
  	LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
  	LIBRUBY_SONAME='$(LIBRUBY_SO)'
diff --git a/lang/ruby32/files/patch-configure.ac b/lang/ruby32/files/patch-configure.ac
index 170a9f3a9fe8..7740d9d0a1c3 100644
--- a/lang/ruby32/files/patch-configure.ac
+++ b/lang/ruby32/files/patch-configure.ac
@@ -1,6 +1,15 @@
---- configure.ac.orig	2018-12-28 12:03:09 UTC
+--- configure.ac.orig	2022-04-03 04:38:31 UTC
 +++ configure.ac
-@@ -2678,7 +2678,7 @@ AS_IF([test "$with_dln_a_out" != yes], [
+@@ -1320,7 +1320,7 @@ AC_CHECK_HEADERS(utime.h)
+ AC_CHECK_HEADERS(time.h)
+ AC_CHECK_HEADERS(ucontext.h)
+ AC_CHECK_HEADERS(utime.h)
+-AS_CASE("$target_cpu", [x64|x86_64|i[3-6]86*], [
++AS_CASE("$target_cpu", [amd64|x64|x86_64|i[3-6]86*], [
+   AC_CHECK_HEADERS(x86intrin.h)
+ ])
+ RUBY_UNIVERSAL_CHECK_HEADER([x86_64, i386], x86intrin.h)
+@@ -3027,7 +3027,7 @@ STATIC=
  			: ${LDSHARED='$(CC) -shared'}
  			AS_IF([test "$rb_cv_binary_elf" = yes], [
  			    LDFLAGS="$LDFLAGS -rdynamic"
@@ -9,7 +18,7 @@
  			], [
  			  test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable'
  			])
-@@ -3163,6 +3163,7 @@ AS_CASE("$enable_shared", [yes], [
+@@ -3501,6 +3501,7 @@ AS_CASE("$enable_shared", [yes], [
      [freebsd*|dragonfly*], [
  	LIBRUBY_SO='lib$(RUBY_SO_NAME).$(SOEXT).$(MAJOR)$(MINOR)'
  	LIBRUBY_SONAME='$(LIBRUBY_SO)'