This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Rename the PRIElfbl, PRIX64, etc, to be PRIEUfldbl, PRIXU64,
[metaconfig.git] / U / modified / Guess.U
CommitLineData
959f3c4c
JH
1?RCS: $Id: Guess.U,v 3.0.1.5 1995/07/25 13:37:14 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: Guess.U,v $
12?RCS: Revision 3.0.1.5 1995/07/25 13:37:14 ram
13?RCS: patch56: now knows about OS/2 platforms
14?RCS:
15?RCS: Revision 3.0.1.4 1994/10/29 15:53:55 ram
16?RCS: patch36: added ?F: line for metalint file checking
17?RCS: patch36: call ./xenix explicitely instead of relying on PATH
18?RCS:
19?RCS: Revision 3.0.1.3 1993/12/15 08:14:35 ram
20?RCS: patch15: variable d_bsd was not always set properly
21?RCS:
22?RCS: Revision 3.0.1.2 1993/08/30 08:57:14 ram
23?RCS: patch8: fixed comment which wrongly attributed the usrinc symbol
24?RCS: patch8: no more ugly messages when no /usr/include/ctype.h
25?RCS:
26?RCS: Revision 3.0.1.1 1993/08/27 14:37:37 ram
27?RCS: patch7: added support for OSF/1 machines
28?RCS:
29?RCS: Revision 3.0 1993/08/18 12:04:57 ram
30?RCS: Baseline for dist 3.0 netwide release.
31?RCS:
32?X:
33?X: This unit hazards some guesses as to what the general nature of the system
34?X: is. The information it collects here is used primarily to establish default
35?X: answers to other questions.
36?X:
37?MAKE:Guess d_eunice d_xenix d_bsd: cat test echo n c contains rm Loc eunicefix
38?MAKE: -pick add $@ %<
39?S:d_eunice:
40?S: This variable conditionally defines the symbols EUNICE and VAX, which
41?S: alerts the C program that it must deal with ideosyncracies of VMS.
42?S:.
43?S:d_xenix:
44?S: This variable conditionally defines the symbol XENIX, which alerts
45?S: the C program that it runs under Xenix.
46?S:.
47?S:d_bsd:
48?S: This symbol conditionally defines the symbol BSD when running on a
49?S: BSD system.
50?S:.
51?C:EUNICE:
52?C: This symbol, if defined, indicates that the program is being compiled
53?C: under the EUNICE package under VMS. The program will need to handle
54?C: things like files that don't go away the first time you unlink them,
55?C: due to version numbering. It will also need to compensate for lack
56?C: of a respectable link() command.
57?C:.
58?X: Should we define VMS here? Is Eunice actually used anymore?
59?X:?C:VMS:
60?X:?C: This symbol, if defined, indicates that the program is running under
61?X:?C: VMS. It is currently only set in conjunction with the EUNICE symbol.
62?X:?C:.
63?C:XENIX:
64?C: This symbol, if defined, indicates thet the program is running under
65?C: Xenix (at least 3.0 ?).
66?C:.
67?X: We don't use BSD in the perl source. It's too vague, and already
68?X: defined in some header files anyway (e.g. NetBSD). This just gives
69?X: us a spurious redefinition error upon compilation.
70?X: --Andy Dougherty Feb 11, 1998
71?X: ?C:BSD:
72?X: ?C: This symbol, if defined, indicates that the program is running under
73?X: ?C: a BSD system.
74?X: ?C:.
75?H:#$d_eunice EUNICE /**/
76?X:?H:#$d_eunice VMS /**/
77?H:#$d_xenix XENIX /**/
78?X: ?H:#$d_bsd BSD /**/
79?H:.
80?F:./bsd ./usg ./v7 ./osf1 ./eunice ./xenix ./venix ./os2
81?T:xxx
82: make some quick guesses about what we are up against
83echo " "
84$echo $n "Hmm... $c"
85echo exit 1 >bsd
86echo exit 1 >usg
87echo exit 1 >v7
88echo exit 1 >osf1
89echo exit 1 >eunice
90echo exit 1 >xenix
91echo exit 1 >venix
92echo exit 1 >os2
93d_bsd="$undef"
94?X:
95?X: Do not use 'usrinc', or we get a circular dependency. because
96?X: usrinc is defined in usrinc.U, which relies on us...
97?X:
98$cat /usr/include/signal.h /usr/include/sys/signal.h >foo 2>/dev/null
99if test -f /osf_boot || $contains 'OSF/1' /usr/include/ctype.h >/dev/null 2>&1
100then
101 echo "Looks kind of like an OSF/1 system, but we'll see..."
102 echo exit 0 >osf1
103elif test `echo abc | tr a-z A-Z` = Abc ; then
104 xxx=`./loc addbib blurfl $pth`
105 if $test -f $xxx; then
106 echo "Looks kind of like a USG system with BSD features, but we'll see..."
107 echo exit 0 >bsd
108 echo exit 0 >usg
109 else
110 if $contains SIGTSTP foo >/dev/null 2>&1 ; then
111 echo "Looks kind of like an extended USG system, but we'll see..."
112 else
113 echo "Looks kind of like a USG system, but we'll see..."
114 fi
115 echo exit 0 >usg
116 fi
117elif $contains SIGTSTP foo >/dev/null 2>&1 ; then
118 echo "Looks kind of like a BSD system, but we'll see..."
119 d_bsd="$define"
120 echo exit 0 >bsd
121else
122 echo "Looks kind of like a Version 7 system, but we'll see..."
123 echo exit 0 >v7
124fi
125case "$eunicefix" in
126*unixtovms*)
127 $cat <<'EOI'
128There is, however, a strange, musty smell in the air that reminds me of
129something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
130EOI
131 echo exit 0 >eunice
132 d_eunice="$define"
133: it so happens the Eunice I know will not run shell scripts in Unix format
134 ;;
135*)
136 echo " "
137 echo "Congratulations. You aren't running Eunice."
138 d_eunice="$undef"
139 ;;
140esac
141: Detect OS2. The p_ variable is set above in the Head.U unit.
142case "$p_" in
143:) ;;
144*)
145 $cat <<'EOI'
146I have the feeling something is not exactly right, however...don't tell me...
147lemme think...does HAL ring a bell?...no, of course, you're only running OS/2!
148EOI
149 echo exit 0 >os2
150 ;;
151esac
152if test -f /xenix; then
153 echo "Actually, this looks more like a XENIX system..."
154 echo exit 0 >xenix
155 d_xenix="$define"
156else
157 echo " "
158 echo "It's not Xenix..."
159 d_xenix="$undef"
160fi
161chmod +x xenix
162$eunicefix xenix
163if test -f /venix; then
164 echo "Actually, this looks more like a VENIX system..."
165 echo exit 0 >venix
166else
167 echo " "
168 if ./xenix; then
169 : null
170 else
171 echo "Nor is it Venix..."
172 fi
173fi
174chmod +x bsd usg v7 osf1 eunice xenix venix os2
175$eunicefix bsd usg v7 osf1 eunice xenix venix os2
176$rm -f foo
177