From 13cce8ec45fd59bd8a1f1101a92576796cba97d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Llu=C3=ADs=20Batlle=20i=20Rossell?= Date: Thu, 11 Mar 2010 20:56:25 +0000 Subject: [PATCH] Making 'bin2c' to be built with the compiler for the local system. I copied the configure.ac code about CC_FOR_BUILD from libX11. --- configure.ac | 9 +++++++++ src/bin2c/Makefile.am | 3 +++ 2 files changed, 12 insertions(+) diff --git a/configure.ac b/configure.ac index 708e61968..4c92bcb5c 100644 --- a/configure.ac +++ b/configure.ac @@ -86,6 +86,15 @@ fi AC_PROG_CC AC_PROG_CXX +# To build programs to be run in the build machine +if test "$CC_FOR_BUILD" = ""; then + if test "$cross_compiling" = "yes"; then + AC_CHECK_PROGS(CC_FOR_BUILD, gcc cc) + else + CC_FOR_BUILD="$CC" + fi +fi +AC_SUBST([CC_FOR_BUILD]) # We are going to use libtool. AC_DISABLE_STATIC diff --git a/src/bin2c/Makefile.am b/src/bin2c/Makefile.am index bdd58808a..f5f118d05 100644 --- a/src/bin2c/Makefile.am +++ b/src/bin2c/Makefile.am @@ -1,3 +1,6 @@ noinst_PROGRAMS = bin2c bin2c_SOURCES = bin2c.c + +bin2c: bin2c.c + $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) -o bin2c bin2c.c