[PATCH] fix "shadow build"
Tomi Ollila
tomi.ollila at iki.fi
Sun Nov 13 11:55:03 PST 2016
With working tests.
---
Some day we dump `find_notmuch_path()`
configure | 6 ++++--
test/test-lib-common.sh | 2 ++
test/test-lib.sh | 6 +++---
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/configure b/configure
index 2a0ce9e..05b964d 100755
--- a/configure
+++ b/configure
@@ -342,8 +342,8 @@ int main(void) {
return 0;
}
EOF
-if ${CC} ${CFLAGS} _libversion.c -o _libversion > /dev/null 2>&1 && \
- ./_libversion > _libversion.sh && . ./_libversion.sh
+if ${CC} ${CFLAGS} -I "$srcdir" _libversion.c -o _libversion > /dev/null 2>&1 \
+ && ./_libversion > _libversion.sh && . ./_libversion.sh
then
printf "OK.\n"
else
@@ -1158,6 +1158,8 @@ cat > sh.config <<EOF
# This sh.config was automatically generated by the ./configure
# script of notmuch.
+NOTMUCH_SRCDIR='${srcdir}'
+
# Whether the Xapian version in use supports compaction
NOTMUCH_HAVE_XAPIAN_COMPACT=${have_xapian_compact}
diff --git a/test/test-lib-common.sh b/test/test-lib-common.sh
index 03ef1d2..2161bbb 100644
--- a/test/test-lib-common.sh
+++ b/test/test-lib-common.sh
@@ -66,6 +66,8 @@ export LD_LIBRARY_PATH
# configure output
. $notmuch_path/sh.config || exit 1
+SOURCE_DIRECTORY=$(cd ../$NOTMUCH_SRCDIR; pwd -P)
+
if test -n "$valgrind"
then
make_symlink () {
diff --git a/test/test-lib.sh b/test/test-lib.sh
index a12c6d0..1cd0ff0 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -1205,19 +1205,19 @@ test_emacs () {
test_python() {
# Note: if there is need to print debug information from python program,
# use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w')
- PYTHONPATH="$TEST_DIRECTORY/../bindings/python${PYTHONPATH:+:$PYTHONPATH}" \
+ PYTHONPATH="$SOURCE_DIRECTORY/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \
$NOTMUCH_PYTHON -B - > OUTPUT
}
test_ruby() {
- MAIL_DIR=$MAIL_DIR ruby -I $TEST_DIRECTORY/../bindings/ruby> OUTPUT
+ MAIL_DIR=$MAIL_DIR ruby -I $SOURCE_DIRECTORY/bindings/ruby> OUTPUT
}
test_C () {
exec_file="test${test_count}"
test_file="${exec_file}.c"
cat > ${test_file}
- ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${TEST_DIRECTORY}/../lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc
+ ${TEST_CC} ${TEST_CFLAGS} -I${TEST_DIRECTORY} -I${SOURCE_DIRECTORY}/lib -o ${exec_file} ${test_file} -L${TEST_DIRECTORY}/../lib/ -lnotmuch -ltalloc
echo "== stdout ==" > OUTPUT.stdout
echo "== stderr ==" > OUTPUT.stderr
./${exec_file} "$@" 1>>OUTPUT.stdout 2>>OUTPUT.stderr
--
2.7.4
More information about the notmuch
mailing list