From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22262 invoked by alias); 12 Jan 2009 12:20:40 -0000 Received: (qmail 22251 invoked by uid 22791); 12 Jan 2009 12:20:39 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Jan 2009 12:19:58 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LMLlo-0005lm-Pn for cygwin@cygwin.com; Mon, 12 Jan 2009 12:19:52 +0000 Received: from nl-216-124.netlogon.liu.se ([130.236.216.124]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 12:19:52 +0000 Received: from mindcooler by nl-216-124.netlogon.liu.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 12 Jan 2009 12:19:52 +0000 To: cygwin@cygwin.com From: Eric Lilja Subject: Reliably check if we're running under cygwin inside Makefile Date: Mon, 12 Jan 2009 12:48:00 -0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) X-IsSubscribed: yes Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com X-SW-Source: 2009-01/txt/msg00316.txt.bz2 Hello, I have a program that will built both under fedora and under cygwin. The program is written in C and the Makefile is slightly different between the two systems. Is it possible to check some environment variable in the makefile to determine what to do? The source code itself have constructs like these for parts that differ between cygwin and fedora: #if defined __CYGWIN__ /* Turn on vsync, this works on Cygwin. */ SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); #elif defined __linux /* Fedora doesn't support SDL_GL_SWAP_CONTROL, but we use this extension instead. */ SDL_putenv("__GL_SYNC_TO_VBLANK=1"); #endif and I'm looking for something similiar to use with the Makefiles so I can turn the two Makefiles into one. I hope this is considered on-topic, if not, I apologise. - EL -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/