Chris@0
|
1 #!/bin/bash
|
Chris@0
|
2
|
Chris@0
|
3 # Copyright (C) 2010-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
Chris@0
|
4 #
|
Chris@0
|
5 # All rights reserved.
|
Chris@0
|
6 #
|
Chris@0
|
7 # Redistribution and use in source and binary forms, with or without
|
Chris@0
|
8 # modification, are permitted provided that the following conditions are
|
Chris@0
|
9 # met:
|
Chris@0
|
10 #
|
Chris@0
|
11 # * Redistributions of source code must retain the above copyright
|
Chris@0
|
12 # notice, this list of conditions and the following disclaimer.
|
Chris@0
|
13 # * Redistributions in binary form must reproduce the above copyright
|
Chris@0
|
14 # notice, this list of conditions and the following disclaimer in
|
Chris@0
|
15 # the documentation and/or other materials provided with the
|
Chris@0
|
16 # distribution.
|
Chris@0
|
17 # * Neither the author nor the names of any contributors may be used
|
Chris@0
|
18 # to endorse or promote products derived from this software without
|
Chris@0
|
19 # specific prior written permission.
|
Chris@0
|
20 #
|
Chris@0
|
21 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
Chris@0
|
22 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
Chris@0
|
23 # TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
Chris@0
|
24 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
Chris@0
|
25 # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
Chris@0
|
26 # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
Chris@0
|
27 # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
|
Chris@0
|
28 # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
Chris@0
|
29 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
|
Chris@0
|
30 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
Chris@0
|
31 # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Chris@0
|
32
|
Chris@0
|
33
|
Chris@0
|
34 if test ! -f @top_srcdir@/tests/sfversion.c ; then
|
Chris@0
|
35 exit 0
|
Chris@0
|
36 fi
|
Chris@0
|
37
|
Chris@0
|
38 echo -n " Pedantic header test : "
|
Chris@0
|
39
|
Chris@0
|
40 # Only do this if the compiler is GCC.
|
Chris@0
|
41 if test -n "@GCC_MAJOR_VERSION@" ; then
|
Chris@0
|
42
|
Chris@0
|
43 CC=`echo "@CC@" | sed "s/.*shave cc //"`
|
Chris@0
|
44 # Compile with -Werror and -pedantic.
|
Chris@0
|
45 $CC -std=c99 -Werror -pedantic -I@top_builddir@/src -c @top_srcdir@/tests/sfversion.c -o /dev/null
|
Chris@0
|
46
|
Chris@0
|
47 # Check compiler return status.
|
Chris@0
|
48 if test $? -ne 0 ; then
|
Chris@0
|
49 echo
|
Chris@0
|
50 exit 1
|
Chris@0
|
51 fi
|
Chris@0
|
52
|
Chris@0
|
53 echo "ok"
|
Chris@0
|
54 else
|
Chris@0
|
55 echo "n/a"
|
Chris@0
|
56 fi
|
Chris@0
|
57
|
Chris@0
|
58 exit 0
|