1 ?X: These units are based on the ones supplied with dist-3.0
2 ?X: patchlevel 22. They have been changed or enhanced to work with
3 ?X: perl5alpha. I would appreciate hearing about any changes,
4 ?X: corrections, or enhancements.
5 ?X: Andy Dougherty doughera@lafcol.lafayette.edu
8 ?X: Easton, PA 18042-1782
9 ?X: Sat Apr 2 15:45:17 EST 1994
10 ?RCS: $Id: Oldconfig.U,v 3.0.1.2 1994/01/24 14:05:02 ram Exp $
12 ?RCS: Copyright (c) 1991-1993, Raphael Manfredi
14 ?RCS: You may redistribute only under the terms of the Artistic Licence,
15 ?RCS: as specified in the README file that comes with the distribution.
16 ?RCS: You may reuse parts of this distribution only within the terms of
17 ?RCS: that same Artistic Licence; a copy of which may be found at the root
18 ?RCS: of the source tree for dist 3.0.
20 ?RCS: $Log: Oldconfig.U,v $
21 ?RCS: Revision 3.0.1.2 1994/01/24 14:05:02 ram
22 ?RCS: patch16: added post-processing on myuname for Xenix targets
23 ?RCS: patch16: message proposing config.sh defaults made consistent
25 ?RCS: Revision 3.0.1.1 1993/09/13 15:56:32 ram
26 ?RCS: patch10: force use of config.sh when -d option is used (WAD)
27 ?RCS: patch10: complain about non-existent hint files (WAD)
28 ?RCS: patch10: added Options dependency for fastread variable
30 ?RCS: Revision 3.0 1993/08/18 12:05:12 ram
31 ?RCS: Baseline for dist 3.0 netwide release.
34 ?X: This unit tries to remember what we did last time we ran Configure, mostly
35 ?X: for the sake of setting defaults.
37 ?MAKE:Oldconfig hint myuname: Instruct Myread uname sed test cat rm n c \
39 ?MAKE: -pick wipe $@ %<
41 ?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix,
42 ?S: pseudo variables assignments in the output are stripped, thank you. The
43 ?S: whole thing is then lower-cased.
46 ?S: Gives the type of hints used for previous answers. May be one of
47 ?S: "default", "recommended" or "previous".
49 ?T:tmp file oldmyuname tans _
51 : Try to determine whether config.sh was made on this system
54 ?X: indentation wrong on purpose--RAM
55 ?X: Leave a white space between first two '(' for ksh. The sub-shell is needed
56 ?X: on some machines to avoid the error message when uname is not found; e.g.
57 ?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh!
58 myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
59 ?X: Special mention for Xenix, whose 'uname -a' gives us output like this:
62 ?X: release=2.3.2 .. etc...
63 ?X: Therefore, we strip all this variable assignment junk and remove all the
64 ?X: new lines to keep the myuname variable sane... --RAM
65 myuname=`echo $myuname | $sed -e 's/^[^=]*=//' | \
66 tr '[A-Z]' '[a-z]' | tr '\012' ' '`
68 if test "$fastread" = yes; then
70 elif test -f ../config.sh; then
71 ?X: The value from config.sh will superseed the one we've just computed
72 ?X: ... but not if we choose to ignore config.sh, so eval oldmyuname here.
74 if $contains myuname= ../config.sh >/dev/null 2>&1; then
75 eval "old`grep myuname= ../config.sh`"
77 if test "X$myuname" = "X$oldmyuname"; then
82 @if {test -d ../hints}
83 : Get old answers from old config file if Configure was run on the
84 : same system, otherwise use the hints.
87 if test -f config.sh; then
89 rp="I see a config.sh file. Shall I use it to set the defaults?"
92 n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
93 *) echo "Fetching default answers from your old config.sh file..." >&4
104 if test ! -f config.sh; then
107 First time through, eh? I have some defaults handy for the following systems:
110 cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
112 : Half the following guesses are probably wrong... If you have better
113 : tests or hints, please send them to <MAINTLOC>
114 : The metaconfig authors would also appreciate a copy...
115 $test -f /irix && dflt="$dflt sgi"
116 $test -f /xenix && dflt="$dflt sco_xenix"
117 $test -f /dynix && dflt="$dflt dynix"
118 $test -f /dnix && dflt="$dflt dnix"
119 $test -f /bin/mips && /bin/mips && dflt="$dflt mips"
120 $test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next"
121 $test -d /usr/include/minix && dflt="$dflt minix"
122 ?X: If we have uname, we already computed a suitable uname -a output, correctly
123 ?X: formatted for Xenix, and it lies in $myuname.
124 if $test -f $uname; then
128 $test -f $5.sh && dflt="$dflt $5"
131 fps*) dflt="$dflt fps";;
134 umips) dflt="$dflt umips";;
135 *) dflt="$dflt mips";;
137 [23]100) dflt="$dflt mips";;
138 next*) dflt="$dflt next" ;;
139 news*) dflt="$dflt news" ;;
140 i386*) if $test -f /etc/kconfig; then
141 if $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
142 dflt="$dflt isc_3_2_3"
143 elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
144 dflt="$dflt isc_3_2_2"
146 : i386.sh hint is wrong for Interactive.
147 dflt=`echo $dflt | $sed 's/i386//'`
153 aix) dflt="$dflt aix_rs" ;;
154 sun[Oo][Ss]) case "$3" in
155 [34]*) vers=`echo $3 | $sed 's/\./_/g'`
156 dflt="$dflt sunos_$vers" ;;
157 5*) vers=`echo $3 | $sed 's/^5/2/g'`
158 dflt="$dflt solaris_$vers" ;;
161 [sS]olaris) case "$3" in
162 5*) vers=`echo $3 | $sed 's/^5/2/g'`
163 dflt="$dflt solaris_$vers" ;;
166 dnix) dflt="$dflt dnix" ;;
167 dgux) dflt="$dflt dgux" ;;
168 genix) dflt="$dflt genix" ;;
169 hp*ux) dflt="$dflt hpux" ;;
170 next) dflt="$dflt next" ;;
171 irix) dflt="$dflt sgi" ;;
173 3*) dflt="$dflt ultrix_3" ;;
174 4*) dflt="$dflt ultrix_4" ;;
177 uts) dflt="$dflt uts" ;;
180 *) if test -f /etc/systemid; then
181 set `echo $3 | $sed 's/\./ /g'` $4
182 if $test -f sco_$1_$2_$3.sh; then
183 dflt="$dflt sco_$1_$2_$3"
184 elif $test -f sco_$1_$2.sh; then
185 dflt="$dflt sco_$1_$2"
186 elif $test -f sco_$1.sh; then
195 ?X: Try to identify sony's NEWS-OS (BSD unix)
196 if test -f /vmunix -a -f news_os.sh; then
197 (what /vmunix | tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
198 if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
201 $rm -f ../UU/kernel.what
204 set X `echo $dflt | tr ' ' '\012' | sort | uniq`
208 if $test -f "$file.sh"; then
220 You may give one or more space-separated answers, or "none" if appropriate.
221 If your OS version has no hints, DO NOT give a wrong version -- say "none".
224 rp="Which of these apply, if any?"
227 if $test -f $file.sh; then
229 $cat $file.sh >> ../UU/config.sh
230 elif $test X$ans = X -o X$ans = Xnone ; then
233 echo "$file.sh does not exist -- ignored"
241 : Get old answers, if there is a config file out there
243 if test -f ../config.sh; then
245 rp="I see a config.sh file. Shall I use it to set the defaults?"
248 n*|N*) echo "OK, I'll ignore it.";;
249 *) echo "Fetching default answers from your old config.sh file..." >&4
261 ?X: remember, indentation is wrong--RAM
265 echo "Fetching default answers from $config_sh..." >&4
269 ?X: preserve symbolic links, if any
270 cp $config_sh config.sh 2>/dev/null
280 : Restore computed paths
281 for file in $loclist $trylist; do
282 eval $file="\$_$file"