configure
changeset 7498 bda3639deecc
parent 7494 25575b2a188f
child 7554 4b653ef6050d
     1.1 --- a/configure	Sun Jul 21 22:09:00 2013 +0200
     1.2 +++ b/configure	Sun Jul 21 23:01:01 2013 -0700
     1.3 @@ -15802,15 +15802,45 @@
     1.4      separate directory so you don't clobber SDL_config.h, SDL_revision.h
     1.5  " "$LINENO" 5
     1.6  fi
     1.7 +BASE_CFLAGS=""
     1.8 +BASE_LDFLAGS=""
     1.9  case "$host" in
    1.10      *-*-cygwin*)
    1.11          # We build SDL on cygwin without the UNIX emulation layer
    1.12 -        BASE_CFLAGS="-I/usr/include/mingw -mno-cygwin"
    1.13 -        BASE_LDFLAGS="-mno-cygwin"
    1.14 -        ;;
    1.15 -    *)
    1.16 -        BASE_CFLAGS=""
    1.17 -        BASE_LDFLAGS=""
    1.18 +        save_CFLAGS="$CFLAGS"
    1.19 +        have_no_cygwin=no
    1.20 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GCC -mno-cygwin option" >&5
    1.21 +$as_echo_n "checking for GCC -mno-cygwin option... " >&6; }
    1.22 +        CFLAGS="$save_CFLAGS -mno-cygwin"
    1.23 +
    1.24 +        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.25 +/* end confdefs.h.  */
    1.26 +
    1.27 +
    1.28 +int
    1.29 +main ()
    1.30 +{
    1.31 +
    1.32 +
    1.33 +  ;
    1.34 +  return 0;
    1.35 +}
    1.36 +_ACEOF
    1.37 +if ac_fn_c_try_compile "$LINENO"; then :
    1.38 +
    1.39 +        have_no_cygwin=yes
    1.40 +
    1.41 +fi
    1.42 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.43 +        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_no_cygwin" >&5
    1.44 +$as_echo "$have_no_cygwin" >&6; }
    1.45 +        CFLAGS="$save_CFLAGS"
    1.46 +
    1.47 +        if test x$have_no_cygwin = xyes; then
    1.48 +            BASE_CFLAGS="-mno-cygwin"
    1.49 +            BASE_LDFLAGS="-mno-cygwin"
    1.50 +        fi
    1.51 +        BASE_CFLAGS="$BASE_CFLAGS -I/usr/include/mingw"
    1.52          ;;
    1.53  esac
    1.54  # Uncomment the following line if you want to force SDL and applications
    1.55 @@ -22428,7 +22458,49 @@
    1.56          VERSION_SOURCES="$srcdir/src/main/windows/*.rc"
    1.57          SDLMAIN_SOURCES="$srcdir/src/main/windows/*.c"
    1.58          SDL_CFLAGS="$SDL_CFLAGS -Dmain=SDL_main"
    1.59 -        SDL_LIBS="-lmingw32 -lSDL2main $SDL_LIBS -mwindows"
    1.60 +        SDL_LIBS="-lSDL2main $SDL_LIBS -mwindows"
    1.61 +
    1.62 +        # Check to see if this is a mingw or cygwin build
    1.63 +        have_mingw32=
    1.64 +        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmingw32" >&5
    1.65 +$as_echo_n "checking for main in -lmingw32... " >&6; }
    1.66 +if ${ac_cv_lib_mingw32_main+:} false; then :
    1.67 +  $as_echo_n "(cached) " >&6
    1.68 +else
    1.69 +  ac_check_lib_save_LIBS=$LIBS
    1.70 +LIBS="-lmingw32  $LIBS"
    1.71 +cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.72 +/* end confdefs.h.  */
    1.73 +
    1.74 +
    1.75 +int
    1.76 +main ()
    1.77 +{
    1.78 +return main ();
    1.79 +  ;
    1.80 +  return 0;
    1.81 +}
    1.82 +_ACEOF
    1.83 +if ac_fn_c_try_link "$LINENO"; then :
    1.84 +  ac_cv_lib_mingw32_main=yes
    1.85 +else
    1.86 +  ac_cv_lib_mingw32_main=no
    1.87 +fi
    1.88 +rm -f core conftest.err conftest.$ac_objext \
    1.89 +    conftest$ac_exeext conftest.$ac_ext
    1.90 +LIBS=$ac_check_lib_save_LIBS
    1.91 +fi
    1.92 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mingw32_main" >&5
    1.93 +$as_echo "$ac_cv_lib_mingw32_main" >&6; }
    1.94 +if test "x$ac_cv_lib_mingw32_main" = xyes; then :
    1.95 +  have_mingw32=yes
    1.96 +fi
    1.97 +
    1.98 +        if test x$have_mingw32 = xyes; then
    1.99 +            SDL_LIBS="-lmingw32 $SDL_LIBS"
   1.100 +        else
   1.101 +            SDL_LIBS="-lcygwin $SDL_LIBS"
   1.102 +        fi
   1.103          ;;
   1.104      *-*-beos* | *-*-haiku*)
   1.105          ARCH=beos