]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix tests when building out-of-tree
authorNick Mathewson <nickm@torproject.org>
Wed, 16 Jul 2014 19:07:22 +0000 (21:07 +0200)
committerNick Mathewson <nickm@torproject.org>
Wed, 16 Jul 2014 19:07:22 +0000 (21:07 +0200)
(This was too hard. Silly autoconf.)

configure.ac
src/test/test_entrynodes.c

index 414c72a42c4bc9e6b3f34b2bd8f6370ecbac649d..40e2558b15eb3f33bfce6915061bdc12782ae6fb 100644 (file)
@@ -1407,6 +1407,14 @@ AC_SUBST(BINDIR)
 LOCALSTATEDIR=`eval echo $localstatedir`
 AC_SUBST(LOCALSTATEDIR)
 
+case "$srcdir" in
+  /*) TOP_SRCDIR=$srcdir;;
+  *) TOP_SRCDIR=$PWD/$srcdir;;
+esac
+
+AH_TEMPLATE([TOP_SRCDIR],[source directory we're building from])
+AC_DEFINE_UNQUOTED(TOP_SRCDIR,"$TOP_SRCDIR")
+
 if test "$bwin32" = true; then
   # Test if the linker supports the --nxcompat and --dynamicbase options
   # for Windows
index 1be0ce126b2a2ea0b2b677092a24d1720ce14db1..285a5ae0cf87f0666a6db193f801e290530fe509 100644 (file)
@@ -115,7 +115,7 @@ static void *
 fake_network_setup(const struct testcase_t *testcase)
 {
   /* This is the file containing our test descriptors. */
-  const char *fname = BUILDDIR "/src/test/test_descriptors.txt";
+  const char *fname = TOP_SRCDIR "/src/test/test_descriptors.txt";
 
   (void) testcase;