On Sun, 12 Aug 2007 16:59:25 +0200
Julien Cristau <[EMAIL PROTECTED]> wrote:

> Hi Neil,
> 
> can you test the following patch?
> 
>  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
> +

CC_FOR_BUILD needs to be substituted so I added:
AC_SUBST(CC_FOR_BUILD)

>  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@

I could not get that to work.

A working patch, based on the above, is attached, using the 'override'
command to 'make'.

If this patch is applied within Debian, autoconf needs to be added to
debian/rules build-stamp target:

 build-stamp:
        dh_testdir
-
+       autoconf
and the Build-Depends.

That can be skipped if the patch is applied upstream.

Emdebian patches:
http://buildd.emdebian.org/svn/browser/current/target/trunk/l/libx11/trunk/
http://buildd.emdebian.org/svn/browser/current/target/trunk/l/libx11/trunk/debian-patch-023_emdebian.diff?rev=1460&format=txt

Build log:
http://buildd.emdebian.org/svn/browser/current/target/trunk/l/libx11/trunk/libx11_2%3A1.0.3-7em1_arm.build?format=raw

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Index: libx11-1.0.3/configure.ac
===================================================================
--- libx11-1.0.3.orig/configure.ac	2007-08-12 19:08:08.000000000 +0100
+++ libx11-1.0.3/configure.ac	2007-08-12 19:08:13.000000000 +0100
@@ -18,6 +18,13 @@
 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
+AC_SUBST(CC_FOR_BUILD)
+
 XORG_PROG_RAWCPP
 
 # Checks for pkg-config packages
Index: libx11-1.0.3/src/util/Makefile.am
===================================================================
--- libx11-1.0.3.orig/src/util/Makefile.am	2007-08-12 19:08:08.000000000 +0100
+++ libx11-1.0.3/src/util/Makefile.am	2007-08-12 19:17:09.000000000 +0100
@@ -5,6 +5,7 @@
 makekeys_CFLAGS=$(X11_CFLAGS)
 
 #override CC = gcc
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+override [EMAIL PROTECTED]@
+override LINK = @CC_FOR_BUILD@ $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 
 EXTRA_DIST = mkks.sh
Index: libx11-1.0.3/src/util/Makefile.in
===================================================================
--- libx11-1.0.3.orig/src/util/Makefile.in	2007-08-12 19:08:08.000000000 +0100
+++ libx11-1.0.3/src/util/Makefile.in	2007-08-12 19:17:19.000000000 +0100
@@ -237,7 +237,8 @@
 makekeys_CFLAGS = $(X11_CFLAGS)
 
 #override CC = gcc
-LINK = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+override [EMAIL PROTECTED]@
+override LINK = @CC_FOR_BUILD@ $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 EXTRA_DIST = mkks.sh
 all: all-am
 

Attachment: pgphFgnGFtE2y.pgp
Description: PGP signature

Reply via email to