summaryrefslogtreecommitdiff
path: root/t/nostdinc.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/nostdinc.sh')
-rw-r--r--t/nostdinc.sh43
1 files changed, 27 insertions, 16 deletions
diff --git a/t/nostdinc.sh b/t/nostdinc.sh
index 4e9954a3a..4b6a84a7e 100644
--- a/t/nostdinc.sh
+++ b/t/nostdinc.sh
@@ -16,11 +16,7 @@
# Test to make sure nostdinc option works correctly.
-# We don't require a C compiler explicitly, because the first part of the
-# test (where 'Makefile.in' is grepped) does not require one. Insted, we
-# just skip the rest of the test if configure fails to find a working C
-# compiler.
-
+required=cc
. test-init.sh
cat >> configure.ac << 'END'
@@ -31,26 +27,41 @@ END
cat > Makefile.am << 'END'
AUTOMAKE_OPTIONS = nostdinc
bin_PROGRAMS = foo
-foo_SOURCES = foo.c
END
-$ACLOCAL
-$AUTOMAKE
+cat > foo.c << 'END'
+#include <stdlib.h>
+int main (void)
+{
+ exit (0);
+}
+END
-$EGREP '(-I *\.|-I.*srcdir|am__isrc)' Makefile.in && exit 1
+# This shouldn't be picked up.
+cat > stdlib.h << 'END'
+#error "stdlib.h from source dir included"
+choke me
+END
-# We'll test the fully-processed Makefile too.
+$ACLOCAL
$AUTOCONF
+$AUTOMAKE --add-missing
# Test with $builddir != $srcdir
mkdir build
cd build
-../configure || exit $?
-$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && exit 1
+../configure
+run_make -O V=1
+grep '.*-I *\.' stdout && exit 1
+$MAKE clean
+# Shouldn't be picked up from builddir either.
+cp ../stdlib.h .
+$MAKE
+cd ..
# Test with $builddir = $srcdir
-cd ..
-./configure || exit $?
-$EGREP '.*-I *(\.|\$.srcdir.)' Makefile && exit 1
+./configure
+run_make -O V=1
+grep '.*-I *\.' stdout && exit 1
-exit 0
+: