ref: d87f9a65a84d7919655d25ceeb06a9c482b15be0
parent: a8772918a35d446945d3a480cdab69f838f2b399
author: Werner Lemberg <[email protected]>
date: Tue Feb 4 11:14:09 EST 2014
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.
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,18 @@
2014-02-04 Werner Lemberg <[email protected]>
+ 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 <[email protected]>
+
[autofit] Minor fix.
* src/autofit/afcjk.c (af_cjk_metrics_init_widths),
--- a/builds/unix/configure.raw
+++ b/builds/unix/configure.raw
@@ -206,30 +206,49 @@
# 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 <stdio.h>],[{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 <stdio.h>
+
+ ],
+ [
+
+ {
+ 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*)