From f4567d7190356e923feb7f997a285252348df0dd Mon Sep 17 00:00:00 2001 From: cathugger Date: Sun, 31 Mar 2019 19:12:07 +0000 Subject: [PATCH] move windows check off Makefile --- Makefile.in | 3 --- configure.ac | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 60ee2c5..37fc000 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,9 +1,6 @@ CC= @CC@ CSTD= @CSTD@ -ifeq ($(OS),Windows_NT) - CSTD+= -Wno-pedantic-ms-format -endif CFLAGS= $(CSTD) @CFLAGS@ @CPPFLAGS@ -DED25519_@ED25519IMPL@ @MYDEFS@ ASFLAGS= LDFLAGS= @NOPIE@ @LDFLAGS@ diff --git a/configure.ac b/configure.ac index 1e2c103..8e88701 100644 --- a/configure.ac +++ b/configure.ac @@ -171,6 +171,7 @@ fi cstd="" c99="" oldcflags="$CFLAGS" + CFLAGS="-std=c99" AC_MSG_CHECKING([whether CC supports -std=c99]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], @@ -179,6 +180,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [cstd="-std=c99"], [AC_MSG_RESULT([no])] ) + CFLAGS="$cstd -Wall" AC_MSG_CHECKING([whether CC supports -Wall]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], @@ -186,6 +188,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [cstd="$cstd -Wall"], [AC_MSG_RESULT([no])] ) + # (negative) detection on clang fails without -Werror CFLAGS="$cstd -Wno-maybe-uninitialized -Werror" AC_MSG_CHECKING([whether CC supports -Wno-maybe-uninitialized]) @@ -194,6 +197,7 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], [cstd="$cstd -Wno-maybe-uninitialized"], [AC_MSG_RESULT([no])] ) + if test "x$c99" = "xyes" -a "x$ed25519impl" != "xdonna" -a "x$enable_intfilter" != "x128" then CFLAGS="$cstd -pedantic" @@ -204,6 +208,17 @@ then [AC_MSG_RESULT([no])] ) fi + +CFLAGS="$cstd -Wno-pedantic-ms-format -Werror" +AC_MSG_CHECKING([whether CC supports and needs -Wno-pedantic-ms-format]) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifndef _WIN32 +#error wants windows +#endif]], [])], + [AC_MSG_RESULT([yes])] + [cstd="$cstd -Wno-pedantic-ms-format"], + [AC_MSG_RESULT([no])] +) + if test "x$ed25519impl" = "xdonna" then CFLAGS="$cstd -Wno-unused-function -Werror" @@ -214,6 +229,7 @@ then [AC_MSG_RESULT([no])] ) fi + CFLAGS="$oldcflags" AC_ARG_ENABLE([binfilterlen],