xref: /freebsd/contrib/libfido2/tools/include_check.sh (revision 2ccfa855b2fc331819953e3de1b1c15ce5b95a7e)
10afa8e06SEd Maste#!/bin/sh
20afa8e06SEd Maste
30afa8e06SEd Maste# Copyright (c) 2019 Yubico AB. All rights reserved.
40afa8e06SEd Maste# Use of this source code is governed by a BSD-style
50afa8e06SEd Maste# license that can be found in the LICENSE file.
6*2ccfa855SEd Maste# SPDX-License-Identifier: BSD-2-Clause
70afa8e06SEd Maste
80afa8e06SEd Mastecheck() {
90afa8e06SEd Maste	for f in $(find $1 -maxdepth 1 -name '*.h'); do
100afa8e06SEd Maste		echo "#include \"$f\"" | \
110afa8e06SEd Maste			cc $CFLAGS -Isrc -xc -c - -o /dev/null 2>&1
120afa8e06SEd Maste		echo "$f $CFLAGS $?"
130afa8e06SEd Maste	done
140afa8e06SEd Maste}
150afa8e06SEd Maste
160afa8e06SEd Mastecheck examples
170afa8e06SEd Mastecheck fuzz
180afa8e06SEd Mastecheck openbsd-compat
190afa8e06SEd MasteCFLAGS="${CFLAGS} -D_FIDO_INTERNAL" check src
200afa8e06SEd Mastecheck src/fido.h
210afa8e06SEd Mastecheck src/fido
220afa8e06SEd Mastecheck tools
23