diff --git a/tests/test-headers.sh b/tests/test-headers.sh index ab17b41704..e8fb8eed9c 100644 --- a/tests/test-headers.sh +++ b/tests/test-headers.sh @@ -1,35 +1,36 @@ #!/bin/sh # # Check public headers for c++ compatibility and consistent protection #ifdefs # # INCLUDE_FILES="`find ../include/ -name \*.h -a \! -name \*internal.h`" for i in $INCLUDE_FILES do NAME="`echo $i | cut -c12-`" # config.h is generated by autoconf - if [ "$NAME" = "config.h" ] + # gettext.h is supplied by gettext + if [ "$NAME" = "config.h" ] || [ "$NAME" = "gettext.h" ] then continue fi PROTECT="PCMK__`echo $NAME | tr '[:lower:]' '[:upper:]' | tr '/\.' '_' |tr '-' '_' `" PROTECT=`echo $PROTECT|sed 's/_H/__H/'` # PCMK uses double underscore for .h (eg NAME__H) echo "#include <$NAME>" > _test_file.c echo "#ifndef $PROTECT" >> _test_file.c echo "#error no header protector in file $i" >> _test_file.c echo "#endif" >> _test_file.c echo "int main(void) {return 0;}" >> _test_file.c # Not including ${CFLAGS} because it seems to break header detection. But we're not really building here ${CC} -I ../include -DHAVE_CONFIG_H ${CPPFLAGS} ${LIBS} _test_file.c -o /dev/null if [ "$CXX" ] then ${CXX} ${CXXFLAGS} ${CPPFLAGS} ${LIBS} -I ../include _test_file.c -o /dev/null echo -n fi rm -f _test_file.c done