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