[PATCH:libX11] Bug 22584 - libX11 does not cross compile

Alan Coopersmith alan.coopersmith at oracle.com
Thu Jun 3 11:15:17 PDT 2010


Adaptation of patch submitted by Paul Bender in attachment 27301 to
https://bugs.freedesktop.org/show_bug.cgi?id=22584

Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>
---
 configure.ac         |   26 +++++++++++++++++++++++++-
 src/util/Makefile.am |    3 +++
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 85e7b44..502996a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,6 +8,8 @@ AC_INIT([libX11],
         libX11)
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_BUILD
+AC_CANONICAL_HOST
 
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE
@@ -32,6 +34,7 @@ XORG_WITH_PS2PDF
 AC_PROG_LIBTOOL
 DOLT
 AC_PROG_CC
+PKG_PROG_PKG_CONFIG
 
 if test x"$CC_FOR_BUILD" = x; then
 	if test x"$cross_compiling" = xyes; then
@@ -42,6 +45,27 @@ if test x"$CC_FOR_BUILD" = x; then
 fi
 AC_SUBST([CC_FOR_BUILD])
 
+if test x"$CPPFLAGS_FOR_BUILD" = x; then
+	if test ! x"$cross_compiling" = xyes; then
+		CPPFLAGS_FOR_BUILD=${CPPFLAGS}
+	fi
+fi
+AC_SUBST(CPPFLAGS_FOR_BUILD)
+
+if test x"$CFLAGS_FOR_BUILD" = x; then
+	if test ! x"$cross_compiling" = xyes; then
+		CFLAGS_FOR_BUILD=${CFLAGS}
+	fi
+fi
+AC_SUBST(CFLAGS_FOR_BUILD)
+
+if test x"$LDFLAGS_FOR_BUILD" = x; then
+	if test ! x"$cross_compiling" = xyes; then
+		LDFLAGS_FOR_BUILD=${LDFLAGS}
+	fi
+fi
+AC_SUBST(LDFLAGS_FOR_BUILD)
+
 XORG_PROG_RAWCPP
 
 # Find perl for "make check" tests in nls/localerules.in
@@ -285,7 +309,7 @@ AC_CHECK_FUNC(poll, [AC_DEFINE(USE_POLL, 1, [poll() function is available])], )
 # Find keysymdef.h
 #
 AC_MSG_CHECKING([keysymdef.h])
-dir=`pkg-config --variable=includedir xproto`
+dir=`$PKG_CONFIG --variable=includedir xproto`
 KEYSYMDEF="$dir/X11/keysymdef.h"
 if test -f "$KEYSYMDEF"; then
         AC_MSG_RESULT([$KEYSYMDEF])
diff --git a/src/util/Makefile.am b/src/util/Makefile.am
index 644d6b6..3b100e0 100644
--- a/src/util/Makefile.am
+++ b/src/util/Makefile.am
@@ -6,6 +6,9 @@ makekeys_CFLAGS = \
 	$(CWARNFLAGS)
 
 CC = @CC_FOR_BUILD@
+CPPFLAGS = @CPPFLAGS_FOR_BUILD@
+CFLAGS = @CFLAGS_FOR_BUILD@
+LDFLAGS = @LDFLAGS_FOR_BUILD@
 
 EXTRA_DIST = mkks.sh
 
-- 
1.5.6.5



More information about the xorg-devel mailing list