Commit f4d8e2932cdd60653d2f762ad7502e6ec5710fe5

Dan Nicholson 2009-03-26T06:50:33

Move ks_tables.h build into makekeys subdirectory This avoids the BUILT_SOURCES weirdness and forcing the build into the makekeys subdirectory. Added a new make variable KS_HEADERS that lists all the keysym headers we're going to parse.

diff --git a/configure.ac b/configure.ac
index b03baa4..652fbf4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -67,6 +67,8 @@ test -f "$XF86KEYSYM_H" || AC_MSG_ERROR([can't locate XF86keysym.h in $x11includ
 AC_MSG_RESULT([$XF86KEYSYM_H])
 AC_SUBST([XF86KEYSYM_H])
 
+AC_SUBST([KS_HEADERS], ['$(KEYSYMDEF_H) $(XF86KEYSYM_H)'])
+
 # Require xorg-macros version 1.2.0 or newer for XORG_CHANGELOG macro
 m4_ifndef([XORG_MACROS_VERSION],
     [m4_fatal([must install xorg-macros before running autoconf/autogen.sh])])
diff --git a/src/Makefile.am b/src/Makefile.am
index ab944a2..72c29af 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,21 +1,11 @@
 SUBDIRS = makekeys
 
-INCLUDES = -I$(top_srcdir)/include
+INCLUDES = -I$(top_srcdir)/include -I$(builddir)/makekeys
 AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS) $(XMALLOC_ZERO_CFLAGS)
 
-BUILT_SOURCES = ks_tables.h
-ks_tables.h: $(builddir)/makekeys/makekeys$(EXEEXT)
-	@rm -f $@
-	cat $(KEYSYMDEF_H) $(XF86KEYSYM_H) | \
-	  $(builddir)/makekeys/makekeys$(EXEEXT) >$@
-
-$(builddir)/makekeys/makekeys$(EXEEXT):
-	@cd makekeys && $(MAKE) $(AM_MAKEFLAGS)
-
 lib_LTLIBRARIES = libxkbcommon.la
 libxkbcommon_la_SOURCES = \
 	XKBcommonint.h \
-	ks_tables.h \
 	alloc.c \
 	galloc.c \
 	atom.c \
diff --git a/src/makekeys/Makefile.am b/src/makekeys/Makefile.am
index bd05903..781723c 100644
--- a/src/makekeys/Makefile.am
+++ b/src/makekeys/Makefile.am
@@ -4,3 +4,10 @@ AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
 # need to use build-native compiler
 CC = $(CC_FOR_BUILD)
 noinst_PROGRAMS = makekeys
+
+nodist_noinst_HEADERS = ks_tables.h
+CLEANFILES = ks_tables.h
+
+ks_tables.h: makekeys$(EXEEXT)
+	@rm -f $@
+	cat $(KS_HEADERS) | $(builddir)/makekeys$(EXEEXT) > $@