?RCS: $Id: Head.U 167 2013-05-08 17:58:00Z rmanfredi $ ?RCS: ?RCS: Copyright (c) 1991-1997, 2004-2006, Raphael Manfredi ?RCS: ?RCS: You may redistribute only under the terms of the Artistic License, ?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 License; a copy of which may be found at the root ?RCS: of the source tree for dist 4.0. ?RCS: ?RCS: $Log: Head.U,v $ ?RCS: Revision 3.0.1.9 1997/02/28 15:02:09 ram ?RCS: patch61: make sure we unset CDPATH for shells that support this ?RCS: patch61: improved Korn shell detection and handling ?RCS: ?RCS: Revision 3.0.1.8 1995/07/25 13:40:02 ram ?RCS: patch56: added SVR4-ish /opt directories to path list (ADO) ?RCS: patch56: OS/2 platforms are using another path separator ?RCS: ?RCS: Revision 3.0.1.7 1995/03/21 08:46:15 ram ?RCS: patch52: definition of paths wrongly added spurious ':' chars ?RCS: ?RCS: Revision 3.0.1.6 1994/10/29 15:54:19 ram ?RCS: patch36: make sure ENV is unset before calling /bin/ksh ?RCS: ?RCS: Revision 3.0.1.5 1994/08/29 16:03:44 ram ?RCS: patch32: now sets PATH only using existing directories ?RCS: ?RCS: Revision 3.0.1.4 1994/06/20 06:54:28 ram ?RCS: patch30: now computes its invocation name into 'me' ?RCS: patch30: symbol me is made visible to all units read-only ?RCS: ?RCS: Revision 3.0.1.3 1993/12/15 08:15:07 ram ?RCS: patch15: added /sbin:/usr/sbin:/usr/libexec in PATH for BSD/386 ?RCS: ?RCS: Revision 3.0.1.2 1993/11/10 17:32:35 ram ?RCS: patch14: ensure PATH is reset to '.' before testing for alias ?RCS: ?RCS: Revision 3.0.1.1 1993/08/27 14:38:07 ram ?RCS: patch7: not all 'test' programs support the -x option ?RCS: ?RCS: Revision 3.0 1993/08/18 12:04:58 ram ?RCS: Baseline for dist 3.0 netwide release. ?RCS: ?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: ?MAKE:Head: ?MAKE: -pick wipe $@ %< ?V:PATH p_ _exe me newsh ?T:argv Id p paths OS2_SHELL DJGPP ?T:inksh needksh avoidksh newsh changesh reason ?F:!* ?LINT:extern ENV CDPATH SHELL MACHTYPE ?LINT:change ENV CDPATH ?LINT:nocomment #! /bin/sh # # If these # comments don't work, trim them. Don't worry about any other # shell scripts, Configure will trim # comments from them for you. # # (If you are trying to port this package to a machine without sh, # I would suggest you have a look at the prototypical config_h.SH file # and edit it to reflect your system. Some packages may include samples # of config.h for certain machines, so you might look for one of those.) # ?X: ?X: NOTE THAT A CONFIGURE SCRIPT IS IN THE PUBLIC DOMAIN (whether or not ?X: the software which uses it is in the public domain). ?X: # Yes, you may rip this off to use in other distribution packages. This # script belongs to the public domain and cannot be copyrighted. # ?X: ?X: WE ASK YOU NOT TO REMOVE OR ALTER THE FOLLOWING PARAGRAPH, PLEASE: ?X: # Note: this Configure script was generated automatically. Rather than # working with this copy of Configure, you may wish to get metaconfig. # The dist package (which contains metaconfig) is available via SVN: # svn co https://svn.code.sf.net/p/dist/code/trunk/dist ?X: ?X: NOTA BENE: ?X: If you develop you own version of metaconfig based on this work, ?X: you have to add some comments telling that the script was generated ?X: by your version, not mine: It credits your work. ?X: # $Id: Head.U 167 2013-05-08 17:58:00Z rmanfredi $ # # Generated on [metaconfig -] cat >c1$$ <c2$$ </dev/null` test "$me" || me=$0 ;; esac ?X: ?X: To be able to run under OS/2, we must detect that early enough to use ?X: the proper path separator, stored in $p_. It is : on UNIX and ; on ?X: DOSish systems such as OS/2. ?X: : 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 -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]'` elif test -n "$DJGPP"; then case "X${MACHTYPE:-nonesuchmach}" in *cygwin|*msys) ;; *) p_=\; ;; esac fi fi ?X: ?X: There are two schools of thoughts here. Some people correctly argue that ?X: the user has a better chance than we do of setting a reasonable PATH and ?X: others argue that Configure is the best place there is to set up a suitable ?X: PATH. Well, here we try to compromise by keeping the user's PATH and ?X: appending some directories which are known to work on some machine or the ?X: other. The rationale behind this being that a novice user might not have a ?X: proper environment variable set, and some directories like /etc (where ?X: chown is located on some BSD systems) may be missing--RAM. ?X: ?X: SVR4 adds an /opt directory for optional packages. Some sites use ?X: various permutations on /opt as opposed to /usr or /usr/local.-- ADO ?X: ?X: We only add directories that are not already in the PATH of the ?X: user and the directories must exist also. ?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 /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 case "$p_$PATH$p_" in *$p_$p$p_*) ;; *) test -d $p && PATH=$PATH$p_$p ;; esac done PATH=.$p_$PATH export PATH : shall we be using ksh? inksh='' needksh='' avoidksh='' newsh=/bin/ksh changesh='' ?X: Use (alias -x) and not (alias) since zsh and bash recognize the alias ?X: builtin but not the -x option which is typically ksh... ?X: We need to set up PATH before calling the "alias" built-in since some ?X: systems like HP-UX have a binary called /bin/alias. if (PATH=.; alias -x) >/dev/null 2>&1; then inksh=true fi ?X: On HP-UX, large Configure scripts may exercise a bug in /bin/sh, use ksh if test -f /hp-ux -a -f /bin/ksh; then needksh='to avoid sh bug in "here document" expansion' fi ?X: On AIX4, /bin/sh is really ksh and it causes problems, use sh if test -d /usr/lpp -a -f /usr/bin/bsh -a -f /usr/bin/uname; then if test X`/usr/bin/uname -v` = X4; then avoidksh="to avoid AIX 4's /bin/sh" newsh=/usr/bin/bsh fi fi ?X: On Digital UNIX, /bin/sh may start up buggy /bin/ksh, use sh if test -f /osf_boot -a -f /usr/sbin/setld; then if test X`/usr/bin/uname -s` = XOSF1; then avoidksh="to avoid Digital UNIX' ksh" newsh=/bin/sh ?X: if BIN_SH is set to 'xpg4', sh will start up ksh unset BIN_SH fi fi ?X: If we are not in ksh and need it, then feed us back to it case "$inksh/$needksh" in /[a-z]*) ?X: Clear ENV to avoid any ~/.kshrc that could alias cd or whatever... ?X: Don't use "unset ENV", that is not portable enough ENV='' changesh=true reason="$needksh" ;; esac ?X: If we are in ksh and must avoid it, then feed us back to a new shell case "$inksh/$avoidksh" in true/[a-z]*) changesh=true reason="$avoidksh" ;; esac ?X: Warn them if they use ksh on other systems, which are those where ?X: we don't need ksh nor want to avoid it explicitly, yet are using it. case "$inksh/$needksh-$avoidksh-" in true/--) cat <