move windows check off Makefile

This commit is contained in:
cathugger 2019-03-31 19:12:07 +00:00
parent 0f000d3820
commit f4567d7190
No known key found for this signature in database
GPG key ID: 9BADDA2DAF6F01A8
2 changed files with 16 additions and 3 deletions

View file

@ -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@

View file

@ -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],