This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RE: [perl #26136] localtime(3) calls tzset(3), but localtime_r(3) may not.
[metaconfig.git] / U / modified / spitshell.U
1 ?RCS: $Id: spitshell.U,v 3.0.1.4 1997/02/28 16:22:12 ram Exp $
2 ?RCS:
3 ?RCS: Copyright (c) 1991-1993, 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 3.0.
10 ?RCS:
11 ?RCS: $Log: spitshell.U,v $
12 ?RCS: Revision 3.0.1.4  1997/02/28  16:22:12  ram
13 ?RCS: patch61: removed useless chatter as this is now done very early
14 ?RCS:
15 ?RCS: Revision 3.0.1.3  1995/01/11  15:37:01  ram
16 ?RCS: patch45: use 'test -f' instead of 'test -r' for exec-only cat progs (WED)
17 ?RCS: patch45: protected "sh -c" within backquotes for Linux and SGI
18 ?RCS:
19 ?RCS: Revision 3.0.1.2  1994/08/29  16:33:00  ram
20 ?RCS: patch32: don't create spitshell under the UU directory
21 ?RCS: patch32: allow for cat in /bin or /usr/bin
22 ?RCS:
23 ?RCS: Revision 3.0.1.1  1993/09/13  16:12:58  ram
24 ?RCS: patch10: made #!-failure message more friendly (WAD)
25 ?RCS:
26 ?RCS: Revision 3.0  1993/08/18  12:09:49  ram
27 ?RCS: Baseline for dist 3.0 netwide release.
28 ?RCS:
29 ?MAKE:spitshell shsharp sharpbang: eunicefix sh Head
30 ?MAKE:  -pick add $@ %<
31 ?S:spitshell:
32 ?S:     This variable contains the command necessary to spit out a runnable
33 ?S:     shell on this system.  It is either cat or a grep -v for # comments.
34 ?S:.
35 ?S:shsharp:
36 ?S:     This variable tells further Configure units whether your sh can
37 ?S:     handle # comments.
38 ?S:.
39 ?S:sharpbang:
40 ?S:     This variable contains the string #! if this system supports that
41 ?S:     construct.
42 ?S:.
43 ?T:xcat p
44 ?X: paths comes from Head
45 ?LINT:extern paths _exe
46 : see if sh knows # comments
47 ?X: This is loaded up early, so avoid being chatty.
48 ?X: echo " "
49 ?X: echo "Checking your $sh to see if it knows about # comments..." >&2
50 if `$sh -c '#' >/dev/null 2>&1`; then
51 ?X:     echo "Your $sh handles # comments correctly."
52         shsharp=true
53         spitshell=cat
54 ?X:     echo " "
55 ?X:     echo "Okay, let's see if #! works on this system..."
56         xcat=/bin/cat
57         test -f $xcat$_exe || xcat=/usr/bin/cat
58         if test ! -f $xcat$_exe; then
59                 for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
60                         if test -f $p/cat$_exe; then
61                                 xcat=$p/cat
62                                 break
63                         fi
64                 done
65                 if test ! -f $xcat$_exe; then
66                         echo "Can't find cat anywhere!"
67                         exit 1
68                 fi
69         fi
70         echo "#!$xcat" >sharp
71         $eunicefix sharp
72         chmod +x sharp
73         ./sharp > today
74         if test -s today; then
75 ?X:             echo "It does."
76                 sharpbang='#!'
77         else
78                 echo "#! $xcat" > sharp
79                 $eunicefix sharp
80                 chmod +x sharp
81                 ./sharp > today
82                 if test -s today; then
83 ?X:                     echo "It does."
84                         sharpbang='#! '
85                 else
86 ?X:                     echo "Okay, let's see if #! works on this system..."
87 ?X:                     echo "It's just a comment."
88                         sharpbang=': use '
89                 fi
90         fi
91 else
92         echo " "
93         echo "Your $sh doesn't grok # comments--I will strip them later on."
94         shsharp=false
95 ?X: The spitshell script will be perused, so leave it out the UU directory
96         cd ..
97         echo "exec grep -v '^[  ]*#'" >spitshell
98         chmod +x spitshell
99         $eunicefix spitshell
100         spitshell=`pwd`/spitshell
101         cd UU
102         echo "I presume that if # doesn't work, #! won't work either!"
103         sharpbang=': use '
104 fi
105 rm -f sharp today
106