Fixed building with cygwin
authorSam Lantinga
Thu, 16 Feb 2006 20:17:43 +0000
changeset 1363dc623bb58c9a
parent 1362 88ddeb76c9c1
child 1364 4214be2b8d77
Fixed building with cygwin
configure.in
     1.1 --- a/configure.in	Thu Feb 16 10:22:28 2006 +0000
     1.2 +++ b/configure.in	Thu Feb 16 20:17:43 2006 +0000
     1.3 @@ -49,6 +49,20 @@
     1.4      AC_DEFINE(SDL_BYTEORDER, 1234)
     1.5  fi
     1.6  
     1.7 +dnl Set up the base CFLAGS and LIBS
     1.8 +case "$target" in
     1.9 +    *-*-cygwin*)
    1.10 +        # We build SDL on cygwin without the UNIX emulation layer
    1.11 +        BASE_CFLAGS="-I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.12 +        BASE_LIBS="-mno-cygwin"
    1.13 +        ;;
    1.14 +    *)
    1.15 +        BASE_CFLAGS="-D_GNU_SOURCE=1"
    1.16 +        BASE_LIBS=""
    1.17 +        ;;
    1.18 +esac
    1.19 +CFLAGS="$CFLAGS $BASE_CFLAGS"
    1.20 +
    1.21  dnl Check for tools
    1.22  #AC_LIBTOOL_DLOPEN
    1.23  AC_LIBTOOL_WIN32_DLL
    1.24 @@ -144,7 +158,7 @@
    1.25  if test x$srcdir != x.; then
    1.26      INCLUDE="-Iinclude $INCLUDE"
    1.27  fi
    1.28 -BUILD_CFLAGS='-D_GNU_SOURCE=1 $(INCLUDE)'
    1.29 +BUILD_CFLAGS="$BASE_CFLAGS \$(INCLUDE)"
    1.30  
    1.31  # Standard C sources
    1.32  SOURCES="$SOURCES $srcdir/src/*.c"
    1.33 @@ -160,15 +174,13 @@
    1.34  SOURCES="$SOURCES $srcdir/src/video/*.c"
    1.35  
    1.36  # Set up the build libraries needed
    1.37 -BUILD_LIBS=""
    1.38 +BUILD_LIBS="$BASE_LIBS"
    1.39  
    1.40 -dnl Initialize the compiler and linker flags for SDL applications
    1.41 -
    1.42 -SDL_CFLAGS=""
    1.43 -SDL_LIBS="-lSDL"
    1.44 +# Set up the compiler and linker flags for SDL applications
    1.45 +SDL_CFLAGS="$BASE_CFLAGS"
    1.46 +SDL_LIBS="$BASE_LIBS -lSDL"
    1.47  
    1.48  dnl Add the math library for the new gamma correction support
    1.49 -
    1.50  case "$target" in
    1.51      *-*-cygwin* | *-*-mingw32*)
    1.52          MATHLIB=""
    1.53 @@ -2123,17 +2135,7 @@
    1.54          fi
    1.55          # The Win32 platform requires special setup
    1.56          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
    1.57 -        case "$target" in
    1.58 -            *-*-cygwin*)
    1.59 -                BUILD_CFLAGS="$BUILD_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.60 -                SDL_CFLAGS="$SDL_CFLAGS -I/usr/include/mingw -DWIN32 -Uunix -mno-cygwin"
    1.61 -                BUILD_LIBS="$BUILD_LIBS -mno-cygwin"
    1.62 -                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows -mno-cygwin"
    1.63 -                ;;
    1.64 -            *-*-mingw32*)
    1.65 -                SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
    1.66 -                ;;
    1.67 -        esac
    1.68 +        SDL_LIBS="-lmingw32 -lSDLmain $SDL_LIBS -mwindows"
    1.69          ;;
    1.70      *-*-beos*)
    1.71          ARCH=beos