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 Subject: Reliably check if we're running under cygwin inside Makefile Date: Mon, 12 Jan 2009 13:19:37 +0100 Lines: 22 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 AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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/