?RCS: $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
?RCS:
?RCS: Copyright (c) 1991-1993, Raphael Manfredi
-?RCS:
+?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: Revision 3.0 1993/08/18 12:04:58 ram
?RCS: Baseline for dist 3.0 netwide release.
?RCS:
-?X:
+?X:
?X: This is the very first unit in the Configure script. It is mostly just
?X: things to keep people from getting into a tizzy right off the bat.
-?X:
+?X:
?MAKE:Head:
?MAKE: -pick wipe $@ %<
?V:PATH p_ me
?T:argv Id p paths OS2_SHELL DJGPP
?T:inksh needksh avoidksh newsh changesh reason
-?LINT:extern ENV CDPATH SHELL
-?LINT:change ENV CDPATH
+?LINT:extern ENV CDPATH SHELL MACHTYPE _exe is_os2
+?LINT:change ENV CDPATH is_os2
#! /bin/sh
#
# If these # comments don't work, trim them. Don't worry about any other
# comp.sources.misc and is available on CPAN under authors/id/RAM so
# you may fetch it yourself from your nearest archive site.)
#
+?X: OK, I'll not alter, but I'll add to it then ...
+#
+# Though this script was generated by metaconfig, it is OK to send
+# patches against it. It's up to the Configure pumpkin to backport
+# the patch to the metaunits if it is accepted.
+# See Porting/pumpkin.pod for more information on metaconfig.
+#
?X:
?X: NOTA BENE:
?X: If you develop you own version of metaconfig based on this work,
# Generated on <DATE> [metaconfig <VERSION> PL<PATCHLEVEL>]
# (with additional metaconfig patches by <MAINTLOC>)
-cat >/tmp/c1$$ <<EOF
+cat >c1$$ <<EOF
ARGGGHHHH!!!!!
SCO csh still thinks true is false. Write to SCO today and tell them that next
[End of diatribe. We now return you to your regularly scheduled programming...]
EOF
-cat >/tmp/c2$$ <<EOF
+cat >c2$$ <<EOF
OOPS! You naughty creature! You didn't run Configure with sh!
I will attempt to remedy the situation by running sh for you...
EOF
-true || cat /tmp/c1$$ /tmp/c2$$
+true || cat c1$$ c2$$
true || exec sh $0 $argv:q
-(exit $?0) || cat /tmp/c2$$
+(exit $?0) || cat c2$$
(exit $?0) || exec sh $0 $argv:q
-rm -f /tmp/c1$$ /tmp/c2$$
+rm -f c1$$ c2$$
+
+if test -f /dev/cputype -a -f /dev/drivers -a -f /dev/osversion; then
+ cat >&4 <<EOF
+***
+*** I'm sorry but this system looks like Plan 9 and Plan 9 doesn't do
+*** Configure that well. (Plan 9 is close to UNIX but not close enough.)
+*** Please read the README.plan9 for further instructions.
+*** Cannot continue, aborting.
+***
+EOF
+ exit 1
+fi
+
+if test ! -c /dev/null ; then
+ cat >&4 <<EOF
+***
+*** I'm sorry, but /dev/null appears to be a file rather than a device.
+*** Please consult your operating sytem's notes for making a device
+*** in /dev.
+*** Cannot continue, aborting.
+***
+EOF
+ exit 1
+fi
: compute my invocation name
me=$0
: Proper separator for the PATH environment variable
p_=:
: On OS/2 this directory should exist if this is not floppy only system :-]
-if test -d c:/. ; then
+if test -d c:/. || ( uname -a | grep -i 'os\(/\|\)2' ) 2>&1 >/dev/null ; then
if test -n "$OS2_SHELL"; then
p_=\;
PATH=`cmd /c "echo %PATH%" | tr '\\\\' / `
?X: That's a bug in ksh5.22
OS2_SHELL=`cmd /c "echo %OS2_SHELL%" | tr '\\\\' / | tr '[A-Z]' '[a-z]'`
+ is_os2=yes
elif test -n "$DJGPP"; then
- p_=\;
+ case "X${MACHTYPE:-nonesuchmach}" in
+ *cygwin) ;;
+ *) p_=\; ;;
+ esac
fi
fi
?X: We only add directories that are not already in the PATH of the
?X: user and the directories must exist also.
?X:
+?X: 20040627, Merijn, HP-UX's ANSI compiler is in /opt/ansic/bin if present
+?X: and should be before /usr/ccs/bin, where the braindead bundled compiler
+?X: can be found. The .usr/ccs/bin compiler cannot be used to build perl.
+?X:
: Proper PATH setting
paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /usr/ccs/bin"
+paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
paths="$paths /sbin /usr/sbin /usr/libexec"
+paths="$paths /system/gnu_library/bin"
for p in $paths
do
esac
case "$changesh" in
true)
+ export newsh
echo "(Feeding myself to $newsh $reason.)"
?X: Make sure they didn't say sh <Configure by checking whether $0 ends
?X: with Configure or not. If they did say sh <../../Configure, then too
esac
;;
esac
+?X: 2004.06.09 rac
+?X: having $newsh persist as ksh here is bad news if ksh doesn't really
+?X: exist. this causes us to toss away a perfectly good working test in
+?X: bash in favour of more exotic external options. see bug 42665.
+test -x "${newsh}" || unset newsh
?X: Unset CDPATH to avoid surprises when using cd under some shells
?X: Can't unset it because that's not portable to very old shells.