httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: Configur{e,ation} changes
Date Mon, 09 Sep 1996 23:43:46 GMT
Robert S. Thau wrote:
> 
> Jim's approach is, of course, not as dodgy as the xgospel stunt, and
> might hold up even if the xgospel stunt wouldn't --- I'm not saying it
> would or it wouldn't, as I'm not a lawyer.  (For that matter, the
> lawyers I know don't answer questions like this without time to study
> the matter carefully, and not just because they bill by the hour).
> I'm just trying to point out that there is, at least potentially, an
> issue here.
> 

Just for posterity's sake (and maybe if we decide NOT to use the autoconf
stuff), here was a script I called os.guess which emulated the output
of config.guess|config.sub for Configure...

#!/bin/sh
#
# Simple OS/Platform guesser. Similar to config.guess but
# much, much smaller. Also has no licensing to speak
# of. You want it, you got it.
#
# Be as similar to the output of config.guess/config.sub
# as possible

# First get uname entries that we use below

MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown"
RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown"
SYSTEM=`(uname -s) 2>/dev/null`  || SYSTEM="unknown"
VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown"

# Do the Apollo stuff first

test -d /usr/apollo && { echo "whatever-apollo-whatever"; exit 0; }

# Now NeXT

if hostname > /dev/null 2>/dev/null; then
    ISNEXT=`hostname`
    case "$ISNEXT" in
    	*NeXT*)
	    echo "whatever-next-nextstep"; exit 0
	    ;;
    esac
fi

# Now test for SCO, since it's weird

if uname -X > /dev/null 2>/dev/null; then
    RELEASE=`uname -X | grep "^Release" | cut -f3 -d' '`
    case "$RELEASE" in
   	3\.2v4\.2)
	    echo "whatever-whatever-sco3"; exit 0
	    ;;
	3\.2v5\.0\.0)
	    echo "whatever-whatever-sco5"; exit 0
	    ;;
    esac
else
    case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in
    	A/UX:*)
	    echo "m68k-apple-aux3"; exit 0
	    ;;

	AIX:*)
	    echo "${MACHINE}-ibm-aix"; exit 0
	    ;;

	dgux:*)
	    echo "${MACHINE}-dg-dgux"; exit 0
	    ;;

	HP-UX:*)
	    HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'`
	    case "$HPUXVER" in
	    	10.*)
		    echo "${MACHINE}-hp-hpux10."; exit 0
		    ;;
		*)
		    echo "${MACHINE}-hp-hpux"; exit 0
		    ;;
	    esac
	    ;;

	IRIX:*)
	    echo "${MACHINE}-sgi-irix"; exit 0
	    ;;

	Linux:*)
	    echo "${MACHINE}-whatever-linux"; exit 0
	    ;;

	LynxOS:*)
	    echo "${MACHINE}-lynx-lynxos"; exit 0
	    ;;

	BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*)
	    echo "486-whatever-bsdi"; exit 0
	    ;;

	BSD/386:*|BSD/OS:*)
	    echo "whatever-whatever-bsdi"; exit 0
	    ;;

	FreeBSD:*:*:*486*)
	    echo "486-whatever-freebsd"; exit 0
	    ;;

	FreeBSD:*)
	    echo "whatever-whatever-freebsd"; exit 0
	    ;;

	NetBSD:*:*:*486*)
	    echo "486-whatever-netbsd"; exit 0
	    ;;

	NetBSD:*)
	    echo "whatever-whatever-netbsd"; exit 0
	    ;;

	OSF1:*:*:*alpha*)
	    echo "${MACHINE}-dec-osf"; exit 0
	    ;;

	SunOS:5.*)
	    echo "${MACHINE}-sun-solaris2"; exit 0
	    ;;

	SunOS:*)
	    echo "${MACHINE}-sun-sunos4"; exit 0
	    ;;

	UNIX_System_V:4.*:*)
	    echo "${MACHINE}-whatever-sysv4"; exit 0
	    ;;

	*:4*:R4*:m88k)
	    echo "${MACHINE}-whatever-sysv4"; exit 0
	    ;;

	DYNIX/ptx:4*:*)
	    echo "${MACHINE}-whatever-sysv4"; exit 0
	    ;;

	*:4.0:3.0:3[34]??,* | *:4.0:3.0:3[34]??,*)
	    echo "${MACHINE}-whatever-sysv4"; exit 0
	    ;;

	*:4.0:*:3[34]??,* | *:4.0:*:3[34]??,*)
	    echo "${MACHINE}-whatever-sysv4"; exit 0
	    ;;

    esac
fi

#
# Ugg. These are all we can determine by what we know about
# the output of uname... Punt.
#

echo "${MACHINE}-whatever-${SYSTEM}|${RELEASE}|${VERSION}" 
exit 0

-- 
Jim Jagielski  << jim@jaguNET.com >>   |   "There is a time for laughing,
  **  jaguNET Access Services  **      |    and a time for not laughing,
      Email: info@jaguNET.com          |    and this is not one of them"
++    http://www.jaguNET.com/         +++      Voice/Fax: 410-931-3157       ++

Mime
View raw message