Skip to content

Commit d10254c

Browse files
author
Paul Dreik
committed
don't use deprecated header nettle/sha.h
1 parent 4af3a40 commit d10254c

File tree

2 files changed

+38
-39
lines changed

2 files changed

+38
-39
lines changed

Checksum.hh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#include <cstddef>
1111

1212
#include <nettle/md5.h>
13-
#include <nettle/sha.h>
13+
#include <nettle/sha1.h>
14+
#include <nettle/sha2.h>
1415

1516
/**
1617
* class for checksum calculation

configure.ac

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ dnl for assert() support
3535
AC_HEADER_ASSERT
3636

3737
dnl test for nettle
38-
AC_CHECK_HEADER(nettle/sha.h,,[AC_MSG_ERROR([
38+
AC_CHECK_HEADER(nettle/sha1.h,,[AC_MSG_ERROR([
3939
nettle header files missing. Please install nettle
4040
first. If you have already done so and get this error message
4141
anyway, it may be installed somewhere else, maybe because you
4242
don't have root access. Pass CPPFLAGS=-I/your/path/to/nettle to configure
43-
and try again. The path should be so that \#include "nettle/sha.h" works.
43+
and try again. The path should be so that \#include "nettle/sha1.h" works.
4444
On Debian-ish systems, use "apt-get install nettle-dev" to get a system
4545
wide nettle install.
4646
])])
@@ -62,7 +62,9 @@ AC_SYS_LARGEFILE
6262

6363
dnl make sure we have c++11 or better,
6464
AC_MSG_CHECKING([for C++11 support or better])
65-
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() { auto a=1;return a;}])],
65+
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int f() {
66+
auto a = 1;
67+
return a;}])],
6668
[AC_MSG_RESULT([yes])],
6769
[AC_MSG_ERROR([no c++11 support, please set CXXFLAGS properly])])
6870

@@ -128,21 +130,20 @@ if test "x$set_more_warnings" != xno; then
128130
-Wextra-semi \
129131
-Wbiznafronck"
130132

131-
#these warnings were tried but deemed unuseful for this project:
132-
# -Wunsafe-loop-optimizations \
133-
134-
for option in $warning_options ; do
135-
SAVE_CXXFLAGS="$CXXFLAGS"
136-
CXXFLAGS="$CXXFLAGS $uwoption $option"
137-
AC_MSG_CHECKING([whether compiler understands $option])
138-
dnl Include a system header so we ignore Werror=... flags
139-
dnl that cause trouble.
140-
AC_COMPILE_IFELSE(
141-
[AC_LANG_PROGRAM([[#include <stdio.h>]], [])],
142-
[has_option=yes],
143-
[has_option=no])
144-
CXXFLAGS="$SAVE_CXXFLAGS"
145-
if test $has_option = yes; then
133+
#these warnings were tried but deemed unuseful for this project:
134+
#- Wunsafe - loop - optimizations \
135+
136+
for option in $warning_options ;
137+
do
138+
SAVE_CXXFLAGS = "$CXXFLAGS" CXXFLAGS =
139+
"$CXXFLAGS $uwoption $option" AC_MSG_CHECKING(
140+
[whether compiler understands $option])
141+
dnl Include a system header so we ignore Werror =
142+
... flags dnl that cause trouble.AC_COMPILE_IFELSE(
143+
[AC_LANG_PROGRAM([[#include<stdio.h>]], [])],
144+
[has_option = yes],
145+
[has_option = no]) CXXFLAGS = "$SAVE_CXXFLAGS" if test $has_option =
146+
yes; then
146147
CXXFLAGS="$CXXFLAGS $option"
147148
fi
148149
AC_MSG_RESULT(got result $has_option)
@@ -159,29 +160,26 @@ AC_MSG_CHECKING([check for fallthrough support])
159160
define([str],[[[[fallthrough]]]])
160161
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
161162
int f() {
162-
switch(1){
163-
case 1:
164-
[[fallthrough]];
165-
case 2:
166-
return 2;
163+
switch (1) {
164+
case 1:
165+
[[fallthrough]];
166+
case 2:
167+
return 2;
167168
};
168169
}
169170
]], [])],
170171
[has_fallthrough=yes],
171172
[has_fallthrough=no])
172173
AC_MSG_RESULT($has_fallthrough)
173-
if test $has_fallthrough = yes; then
174-
AC_DEFINE(FALLTHROUGH, [str], "support for c++17 fallthrough")
175-
else
176-
AC_DEFINE(FALLTHROUGH, [], "support for c++17 fallthrough")
177-
fi
178-
179-
dnl valgrind support
180-
dnl unfortunately it makes checking much slower
181-
dnl even if valgrind is not used, so leave it inactive.
182-
dnl AX_VALGRIND_CHECK
183-
dnl
184-
dnl instead, just use "VALGRIND=valgrind make check" to test with valgrind
185-
dnl read Makefile.in and write Makefile
186-
AC_CONFIG_FILES([Makefile])
187-
AC_OUTPUT
174+
if test $has_fallthrough = yes;
175+
then
176+
AC_DEFINE(FALLTHROUGH, [str], "support for c++17 fallthrough") else AC_DEFINE(
177+
FALLTHROUGH,
178+
[],
179+
"support for c++17 fallthrough") fi
180+
181+
dnl valgrind support dnl unfortunately it makes checking much slower dnl even
182+
if valgrind is not used,
183+
so leave it inactive.dnl AX_VALGRIND_CHECK dnl dnl instead,
184+
just use "VALGRIND=valgrind make check" to test with valgrind dnl read
185+
Makefile.in and write Makefile AC_CONFIG_FILES([Makefile]) AC_OUTPUT

0 commit comments

Comments
 (0)