This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix .gitignore: only ignore 'perl' in root of repo, not U/perl subdir
[metaconfig.git] / U / perl / usefaststdio.U
1 ?RCS: $Id$
2 ?RCS:
3 ?RCS: Copyright (c) 2003 Jarkko Hietaniemi
4 ?RCS:
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
7 ?RCS:
8 ?MAKE:usefaststdio: Myread Oldconfig Setvar rsrc
9 ?MAKE:  -pick add $@ %<
10 ?Y:TOP
11 ?S:usefaststdio:
12 ?S:     This variable conditionally defines the USE_FAST_STDIO symbol,
13 ?S:     and indicates that Perl should be built to use 'fast stdio'.
14 ?S:     Defaults to define in Perls 5.8 and earlier, to undef later.
15 ?S:.
16 ?C:USE_FAST_STDIO:
17 ?C:     This symbol, if defined, indicates that Perl should
18 ?C:     be built to use 'fast stdio'.
19 ?C:     Defaults to define in Perls 5.8 and earlier, to undef later.
20 ?C:.
21 ?H:?%<:#ifndef USE_FAST_STDIO
22 ?H:?%<:#$usefaststdio   USE_FAST_STDIO          /**/
23 ?H:?%<:#endif
24 ?H:.
25 ?T:xversion
26 ?LINT:set usefaststdio
27 : Check if faststdio is requested and available
28 case "$usefaststdio" in
29 $define|true|[yY]*|'')
30         xversion=`awk '/define[         ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
31         case "$xversion" in
32         [68])   dflt='y' ;;
33         *)      dflt='n' ;;
34         esac
35         ;;
36 *) dflt='n';;
37 esac
38 cat <<EOM
39
40 Perl can be built to use 'fast stdio', which means using the stdio
41 library but also directly manipulating the stdio buffers to enable
42 faster I/O.  Using stdio is better for backward compatibility (especially
43 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
44 interface has been preferred instead of stdio.
45
46 If this doesn't make any sense to you, just accept the default '$dflt'.
47 EOM
48 rp='Use the "fast stdio" if available?'
49 . ./myread
50 case "$ans" in
51 y|Y)    val="$define" ;;
52 *)      val="$undef" ;;
53 esac
54 set usefaststdio
55 eval $setvar
56
57