delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/01/12/07:20:46

X-Recipient: archive-cygwin AT delorie DOT com
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
To: cygwin AT cygwin DOT com
From: Eric Lilja <mindcooler AT gmail DOT com>
Subject: Reliably check if we're running under cygwin inside Makefile
Date: Mon, 12 Jan 2009 13:19:37 +0100
Lines: 22
Message-ID: <gkfcgt$m9j$1@ger.gmane.org>
Mime-Version: 1.0
User-Agent: Thunderbird 2.0.0.19 (Windows/20081209)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
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

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/

- Raw text -


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