]>
Commit | Line | Data |
---|---|---|
43c58c85 | 1 | #!/bin/sh |
e1f7507e | 2 | # |
4ac4a490 | 3 | ## Copyright (C) 1996-2017 The Squid Software Foundation and contributors |
4e0938ef AJ |
4 | ## |
5 | ## Squid software is distributed under GPLv2+ license and includes | |
6 | ## contributions from numerous individuals and organizations. | |
7 | ## Please see the COPYING and CONTRIBUTORS files for details. | |
8 | ## | |
9 | ||
e1f7507e AJ |
10 | # test all header files (.h) for dependancy issues. |
11 | # | |
12 | # Ideally this test should be performed twice before any code is accepted. | |
13 | # With or without inline enabled. This is needed because the .cci files | |
14 | # are only included into the .h files when inline mode is enabled. | |
15 | # | |
16 | # This script should be run from the makefile with the directory path and ccflags | |
17 | # | |
18 | cc="${1}" | |
a0fdc9bf | 19 | shift |
96ccb411 FC |
20 | for dir in /usr/bin /usr/local/bin /usr/gnu/bin |
21 | do | |
22 | test -x ${dir}/true && TRUE=${dir}/true | |
23 | done | |
24 | TRUE=${TRUE:-/bin/true} | |
e1f7507e | 25 | |
d18e40db AR |
26 | exitCode=0 |
27 | ||
a0fdc9bf FC |
28 | for f in $@; do |
29 | echo -n "Testing ${f} ..." | |
30 | t="testhdr_`basename ${f}`" | |
31 | if [ ! -f "$t.o" -o $f -nt "$t.o" ]; then | |
32 | echo >$t.cc <<EOF | |
33 | /* This file is AUTOMATICALLY GENERATED. DO NOT ALTER IT */ | |
f7f3304a | 34 | #include "squid.h" |
a0fdc9bf FC |
35 | #include "${f}" |
36 | int main( int argc, char* argv[] ) { return 0; } | |
37 | EOF | |
38 | if ${cc} -c -o $t.o $t.cc ; then | |
39 | echo "Ok." | |
40 | else | |
41 | echo "Fail." | |
42 | exitCode=1 | |
43 | fi | |
44 | rm $t.cc $t.o | |
45 | fi | |
46 | test $exitCode -eq 0 || break | |
e1f7507e | 47 | done |
d18e40db | 48 | |
a0fdc9bf | 49 | #who ever said that the test program needs to be meaningful? |
96ccb411 | 50 | test $exitCode -eq 0 && cp ${TRUE} testHeaders |
d18e40db | 51 | exit $exitCode |