This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the files from dist/meta to perl's repo
[metaconfig.git] / dist / U / d_vfork.U
1 ?RCS: $Id: d_vfork.U 1 2006-08-24 12:32:52Z rmanfredi $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1997, 2004-2006, 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 4.0.
10 ?RCS:
11 ?RCS: $Log: d_vfork.U,v $
12 ?RCS: Revision 3.0.1.6  1994/08/29  16:18:21  ram
13 ?RCS: patch32: set default to 'y' the first time
14 ?RCS:
15 ?RCS: Revision 3.0.1.5  1994/06/20  06:59:14  ram
16 ?RCS: patch30: usevfork was not always properly set
17 ?RCS:
18 ?RCS: Revision 3.0.1.4  1994/05/13  15:20:56  ram
19 ?RCS: patch27: modified to avoid spurious Whoa warnings (ADO)
20 ?RCS:
21 ?RCS: Revision 3.0.1.3  1994/05/06  14:59:09  ram
22 ?RCS: patch23: now explicitly ask whether vfork() should be used (ADO)
23 ?RCS:
24 ?RCS: Revision 3.0.1.2  1993/10/16  13:49:39  ram
25 ?RCS: patch12: added magic for vfork()
26 ?RCS:
27 ?RCS: Revision 3.0.1.1  1993/09/13  16:06:57  ram
28 ?RCS: patch10: removed automatic remapping of vfork on fork (WAD)
29 ?RCS: patch10: added compatibility code for older config.sh (WAD)
30 ?RCS:
31 ?RCS: Revision 3.0  1993/08/18  12:07:55  ram
32 ?RCS: Baseline for dist 3.0 netwide release.
33 ?RCS:
34 ?MAKE:d_vfork usevfork: Inlibc Myread Oldconfig Setvar
35 ?MAKE:  -pick add $@ %<
36 ?S:d_vfork:
37 ?S:     This variable conditionally defines the HAS_VFORK symbol, which
38 ?S:     indicates the vfork() routine is available.
39 ?S:.
40 ?S:usevfork:
41 ?S:     This variable is set to true when the user accepts to use vfork.
42 ?S:     It is set to false when no vfork is available or when the user
43 ?S:     explicitly requests not to use vfork.
44 ?S:.
45 ?C:HAS_VFORK (VFORK):
46 ?C:     This symbol, if defined, indicates that vfork() exists.
47 ?C:.
48 ?H:#$d_vfork HAS_VFORK  /**/
49 ?H:.
50 ?M:vfork: HAS_VFORK
51 ?M:#ifndef HAS_VFORK
52 ?M:#define vfork fork
53 ?M:#endif
54 ?M:.
55 ?LINT:set d_vfork
56 : see if there is a vfork
57 val=''
58 set vfork val
59 eval $inlibc
60
61 : Ok, but do we want to use it. vfork is reportedly unreliable in 
62 : perl on Solaris 2.x, and probably elsewhere.
63 case "$val" in
64 $define)
65         echo " "
66         case "$usevfork" in
67         false) dflt='n';;
68         *) dflt='y';;
69         esac
70         rp="Some systems have problems with vfork().  Do you want to use it?"
71         . ./myread
72         case "$ans" in
73         y|Y) ;;
74         *)
75                 echo "Ok, we won't use vfork()."
76                 val="$undef"
77                 ;;
78         esac
79         ;;
80 esac
81 ?X:
82 ?X: Only set it when final value is known to avoid spurious Whoas
83 ?X: Then set usevfork accordingly to the current value, for next run
84 ?X:
85 set d_vfork
86 eval $setvar
87 case "$d_vfork" in
88 $define) usevfork='true';;
89 *) usevfork='false';;
90 esac
91