blob: 59c378fcd211bd47f98c64b3c61c967985724833 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#!/bin/bash -e
# This script is invoked by "make check" to verify that we have
# correctly declared the exact set of Boost include files that
# "configure" should look for.
#
# Currently, this assumes that every occurrence of "boost/foo.hpp" is
# significant. If stray strings that look like that find their way
# into the source code or configure, we'll have to look at #include
# lines and/or mark off the section of configure with a tag (and,
# e.g., use "awk" instead of "grep").
echo "Verifying that the configure check tests the correct set of header files."
RESULT=0
BOOST_PATTERN='boost/[a-zA-Z0-9_./-]*\.hpp'
# Exclude headers that are only used, e.g., to write configure tests.
BOOST_CONFIGURE_PATTERN="$BOOST_PATTERN"' dnl$'
# Check that the source code and the configure check look for the same
# Boost headers.
SRC_OCCURRENCES=$((find src \( -name \*.cc -or -name \*.h \) -print0; find tests \( -name \*.cc -or -name \*.h \) -print0) \
| xargs -0 grep -h --only-matching "$BOOST_PATTERN" | sort -u)
if ! grep -h --only-matching "$BOOST_CONFIGURE_PATTERN" configure.ac | sed 's/ dnl$//' | sort -c
then
echo "The list of Boost headers in configure.ac is not sorted."
RESULT=2
fi
CONFIGURE_OCCURRENCES=$(grep -h --only-matching "$BOOST_CONFIGURE_PATTERN" configure.ac | sed 's/ dnl$//' | sort -u)
if ! cmp <(echo "$SRC_OCCURRENCES") <(echo "$CONFIGURE_OCCURRENCES")
then
ONLY_SRC=$(comm -2 -3 <(echo "$SRC_OCCURRENCES") <(echo "$CONFIGURE_OCCURRENCES"))
ONLY_CONFIG=$(comm -1 -3 <(echo "$SRC_OCCURRENCES") <(echo "$CONFIGURE_OCCURRENCES"))
echo "Mismatch in Boost header file declarations."
if [ -n "$ONLY_SRC" ]
then
echo "The following headers occur only in the source code:"
echo "$ONLY_SRC"
fi
if [ -n "$ONLY_CONFIG" ]
then
echo "The following headers occur only in the configure script:"
echo "$ONLY_CONFIG"
fi
echo "*** BOOST CONFIGURE CHECK MISMATCH."
echo "*** Please update the configure script to match the source code."
RESULT=1
fi
exit $RESULT
|