configure: test for python and python-argparse
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 14 Oct 2013 05:28:16 +0000 (15:28 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 21 Oct 2013 10:17:22 +0000 (20:17 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
configure.ac
libevdev/Makefile.am

index af73bed049568d4107617b03c528db04e93e9d31..df64f3b8b420d0443d1c64ca8dfdb3af48dc8f75 100644 (file)
@@ -97,6 +97,11 @@ AS_IF([test "x$enable_gcov" != "xno"],
        ],
 )
 
+AM_PATH_PYTHON()
+AC_SUBST(PYTHON)
+AS_IF([$($PYTHON -c "import argparse")], [:],
+       AC_MSG_ERROR([python argparse module is missing]))
+
 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" != "xno"])
 AC_SUBST([GCOV_CFLAGS])
 AC_SUBST([GCOV_LDFLAGS])
index 552df70b65396c62f355d9e33f91a50e8b2fc4f3..94f55144ce0ddb61846012ef457a99da573072cf 100644 (file)
@@ -21,7 +21,7 @@ libevdevincludedir = $(includedir)/libevdev-1.0/libevdev
 libevdevinclude_HEADERS = libevdev.h libevdev-uinput.h
 
 event-names.h: Makefile make-event-names.py
-               $(srcdir)/make-event-names.py --output=c > $@
+       $(PYTHON) $(srcdir)/make-event-names.py --output=c > $@
 
 EXTRA_DIST = make-event-names.py
 CLEANFILES = event-names.h