summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-09-20 10:09:54 -0400
committerAdrian Thurston <thurston@complang.org>2015-09-20 10:09:54 -0400
commit6aa9bd3e02f4c9ace4c991ffc1efa7f9439d3710 (patch)
treeede64126d527fd50a60deb4621bba8ea11d58842
parent93dccf445bb3079dfa60d654ea5e56fbcc3f1c54 (diff)
downloadcolm-6aa9bd3e02f4c9ace4c991ffc1efa7f9439d3710.tar.gz
determine CPPFLAGS and LDFLAGS for source tests in configurecolm-0.13.0.2
-rw-r--r--test/configure.ac20
-rw-r--r--test/runtests.sh8
2 files changed, 21 insertions, 7 deletions
diff --git a/test/configure.ac b/test/configure.ac
index d3230887..cacb7e56 100644
--- a/test/configure.ac
+++ b/test/configure.ac
@@ -13,14 +13,26 @@ dnl Which colm are we testing. Default is the one in parent's source dir.
dnl
AC_ARG_WITH(subject,
[AC_HELP_STRING([--with-subject], [location of colm to test])],
- [SUBJECT="$withval/bin/colm"],
- [SUBJECT="../src/colm"]
+ [
+ SUBJECT_BIN="$withval/bin/colm"
+ SUBJECT_CPPFLAGS="-I$withval/include"
+ SUBJECT_LDFLAGS="-L$withval/lib"
+ ],
+ [
+ SUBJECT_BIN="../src/colm"
+ SUBJECT_CPPFLAGS="-I../src/include"
+ SUBJECT_LDFLAGS="-L../src"
+ ]
)
-AC_SUBST(SUBJECT)
+AC_SUBST(SUBJECT_BIN)
+AC_SUBST(SUBJECT_CPPFLAGS)
+AC_SUBST(SUBJECT_LDFLAGS)
SED_SUBST=["\
- -e 's|@SUBJECT@|${SUBJECT}|g' \
+ -e 's|@SUBJECT_BIN@|${SUBJECT_BIN}|g' \
+ -e 's|@SUBJECT_CPPFLAGS@|${SUBJECT_CPPFLAGS}|g' \
+ -e 's|@SUBJECT_LDFLAGS@|${SUBJECT_LDFLAGS}|g' \
"]
AC_SUBST(SED_SUBST)
diff --git a/test/runtests.sh b/test/runtests.sh
index 8223890d..7eeebba0 100644
--- a/test/runtests.sh
+++ b/test/runtests.sh
@@ -38,7 +38,9 @@
WORKING=working
ERRORS=0
-COLM=@SUBJECT@
+COLM="@SUBJECT_BIN@"
+CPPFLAGS="@SUBJECT_CPPFLAGS@"
+LDFLAGS="@SUBJECT_LDFLAGS@"
cd `dirname $0`
test -d $WORKING || mkdir $WORKING
@@ -200,8 +202,8 @@ function runtests()
continue
fi
- echo_cmd gcc -c -I../src/include -L../src -o $PARSE.o $PARSE.c
- echo_cmd g++ -I. -I../src/include -L../src -o $WORKING/$ROOT \
+ echo_cmd gcc -c $CPPFLAGS $LDFLAGS -o $PARSE.o $PARSE.c
+ echo_cmd g++ -I. $CPPFLAGS $LDFLAGS -o $WORKING/$ROOT \
$IF.cc $HOST $PARSE.o -lcolmd
if ! check_compilation $?; then