This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Part 2 of a big cleanup action based on the upcoming dist-4.0
[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 case "$usefaststdio" in
28 $define|true|[yY]*|'')
29         xversion=`awk '/define[         ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
30         case "$xversion" in
31         [68])   dflt='y' ;;
32         *)      dflt='n' ;;
33         esac
34         ;;
35 *) dflt='n';;
36 esac
37 cat <<EOM
38
39 Perl can be built to use 'fast stdio', which means using the stdio
40 library but also directly manipulating the stdio buffers to enable
41 faster I/O.  Using stdio is better for backward compatibility (especially
42 for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
43 interface has been preferred instead of stdio.
44
45 If this doesn't make any sense to you, just accept the default '$dflt'.
46 EOM
47 rp='Use the "fast stdio" if available?'
48 . ./myread
49 case "$ans" in
50 y|Y)    val="$define" ;;     
51 *)      val="$undef" ;;
52 esac
53 set usefaststdio
54 eval $setvar
55
56