Blame SOURCES/unbound-1.7.2-python3-devel.patch

8ba890
From b5aab36d41f374eddb0f66f28f251588f53a1e1e Mon Sep 17 00:00:00 2001
8ba890
From: Wouter Wijngaards <wouter@nlnetlabs.nl>
8ba890
Date: Wed, 27 Jun 2018 05:46:36 +0000
8ba890
Subject: [PATCH 1/2] - #4109: Fix that package config depends on python
8ba890
 unconditionally.
8ba890
8ba890
git-svn-id: file:///svn/unbound/trunk@4757 be551aaa-1e26-0410-a405-d3ace91eadb9
8ba890
---
8ba890
 configure    | 257 +++++++++++++++++++++++++++++++----------------------------
8ba890
 configure.ac |   5 +-
8ba890
 2 files changed, 137 insertions(+), 125 deletions(-)
8ba890
8ba890
diff --git a/configure b/configure
8ba890
index 3f1c372a..2a1687ae 100755
8ba890
--- a/configure
8ba890
+++ b/configure
8ba890
@@ -670,9 +670,6 @@ SYSTEMD_DAEMON_LIBS
8ba890
 SYSTEMD_DAEMON_CFLAGS
8ba890
 SYSTEMD_LIBS
8ba890
 SYSTEMD_CFLAGS
8ba890
-PKG_CONFIG_LIBDIR
8ba890
-PKG_CONFIG_PATH
8ba890
-PKG_CONFIG
8ba890
 staticexe
8ba890
 PC_LIBEVENT_DEPENDENCY
8ba890
 UNBOUND_EVENT_UNINSTALL
8ba890
@@ -697,6 +694,9 @@ swig
8ba890
 SWIG_LIB
8ba890
 SWIG
8ba890
 PC_PY_DEPENDENCY
8ba890
+PKG_CONFIG_LIBDIR
8ba890
+PKG_CONFIG_PATH
8ba890
+PKG_CONFIG
8ba890
 PY_MAJOR_VERSION
8ba890
 PYTHON_SITE_PKG
8ba890
 PYTHON_LDFLAGS
8ba890
@@ -16930,7 +16930,136 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h
8ba890
         CPPFLAGS="$PYTHON_CPPFLAGS"
8ba890
       fi
8ba890
       ub_have_python=yes
8ba890
-      PC_PY_DEPENDENCY="python"
8ba890
+
8ba890
+
8ba890
+
8ba890
+
8ba890
+
8ba890
+
8ba890
+
8ba890
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8ba890
+	if test -n "$ac_tool_prefix"; then
8ba890
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
8ba890
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
8ba890
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8ba890
+$as_echo_n "checking for $ac_word... " >&6; }
8ba890
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
8ba890
+  $as_echo_n "(cached) " >&6
8ba890
+else
8ba890
+  case $PKG_CONFIG in
8ba890
+  [\\/]* | ?:[\\/]*)
8ba890
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
8ba890
+  ;;
8ba890
+  *)
8ba890
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8ba890
+for as_dir in $PATH
8ba890
+do
8ba890
+  IFS=$as_save_IFS
8ba890
+  test -z "$as_dir" && as_dir=.
8ba890
+    for ac_exec_ext in '' $ac_executable_extensions; do
8ba890
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8ba890
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8ba890
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8ba890
+    break 2
8ba890
+  fi
8ba890
+done
8ba890
+  done
8ba890
+IFS=$as_save_IFS
8ba890
+
8ba890
+  ;;
8ba890
+esac
8ba890
+fi
8ba890
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
8ba890
+if test -n "$PKG_CONFIG"; then
8ba890
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
8ba890
+$as_echo "$PKG_CONFIG" >&6; }
8ba890
+else
8ba890
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
+$as_echo "no" >&6; }
8ba890
+fi
8ba890
+
8ba890
+
8ba890
+fi
8ba890
+if test -z "$ac_cv_path_PKG_CONFIG"; then
8ba890
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
8ba890
+  # Extract the first word of "pkg-config", so it can be a program name with args.
8ba890
+set dummy pkg-config; ac_word=$2
8ba890
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8ba890
+$as_echo_n "checking for $ac_word... " >&6; }
8ba890
+if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
8ba890
+  $as_echo_n "(cached) " >&6
8ba890
+else
8ba890
+  case $ac_pt_PKG_CONFIG in
8ba890
+  [\\/]* | ?:[\\/]*)
8ba890
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
8ba890
+  ;;
8ba890
+  *)
8ba890
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8ba890
+for as_dir in $PATH
8ba890
+do
8ba890
+  IFS=$as_save_IFS
8ba890
+  test -z "$as_dir" && as_dir=.
8ba890
+    for ac_exec_ext in '' $ac_executable_extensions; do
8ba890
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8ba890
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8ba890
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8ba890
+    break 2
8ba890
+  fi
8ba890
+done
8ba890
+  done
8ba890
+IFS=$as_save_IFS
8ba890
+
8ba890
+  ;;
8ba890
+esac
8ba890
+fi
8ba890
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
8ba890
+if test -n "$ac_pt_PKG_CONFIG"; then
8ba890
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
8ba890
+$as_echo "$ac_pt_PKG_CONFIG" >&6; }
8ba890
+else
8ba890
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
+$as_echo "no" >&6; }
8ba890
+fi
8ba890
+
8ba890
+  if test "x$ac_pt_PKG_CONFIG" = x; then
8ba890
+    PKG_CONFIG=""
8ba890
+  else
8ba890
+    case $cross_compiling:$ac_tool_warned in
8ba890
+yes:)
8ba890
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8ba890
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8ba890
+ac_tool_warned=yes ;;
8ba890
+esac
8ba890
+    PKG_CONFIG=$ac_pt_PKG_CONFIG
8ba890
+  fi
8ba890
+else
8ba890
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
8ba890
+fi
8ba890
+
8ba890
+fi
8ba890
+if test -n "$PKG_CONFIG"; then
8ba890
+	_pkg_min_version=0.9.0
8ba890
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
8ba890
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
8ba890
+	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8ba890
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8ba890
+$as_echo "yes" >&6; }
8ba890
+	else
8ba890
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
+$as_echo "no" >&6; }
8ba890
+		PKG_CONFIG=""
8ba890
+	fi
8ba890
+fi
8ba890
+      if test -n "$PKG_CONFIG" && \
8ba890
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\"python\${PY_MAJOR_VERSION}\"\""; } >&5
8ba890
+  ($PKG_CONFIG --exists --print-errors ""python${PY_MAJOR_VERSION}"") 2>&5
8ba890
+  ac_status=$?
8ba890
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
8ba890
+  test $ac_status = 0; }; then
8ba890
+  PC_PY_DEPENDENCY="python${PY_MAJOR_VERSION}"
8ba890
+else
8ba890
+  PC_PY_DEPENDENCY="python"
8ba890
+fi
8ba890
 
8ba890
 
8ba890
       # Check for SWIG
8ba890
@@ -18960,126 +19089,6 @@ else
8ba890
 fi
8ba890
 
8ba890
 have_systemd=no
8ba890
-
8ba890
-
8ba890
-
8ba890
-
8ba890
-
8ba890
-
8ba890
-
8ba890
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
8ba890
-	if test -n "$ac_tool_prefix"; then
8ba890
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
8ba890
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
8ba890
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8ba890
-$as_echo_n "checking for $ac_word... " >&6; }
8ba890
-if ${ac_cv_path_PKG_CONFIG+:} false; then :
8ba890
-  $as_echo_n "(cached) " >&6
8ba890
-else
8ba890
-  case $PKG_CONFIG in
8ba890
-  [\\/]* | ?:[\\/]*)
8ba890
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
8ba890
-  ;;
8ba890
-  *)
8ba890
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8ba890
-for as_dir in $PATH
8ba890
-do
8ba890
-  IFS=$as_save_IFS
8ba890
-  test -z "$as_dir" && as_dir=.
8ba890
-    for ac_exec_ext in '' $ac_executable_extensions; do
8ba890
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8ba890
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8ba890
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8ba890
-    break 2
8ba890
-  fi
8ba890
-done
8ba890
-  done
8ba890
-IFS=$as_save_IFS
8ba890
-
8ba890
-  ;;
8ba890
-esac
8ba890
-fi
8ba890
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
8ba890
-if test -n "$PKG_CONFIG"; then
8ba890
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
8ba890
-$as_echo "$PKG_CONFIG" >&6; }
8ba890
-else
8ba890
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
-$as_echo "no" >&6; }
8ba890
-fi
8ba890
-
8ba890
-
8ba890
-fi
8ba890
-if test -z "$ac_cv_path_PKG_CONFIG"; then
8ba890
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
8ba890
-  # Extract the first word of "pkg-config", so it can be a program name with args.
8ba890
-set dummy pkg-config; ac_word=$2
8ba890
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
8ba890
-$as_echo_n "checking for $ac_word... " >&6; }
8ba890
-if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then :
8ba890
-  $as_echo_n "(cached) " >&6
8ba890
-else
8ba890
-  case $ac_pt_PKG_CONFIG in
8ba890
-  [\\/]* | ?:[\\/]*)
8ba890
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
8ba890
-  ;;
8ba890
-  *)
8ba890
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8ba890
-for as_dir in $PATH
8ba890
-do
8ba890
-  IFS=$as_save_IFS
8ba890
-  test -z "$as_dir" && as_dir=.
8ba890
-    for ac_exec_ext in '' $ac_executable_extensions; do
8ba890
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8ba890
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
8ba890
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
8ba890
-    break 2
8ba890
-  fi
8ba890
-done
8ba890
-  done
8ba890
-IFS=$as_save_IFS
8ba890
-
8ba890
-  ;;
8ba890
-esac
8ba890
-fi
8ba890
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
8ba890
-if test -n "$ac_pt_PKG_CONFIG"; then
8ba890
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
8ba890
-$as_echo "$ac_pt_PKG_CONFIG" >&6; }
8ba890
-else
8ba890
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
-$as_echo "no" >&6; }
8ba890
-fi
8ba890
-
8ba890
-  if test "x$ac_pt_PKG_CONFIG" = x; then
8ba890
-    PKG_CONFIG=""
8ba890
-  else
8ba890
-    case $cross_compiling:$ac_tool_warned in
8ba890
-yes:)
8ba890
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
8ba890
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
8ba890
-ac_tool_warned=yes ;;
8ba890
-esac
8ba890
-    PKG_CONFIG=$ac_pt_PKG_CONFIG
8ba890
-  fi
8ba890
-else
8ba890
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
8ba890
-fi
8ba890
-
8ba890
-fi
8ba890
-if test -n "$PKG_CONFIG"; then
8ba890
-	_pkg_min_version=0.9.0
8ba890
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
8ba890
-$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
8ba890
-	if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
8ba890
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
8ba890
-$as_echo "yes" >&6; }
8ba890
-	else
8ba890
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
8ba890
-$as_echo "no" >&6; }
8ba890
-		PKG_CONFIG=""
8ba890
-	fi
8ba890
-fi
8ba890
 if test "x$enable_systemd" != xno; then :
8ba890
 
8ba890
 
8ba890
diff --git a/configure.ac b/configure.ac
8ba890
index 1828253c..b2c95d1a 100644
8ba890
--- a/configure.ac
8ba890
+++ b/configure.ac
8ba890
@@ -586,7 +586,10 @@ if test x_$ub_test_python != x_no; then
8ba890
         CPPFLAGS="$PYTHON_CPPFLAGS"
8ba890
       fi
8ba890
       ub_have_python=yes
8ba890
-      PC_PY_DEPENDENCY="python"
8ba890
+      PKG_PROG_PKG_CONFIG
8ba890
+      PKG_CHECK_EXISTS(["python${PY_MAJOR_VERSION}"],
8ba890
+                       [PC_PY_DEPENDENCY="python${PY_MAJOR_VERSION}"],
8ba890
+                       [PC_PY_DEPENDENCY="python"])
8ba890
       AC_SUBST(PC_PY_DEPENDENCY)
8ba890
 
8ba890
       # Check for SWIG
8ba890
-- 
8ba890
2.14.4
8ba890