From dfac6253be21556bec620eb25aa6adac99da2c64 Mon Sep 17 00:00:00 2001
From: Martin Szulecki <martin.szulecki@libimobiledevice.org>
Date: Thu, 29 Jan 2015 22:03:49 +0100
Subject: [PATCH] m4: Use python-config if available to fix Python 3 support on
 newer distros

---
 m4/ac_python_devel.m4 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/m4/ac_python_devel.m4 b/m4/ac_python_devel.m4
index 2e7406e..f7eb79a 100644
--- a/m4/ac_python_devel.m4
+++ b/m4/ac_python_devel.m4
@@ -150,6 +150,9 @@ $ac_distutils_result])
 	#
 	# Check for Python include path
 	#
+	if type $PYTHON-config; then
+		PYTHON_CPPFLAGS=`$PYTHON-config --includes`
+	fi
 	AC_MSG_CHECKING([for Python include path])
 	if test -z "$PYTHON_CPPFLAGS"; then
 		python_path=`$PYTHON -c "import distutils.sysconfig; \
@@ -166,6 +169,9 @@ $ac_distutils_result])
 	# Check for Python library path
 	#
 	AC_MSG_CHECKING([for Python library path])
+	if type $PYTHON-config; then
+		PYTHON_LDFLAGS=`$PYTHON-config --ldflags`
+	fi
 	if test -z "$PYTHON_LDFLAGS"; then
 		# (makes two attempts to ensure we've got a version number
 		# from the interpreter)
-- 
2.18.1