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

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