This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Mass update of *headers* in dist/U from git
[metaconfig.git] / dist / U / d_attribut.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi
4 ?RCS: 
5 ?RCS: You may redistribute only under the terms of the Artistic License,
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 License; a copy of which may be found at the root
9 ?RCS: of the source tree for dist 4.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:?%<:#define __attribute__(_arg_)
37 ?H:?%<:#endif
38 ?H:.
39 ?W:%<:__attribute__
40 ?LINT:set d_attribut
41 ?LINT:known __attribute__
42 : Look for GNU-cc style attribute checking
43 echo " "
44 echo "Checking whether your compiler can handle __attribute__ ..." >&4
45 $cat >attrib.c <<'EOCP'
46 #include <stdio.h>
47 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
48 EOCP
49 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
50         if $contains 'warning' attrib.out >/dev/null 2>&1; then
51                 echo "Your C compiler doesn't fully support __attribute__."
52                 val="$undef"
53         else
54                 echo "Your C compiler supports __attribute__."
55                 val="$define"
56         fi
57 else
58         echo "Your C compiler doesn't seem to understand __attribute__ at all."
59         val="$undef"
60 fi
61 set d_attribut
62 eval $setvar
63 $rm -f attrib*
64