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

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