summaryrefslogtreecommitdiff
path: root/U/Oldconfig.U
diff options
context:
space:
mode:
Diffstat (limited to 'U/Oldconfig.U')
-rw-r--r--U/Oldconfig.U284
1 files changed, 284 insertions, 0 deletions
diff --git a/U/Oldconfig.U b/U/Oldconfig.U
new file mode 100644
index 0000000000..18c2a811b0
--- /dev/null
+++ b/U/Oldconfig.U
@@ -0,0 +1,284 @@
+?X: These units are based on the ones supplied with dist-3.0
+?X: patchlevel 22. They have been changed or enhanced to work with
+?X: perl5alpha. I would appreciate hearing about any changes,
+?X: corrections, or enhancements.
+?X: Andy Dougherty doughera@lafcol.lafayette.edu
+?X: Dept. of Physics
+?X: Lafayette College
+?X: Easton, PA 18042-1782
+?X: Sat Apr 2 15:45:17 EST 1994
+?RCS: $Id: Oldconfig.U,v 3.0.1.2 1994/01/24 14:05:02 ram Exp $
+?RCS:
+?RCS: Copyright (c) 1991-1993, Raphael Manfredi
+?RCS:
+?RCS: You may redistribute only under the terms of the Artistic Licence,
+?RCS: as specified in the README file that comes with the distribution.
+?RCS: You may reuse parts of this distribution only within the terms of
+?RCS: that same Artistic Licence; a copy of which may be found at the root
+?RCS: of the source tree for dist 3.0.
+?RCS:
+?RCS: $Log: Oldconfig.U,v $
+?RCS: Revision 3.0.1.2 1994/01/24 14:05:02 ram
+?RCS: patch16: added post-processing on myuname for Xenix targets
+?RCS: patch16: message proposing config.sh defaults made consistent
+?RCS:
+?RCS: Revision 3.0.1.1 1993/09/13 15:56:32 ram
+?RCS: patch10: force use of config.sh when -d option is used (WAD)
+?RCS: patch10: complain about non-existent hint files (WAD)
+?RCS: patch10: added Options dependency for fastread variable
+?RCS:
+?RCS: Revision 3.0 1993/08/18 12:05:12 ram
+?RCS: Baseline for dist 3.0 netwide release.
+?RCS:
+?X:
+?X: This unit tries to remember what we did last time we ran Configure, mostly
+?X: for the sake of setting defaults.
+?X:
+?MAKE:Oldconfig hint myuname: Instruct Myread uname sed test cat rm n c \
+ contains Loc Options
+?MAKE: -pick wipe $@ %<
+?S:myuname:
+?S: The output of 'uname -a' if available, otherwise the hostname. On Xenix,
+?S: pseudo variables assignments in the output are stripped, thank you. The
+?S: whole thing is then lower-cased.
+?S:.
+?S:hint:
+?S: Gives the type of hints used for previous answers. May be one of
+?S: "default", "recommended" or "previous".
+?S:.
+?T:tmp file oldmyuname tans _
+?LINT:change n c
+: Try to determine whether config.sh was made on this system
+case "$config_sh" in
+'')
+?X: indentation wrong on purpose--RAM
+?X: Leave a white space between first two '(' for ksh. The sub-shell is needed
+?X: on some machines to avoid the error message when uname is not found; e.g.
+?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh!
+myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
+?X: Special mention for Xenix, whose 'uname -a' gives us output like this:
+?X: sysname=XENIX
+?X: nodename=whatever
+?X: release=2.3.2 .. etc...
+?X: Therefore, we strip all this variable assignment junk and remove all the
+?X: new lines to keep the myuname variable sane... --RAM
+myuname=`echo $myuname | $sed -e 's/^[^=]*=//' | \
+ tr '[A-Z]' '[a-z]' | tr '\012' ' '`
+dflt=n
+if test "$fastread" = yes; then
+ dflt=y
+elif test -f ../config.sh; then
+?X: The value from config.sh will superseed the one we've just computed
+?X: ... but not if we choose to ignore config.sh, so eval oldmyuname here.
+ oldmyuname=''
+ if $contains myuname= ../config.sh >/dev/null 2>&1; then
+ eval "old`grep myuname= ../config.sh`"
+ fi
+ if test "X$myuname" = "X$oldmyuname"; then
+ dflt=y
+ fi
+fi
+
+@if {test -d ../hints}
+: Get old answers from old config file if Configure was run on the
+: same system, otherwise use the hints.
+hint=default
+cd ..
+if test -f config.sh; then
+ echo " "
+ rp="I see a config.sh file. Shall I use it to set the defaults?"
+ . UU/myread
+ case "$ans" in
+ n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
+ *) echo "Fetching default answers from your old config.sh file..." >&4
+ tmp="$n"
+ tans="$c"
+ . ./config.sh
+ cp config.sh UU
+ n="$tmp"
+ c="$tans"
+ hint=previous
+ ;;
+ esac
+fi
+if test ! -f config.sh; then
+ $cat <<EOM
+
+First time through, eh? I have some defaults handy for the following systems:
+
+EOM
+ cd hints; ls -C *.sh | $sed 's/\.sh/ /g' >&4
+ dflt=''
+ : Half the following guesses are probably wrong... If you have better
+ : tests or hints, please send them to <MAINTLOC>
+ : The metaconfig authors would also appreciate a copy...
+ $test -f /irix && dflt="$dflt sgi"
+ $test -f /xenix && dflt="$dflt sco_xenix"
+ $test -f /dynix && dflt="$dflt dynix"
+ $test -f /dnix && dflt="$dflt dnix"
+ $test -f /bin/mips && /bin/mips && dflt="$dflt mips"
+ $test -d /NextApps && test -f /usr/adm/software_version && dflt="$dflt next"
+ $test -d /usr/include/minix && dflt="$dflt minix"
+?X: If we have uname, we already computed a suitable uname -a output, correctly
+?X: formatted for Xenix, and it lies in $myuname.
+ if $test -f $uname; then
+ set X $myuname
+ shift
+
+ $test -f $5.sh && dflt="$dflt $5"
+
+ case "$5" in
+ fps*) dflt="$dflt fps";;
+ mips*)
+ case "$4" in
+ umips) dflt="$dflt umips";;
+ *) dflt="$dflt mips";;
+ esac;;
+ [23]100) dflt="$dflt mips";;
+ next*) dflt="$dflt next" ;;
+ news*) dflt="$dflt news" ;;
+ i386*) if $test -f /etc/kconfig; then
+ if $contains _SYSV3 /usr/include/stdio.h > /dev/null 2>&1 ; then
+ dflt="$dflt isc_3_2_3"
+ elif $contains _POSIX_SOURCE /usr/include/stdio.h > /dev/null 2>&1 ; then
+ dflt="$dflt isc_3_2_2"
+ fi
+ : i386.sh hint is wrong for Interactive.
+ dflt=`echo $dflt | $sed 's/i386//'`
+ fi
+ ;;
+ esac
+
+ case "$1" in
+ aix) dflt="$dflt aix_rs" ;;
+ sun[Oo][Ss]) case "$3" in
+ [34]*) vers=`echo $3 | $sed 's/\./_/g'`
+ dflt="$dflt sunos_$vers" ;;
+ 5*) vers=`echo $3 | $sed 's/^5/2/g'`
+ dflt="$dflt solaris_$vers" ;;
+ esac
+ ;;
+ [sS]olaris) case "$3" in
+ 5*) vers=`echo $3 | $sed 's/^5/2/g'`
+ dflt="$dflt solaris_$vers" ;;
+ esac
+ ;;
+ dnix) dflt="$dflt dnix" ;;
+ dgux) dflt="$dflt dgux" ;;
+ genix) dflt="$dflt genix" ;;
+ hp*ux) dflt="$dflt hpux" ;;
+ next) dflt="$dflt next" ;;
+ irix) dflt="$dflt sgi" ;;
+ ultrix) case "$3" in
+ 3*) dflt="$dflt ultrix_3" ;;
+ 4*) dflt="$dflt ultrix_4" ;;
+ esac
+ ;;
+ uts) dflt="$dflt uts" ;;
+ $2) case "$dflt" in
+ *isc*) ;;
+ *) if test -f /etc/systemid; then
+ set `echo $3 | $sed 's/\./ /g'` $4
+ if $test -f sco_$1_$2_$3.sh; then
+ dflt="$dflt sco_$1_$2_$3"
+ elif $test -f sco_$1_$2.sh; then
+ dflt="$dflt sco_$1_$2"
+ elif $test -f sco_$1.sh; then
+ dflt="$dflt sco_$1"
+ fi
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ else
+?X: Try to identify sony's NEWS-OS (BSD unix)
+ if test -f /vmunix -a -f news_os.sh; then
+ (what /vmunix | tr '[A-Z]' '[a-z]') > ../UU/kernel.what 2>&1
+ if $contains news-os ../UU/kernel.what >/dev/null 2>&1; then
+ dflt="$dflt news_os"
+ fi
+ $rm -f ../UU/kernel.what
+ fi
+ fi
+ set X `echo $dflt | tr ' ' '\012' | sort | uniq`
+ shift
+ dflt=''
+ for file in $*; do
+ if $test -f "$file.sh"; then
+ dflt="$dflt $file"
+ fi
+ done
+ set X $dflt
+ shift
+ dflt=${1+"$@"}
+ case "$dflt" in
+ '') dflt=none;;
+ esac
+ $cat <<EOM
+
+You may give one or more space-separated answers, or "none" if appropriate.
+If your OS version has no hints, DO NOT give a wrong version -- say "none".
+
+EOM
+ rp="Which of these apply, if any?"
+ . ../UU/myread
+ for file in $ans; do
+ if $test -f $file.sh; then
+ . ./$file.sh
+ $cat $file.sh >> ../UU/config.sh
+ elif $test X$ans = X -o X$ans = Xnone ; then
+ : nothing
+ else
+ echo "$file.sh does not exist -- ignored"
+ fi
+ done
+ hint=recommended
+ cd ..
+fi
+cd UU
+@else
+: Get old answers, if there is a config file out there
+hint=default
+if test -f ../config.sh; then
+ echo " "
+ rp="I see a config.sh file. Shall I use it to set the defaults?"
+ . ./myread
+ case "$ans" in
+ n*|N*) echo "OK, I'll ignore it.";;
+ *) echo "Fetching default answers from your old config.sh file..." >&4
+ tmp="$n"
+ tans="$c"
+ . ../config.sh
+ cp ../config.sh .
+ n="$tmp"
+ c="$tans"
+ hint=previous
+ ;;
+ esac
+fi
+@end
+?X: remember, indentation is wrong--RAM
+;;
+*)
+ echo " "
+ echo "Fetching default answers from $config_sh..." >&4
+ tmp="$n"
+ tans="$c"
+ cd ..
+?X: preserve symbolic links, if any
+ cp $config_sh config.sh 2>/dev/null
+ . ./config.sh
+ cd UU
+ cp ../config.sh .
+ n="$tmp"
+ c="$tans"
+ hint=previous
+ ;;
+esac
+
+: Restore computed paths
+for file in $loclist $trylist; do
+ eval $file="\$_$file"
+done
+