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

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 16:11:43 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: "Cygwin (E-mail)" <cygwin AT cygwin DOT com>
Subject: Re: testing if it's cygwin
Message-ID: <20001117161143.F17114@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: "Cygwin (E-mail)" <cygwin AT cygwin DOT com>
References: <200011171625 DOT eAHGPWM02513 AT dymwsm11 DOT mailwatch DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <200011171625.eAHGPWM02513@dymwsm11.mailwatch.com>; from kfleisc1@ford.com on Fri, Nov 17, 2000 at 11:25:21AM -0500

On Fri, Nov 17, 2000 at 11:25:21AM -0500, Fleischer, Karsten (K.) wrote:
>Hi Joerg,
>
>> I use 
>> 
>> if ( test `uname | grep -ic Cygwin` -gt 0 ); then
>> 	echo "Cygwin"
>> fi
>> 
>
>Surely this will work. But if you have _one_ makefile used to bootstrap the
>building process on _any_ machine (I think that's what Kris wants to do),
>you'll have to do something very simple to determine the OS type to prevent
>make from complaining about not finding 'uname' or whatever.
>I provided a Cygwin build system for FreeType2 (www.freetype.org), which
>will build on Windows, DOS, different Unices, from one makefile and I use
>OSTYPE to differentiate between Windows/DOS and Cygwin.
>
>> > I check the environment variable OSTYPE for "cygwin" in my 
>> makefiles.
>> > However, I don't know if it's reliable.
>> 
>> It's not. Changed from cygwin to cygwin32 and back to cygwin.
>
>On B20, I think, it was cygwin32. If we could rely on it being "cygwin" now
>and forever, we have no problems with it.

Just rely on it being [Cc][Yy][Gg][Ww][Ii][Nn]* .  ash/bash/zsh, and tcsh all
have methods for testing this.  With ash/bsh/zsh you use a case statement on
tcsh you use a pattern matching if.

cgf

--
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