cannam@125: #!/bin/bash cannam@125: cannam@125: # Copyright (C) 2010-2011 Erik de Castro Lopo cannam@125: # cannam@125: # All rights reserved. cannam@125: # cannam@125: # Redistribution and use in source and binary forms, with or without cannam@125: # modification, are permitted provided that the following conditions are cannam@125: # met: cannam@125: # cannam@125: # * Redistributions of source code must retain the above copyright cannam@125: # notice, this list of conditions and the following disclaimer. cannam@125: # * Redistributions in binary form must reproduce the above copyright cannam@125: # notice, this list of conditions and the following disclaimer in cannam@125: # the documentation and/or other materials provided with the cannam@125: # distribution. cannam@125: # * Neither the author nor the names of any contributors may be used cannam@125: # to endorse or promote products derived from this software without cannam@125: # specific prior written permission. cannam@125: # cannam@125: # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS cannam@125: # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED cannam@125: # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR cannam@125: # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR cannam@125: # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, cannam@125: # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, cannam@125: # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; cannam@125: # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, cannam@125: # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR cannam@125: # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF cannam@125: # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cannam@125: cannam@125: cannam@125: if test ! -f @top_srcdir@/tests/sfversion.c ; then cannam@125: exit 0 cannam@125: fi cannam@125: cannam@125: echo -n " Pedantic header test : " cannam@125: cannam@125: # Only do this if the compiler is GCC. cannam@125: if test -n "@GCC_MAJOR_VERSION@" ; then cannam@125: cannam@125: CC=`echo "@CC@" | sed "s/.*shave cc //"` cannam@125: # Compile with -Werror and -pedantic. cannam@125: $CC -std=c99 -Werror -pedantic -I@top_builddir@/src -c @top_srcdir@/tests/sfversion.c -o /dev/null cannam@125: cannam@125: # Check compiler return status. cannam@125: if test $? -ne 0 ; then cannam@125: echo cannam@125: exit 1 cannam@125: fi cannam@125: cannam@125: echo "ok" cannam@125: else cannam@125: echo "n/a" cannam@125: fi cannam@125: cannam@125: exit 0