mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 18:44:17 +00:00
bug #28677: Cygwin's GCC no longer supports -mno-cygwin option
* configure.ac: For Win32 environments, add a check whether the compiler understands the -mno-cygwin option. If not, don't use it but suggest using a different compiler. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@930 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
46
configure.ac
46
configure.ac
@@ -241,16 +241,6 @@ else
|
||||
fi
|
||||
export confsubst
|
||||
|
||||
# See if we need to drop into the windows subdir.
|
||||
case $target in
|
||||
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
WINDOWS_DIRS="windows"
|
||||
CFLAGS="${CFLAGS} -mno-cygwin -DWIN32NATIVE"
|
||||
LDFLAGS="${LDFLAGS} -static"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(WINDOWS_DIRS,$WINDOWS_DIRS)
|
||||
|
||||
# If we are compiling with gcc, enable all warning and make warnings errors.
|
||||
if test "$GCC" = yes; then
|
||||
ENABLE_WARNINGS="-Wall"
|
||||
@@ -276,6 +266,42 @@ if test "$GCC" = yes; then
|
||||
fi
|
||||
AC_SUBST(ENABLE_WARNINGS,$ENABLE_WARNINGS)
|
||||
|
||||
# See if we need to drop into the windows subdir.
|
||||
case $target in
|
||||
*-*-mingw32* | *-*-cygwin* | *-*-windows*)
|
||||
if test "$GCC" = yes -a \( "$CC" = "cc" -o "$CC" = "gcc" \); then
|
||||
# does this compiler support -mno-cygwin?
|
||||
AC_MSG_CHECKING([if $CC accepts -mno-cygwin])
|
||||
|
||||
safe_CFLAGS=$CFLAGS
|
||||
CFLAGS="$ENABLE_WARNINGS -mno-cygwin"
|
||||
|
||||
AC_TRY_COMPILE(, [ int main () { return 0 ; } ], [
|
||||
no_cygwin=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
], [
|
||||
no_cygwin=no
|
||||
AC_MSG_RESULT([no])
|
||||
])
|
||||
CFLAGS=$safe_CFLAGS
|
||||
|
||||
if test x$no_cygwin = xyes; then
|
||||
CFLAGS="${CFLAGS} -mno-cygwin"
|
||||
else
|
||||
AC_MSG_NOTICE([Your compiler does not understand the -mno-cygwin option.])
|
||||
AC_MSG_NOTICE([You might want to select an alternative compiler, like])
|
||||
AC_MSG_NOTICE([])
|
||||
AC_MSG_NOTICE([CC=mingw32-gcc ./configure])
|
||||
AC_MSG_NOTICE([])
|
||||
fi
|
||||
fi
|
||||
WINDOWS_DIRS="windows"
|
||||
CFLAGS="${CFLAGS} -DWIN32NATIVE"
|
||||
LDFLAGS="${LDFLAGS} -static"
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(WINDOWS_DIRS,$WINDOWS_DIRS)
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
doc/Makefile
|
||||
windows/Makefile
|
||||
|
||||
Reference in New Issue
Block a user