esac
AC_SUBST(extra_libs)
+AC_SUBST(extra_cflags)
AC_SUBST(getopt_long_c)
AC_SUBST(include_dev_mk)
AC_SUBST(test_suites)
include_dev_mk='include dev.mk'
version=`(git --git-dir=$srcdir/.git describe --dirty 2>/dev/null || echo vunknown) | sed -e 's/v//' -e 's/-/+/' -e 's/-/_/g'`
echo "extern const char CCACHE_VERSION@<:@@:>@; const char CCACHE_VERSION@<:@@:>@ = \"$version\";" >src/version.c
+
+ dnl Check for -Wimplicit-fallthrough and disable if exists
+ AC_MSG_CHECKING([whether C compiler supports -Wimplicit-fallthrough])
+ saved_cflags=$CFLAGS
+ CFLAGS=-Wimplicit-fallthrough
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_RESULT([yes])]
+ [extra_cflags="-Wno-error=implicit-fallthrough"],
+ [AC_MSG_RESULT([no])]
+ )
+ CFLAGS=$saved_cflags
else
AC_MSG_NOTICE(developer mode disabled)
fi
# GNU make syntax reigns in this file.
-all_cflags += -Werror
+all_cflags += -Werror @extra_cflags@
all_cppflags += -MD -MP -MF .deps/$(subst .._,,$(subst /,_,$<)).d
A2X = a2x
#define O_BINARY 0
#endif
-// mkstemp() on some versions of cygwin don't handle binary files, so override.
-#ifdef __CYGWIN__
-#undef HAVE_MKSTEMP
-#endif
-
#ifdef _WIN32
char *win32argvtos(char *prefix, char **argv);
char *win32getshell(char *path);
int
mkstemp(char *template)
{
+#ifdef __GNUC__
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
mktemp(template);
+#ifdef __GNUC__
+ #pragma GCC diagnostic pop
+#endif
return open(template, O_RDWR | O_CREAT | O_EXCL | O_BINARY, 0600);
}
#endif
# include <io.h>
#endif
-#if defined(_WIN32) || defined(__CYGWIN__)
+#if defined(_WIN32)
# define WIDECHAR
#endif
ZEXTERN unsigned long ZEXPORT inflateCodesUsed OF ((z_streamp));
ZEXTERN int ZEXPORT inflateResetKeep OF((z_streamp));
ZEXTERN int ZEXPORT deflateResetKeep OF((z_streamp));
-#if (defined(_WIN32) || defined(__CYGWIN__)) && !defined(Z_SOLO)
+#if defined(_WIN32) && !defined(Z_SOLO)
ZEXTERN gzFile ZEXPORT gzopen_w OF((const wchar_t *path,
const char *mode));
#endif
# define OS_CODE 13
#endif
-#if defined(WIN32) && !defined(__CYGWIN__)
+#if defined(WIN32)
# define OS_CODE 10
#endif