Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site gatech.UUCP Path: utzoo!utcs!lsuc!pesnta!amd!gatech!arnold From: arnold@gatech.UUCP (Arnold Robbins) Newsgroups: net.unix-wizards Subject: Re: Which *nix ? BSD : System V Message-ID: <12076@gatech.UUCP> Date: Mon, 18-Feb-85 17:06:24 EST Article-I.D.: gatech.12076 Posted: Mon Feb 18 17:06:24 1985 Date-Received: Tue, 19-Feb-85 02:12:56 EST References: <147@rtech.ARPA> Distribution: net Organization: Firefighters Extraordinaire, Inc. Lines: 51 ...!rtech!daveb suggests checking for BSD or System V by including and then seeing if FNDELAY is or isn't defined. This probably works just fine. I posted a more elaborate solution a couple months back to net.sources, and will duplicate here (it's short). Its main advantage is that it differentiates between 4.1, 4.2, and System V (we have all three around here...) It is used by saying CFLAGS=-O `where` in a makefile ------ #! /bin/sh # where --- shell file to determine what kind of environment we are in if test -r /bin/universe # on a pyramid then OPATH=$PATH PATH=/bin case `universe` in # universe is dumb, looking only at argv[0] att) echo "-DUSG -UBSD -UBSD4_2" ;; ucb) echo "-UUSG -DBSD -DBSD4_2" ;; *) echo unknown operating system! 1>&2 echo "-UUSG -UBSD -UBSD4_2" # undefine them all ;; esac PATH=$OPATH else # on something that is not a pyrmaid if grep SIGTSTP /usr/include/signal.h > /dev/null then # berkeley unix if test -r /usr/include/whoami.h # 4.1 then echo "-UUSG -DBSD -UBSD4_2" else # 4.2 echo "-UUSG -DBSD -DBSD4_2" fi else # ATT unix echo "-DUSG -UBSD -UBSD4_2" fi fi -- Arnold Robbins CSNET: arnold@gatech ARPA: arnold%gatech.csnet@csnet-relay.arpa UUCP: { akgua, allegra, hplabs, ihnp4, seismo, ut-sally }!gatech!arnold Help advance the state of Computer Science: Nuke a PR1ME today!