We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1980

Summary: configure needs to be updated to detect latest cygwin/gcc 4.7.2 which deprecates -mno-cygwin
Product: SDL Reporter: Andreas Schiffler <aschiffler>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: HG 2.0   
Hardware: x86_64   
OS: Windows 7   

Description Andreas Schiffler 2013-07-21 23:30:10 UTC
The default configure script uses
 case "$host" in
     *-*-cygwin*)
         # We build SDL on cygwin without the UNIX emulation layer
         BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
         BASE_LDFLAGS="-mno-cygwin"
which fails on the latest cygwin with the error
  checking Windows compiler... no
  configure: error:
  *** Your compiler (gcc) does not produce Windows executables!

The root cause is that the included gcc has deprecated the -mno-cygwin and the following update fixes configure:

$ hg diff ../configure
diff -r 109f37bca7cc configure
--- a/configure Sun Jul 21 22:09:00 2013 +0200
+++ b/configure Sun Jul 21 20:25:14 2013 -0700
@@ -15805,8 +15805,10 @@
 case "$host" in
     *-*-cygwin*)
         # We build SDL on cygwin without the UNIX emulation layer
-        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
-        BASE_LDFLAGS="-mno-cygwin"
+        BASE_CFLAGS="-I/usr/include/mingw"
+        BASE_LDFLAGS=""
         ;;
     *)
         BASE_CFLAGS=""

Since older versions of cygwin worked fine, the recommended fix is to add a dynamic check for the compiler version. This was discussed and implemented in this thread for cmake builds:
   http://forums.libsdl.org/viewtopic.php?p=34600

Installed gcc after cygwin update:
$ gcc --version
gcc (GCC) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Sam Lantinga 2013-07-22 02:02:23 UTC
Fixed!
http://hg.libsdl.org/SDL/rev/bda3639deecc

Note that building with cygwin gcc 4 will result in a DLL that depends on cygwin1.dll