Commit | Line | Data |
---|---|---|
0b272666 JH |
1 | ?RCS: $Id: d_attribut.U,v 3.0.1.3 1995/01/30 14:33:45 ram Exp $ |
2 | ?RCS: | |
3 | ?RCS: Copyright (c) 1991-1993, Raphael Manfredi | |
4 | ?RCS: | |
5 | ?RCS: You may redistribute only under the terms of the Artistic Licence, | |
6 | ?RCS: as specified in the README file that comes with the distribution. | |
7 | ?RCS: You may reuse parts of this distribution only within the terms of | |
8 | ?RCS: that same Artistic Licence; a copy of which may be found at the root | |
9 | ?RCS: of the source tree for dist 3.0. | |
10 | ?RCS: | |
11 | ?RCS: Original Author: Andy Dougherty <doughera@lafcol.lafayette.edu> | |
12 | ?RCS: | |
13 | ?RCS: $Log: d_attribut.U,v $ | |
14 | ?RCS: Revision 3.0.1.3 1995/01/30 14:33:45 ram | |
15 | ?RCS: patch49: test C program now includes <stdio.h> (WED) | |
16 | ?RCS: | |
17 | ?RCS: Revision 3.0.1.2 1995/01/11 15:25:47 ram | |
18 | ?RCS: patch45: fixed typo in the d_attribut variable (ADO) | |
19 | ?RCS: | |
20 | ?RCS: Revision 3.0.1.1 1994/10/29 16:08:55 ram | |
21 | ?RCS: patch36: created by ADO | |
22 | ?RCS: | |
23 | ?MAKE:d_attribut: Myread Oldconfig cat cc ccflags rm Setvar contains | |
24 | ?MAKE: -pick add $@ %< | |
25 | ?S:d_attribut (d_attrib): | |
26 | ?S: This variable conditionally defines HASATTRIBUTE, which | |
27 | ?S: indicates the C compiler can check for function attributes, | |
28 | ?S: such as printf formats. | |
29 | ?S:. | |
30 | ?C:HASATTRIBUTE ~ %< (GNUC_ATTRIBUTE_CHECK): | |
31 | ?C: This symbol indicates the C compiler can check for function attributes, | |
32 | ?C: such as printf formats. This is normally only supported by GNU cc. | |
33 | ?C:. | |
34 | ?H:?%<:#$d_attribut HASATTRIBUTE /**/ | |
35 | ?H:?%<:#ifndef HASATTRIBUTE | |
36 | ?H:?%<:#ifdef __attribute__ | |
37 | ?H:?%<:#undef __attribute__ | |
38 | ?H:?%<:#endif | |
39 | ?H:?%<:#define __attribute__(_arg_) | |
40 | ?H:?%<:#endif | |
41 | ?H:. | |
42 | ?W:%<:__attribute__ | |
43 | ?LINT:set d_attribut | |
44 | ?LINT:known __attribute__ | |
45 | : Look for GNU-cc style attribute checking | |
cdbedeff GA |
46 | case "$d_attribut" in |
47 | '') | |
0b272666 JH |
48 | echo " " |
49 | echo "Checking whether your compiler can handle __attribute__ ..." >&4 | |
50 | $cat >attrib.c <<'EOCP' | |
51 | #include <stdio.h> | |
62eece6b | 52 | void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn)); |
0b272666 JH |
53 | EOCP |
54 | if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then | |
55 | if $contains 'warning' attrib.out >/dev/null 2>&1; then | |
56 | echo "Your C compiler doesn't fully support __attribute__." | |
57 | val="$undef" | |
58 | else | |
59 | echo "Your C compiler supports __attribute__." | |
60 | val="$define" | |
61 | fi | |
62 | else | |
63 | echo "Your C compiler doesn't seem to understand __attribute__ at all." | |
64 | val="$undef" | |
65 | fi | |
cdbedeff GA |
66 | ;; |
67 | *) val="$d_attribut" ;; | |
68 | esac | |
0b272666 JH |
69 | set d_attribut |
70 | eval $setvar | |
71 | $rm -f attrib* | |
72 |