When cross-compiling against a sysroot for instance, a --sysroot option
is typically passed via the CPPFLAGS variable. This can cause the build
to break in the util subdirectory which requires the CPPFLAGS to be set
for the build system.

Solve this by using the value of CPPFLAGS_FOR_BUILD for CPPFLAGS in the
util subdirectory. Cross-compile setups can override the variable when
calling teh configure script.

Signed-off-by: Thierry Reding <[email protected]>
---
 configure.ac     | 2 ++
 util/Makefile.am | 1 +
 2 files changed, 3 insertions(+)

diff --git a/configure.ac b/configure.ac
index c59cc26..65ad585 100644
--- a/configure.ac
+++ b/configure.ac
@@ -65,6 +65,8 @@ if test x"$CC_FOR_BUILD" = x; then
        fi
 fi
 AC_SUBST([CC_FOR_BUILD])
+CPPFLAGS_FOR_BUILD=${CPPFLAGS_FOR_BUILD-${CPPFLAGS}}
+AC_SUBST(CPPFLAGS_FOR_BUILD)
 CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD-${CFLAGS}}
 AC_SUBST(CFLAGS_FOR_BUILD)
 LDFLAGS_FOR_BUILD=${LDFLAGS_FOR_BUILD-${LDFLAGS}}
diff --git a/util/Makefile.am b/util/Makefile.am
index dedfa6b..800b35b 100644
--- a/util/Makefile.am
+++ b/util/Makefile.am
@@ -1,6 +1,7 @@
 noinst_PROGRAMS = makestrs
 
 CC = @CC_FOR_BUILD@
+CPPFLAGS = @CPPFLAGS_FOR_BUILD@
 CFLAGS = @CFLAGS_FOR_BUILD@
 LDFLAGS = @LDFLAGS_FOR_BUILD@
 
-- 
1.8.0.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to