[vala/staging] Respect CFLAGS, LDFLAGS, and CPPFLAGS when compiling vala programs in the testsuite.



commit 3d3693eb038b01a8f3831360d8ca54c1a8a9662e
Author: Nathan Phillip Brink <binki gentoo org>
Date:   Wed Nov 23 02:57:23 2011 +0000

    Respect CFLAGS, LDFLAGS, and CPPFLAGS when compiling vala programs in the testsuite.
    
    Fixes bug #664606.

 tests/Makefile.am   |    4 ++--
 tests/testrunner.sh |    6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 119f1f8..c5248d3 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -12,7 +12,7 @@ BUILT_SOURCES = \
 noinst_PROGRAMS = \
 	$(NULL)
 
-TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) $(srcdir)/testrunner.sh
+TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(srcdir)/testrunner.sh
 
 TESTS = \
 	basic-types/integers.vala \
@@ -168,7 +168,7 @@ TESTS = \
 	$(NULL)
 
 check-TESTS: $(TESTS)
-	@EXEEXT=$(EXEEXT) $(srcdir)/testrunner.sh $(TESTS)
+	@EXEEXT=$(EXEEXT) EXEEXT=$(EXEEXT) CFLAGS='$(CFLAGS)' CPPFLAGS='$(CPPFLAGS)' LDFLAGS='$(LDFLAGS)' $(srcdir)/testrunner.sh $(TESTS)
 
 EXTRA_DIST = \
 	testrunner.sh \
diff --git a/tests/testrunner.sh b/tests/testrunner.sh
index adb20d6..02948c1 100755
--- a/tests/testrunner.sh
+++ b/tests/testrunner.sh
@@ -33,6 +33,12 @@ VALAFLAGS="--vapidir $vapidir --disable-warnings --main main --save-temps -X -g
 VAPIGEN=$topbuilddir/vapigen/vapigen
 VAPIGENFLAGS="--vapidir $vapidir"
 
+# Incorporate the user's CFLAGS. Matters if the user decided to insert
+# -m32 in CFLAGS, for example.
+for cflag in ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+    VALAFLAGS="${VALAFLAGS} -X ${cflag}"
+done
+
 function testheader() {
 	if [ "$1" = "Packages:" ]; then
 		shift



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