This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
753a56ebf6b5c64a4bf0dbd9f52beb1e31aac109
[metaconfig.git] / U / perl / d_isblank.U
1 ?RCS: Copyright (c) 2012-2012, H.Merijn Brand
2 ?RCS: 
3 ?RCS: You may redistribute only under the terms of the Artistic Licence,
4 ?RCS: as specified in the README file that comes with the distribution.
5 ?RCS: You may reuse parts of this distribution only within the terms of
6 ?RCS: that same Artistic Licence; a copy of which may be found at the root
7 ?RCS: of the source tree for dist 4.0.
8 ?RCS:
9 ?RCS: Original Author: H.Merijn Brand
10 ?RCS:
11 ?MAKE:d_isblank: cc cat ccflags ldflags rm libs Setvar
12 ?MAKE:  -pick add $@ %<
13 ?S:d_isblank:
14 ?S:     This variable conditionally defines the HAS_ISBLANK constant,
15 ?S:     which indicates to the C program that isblank() is available.
16 ?S:.
17 ?C:HAS_ISBLANK:
18 ?C:     This manifest constant lets the C program know that isblank 
19 ?C:     is available.
20 ?C:.
21 ?H:#$d_isblank HAS_ISBLANK              /**/
22 ?H:.
23 ?LINT:set d_isblank
24 ?X: Can't use Inlibc because isblank() might be a macro.
25 : Look for isblank
26 echo " "
27 $cat >isblank.c <<'EOCP'
28 #include <stdio.h>
29 #include <ctype.h>
30 int main() {
31         int c = ' ';
32         if (isblank(c))
33                 exit(0);
34         else
35                 exit(1);
36 }
37 EOCP
38 if $cc $ccflags $ldflags -o isblank isblank.c $libs >/dev/null 2>&1 ; then
39         echo "isblank() found." >&4
40         val="$define"
41 else
42         echo "isblank() NOT found." >&4
43         val="$undef"
44 fi
45 set d_isblank
46 eval $setvar
47 $rm -f isblank*
48