public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: Reliably check if we're running under cygwin inside Makefile
@ 2009-01-12 19:06 Fergus
  2009-01-12 20:10 ` Dave Korn
  2009-01-12 21:52 ` Grant Edwards
  0 siblings, 2 replies; 5+ messages in thread
From: Fergus @ 2009-01-12 19:06 UTC (permalink / raw)
  To: Cygwin ML; +Cc: Fergus

 > osname := $(shell uname -s)
 > osver := $(shell uname -r)
 > cpuarch := $(shell uname -m)

Probably the fault is mine but I can't get this to do anything useful in 
Cygwin. You could try (something like):

   case `uname` in
   *CYGWIN*)
     OS=Cygwin
     ;;
   *Darwin*)
     OS=Darwin
     ;;
   *)
     OS=Linux
     ;;
   esac

and then try things like

   if [ ${OS} == "Linux" ]
   then
   ..
   fi

Fergus



--
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/

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Reliably check if we're running under cygwin inside Makefile
@ 2009-01-12 12:48 Eric Lilja
  2009-01-12 16:19 ` Greg Chicares
  0 siblings, 1 reply; 5+ messages in thread
From: Eric Lilja @ 2009-01-12 12:48 UTC (permalink / raw)
  To: cygwin

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/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-01-12 20:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-12 19:06 Reliably check if we're running under cygwin inside Makefile Fergus
2009-01-12 20:10 ` Dave Korn
2009-01-12 21:52 ` Grant Edwards
  -- strict thread matches above, loose matches on Subject: below --
2009-01-12 12:48 Eric Lilja
2009-01-12 16:19 ` Greg Chicares

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).