diff options
author | Richard Hughes <richard@hughsie.com> | 2007-06-11 16:32:18 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2007-06-11 16:32:18 +0100 |
commit | e7b7241a92149429a9e74a01f83c7fcce585f5ce (patch) | |
tree | 7217ef1ab6a158f880c1e5e73fafca0014f3c752 | |
parent | a492453b15abfbaada99e1fd51a516acb480331d (diff) |
fix build when gperf is not installed
Make still tries to rebuild the .h file, even when present.
If gperf is not installed, don't let make even _try_ to rebuild the file.
-rw-r--r-- | configure.in | 10 | ||||
-rw-r--r-- | tools/Makefile.am | 6 |
2 files changed, 15 insertions, 1 deletions
diff --git a/configure.in b/configure.in index cd8c80c2..0b6734c3 100644 --- a/configure.in +++ b/configure.in @@ -658,6 +658,16 @@ else have_xmllint=yes fi +AC_PATH_PROG(GPERF, [gperf], [no]) +AC_MSG_CHECKING([whether to rebuild gperf header files]) +if test x$GPERF = xno ; then + have_gperf=no +else + have_gperf=yes +fi +AC_SUBST(HAVE_GPERF) +AM_CONDITIONAL(HAVE_GPERF, [test x$have_gperf = xyes]) + if test x$enable_docbook_docs = xauto ; then if test x$have_xmlto = xno || test x$have_xmllint = xno ; then enable_docbook_docs=no diff --git a/tools/Makefile.am b/tools/Makefile.am index 6897eb61..077e3624 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -78,6 +78,7 @@ endif if BUILD_KEYMAPS +if HAVE_GPERF hal-setup-keymap-keys.txt: /usr/include/linux/input.h awk '/^#define.*KEY_/ { if ($$2 != "KEY_MAX") { print substr($$2, 5) } }' < $< > $@ @@ -86,11 +87,12 @@ hal-setup-keymap-hash-name.gperf: hal-setup-keymap-keys.txt hal-setup-keymap-hash-name.h: hal-setup-keymap-hash-name.gperf gperf -t --ignore-case -N lookup_key -H hash_input_names -p -C < $< > $@ +endif #HAVE_GPERF hal_setup_keymap_SOURCES = hal-setup-keymap.c hal-setup-keymap-hash-name.h hal_setup_keymap_LDADD = $(top_builddir)/libhal/libhal.la -endif +endif #BUILD_KEYMAPS libexec_PROGRAMS = \ hal-storage-mount \ @@ -177,6 +179,7 @@ umount_hal_SOURCES = umount-hal.c umount_hal_LDADD = @DBUS_LIBS@ $(top_builddir)/libhal/libhal.la $(top_builddir)/libhal-storage/libhal-storage.la endif +if HAVE_GPERF DISTCLEANFILES += \ hal-setup-keymap-hash-name.h \ hal-setup-keymap-hash-name.gperf \ @@ -186,6 +189,7 @@ BUILT_SOURCES += \ hal-setup-keymap-hash-name.h \ hal-setup-keymap-hash-name.gperf \ hal-setup-keymap-keys.txt +endif check: for f in $(script_SCRIPTS); do \ |