File fix-openssl-checks.patch of Package uim_backports

--- ./m4/openssl.m4.orig	2015-03-22 18:02:17.000000000 +0900
+++ ./m4/openssl.m4	2024-08-17 00:38:51.477774130 +0900
@@ -76,6 +76,7 @@
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <openssl/opensslv.h>
 #define DATA "conftest.sslincver"
@@ -112,6 +113,7 @@
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <openssl/opensslv.h>
 #include <openssl/crypto.h>
@@ -156,8 +158,10 @@
 AC_MSG_CHECKING([whether OpenSSL's headers match the library])
 AC_RUN_IFELSE(
 	[AC_LANG_SOURCE([[
+#include <stdlib.h>
 #include <string.h>
 #include <openssl/opensslv.h>
+#include <openssl/crypto.h>
 int main(void) { exit(SSLeay() == OPENSSL_VERSION_NUMBER ? 0 : 1); }
 	]])],
 	[
@@ -217,11 +221,13 @@
 	]
 )
 
+# Use the return value from OpenSSL_version_num to avoid it being
+# optimized out with LTO.
 AC_MSG_CHECKING([if programs using OpenSSL functions will link])
 AC_LINK_IFELSE(
 	[AC_LANG_SOURCE([[
-#include <openssl/evp.h>
-int main(void) { SSLeay_add_all_algorithms(); }
+#include <openssl/crypto.h>
+int main(void) { return (int) OpenSSL_version_num(); }
 	]])],
 	[
 		AC_MSG_RESULT(yes)
openSUSE Build Service is sponsored by