This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reliably check if we're running under cygwin inside Makefile


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]