delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/06/03/14:45:54

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Envelope-From: markie AT osafoundation DOT org
X-Envelope-To: <cygwin AT cygwin DOT com>
Mime-Version: 1.0 (Apple Message framework v618)
To: cygwin AT cygwin DOT com
Message-Id: <24B60BF0-B58E-11D8-93D7-000A95BDA2FE@osafoundation.org>
From: Mark Jaffe <markie AT osafoundation DOT org>
Subject: Recognizing host OS
Date: Thu, 3 Jun 2004 11:45:11 -0700
X-Scanned-By: MIMEDefang 2.39
X-IsSubscribed: yes

--Apple-Mail-16-606928982
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	format=flowed

I am very perplexed by this situation, and I wonder if I am alone. When 
compiling our sources (mixed environments supported) I am discovering 
that when run on cygwin (host WinXP env) the make script is failing to 
properly identify the OS. I have documented this here:
(in the following, REAL_OS is determined in the subject Makefile thus:
REAL_OS=unknown

ifeq ($(OS),Cygwin)
   REAL_OS=WINNT
endif

ifeq ($(OS),WINNT)
   REAL_OS=WINNT
endif
OS and PLATFORM are determined in an included Makefile.inc thus:
OS=$(shell uname)

ifeq ($(findstring CYGWIN,$(OS)),CYGWIN)
OS=Cygwin
endif

ifeq ($(findstring WINNT,$(OS)),WINNT)
OS=Cygwin
endif

ifeq ($(OS),Cygwin)
PYTHON:=$(PREFIX)/bin/$(PYTHON).exe
SITE=bin/Lib/site-packages
PLATFORM=windows
else
ifeq ($(OS),Darwin)
FRAMEWORK=Library/Frameworks/Python.framework/Versions/2.3
PYTHON:=$(PREFIX)/$(FRAMEWORK)/bin/$(PYTHON)
SITE=$(FRAMEWORK)/lib/python2.3/site-packages
PLATFORM=macosx
else
PYTHON:=$(PREFIX)/bin/$(PYTHON)
SITE=lib/python2.3/site-packages
PLATFORM=linux
endif
endif
)

dummy:
         @echo "OS is" $(OS) "real OS is " $(REAL_OS) " platform is " 
$(PLATFORM)
         @something=$(findstring WIN,$(OS))
         @echo $(something)

and running it four times in a row without any other changes yielded 
this result:
builder AT haleakala ~/new-extern/external/openssl
$ make dummy
OS is Cygwin real OS is  WINNT  platform is  windows


builder AT haleakala ~/new-extern/external/openssl
$ make dummy
OS is CYGWIN_NT-5.1 real OS is  unknown  platform is  linux


builder AT haleakala ~/new-extern/external/openssl
$ make dummy
OS is Cygwin real OS is  WINNT  platform is  windows


builder AT haleakala ~/new-extern/external/openssl
$ make dummy
OS is real OS is  unknown  platform is  linux


-- 
Mark Jaffe               | (415) 946-3028 (work)
Release Engineer         | (408) 807-2093 (cell)
OSAF                     | (415) 946-3001 (FAX)
markie AT osafoundation DOT org | http://www.osafoundation.org/
PGP Fingerprint: 3435 EB88 6424 F5DF F2CA EF16 2DBF DFEF 143C 1ADE
--Apple-Mail-16-606928982
Content-Transfer-Encoding: 7bit
Content-Type: text/enriched;
	charset=US-ASCII

I am very perplexed by this situation, and I wonder if I am alone.
When compiling our sources (mixed environments supported) I am
discovering that when run on cygwin (host WinXP env) the make script
is failing to properly identify the OS. I have documented this here:

(in the following, REAL_OS is determined in the subject Makefile thus:

<smaller>REAL_OS=unknown


ifeq ($(OS),Cygwin)

  REAL_OS=WINNT

endif


ifeq ($(OS),WINNT)

  REAL_OS=WINNT

endif

</smaller>OS and PLATFORM are determined in an included Makefile.inc
thus:

<smaller>OS=$(shell uname)


ifeq ($(findstring CYGWIN,$(OS)),CYGWIN)

OS=Cygwin

endif


ifeq ($(findstring WINNT,$(OS)),WINNT)

OS=Cygwin

endif

</smaller>

<smaller>ifeq ($(OS),Cygwin)

PYTHON:=$(PREFIX)/bin/$(PYTHON).exe

SITE=bin/Lib/site-packages

PLATFORM=windows

else

ifeq ($(OS),Darwin)

FRAMEWORK=Library/Frameworks/Python.framework/Versions/2.3

PYTHON:=$(PREFIX)/$(FRAMEWORK)/bin/$(PYTHON)

SITE=$(FRAMEWORK)/lib/python2.3/site-packages

PLATFORM=macosx

else

PYTHON:=$(PREFIX)/bin/$(PYTHON)

SITE=lib/python2.3/site-packages

PLATFORM=linux

endif

endif

</smaller>)

 

dummy:

        @echo "OS is" $(OS) "real OS is " $(REAL_OS) " platform is "
$(PLATFORM)

        @something=$(findstring WIN,$(OS))

        @echo $(something)


and running it four times in a row without any other changes yielded
this result:

builder AT haleakala ~/new-extern/external/openssl

$ make dummy

OS is Cygwin real OS is  WINNT  platform is  windows



builder AT haleakala ~/new-extern/external/openssl

$ make dummy

OS is CYGWIN_NT-5.1 real OS is  unknown  platform is  linux



builder AT haleakala ~/new-extern/external/openssl

$ make dummy

OS is Cygwin real OS is  WINNT  platform is  windows



builder AT haleakala ~/new-extern/external/openssl

$ make dummy

OS is real OS is  unknown  platform is  linux



<fixed><fontfamily><param>Andale Mono</param><smaller>-- 

Mark Jaffe               | (415) 946-3028 (work)

Release Engineer         | (408) 807-2093 (cell)

OSAF                     | (415) 946-3001 (FAX)

markie AT osafoundation DOT org | http://www.osafoundation.org/

PGP Fingerprint: 3435 EB88 6424 F5DF F2CA EF16 2DBF DFEF 143C 1ADE</smaller></fontfamily></fixed>
--Apple-Mail-16-606928982--

- Raw text -


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