Blame SOURCES/cyrus-sasl-2.1.27-fix-for-autoconf270.patch

8b8af0
From 3b0149cf3d235247b051b7cb7663bc3dadbb999b Mon Sep 17 00:00:00 2001
8b8af0
From: Pavel Raiskup <praiskup@redhat.com>
8b8af0
Date: Thu, 1 Apr 2021 17:17:52 +0200
8b8af0
Subject: [PATCH] configure.ac: avoid side-effects in AC_CACHE_VAL
8b8af0
8b8af0
In the COMMANDS-TO-SET-IT argument, per Autoconf docs:
8b8af0
https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Caching-Results.html
8b8af0
---
8b8af0
 configure.ac | 7 +++++--
8b8af0
 1 file changed, 5 insertions(+), 2 deletions(-)
8b8af0
8b8af0
diff --git a/configure.ac b/configure.ac
8b8af0
index a106d35e..d333496d 100644
8b8af0
--- a/configure.ac
8b8af0
+++ b/configure.ac
8b8af0
@@ -220,11 +220,14 @@ void foo() { int i=0;}
8b8af0
 int main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
8b8af0
     if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo");
8b8af0
     if(ptr1 && !ptr2) exit(0); } exit(1); } 
8b8af0
-], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no
8b8af0
-	AC_DEFINE(DLSYM_NEEDS_UNDERSCORE, [], [Do we need a leading _ for dlsym?]),
8b8af0
+], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no,
8b8af0
 	AC_MSG_WARN(cross-compiler, we'll do our best)))
8b8af0
 	LIBS="$cmu_save_LIBS"
8b8af0
       AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore)
8b8af0
+
8b8af0
+      if test "$sasl_cv_dlsym_adds_uscore" = no; then
8b8af0
+        AC_DEFINE(DLSYM_NEEDS_UNDERSCORE, [], [Do we need a leading _ for dlsym?])
8b8af0
+      fi
8b8af0
   fi
8b8af0
 fi
8b8af0
 
8b8af0
From d3bcaf62f6213e7635e9c4a574f39a831e333980 Mon Sep 17 00:00:00 2001
8b8af0
From: Pavel Raiskup <praiskup@redhat.com>
8b8af0
Date: Thu, 1 Apr 2021 17:26:28 +0200
8b8af0
Subject: [PATCH] configure.ac: properly quote macro arguments
8b8af0
8b8af0
Autoconf 2.70+ is more picky about the quotation (even though with
8b8af0
previous versions the arguments should have been quoted, too).  When we
8b8af0
don't quote macros inside the AC_CACHE_VAL macro - some of the Autoconf
8b8af0
initialization is wrongly ordered in ./configure script and we keep
8b8af0
seeing bugs like:
8b8af0
8b8af0
    ./configure: line 2165: ac_fn_c_try_run: command not found
8b8af0
8b8af0
Original report: https://bugzilla.redhat.com/1943013
8b8af0
---
8b8af0
 configure.ac | 7 ++++---
8b8af0
 1 file changed, 4 insertions(+), 3 deletions(-)
8b8af0
8b8af0
diff --git a/configure.ac b/configure.ac
8b8af0
index d333496d..7281cba0 100644
8b8af0
--- a/configure.ac
8b8af0
+++ b/configure.ac
8b8af0
@@ -213,15 +213,16 @@ if test $sasl_cv_uscore = yes; then
8b8af0
 	AC_MSG_CHECKING(whether dlsym adds the underscore for us)
8b8af0
 	cmu_save_LIBS="$LIBS"
8b8af0
 	LIBS="$LIBS $SASL_DL_LIB"
8b8af0
-	AC_CACHE_VAL(sasl_cv_dlsym_adds_uscore,AC_TRY_RUN( [
8b8af0
+	AC_CACHE_VAL([sasl_cv_dlsym_adds_uscore],
8b8af0
+	             [AC_TRY_RUN([
8b8af0
 #include <dlfcn.h>
8b8af0
 #include <stdio.h>
8b8af0
 void foo() { int i=0;}
8b8af0
 int main() { void *self, *ptr1, *ptr2; self=dlopen(NULL,RTLD_LAZY);
8b8af0
     if(self) { ptr1=dlsym(self,"foo"); ptr2=dlsym(self,"_foo");
8b8af0
     if(ptr1 && !ptr2) exit(0); } exit(1); } 
8b8af0
-], [sasl_cv_dlsym_adds_uscore=yes], sasl_cv_dlsym_adds_uscore=no,
8b8af0
-	AC_MSG_WARN(cross-compiler, we'll do our best)))
8b8af0
+], [sasl_cv_dlsym_adds_uscore=yes], [sasl_cv_dlsym_adds_uscore=no],
8b8af0
+	[AC_MSG_WARN(cross-compiler, we'll do our best)])])
8b8af0
 	LIBS="$cmu_save_LIBS"
8b8af0
       AC_MSG_RESULT($sasl_cv_dlsym_adds_uscore)
8b8af0