1#!/bin/sh
2
3# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
4#
5# SPDX-License-Identifier: MPL-2.0
6#
7# This Source Code Form is subject to the terms of the Mozilla Public
8# License, v. 2.0.  If a copy of the MPL was not distributed with this
9# file, you can obtain one at https://mozilla.org/MPL/2.0/.
10#
11# See the COPYRIGHT file distributed with this work for additional
12# information regarding copyright ownership.
13
14#
15# Check the installed bind9 headers to make sure that no header
16# depends on another header having been included first.
17#
18
19prefix=@prefix@
20tmp=/tmp/thdr$$.tmp
21
22status=0
23
24echo "Checking for header interdependencies..."
25
26# Make a list of header files.
27(cd $prefix/include; find . -name '*.h' -print | sed 's!^./!!') > $tmp
28
29# Check each header.
30while read h
31do
32    echo " - <$h>"
33
34    # Build a test program.
35    cat <<EOF >test.c
36#include <$h>
37EOF
38
39    # Compile the test program.
40    if
41       gcc @STD_CWARNINGS@ @STD_CINCLUDES@ -I$prefix/include -c test.c 2>&1
42    then
43       :
44    else
45       status=1
46    fi
47done <$tmp
48
49rm -f test.c test.o $tmp
50
51exit $status
52