File 7717-erts-config-Updated-to-find-ip_mreqn.patch of Package erlang
From 9f1f1c1d109d823dc6803a47e694c1ac794a1e1a Mon Sep 17 00:00:00 2001
From: Micael Karlberg <bmk@erlang.org>
Date: Mon, 16 May 2022 15:56:53 +0200
Subject: [PATCH 07/11] [erts|config] Updated to find 'ip_mreqn'
Add configure checks for the type 'struct ip_mreqn'.
OTP_18091
---
erts/config.h.in | 3 ++
erts/configure | 119 ++++++++++++++++++++++++++--------------------
erts/configure.ac | 10 ++++
3 files changed, 80 insertions(+), 52 deletions(-)
diff --git a/erts/config.h.in b/erts/config.h.in
index 64a955c035..87395b8073 100644
--- a/erts/config.h.in
+++ b/erts/config.h.in
@@ -1013,6 +1013,9 @@
/* Define to 1 if `ifr_map' is a member of `struct ifreq'. */
#undef HAVE_STRUCT_IFREQ_IFR_MAP
+/* Define to 1 if the system has the type `struct ip_mreqn'. */
+#undef HAVE_STRUCT_IP_MREQN
+
/* Define to 1 if `assoc_id' is a member of `struct sctp_accoc_value'. */
#undef HAVE_STRUCT_SCTP_ACCOC_VALUE_ASSOC_ID
diff --git a/erts/configure b/erts/configure
index a85a6d0f00..815428caaf 100755
--- a/erts/configure
+++ b/erts/configure
@@ -2390,52 +2390,6 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_member
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
-# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- as_decl_name=`echo $2|sed 's/ *(.*//'`
- as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-$4
-int
-main ()
-{
-#ifndef $as_decl_name
-#ifdef __cplusplus
- (void) $as_decl_use;
-#else
- (void) $as_decl_name;
-#endif
-#endif
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
- eval "$3=yes"
-else
- eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_decl
-
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -2490,6 +2444,52 @@ $as_echo "$ac_res" >&6; }
} # ac_fn_c_check_type
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ as_decl_name=`echo $2|sed 's/ *(.*//'`
+ as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+ (void) $as_decl_use;
+#else
+ (void) $as_decl_name;
+#endif
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ eval "$3=yes"
+else
+ eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
@@ -14937,6 +14937,21 @@ _ACEOF
fi
+
+ac_fn_c_check_type "$LINENO" "struct ip_mreqn" "ac_cv_type_struct_ip_mreqn" "
+ #include <netinet/in.h>
+
+"
+if test "x$ac_cv_type_struct_ip_mreqn" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_IP_MREQN 1" >>confdefs.h
+
+
+fi
+
+
+
if test x"$enable_systemd" != x"no"; then
systemd_daemon_save_LIBS=$LIBS
diff --git a/erts/configure.in b/erts/configure.in
index 9ee5a37a40..ab2ee78acd 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1658,6 +1658,16 @@ AC_CHECK_MEMBERS([struct ifreq.ifr_enaddr], [], [],
#endif
])
+dnl ----------------------------------------------------------------------
+dnl Checks for types.
+dnl ----------------------------------------------------------------------
+
+AC_CHECK_TYPES([struct ip_mreqn], [], [],
+ [
+ #include <netinet/in.h>
+ ])
+
+
dnl ----------------------------------------------------------------------
dnl Check the availability of systemd
dnl ----------------------------------------------------------------------
--
2.35.3