makekeys: fix cross-compilation
authorPekka Paalanen <ppaalanen@gmail.com>
Tue, 8 May 2012 08:46:58 +0000 (11:46 +0300)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 9 May 2012 14:24:50 +0000 (15:24 +0100)
makekeys must be built with the build-native compiler, not with $(CC)
which is the cross-compiler. The only sane way to achieve this seems to
be to use a separate Makefile.am for it.

This patch fixes the problem apparently caused by:

commit b5efe41f190cbb76eb1ca8ddf0c96990ddb83704
Author: Ran Benita <ran234@gmail.com>
Date:   Sat Mar 24 04:48:31 2012 +0200

    Make build non-recursive

There is no such thing as makekeys_makekeys_CC in automake.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Makefile.am
configure.ac
makekeys/Makefile.am [new file with mode: 0644]

index ac9cf8a..db4acc0 100644 (file)
@@ -1,5 +1,7 @@
 ACLOCAL_AMFLAGS = -I m4
 
+SUBDIRS = makekeys
+
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = xkbcommon.pc
 
@@ -87,16 +89,12 @@ BUILT_SOURCES = \
        src/ks_tables.h
 CLEANFILES = $(BUILT_SOURCES)
 
-noinst_PROGRAMS = makekeys/makekeys
-makekeys_makekeys_SOURCES = makekeys/makekeys.c
-makekeys_makekeys_CC = $(CC_FOR_BUILD)
-makekeys_makekeys_CPPFLAGS = $(AM_CPPFLAGS) $(CPPFLAGS_FOR_BUILD)
-makekeys_makekeys_CFLAGS = $(AM_CFLAGS) $(CFLAGS_FOR_BUILD)
-makekeys_makekeys_LDFLAGS = $(AM_LDFLAGS) $(LDFLAGS_FOR_BUILD)
-
 src/ks_tables.h: $(KEYSYMDEFS) $(top_builddir)/makekeys/makekeys$(EXEEXT)
        $(top_builddir)/makekeys/makekeys $(KEYSYMDEFS) > $@
 
+$(top_builddir)/makekeys/makekeys$(EXEEXT): $(top_srcdir)/makekeys/makekeys.c
+       $(MAKE) -C makekeys
+
 # Tests
 
 TESTS_ENVIRONMENT =
index 04a737c..54bd6a5 100644 (file)
@@ -114,5 +114,9 @@ AC_ARG_WITH([xkb_config_root],
     [XKBCONFIGROOT="$xkb_base"])
 AC_SUBST([XKBCONFIGROOT])
 
-AC_CONFIG_FILES([Makefile xkbcommon.pc])
+
+AC_CONFIG_FILES([
+    Makefile
+    makekeys/Makefile
+    xkbcommon.pc])
 AC_OUTPUT
diff --git a/makekeys/Makefile.am b/makekeys/Makefile.am
new file mode 100644 (file)
index 0000000..bb93777
--- /dev/null
@@ -0,0 +1,11 @@
+AM_CPPFLAGS = -I$(top_srcdir)/include
+AM_CFLAGS = $(X11_CFLAGS) $(CWARNFLAGS)
+
+# need to use build-native compiler
+
+CC = $(CC_FOR_BUILD)
+CPPFLAGS = $(CPPFLAGS_FOR_BUILD)
+CFLAGS = $(CFLAGS_FOR_BUILD)
+LDFLAGS = $(LDFLAGS_FOR_BUILD)
+noinst_PROGRAMS = makekeys
+