xref: /freebsd/contrib/libfido2/tools/include_check.sh (revision e5b786625f7f82a1fa91e41823332459ea5550f9)
1#!/bin/sh
2
3# Copyright (c) 2019 Yubico AB. All rights reserved.
4# Use of this source code is governed by a BSD-style
5# license that can be found in the LICENSE file.
6# SPDX-License-Identifier: BSD-2-Clause
7
8check() {
9	for f in $(find $1 -maxdepth 1 -name '*.h'); do
10		echo "#include \"$f\"" | \
11			cc $CFLAGS -Isrc -xc -c - -o /dev/null 2>&1
12		echo "$f $CFLAGS $?"
13	done
14}
15
16check examples
17check fuzz
18check openbsd-compat
19CFLAGS="${CFLAGS} -D_FIDO_INTERNAL" check src
20check src/fido.h
21check src/fido
22check tools
23