This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
metaconfig unit change for #18833.
[metaconfig.git] / U / modified / d_attribut.U
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
46 echo " "
47 echo "Checking whether your compiler can handle __attribute__ ..." >&4
48 $cat >attrib.c <<'EOCP'
49 #include <stdio.h>
50 void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn));
51 EOCP
52 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
53         if $contains 'warning' attrib.out >/dev/null 2>&1; then
54                 echo "Your C compiler doesn't fully support __attribute__."
55                 val="$undef"
56         else
57                 echo "Your C compiler supports __attribute__."
58                 val="$define"
59         fi
60 else
61         echo "Your C compiler doesn't seem to understand __attribute__ at all."
62         val="$undef"
63 fi
64 set d_attribut
65 eval $setvar
66 $rm -f attrib*
67