delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/11/17/11:24:02

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Fri, 17 Nov 2000 11:18:01 -0500
From: Jason Tishler <Jason DOT Tishler AT dothill DOT com>
To: Kris Thielemans <kris DOT thielemans AT csc DOT mrc DOT ac DOT uk>
Cc: Gnuwin <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: testing if it's cygwin
Message-ID: <20001117111801.A252@dothill.com>
References: <005a01c050aa$591a4490$460a10ac AT rpms DOT ac DOT uk>
Mime-Version: 1.0
User-Agent: Mutt/1.2.5i
In-Reply-To: <005a01c050aa$591a4490$460a10ac@rpms.ac.uk>; from kris.thielemans@csc.mrc.ac.uk on Fri, Nov 17, 2000 at 03:23:33PM -0000
Organization: Dot Hill Systems Corp.

Kris,

On Fri, Nov 17, 2000 at 03:23:33PM -0000, Kris Thielemans wrote:
> what would be the recommended way of testing (in a shell script file, or a
> Makefile) if it's being run on CYGWIN?

We use constructs such as the following:

bash:
====

if [[ $(uname -s) = CYGWIN_NT* ]]
then
	# handle NT/2000
else
	# handle 9X/ME
fi

sh:
==

case `uname -s` in
CYGWIN_NT*)
    # handle NT/2000
    ;;
*)
    # handle 9X/ME
    ;;
esac

make:
====

ifeq ($(findstring CYGWIN_NT, $(shell uname -s)), CYGWIN_NT)
    # handle NT/2000
else
    # handle 9X/ME
endif

> Also, it relies on the existence of uname of course...

Which is a reasonable dependency -- at least for us.

Jason

-- 
Jason Tishler
Director, Software Engineering       Phone: +1 (732) 264-8770 x235
Dot Hill Systems Corporation         Fax:   +1 (732) 264-8798
82 Bethany Road, Suite 7             Email: Jason DOT Tishler AT dothill DOT com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019