File 2503-Update-configure-scripts.patch of Package erlang

From 96bc9990a5aebb437c9dec38944402284d4f2596 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lukas=20Backstr=C3=B6m?= <lukas@erlang.org>
Date: Sun, 9 Feb 2025 13:35:03 +0100
Subject: [PATCH] Update configure scripts

---
 erts/config.h.in              |   2 +-
 lib/erl_interface/config.h.in |   1 -
 lib/odbc/configure            | 261 +++++++++++++++++++++++++++++++---
 3 files changed, 241 insertions(+), 23 deletions(-)

diff --git a/erts/config.h.in b/erts/config.h.in
index fb427ab065..454518a8d0 100644
--- a/erts/config.h.in
+++ b/erts/config.h.in
@@ -1,5 +1,5 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
-/* SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 */
+
 
 #ifndef __ERTS_CONFIG_H__
 #define __ERTS_CONFIG_H__
diff --git a/lib/erl_interface/config.h.in b/lib/erl_interface/config.h.in
index c06d0130ff..61de9340bf 100644
--- a/lib/erl_interface/config.h.in
+++ b/lib/erl_interface/config.h.in
@@ -1,5 +1,4 @@
 /* config.h.in.  Generated from configure.ac by autoheader.  */
-/* SPDX-License-Identifier: GPL-3.0-or-later WITH Autoconf-exception-generic-3.0 */
 
 /* Define to 1 if using 'alloca.c'. */
 #undef C_ALLOCA
diff --git a/lib/odbc/configure b/lib/odbc/configure
index 8be8a5cf52..a13e824f51 100755
--- a/lib/odbc/configure
+++ b/lib/odbc/configure
@@ -4944,25 +4944,6 @@ then :
 
 fi
 
-       for ac_header in sql.h sqlext.h
-do :
-  as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_WINDOWS_H
-     # include <windows.h>
-     #endif
-
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"
-then :
-  cat >>confdefs.h <<_ACEOF
-#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
- odbc_required_headers=yes
-else $as_nop
-  odbc_required_headers=no
-fi
-
-done
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
 printf %s "checking for an ANSI C-conforming const... " >&6; }
@@ -5639,6 +5619,8 @@ case $host_os in #(
 		    ODBC_INCLUDE="-I$with_odbc/include"
 		fi
 
+               save_LIBS="$LIBS"
+               LIBS="$LIBS $ODBC_LIB"
                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -liodbc" >&5
 printf %s "checking for SQLAllocHandle in -liodbc... " >&6; }
 if test ${ac_cv_lib_iodbc_SQLAllocHandle+y}
@@ -5683,17 +5665,70 @@ fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLAllocHandle" >&5
 printf "%s\n" "$ac_cv_lib_iodbc_SQLAllocHandle" >&6; }
 if test "x$ac_cv_lib_iodbc_SQLAllocHandle" = xyes
+then :
+  ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes
+fi
+
+               if test $odbc_lib_link_success = no; then
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5
+printf %s "checking for SQLAllocHandle in -lodbc... " >&6; }
+if test ${ac_cv_lib_odbc_SQLAllocHandle+y}
+then :
+  printf %s "(cached) " >&6
+else case e in #(
+  e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-lodbc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.
+   The 'extern "C"' is for builds by C++ compilers;
+   although this is not generally supported in C code supporting it here
+   has little cost and some practical benefit (sr 110532).  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SQLAllocHandle (void);
+int
+main (void)
+{
+return SQLAllocHandle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_odbc_SQLAllocHandle=yes
+else case e in #(
+  e) ac_cv_lib_odbc_SQLAllocHandle=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_odbc_SQLAllocHandle" >&5
+printf "%s\n" "$ac_cv_lib_odbc_SQLAllocHandle" >&6; }
+if test "x$ac_cv_lib_odbc_SQLAllocHandle" = xyes
 then :
   ODBC_LIB="$ODBC_LIB -lodbc"; odbc_lib_link_success=yes
 fi
 
+               fi
+               LIBS="$save_LIBS"
          ;; #(
   haiku*) :
 
                TARGET_FLAGS="-DUNIX"
                ODBC_LIB= -L"/system/lib"
                ODBC_INCLUDE="-I/system/develop/headers"
-                              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5
+                              save_LIBS="$LIBS"
+               LIBS="$LIBS $ODBC_LIB"
+               { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5
 printf %s "checking for SQLAllocHandle in -lodbc... " >&6; }
 if test ${ac_cv_lib_odbc_SQLAllocHandle+y}
 then :
@@ -5741,6 +5776,57 @@ then :
   ODBC_LIB="$ODBC_LIB -lodbc"; odbc_lib_link_success=yes
 fi
 
+               if test $odbc_lib_link_success = no; then
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -liodbc" >&5
+printf %s "checking for SQLAllocHandle in -liodbc... " >&6; }
+if test ${ac_cv_lib_iodbc_SQLAllocHandle+y}
+then :
+  printf %s "(cached) " >&6
+else case e in #(
+  e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-liodbc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.
+   The 'extern "C"' is for builds by C++ compilers;
+   although this is not generally supported in C code supporting it here
+   has little cost and some practical benefit (sr 110532).  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SQLAllocHandle (void);
+int
+main (void)
+{
+return SQLAllocHandle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_iodbc_SQLAllocHandle=yes
+else case e in #(
+  e) ac_cv_lib_iodbc_SQLAllocHandle=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLAllocHandle" >&5
+printf "%s\n" "$ac_cv_lib_iodbc_SQLAllocHandle" >&6; }
+if test "x$ac_cv_lib_iodbc_SQLAllocHandle" = xyes
+then :
+  ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes
+fi
+
+               fi
+               LIBS="$save_LIBS"
          ;; #(
   win32|cygwin) :
 
@@ -5794,6 +5880,8 @@ fi
 		    ODBC_LIB=-L"$with_odbc/lib"
 		    ODBC_INCLUDE="-I$with_odbc/include"
 		fi
+		save_LIBS="$LIBS"
+		LIBS="$LIBS $ODBC_LIB"
 		{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for main in -lodbc32" >&5
 printf %s "checking for main in -lodbc32... " >&6; }
 if test ${ac_cv_lib_odbc32_main+y}
@@ -5833,6 +5921,7 @@ then :
   ODBC_LIB="$ODBC_LIB -lodbc32"; odbc_lib_link_success=yes
 fi
 
+		LIBS="$save_LIBS"
          ;; #(
   *) :
 
@@ -5911,6 +6000,8 @@ printf "%s\n" "$as_me: WARNING: No odbc library found skipping odbc" >&2;}
 			else
 			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ODBC_LIB" >&5
 printf "%s\n" "$ODBC_LIB" >&6; }
+			    save_LIBS="$LIBS"
+			    LIBS="$LIBS $ODBC_LIB"
 			    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5
 printf %s "checking for SQLAllocHandle in -lodbc... " >&6; }
 if test ${ac_cv_lib_odbc_SQLAllocHandle+y}
@@ -5959,12 +6050,65 @@ then :
   ODBC_LIB="$ODBC_LIB -lodbc"; odbc_lib_link_success=yes
 fi
 
+			    if test $odbc_lib_link_success = no; then
+			       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -liodbc" >&5
+printf %s "checking for SQLAllocHandle in -liodbc... " >&6; }
+if test ${ac_cv_lib_iodbc_SQLAllocHandle+y}
+then :
+  printf %s "(cached) " >&6
+else case e in #(
+  e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-liodbc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.
+   The 'extern "C"' is for builds by C++ compilers;
+   although this is not generally supported in C code supporting it here
+   has little cost and some practical benefit (sr 110532).  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SQLAllocHandle (void);
+int
+main (void)
+{
+return SQLAllocHandle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_iodbc_SQLAllocHandle=yes
+else case e in #(
+  e) ac_cv_lib_iodbc_SQLAllocHandle=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLAllocHandle" >&5
+printf "%s\n" "$ac_cv_lib_iodbc_SQLAllocHandle" >&6; }
+if test "x$ac_cv_lib_iodbc_SQLAllocHandle" = xyes
+then :
+  ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes
+fi
+
+			    fi
+			    LIBS="$save_LIBS"
 			fi
                      ;; #(
   *) :
 
 			ODBC_LIB=-L"$with_odbc/lib"
 			ODBC_INCLUDE="-I$with_odbc/include"
+			save_LIBS="$LIBS"
+			LIBS="$LIBS $ODBC_LIB"
 			{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -lodbc" >&5
 printf %s "checking for SQLAllocHandle in -lodbc... " >&6; }
 if test ${ac_cv_lib_odbc_SQLAllocHandle+y}
@@ -6013,11 +6157,85 @@ then :
   ODBC_LIB="$ODBC_LIB -lodbc"; odbc_lib_link_success=yes
 fi
 
+			if test $odbc_lib_link_success = no; then
+			   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SQLAllocHandle in -liodbc" >&5
+printf %s "checking for SQLAllocHandle in -liodbc... " >&6; }
+if test ${ac_cv_lib_iodbc_SQLAllocHandle+y}
+then :
+  printf %s "(cached) " >&6
+else case e in #(
+  e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-liodbc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.
+   The 'extern "C"' is for builds by C++ compilers;
+   although this is not generally supported in C code supporting it here
+   has little cost and some practical benefit (sr 110532).  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SQLAllocHandle (void);
+int
+main (void)
+{
+return SQLAllocHandle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_iodbc_SQLAllocHandle=yes
+else case e in #(
+  e) ac_cv_lib_iodbc_SQLAllocHandle=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iodbc_SQLAllocHandle" >&5
+printf "%s\n" "$ac_cv_lib_iodbc_SQLAllocHandle" >&6; }
+if test "x$ac_cv_lib_iodbc_SQLAllocHandle" = xyes
+then :
+  ODBC_LIB="$ODBC_LIB -liodbc"; odbc_lib_link_success=yes
+fi
+
+			fi
+			LIBS="$save_LIBS"
                      ;;
 esac
          ;;
 esac
 
+save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $ODBC_INCLUDE"
+       for ac_header in sql.h sqlext.h
+do :
+  as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#ifdef HAVE_WINDOWS_H
+     # include <windows.h>
+     #endif
+
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"
+then :
+  cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ odbc_required_headers=yes
+else $as_nop
+  odbc_required_headers=no
+fi
+
+done
+CFLAGS="$save_CFLAGS"
+
 if test $odbc_required_headers = no;  then
     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: \"ODBC library - header check failed\"" >&5
 printf "%s\n" "$as_me: WARNING: \"ODBC library - header check failed\"" >&2;}
-- 
2.43.0

openSUSE Build Service is sponsored by