diff --git a/Checksum.hh b/Checksum.hh index e13136c..2c3f6e6 100644 --- a/Checksum.hh +++ b/Checksum.hh @@ -10,7 +10,8 @@ #include #include -#include +#include +#include /** * class for checksum calculation diff --git a/configure.ac b/configure.ac index f287492..205736f 100644 --- a/configure.ac +++ b/configure.ac @@ -35,12 +35,12 @@ dnl for assert() support AC_HEADER_ASSERT dnl test for nettle -AC_CHECK_HEADER(nettle/sha.h,,[AC_MSG_ERROR([ +AC_CHECK_HEADER(nettle/sha1.h,,[AC_MSG_ERROR([ nettle header files missing. Please install nettle first. If you have already done so and get this error message anyway, it may be installed somewhere else, maybe because you don't have root access. Pass CPPFLAGS=-I/your/path/to/nettle to configure - and try again. The path should be so that \#include "nettle/sha.h" works. + and try again. The path should be so that \#include "nettle/sha1.h" works. On Debian-ish systems, use "apt-get install nettle-dev" to get a system wide nettle install. ])]) @@ -62,7 +62,9 @@ AC_SYS_LARGEFILE dnl make sure we have c++11 or better, AC_MSG_CHECKING([for C++11 support or better]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { auto a=1;return a;}])], +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { + auto a = 1; + return a;}])], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([no c++11 support, please set CXXFLAGS properly])]) @@ -128,21 +130,20 @@ if test "x$set_more_warnings" != xno; then -Wextra-semi \ -Wbiznafronck" - #these warnings were tried but deemed unuseful for this project: - # -Wunsafe-loop-optimizations \ - - for option in $warning_options ; do - SAVE_CXXFLAGS="$CXXFLAGS" - CXXFLAGS="$CXXFLAGS $uwoption $option" - AC_MSG_CHECKING([whether compiler understands $option]) - dnl Include a system header so we ignore Werror=... flags - dnl that cause trouble. - AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], [])], - [has_option=yes], - [has_option=no]) - CXXFLAGS="$SAVE_CXXFLAGS" - if test $has_option = yes; then +#these warnings were tried but deemed unuseful for this project: +#- Wunsafe - loop - optimizations \ + + for option in $warning_options ; +do + SAVE_CXXFLAGS = "$CXXFLAGS" CXXFLAGS = + "$CXXFLAGS $uwoption $option" AC_MSG_CHECKING( + [whether compiler understands $option]) + dnl Include a system header so we ignore Werror = + ... flags dnl that cause trouble.AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include]], [])], + [has_option = yes], + [has_option = no]) CXXFLAGS = "$SAVE_CXXFLAGS" if test $has_option = + yes; then CXXFLAGS="$CXXFLAGS $option" fi AC_MSG_RESULT(got result $has_option) @@ -159,29 +160,26 @@ AC_MSG_CHECKING([check for fallthrough support]) define([str],[[[[fallthrough]]]]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ int f() { - switch(1){ - case 1: - [[fallthrough]]; - case 2: - return 2; + switch (1) { + case 1: + [[fallthrough]]; + case 2: + return 2; }; } ]], [])], [has_fallthrough=yes], [has_fallthrough=no]) AC_MSG_RESULT($has_fallthrough) -if test $has_fallthrough = yes; then -AC_DEFINE(FALLTHROUGH, [str], "support for c++17 fallthrough") -else -AC_DEFINE(FALLTHROUGH, [], "support for c++17 fallthrough") -fi - -dnl valgrind support -dnl unfortunately it makes checking much slower -dnl even if valgrind is not used, so leave it inactive. -dnl AX_VALGRIND_CHECK -dnl -dnl instead, just use "VALGRIND=valgrind make check" to test with valgrind -dnl read Makefile.in and write Makefile -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT +if test $has_fallthrough = yes; +then +AC_DEFINE(FALLTHROUGH, [str], "support for c++17 fallthrough") else AC_DEFINE( + FALLTHROUGH, + [], + "support for c++17 fallthrough") fi + + dnl valgrind support dnl unfortunately it makes checking much slower dnl even + if valgrind is not used, + so leave it inactive.dnl AX_VALGRIND_CHECK dnl dnl instead, + just use "VALGRIND=valgrind make check" to test with valgrind dnl read + Makefile.in and write Makefile AC_CONFIG_FILES([Makefile]) AC_OUTPUT