Skip to contentSkip to conversation

build: use AC_CHECK_PROG() instead of AC_CHECK_FILE() for python3-config

PATCH New Bartosz Golaszewski 1 participant 1 message Nov 25, 2019 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: use AC_CHECK_PROG() instead of AC_CHECK_FILE() for python3-config

From: Bartosz Golaszewski <[email protected]>

Commit 9ed02fc793b3 ("build: check for python-config in configure") breaks cross-compilation because AC_CHECK_FILE() only checks the host machine. Use AC_CHECK_PROG() instead.

Cc Joel Savitz <[email protected]>
Fixes 9ed02fc793b3 ("build: check for python-config in configure")
---
 configure.ac | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
configure.ac +5 -2
index 066c1ad..62e2671 100644
@@ -183,8 +183,11 @@ if test "x$with_bindings_python" = xtrue
 then
 	AM_PATH_PYTHON([3.0], [],
 		[AC_MSG_ERROR([python3 not found - needed for python bindings])])
-	AC_CHECK_FILE(["$PYTHON-config"], [],
-		[AC_MSG_ERROR([python3-config not found - needed for python bindings])])
+	AC_CHECK_PROG([has_python_config], [python3-config], [true], [false])
+	if test "x$has_python_config" = xfalse
+	then
+		AC_MSG_ERROR([python3-config not found - needed for python bindings])
+	fi
 	AS_IF([test -z "$PYTHON_CPPFLAGS"],
 		[AC_SUBST(PYTHON_CPPFLAGS, [`$PYTHON-config --includes`])])
 	AS_IF([test -z "$PYTHON_LIBS"],
Signature · 1 line
2.23.0