linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [libgpiod][PATCH] build: use AC_CHECK_PROG() instead of AC_CHECK_FILE() for python3-config
@ 2019-11-25  8:51 Bartosz Golaszewski
  0 siblings, 0 replies; only message in thread
From: Bartosz Golaszewski @ 2019-11-25  8:51 UTC (permalink / raw)
  To: linux-gpio; +Cc: Bartosz Golaszewski, Joel Savitz

From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

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 <joelsavitz@gmail.com>
Fixes: 9ed02fc793b3 ("build: check for python-config in configure")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 configure.ac | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 066c1ad..62e2671 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"],
-- 
2.23.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-25  8:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-25  8:51 [libgpiod][PATCH] build: use AC_CHECK_PROG() instead of AC_CHECK_FILE() for python3-config Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).