Blame SOURCES/bz1688892-fix-openssl-init-configure.patch

6a7e4c
--- a/configure	2018-11-12 13:40:33.000000000 -0600
6a7e4c
+++ b/configure	2019-03-18 11:29:03.305427768 -0500
6a7e4c
@@ -730,7 +730,6 @@
6a7e4c
 AMDEPBACKSLASH
6a7e4c
 AMDEP_FALSE
6a7e4c
 AMDEP_TRUE
6a7e4c
-am__quote
6a7e4c
 am__include
6a7e4c
 DEPDIR
6a7e4c
 OBJEXT
6a7e4c
@@ -790,7 +789,6 @@
6a7e4c
 docdir
6a7e4c
 oldincludedir
6a7e4c
 includedir
6a7e4c
-runstatedir
6a7e4c
 localstatedir
6a7e4c
 sharedstatedir
6a7e4c
 sysconfdir
6a7e4c
@@ -809,7 +807,8 @@
6a7e4c
 PACKAGE_TARNAME
6a7e4c
 PACKAGE_NAME
6a7e4c
 PATH_SEPARATOR
6a7e4c
-SHELL'
6a7e4c
+SHELL
6a7e4c
+am__quote'
6a7e4c
 ac_subst_files=''
6a7e4c
 ac_user_opts='
6a7e4c
 enable_option_checking
6a7e4c
@@ -925,7 +924,6 @@
6a7e4c
 sysconfdir='${prefix}/etc'
6a7e4c
 sharedstatedir='${prefix}/com'
6a7e4c
 localstatedir='${prefix}/var'
6a7e4c
-runstatedir='${localstatedir}/run'
6a7e4c
 includedir='${prefix}/include'
6a7e4c
 oldincludedir='/usr/include'
6a7e4c
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
6a7e4c
@@ -1178,15 +1176,6 @@
6a7e4c
   | -silent | --silent | --silen | --sile | --sil)
6a7e4c
     silent=yes ;;
6a7e4c
 
6a7e4c
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
6a7e4c
-  | --runstate | --runstat | --runsta | --runst | --runs \
6a7e4c
-  | --run | --ru | --r)
6a7e4c
-    ac_prev=runstatedir ;;
6a7e4c
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
6a7e4c
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
6a7e4c
-  | --run=* | --ru=* | --r=*)
6a7e4c
-    runstatedir=$ac_optarg ;;
6a7e4c
-
6a7e4c
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
6a7e4c
     ac_prev=sbindir ;;
6a7e4c
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
6a7e4c
@@ -1324,7 +1313,7 @@
6a7e4c
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
6a7e4c
 		datadir sysconfdir sharedstatedir localstatedir includedir \
6a7e4c
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
6a7e4c
-		libdir localedir mandir runstatedir
6a7e4c
+		libdir localedir mandir
6a7e4c
 do
6a7e4c
   eval ac_val=\$$ac_var
6a7e4c
   # Remove trailing slashes.
6a7e4c
@@ -1477,7 +1466,6 @@
6a7e4c
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
6a7e4c
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
6a7e4c
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
6a7e4c
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
6a7e4c
   --libdir=DIR            object code libraries [EPREFIX/lib]
6a7e4c
   --includedir=DIR        C header files [PREFIX/include]
6a7e4c
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
6a7e4c
@@ -2689,7 +2677,7 @@
6a7e4c
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
6a7e4c
 
6a7e4c
 
6a7e4c
-am__api_version='1.15'
6a7e4c
+am__api_version='1.16'
6a7e4c
 
6a7e4c
 ac_aux_dir=
6a7e4c
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
6a7e4c
@@ -3234,8 +3222,8 @@
6a7e4c
 
6a7e4c
 # For better backward compatibility.  To be removed once Automake 1.9.x
6a7e4c
 # dies out for good.  For more background, see:
6a7e4c
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
6a7e4c
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
6a7e4c
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
6a7e4c
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
6a7e4c
 mkdir_p='$(MKDIR_P)'
6a7e4c
 
6a7e4c
 # We need awk for the "check" target (and possibly the TAP driver).  The
6a7e4c
@@ -3286,7 +3274,7 @@
6a7e4c
 Aborting the configuration process, to ensure you take notice of the issue.
6a7e4c
 
6a7e4c
 You can download and install GNU coreutils to get an 'rm' implementation
6a7e4c
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
6a7e4c
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
6a7e4c
 
6a7e4c
 If you want to complete the configuration process using your problematic
6a7e4c
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
6a7e4c
@@ -4650,45 +4638,45 @@
6a7e4c
 
6a7e4c
 ac_config_commands="$ac_config_commands depfiles"
6a7e4c
 
6a7e4c
-
6a7e4c
-am_make=${MAKE-make}
6a7e4c
-cat > confinc << 'END'
6a7e4c
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
6a7e4c
+$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; }
6a7e4c
+cat > confinc.mk << 'END'
6a7e4c
 am__doit:
6a7e4c
-	@echo this is the am__doit target
6a7e4c
+	@echo this is the am__doit target >confinc.out
6a7e4c
 .PHONY: am__doit
6a7e4c
 END
6a7e4c
-# If we don't find an include directive, just comment out the code.
6a7e4c
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
6a7e4c
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
6a7e4c
 am__include="#"
6a7e4c
 am__quote=
6a7e4c
-_am_result=none
6a7e4c
-# First try GNU make style include.
6a7e4c
-echo "include confinc" > confmf
6a7e4c
-# Ignore all kinds of additional output from 'make'.
6a7e4c
-case `$am_make -s -f confmf 2> /dev/null` in #(
6a7e4c
-*the\ am__doit\ target*)
6a7e4c
-  am__include=include
6a7e4c
-  am__quote=
6a7e4c
-  _am_result=GNU
6a7e4c
-  ;;
6a7e4c
-esac
6a7e4c
-# Now try BSD make style include.
6a7e4c
-if test "$am__include" = "#"; then
6a7e4c
-   echo '.include "confinc"' > confmf
6a7e4c
-   case `$am_make -s -f confmf 2> /dev/null` in #(
6a7e4c
-   *the\ am__doit\ target*)
6a7e4c
-     am__include=.include
6a7e4c
-     am__quote="\""
6a7e4c
-     _am_result=BSD
6a7e4c
+# BSD make does it like this.
6a7e4c
+echo '.include "confinc.mk" # ignored' > confmf.BSD
6a7e4c
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
6a7e4c
+echo 'include confinc.mk # ignored' > confmf.GNU
6a7e4c
+_am_result=no
6a7e4c
+for s in GNU BSD; do
6a7e4c
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
6a7e4c
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
6a7e4c
+   ac_status=$?
6a7e4c
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
6a7e4c
+   (exit $ac_status); }
6a7e4c
+  case $?:`cat confinc.out 2>/dev/null` in #(
6a7e4c
+  '0:this is the am__doit target') :
6a7e4c
+    case $s in #(
6a7e4c
+  BSD) :
6a7e4c
+    am__include='.include' am__quote='"' ;; #(
6a7e4c
+  *) :
6a7e4c
+    am__include='include' am__quote='' ;;
6a7e4c
+esac ;; #(
6a7e4c
+  *) :
6a7e4c
      ;;
6a7e4c
-   esac
6a7e4c
-fi
6a7e4c
-
6a7e4c
-
6a7e4c
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
6a7e4c
-$as_echo "$_am_result" >&6; }
6a7e4c
-rm -f confinc confmf
6a7e4c
+esac
6a7e4c
+  if test "$am__include" != "#"; then
6a7e4c
+    _am_result="yes ($s style)"
6a7e4c
+    break
6a7e4c
+  fi
6a7e4c
+done
6a7e4c
+rm -f confinc.* confmf.*
6a7e4c
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
6a7e4c
+$as_echo "${_am_result}" >&6; }
6a7e4c
 
6a7e4c
 # Check whether --enable-dependency-tracking was given.
6a7e4c
 if test "${enable_dependency_tracking+set}" = set; then :
6a7e4c
@@ -7506,8 +7494,8 @@
6a7e4c
 done
6a7e4c
 
6a7e4c
 
6a7e4c
-# SSL_set0_rbio(), SSL_set0_wbio() and OPENSSL_init_crypto() introduced OpenSSL v1.1.0
6a7e4c
-for ac_func in SSL_set0_rbio OPENSSL_init_crypto
6a7e4c
+# SSL_set0_rbio(), SSL_set0_wbio() OPENSSL_init_crypto() and TLS_method() introduced OpenSSL v1.1.0
6a7e4c
+for ac_func in SSL_set0_rbio OPENSSL_init_crypto TLS_method
6a7e4c
 do :
6a7e4c
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
6a7e4c
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
6a7e4c
@@ -7520,19 +7508,62 @@
6a7e4c
 done
6a7e4c
 
6a7e4c
 
6a7e4c
-# TLS_method() introduced OpenSSL v1.1.0
6a7e4c
-for ac_func in TLS_method
6a7e4c
-do :
6a7e4c
-  ac_fn_c_check_func "$LINENO" "TLS_method" "ac_cv_func_TLS_method"
6a7e4c
-if test "x$ac_cv_func_TLS_method" = xyes; then :
6a7e4c
-  cat >>confdefs.h <<_ACEOF
6a7e4c
-#define HAVE_TLS_METHOD 1
6a7e4c
-_ACEOF
6a7e4c
+# In OpenSSL v1.1.1 the call to SSL_CTX_new() fails if OPENSSL_init_crypto() has been called with
6a7e4c
+# OPENSSL_INIT_NO_LOAD_CONFIG. It does not fail in v1.1.0h and v1.1.1b.
6a7e4c
+if test .$ac_cv_func_OPENSSL_init_crypto = .yes; then :
6a7e4c
 
6a7e4c
+        if test .$ac_cv_func_TLS_method = .yes; then :
6a7e4c
+  method_func=TLS_method
6a7e4c
+else
6a7e4c
+  method_func=SSLv23_method
6a7e4c
 fi
6a7e4c
-done
6a7e4c
+	if test "$cross_compiling" = yes; then :
6a7e4c
+
6a7e4c
+	    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Cannot determine if need to OPENSSL_init_crypto() problem. Assuming yes for safety." >&5
6a7e4c
+$as_echo "$as_me: WARNING: Cannot determine if need to OPENSSL_init_crypto() problem. Assuming yes for safety." >&2;}
6a7e4c
+	    openssl_init_no_load_bug=1
6a7e4c
+
6a7e4c
+
6a7e4c
+else
6a7e4c
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
6a7e4c
+/* end confdefs.h.  */
6a7e4c
+#include <openssl/ssl.h>
6a7e4c
+int
6a7e4c
+main ()
6a7e4c
+{
6a7e4c
+
6a7e4c
+	      const SSL_METHOD *meth;
6a7e4c
+	      SSL_CTX *ctx;
6a7e4c
+
6a7e4c
+	      if (!OPENSSL_init_crypto(OPENSSL_INIT_NO_LOAD_CONFIG, NULL))
6a7e4c
+		return 1;
6a7e4c
 
6a7e4c
+	      /* Initialize SSL context */
6a7e4c
+	      meth = $method_func();
6a7e4c
+	      if (!(ctx = SSL_CTX_new(meth)))
6a7e4c
+		return 1;
6a7e4c
+	      return 0;
6a7e4c
 
6a7e4c
+  ;
6a7e4c
+  return 0;
6a7e4c
+}
6a7e4c
+_ACEOF
6a7e4c
+if ac_fn_c_try_run "$LINENO"; then :
6a7e4c
+  openssl_init_no_load_bug=0
6a7e4c
+else
6a7e4c
+  openssl_init_no_load_bug=1
6a7e4c
+fi
6a7e4c
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
6a7e4c
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
6a7e4c
+fi
6a7e4c
+
6a7e4c
+	if test $openssl_init_no_load_bug -eq 1; then :
6a7e4c
+
6a7e4c
+$as_echo "#define HAVE_OPENSSL_INIT_NO_LOAD_CONFIG_BUG  1 " >>confdefs.h
6a7e4c
+
6a7e4c
+fi
6a7e4c
+
6a7e4c
+fi
6a7e4c
 unset LIBS
6a7e4c
 
6a7e4c
 if test $BUILD_GENHASH = No; then
6a7e4c
@@ -12695,7 +12726,7 @@
6a7e4c
 #
6a7e4c
 # INIT-COMMANDS
6a7e4c
 #
6a7e4c
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
6a7e4c
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
6a7e4c
 
6a7e4c
 _ACEOF
6a7e4c
 
6a7e4c
@@ -13322,29 +13353,35 @@
6a7e4c
   # Older Autoconf quotes --file arguments for eval, but not when files
6a7e4c
   # are listed without --file.  Let's play safe and only enable the eval
6a7e4c
   # if we detect the quoting.
6a7e4c
-  case $CONFIG_FILES in
6a7e4c
-  *\'*) eval set x "$CONFIG_FILES" ;;
6a7e4c
-  *)   set x $CONFIG_FILES ;;
6a7e4c
-  esac
6a7e4c
+  # TODO: see whether this extra hack can be removed once we start
6a7e4c
+  # requiring Autoconf 2.70 or later.
6a7e4c
+  case $CONFIG_FILES in #(
6a7e4c
+  *\'*) :
6a7e4c
+    eval set x "$CONFIG_FILES" ;; #(
6a7e4c
+  *) :
6a7e4c
+    set x $CONFIG_FILES ;; #(
6a7e4c
+  *) :
6a7e4c
+     ;;
6a7e4c
+esac
6a7e4c
   shift
6a7e4c
-  for mf
6a7e4c
+  # Used to flag and report bootstrapping failures.
6a7e4c
+  am_rc=0
6a7e4c
+  for am_mf
6a7e4c
   do
6a7e4c
     # Strip MF so we end up with the name of the file.
6a7e4c
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
6a7e4c
-    # Check whether this is an Automake generated Makefile or not.
6a7e4c
-    # We used to match only the files named 'Makefile.in', but
6a7e4c
-    # some people rename them; so instead we look at the file content.
6a7e4c
-    # Grep'ing the first line is not enough: some people post-process
6a7e4c
-    # each Makefile.in and add a new line on top of each file to say so.
6a7e4c
-    # Grep'ing the whole file is not good either: AIX grep has a line
6a7e4c
+    am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'`
6a7e4c
+    # Check whether this is an Automake generated Makefile which includes
6a7e4c
+    # dependency-tracking related rules and includes.
6a7e4c
+    # Grep'ing the whole file directly is not great: AIX grep has a line
6a7e4c
     # limit of 2048, but all sed's we know have understand at least 4000.
6a7e4c
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
6a7e4c
-      dirpart=`$as_dirname -- "$mf" ||
6a7e4c
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
6a7e4c
-	 X"$mf" : 'X\(//\)[^/]' \| \
6a7e4c
-	 X"$mf" : 'X\(//\)$' \| \
6a7e4c
-	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
6a7e4c
-$as_echo X"$mf" |
6a7e4c
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
6a7e4c
+      || continue
6a7e4c
+    am_dirpart=`$as_dirname -- "$am_mf" ||
6a7e4c
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
6a7e4c
+	 X"$am_mf" : 'X\(//\)[^/]' \| \
6a7e4c
+	 X"$am_mf" : 'X\(//\)$' \| \
6a7e4c
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
6a7e4c
+$as_echo X"$am_mf" |
6a7e4c
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
6a7e4c
 	    s//\1/
6a7e4c
 	    q
6a7e4c
@@ -13362,53 +13399,48 @@
6a7e4c
 	    q
6a7e4c
 	  }
6a7e4c
 	  s/.*/./; q'`
6a7e4c
-    else
6a7e4c
-      continue
6a7e4c
-    fi
6a7e4c
-    # Extract the definition of DEPDIR, am__include, and am__quote
6a7e4c
-    # from the Makefile without running 'make'.
6a7e4c
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
6a7e4c
-    test -z "$DEPDIR" && continue
6a7e4c
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
6a7e4c
-    test -z "$am__include" && continue
6a7e4c
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
6a7e4c
-    # Find all dependency output files, they are included files with
6a7e4c
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
6a7e4c
-    # simplest approach to changing $(DEPDIR) to its actual value in the
6a7e4c
-    # expansion.
6a7e4c
-    for file in `sed -n "
6a7e4c
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
6a7e4c
-	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
6a7e4c
-      # Make sure the directory exists.
6a7e4c
-      test -f "$dirpart/$file" && continue
6a7e4c
-      fdir=`$as_dirname -- "$file" ||
6a7e4c
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
6a7e4c
-	 X"$file" : 'X\(//\)[^/]' \| \
6a7e4c
-	 X"$file" : 'X\(//\)$' \| \
6a7e4c
-	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
6a7e4c
-$as_echo X"$file" |
6a7e4c
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
6a7e4c
-	    s//\1/
6a7e4c
-	    q
6a7e4c
-	  }
6a7e4c
-	  /^X\(\/\/\)[^/].*/{
6a7e4c
+    am_filepart=`$as_basename -- "$am_mf" ||
6a7e4c
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
6a7e4c
+	 X"$am_mf" : 'X\(//\)$' \| \
6a7e4c
+	 X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
6a7e4c
+$as_echo X/"$am_mf" |
6a7e4c
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
6a7e4c
 	    s//\1/
6a7e4c
 	    q
6a7e4c
 	  }
6a7e4c
-	  /^X\(\/\/\)$/{
6a7e4c
+	  /^X\/\(\/\/\)$/{
6a7e4c
 	    s//\1/
6a7e4c
 	    q
6a7e4c
 	  }
6a7e4c
-	  /^X\(\/\).*/{
6a7e4c
+	  /^X\/\(\/\).*/{
6a7e4c
 	    s//\1/
6a7e4c
 	    q
6a7e4c
 	  }
6a7e4c
 	  s/.*/./; q'`
6a7e4c
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
6a7e4c
-      # echo "creating $dirpart/$file"
6a7e4c
-      echo '# dummy' > "$dirpart/$file"
6a7e4c
-    done
6a7e4c
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
6a7e4c
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
6a7e4c
+        | $MAKE -f - am--depfiles" >&5
6a7e4c
+   (cd "$am_dirpart" \
6a7e4c
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
6a7e4c
+        | $MAKE -f - am--depfiles) >&5 2>&5
6a7e4c
+   ac_status=$?
6a7e4c
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
6a7e4c
+   (exit $ac_status); } || am_rc=$?
6a7e4c
   done
6a7e4c
+  if test $am_rc -ne 0; then
6a7e4c
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
6a7e4c
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
6a7e4c
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
6a7e4c
+    for automatic dependency tracking.  Try re-running configure with the
6a7e4c
+    '--disable-dependency-tracking' option to at least be able to build
6a7e4c
+    the package (albeit without support for automatic dependency tracking).
6a7e4c
+See \`config.log' for more details" "$LINENO" 5; }
6a7e4c
+  fi
6a7e4c
+  { am_dirpart=; unset am_dirpart;}
6a7e4c
+  { am_filepart=; unset am_filepart;}
6a7e4c
+  { am_mf=; unset am_mf;}
6a7e4c
+  { am_rc=; unset am_rc;}
6a7e4c
+  rm -f conftest-deps.mk
6a7e4c
 }
6a7e4c
  ;;
6a7e4c