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
CommitLineData
cc7fe62b
JH
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'.
d6c9cdb3 14?S: Defaults to define in Perls 5.8 and earlier, to undef later.
cc7fe62b
JH
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'.
d6c9cdb3 19?C: Defaults to define in Perls 5.8 and earlier, to undef later.
cc7fe62b
JH
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
2f125bce 27: Check if faststdio is requested and available
cc7fe62b
JH
28case "$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';;
37esac
38cat <<EOM
39
40Perl can be built to use 'fast stdio', which means using the stdio
41library but also directly manipulating the stdio buffers to enable
42faster I/O. Using stdio is better for backward compatibility (especially
43for Perl extensions), but on the other hand since Perl 5.8 the 'perlio'
44interface has been preferred instead of stdio.
45
46If this doesn't make any sense to you, just accept the default '$dflt'.
47EOM
48rp='Use the "fast stdio" if available?'
49. ./myread
50case "$ans" in
2f125bce 51y|Y) val="$define" ;;
cc7fe62b
JH
52*) val="$undef" ;;
53esac
54set usefaststdio
55eval $setvar
56
57