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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
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) > $@