This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: testing if it's cygwin


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.Tishler@dothill.com
Hazlet, NJ 07730 USA                 WWW:   http://www.dothill.com

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]