diff --git a/ChangeLog b/ChangeLog index c6967c352..b02dd1b71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2014-02-04 Werner Lemberg + + Fix compilation with MinGW. + + Right now, compilation out of the box with latest MinGW is broken + due to bugs in header files of mingwrt 4.0.3 in strict ANSI mode, + cf. + + https://sourceforge.net/p/mingw/bugs/2024/ + https://sourceforge.net/p/mingw/bugs/2046/ + + * builds/unix/configure.raw: Don't set `-ansi' flag for MinGW. + 2014-02-04 Werner Lemberg [autofit] Minor fix. diff --git a/builds/unix/configure.raw b/builds/unix/configure.raw index 57fb5f416..2d3dcc75a 100644 --- a/builds/unix/configure.raw +++ b/builds/unix/configure.raw @@ -206,30 +206,49 @@ AC_CHECK_FUNCS([memcpy memmove]) # get compiler flags right -# we try to make the compiler work for C89-strict source. -# even if C compiler is GCC and C89 flags are available, -# some system headers (e.g. Android Bionic libc) is broken -# in C89 mode. we have to check the compilation finishes -# successfully. +# +# We try to make the compiler work for C89-strict source. Even if the +# C compiler is gcc and C89 flags are available, some system headers +# (e.g., Android Bionic libc) are broken in C89 mode. We have to check +# whether the compilation finishes successfully. +# +# Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW. # if test "x$GCC" = xyes; then XX_CFLAGS="-Wall" - XX_ANSIFLAGS="" - for a in -pedantic -ansi - do - AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly]) - orig_CFLAGS="${CFLAGS}" - CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}" - AC_COMPILE_IFELSE([ - AC_LANG_PROGRAM([#include ],[{puts("");return 0;}]) - ],[ - AC_MSG_RESULT([ok, add it to XX_ANSIFLAGS]) - XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}" - ],[ - AC_MSG_RESULT([no]) - ]) - CFLAGS="${orig_CFLAGS}" - done + case "$host" in + *-*-mingw*) + XX_ANSIFLAGS="-pedantic" + ;; + *) + XX_ANSIFLAGS="" + for a in -pedantic -ansi + do + AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly]) + orig_CFLAGS="${CFLAGS}" + CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}" + AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([ + +#include + + ], + [ + + { + puts( "" ); + return 0; + } + + ])], + [AC_MSG_RESULT([ok, add it to XX_ANSIFLAGS]) + XX_ANSIFLAGS="${XX_ANSIFLAGS} ${a}" + ], + [AC_MSG_RESULT([no])]) + CFLAGS="${orig_CFLAGS}" + done + ;; + esac else case "$host" in *-dec-osf*)