[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#425445: libx11-6: fails to cross-build. tries to run cross-built makekeys utility



On Mon, May 21, 2007 at 16:38:18 +0100, Neil Williams wrote:

> arm-linux-gnu-gcc  -Wall -g -O2 -DLIBXCURSOR=\"libXcursor.so.1\"   -o makekeys  makekeys-makekeys.o  -ldl 
> make[3]: Leaving directory `/opt/emdebian/trunk/l/libx11/trunk/libx11-1.0.3/obj-x86_64-linux-gnu/src/util'
> ../src/util/makekeys < /usr/arm-linux-gnu/include/X11/keysymdef.h > ks_tables_h
> /bin/sh: ../src/util/makekeys: cannot execute binary file
> 
Hi Neil,

can you test the following patch?

Thanks,
Julien

From f438f69ee4246fb27053426a285d1d6ffa7fa60e Mon Sep 17 00:00:00 2001
From: Julien Cristau <jcristau@debian.org>
Date: Sun, 12 Aug 2007 16:54:48 +0200
Subject: [PATCH] Build makekeys with CC_FOR_BUILD to fix cross-compiling

makekeys is run during the build process, so needs to be built
with a native compiler.
---
 configure.ac         |    6 ++++++
 src/util/Makefile.am |    3 +--
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f49b9ed..3125dc4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,12 @@ AC_CONFIG_HEADER([include/X11/XlibConf.h])
 AC_PROG_LIBTOOL
 AC_PROG_CC
 
+if test x"$cross_compiling" = xyes; then
+	AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc)
+else
+	CC_FOR_BUILD="$CC"
+fi
+
 XORG_PROG_RAWCPP
 
 # Build with XCB support?
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 3ff421d..c9e81c0 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -4,8 +4,7 @@ noinst_PROGRAMS=makekeys
 
 makekeys_CFLAGS=$(X11_CFLAGS)
 
-#override CC = gcc
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+CC = @CC_FOR_BUILD@
 
 EXTRA_DIST = mkks.sh
 
-- 
1.5.2.4

Attachment: signature.asc
Description: Digital signature


Reply to: