check_headers 733 Bytes
Newer Older
1 2 3 4 5 6 7
#! /bin/sh
# Copyright © 2008 Rémi Denis-Courmont

cd "$(dirname "$0")" || exit $?

# Look for configure #defines in public headers.
# There are incorrect, as external users don't have our <config.h>.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
regexp=""

while read l; do
	d=$(echo "$l" | sed -n -e 's/^#undef \([[:upper:][:digit:]_]*\)$/\1/p')
	test -z "$d" && continue
	test "$d" = "WORDS_BIGENDIAN" && continue
	test "$d" = "UNICODE" && continue
	test "$d" = "__LIBVLC__" && continue

	if test -z "$regexp"; then
		regexp="[^A-Za-z0-9_]\("
	else
		regexp="${regexp}\|"
	fi
	regexp="${regexp}${d}"
done < ../config.h.in
regexp="${regexp}\)\([^A-Za-z0-9_]\|\$\)"
25

Rémi Denis-Courmont's avatar
Rémi Denis-Courmont committed
26 27 28
echo Looking for private defines in public headers...
! grep -- "$regexp" "$@" || exit $?
echo "None found."