[PATCH] Don't install device-manager if python isn't present

Dan Nicholson dbn.lists at gmail.com
Sat Apr 28 11:45:20 PDT 2007


Currently, the hal build will bomb if python isn't present on the
host system. Since python is only needed for the device-manager,
just warn if python isn't found.

Patch is against hal-0_5_9-branch. Maybe it's too late for
hal-0.5.9.1, but it seems to work well on my system with and without
python.

---
 configure.in      |    7 ++++++-
 tools/Makefile.am |    6 +++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/configure.in b/configure.in
index bef2f61..4b91d97 100644
--- a/configure.in
+++ b/configure.in
@@ -36,10 +36,14 @@ AC_HEADER_STDC
 AM_PROG_LIBTOOL
 AC_PROG_MAKE_SET
 AC_PROG_LN_S
-AM_PATH_PYTHON
 AC_SYS_LARGEFILE
 PKG_PROG_PKG_CONFIG
 
+AM_PATH_PYTHON(, have_python=yes,
+  [have_python=no
+  AC_WARN([No python found. Skipping device-manager.])])
+AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
+
 AC_CHECK_HEADERS([sys/ioccom.h sys/inotify.h])
 
 AC_ARG_WITH(os-type,     [  --with-os-type=<os>     Distribution or OS (redhat)])
@@ -908,6 +912,7 @@ echo "
         use APM:                     ${msg_apm}
         use Sony PIC:                ${msg_sonypic}
 
+	Device Manager:              ${have_python}
         Macbook backlight support:   ${BUILD_MACBOOK} (Linux only, x86 only, requires libpci)
         Macbook Pro utils:           ${BUILD_MACBOOKPRO} (Linux only, x86 only, requires libpci)
         OMAP utils:                  ${BUILD_OMAP} (Linux only, arm only)
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 2eba2cd..574cffb 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -1,7 +1,11 @@
 ## Process this file with automake to produce Makefile.in
 
 
-SUBDIRS = device-manager
+SUBDIRS =
+
+if HAVE_PYTHON
+SUBDIRS += device-manager
+endif
 
 if HALD_COMPILE_LINUX
 SUBDIRS += linux
-- 
1.5.1.1





More information about the hal mailing list