From da800c7ebbaf8d97cde9eb6d40d678ec92994077 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Sun, 10 May 2009 22:24:38 +0200 Subject: detect awk in configure (used by keymap) keymap's Makefile uses awk. Instead of hardcoding it, use AC_PROG_AWK properly and use the detected one in the Makefiles. Thanks to Dan Nicholson for the suggestion. --- configure.ac | 1 + keymap/Makefile.am | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index afe6740..3244f94 100644 --- a/configure.ac +++ b/configure.ac @@ -23,6 +23,7 @@ PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82) AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)]) AC_PATH_PROG([XSLTPROC], [xsltproc]) +AC_PROG_AWK AC_PATH_PROG([GPERF], [gperf]) if test -z "$GPERF"; then AC_MSG_ERROR(Could not find gperf) diff --git a/keymap/Makefile.am b/keymap/Makefile.am index 0da136a..9974eb4 100644 --- a/keymap/Makefile.am +++ b/keymap/Makefile.am @@ -40,15 +40,15 @@ CLEANFILES = keys.txt keys-from-name.gperf keys-from-name.h keys-to-name.h # keys.txt: /usr/include/linux/input.h - awk '/^#define.*KEY_/ { if ($$2 != "KEY_MAX" && $$2 != "KEY_CNT") { print $$2 } }' < $< > $@ + $(AWK) '/^#define.*KEY_/ { if ($$2 != "KEY_MAX" && $$2 != "KEY_CNT") { print $$2 } }' < $< > $@ keys-from-name.gperf: keys.txt - awk 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ + $(AWK) 'BEGIN{ print "struct key { const char* name; unsigned short id; };"; print "%null-strings"; print "%%";} { print $$1 ", " $$1 }' < $< > $@ keys-from-name.h: keys-from-name.gperf Makefile $(GPERF) -t --ignore-case -N lookup_key -H hash_key_name -p -C < $< > $@ keys-to-name.h: keys.txt Makefile - awk 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ + $(AWK) 'BEGIN{ print "const char* const key_names[KEY_CNT] = { "} { print "[" $$1 "] = \"" $$1 "\"," } END{print "};"}' < $< > $@ -- cgit