summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/nwztools/upgtools/Makefile20
-rw-r--r--utils/nwztools/upgtools/md5.cpp5
-rw-r--r--utils/nwztools/upgtools/mg.cpp8
3 files changed, 24 insertions, 9 deletions
diff --git a/utils/nwztools/upgtools/Makefile b/utils/nwztools/upgtools/Makefile
index fcfc889ae6..046eb1a1a9 100644
--- a/utils/nwztools/upgtools/Makefile
+++ b/utils/nwztools/upgtools/Makefile
@@ -3,9 +3,23 @@ CC=gcc
3CXX=g++ 3CXX=g++
4LD=g++ 4LD=g++
5PROFILE= 5PROFILE=
6CFLAGS=-g $(PROFILE) -std=c99 -Wall $(DEFINES) `pkg-config --cflags libcrypto++` 6PKGCONFIG := $(CROSS)pkg-config
7CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES) `pkg-config --cflags libcrypto++` 7
8LDFLAGS=$(PROFILE) `pkg-config --libs libcrypto++` -lpthread 8# Distros could use different names for the crypto library. We try a list
9# of candidate names, only one of them should be the valid one.
10LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++
11
12$(foreach l,$(LIBCRYPTO_NAMES),\
13 $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l))))
14$(foreach l,$(LIBCRYPTO_NAMES),\
15 $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
16$(foreach l,$(LIBCRYPTO_NAMES),\
17 $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
18
19CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES)
20CFLAGS=-g $(PROFILE) -Wall -std=c99 $(DEFINES)
21LDFLAGS=$(PROFILE) $(LDOPTS) -lpthread
22
9BINS=upgtool 23BINS=upgtool
10 24
11all: $(BINS) 25all: $(BINS)
diff --git a/utils/nwztools/upgtools/md5.cpp b/utils/nwztools/upgtools/md5.cpp
index 3b0c2358e4..3d453da409 100644
--- a/utils/nwztools/upgtools/md5.cpp
+++ b/utils/nwztools/upgtools/md5.cpp
@@ -21,11 +21,12 @@
21#include "md5.h" 21#include "md5.h"
22/* MD5 is considered insecure by crypto++ */ 22/* MD5 is considered insecure by crypto++ */
23#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1 23#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
24#include <crypto++/md5.h> 24#include <cryptopp/cryptlib.h>
25#include <cryptopp/md5.h>
25 26
26using namespace CryptoPP::Weak; 27using namespace CryptoPP::Weak;
27 28
28void MD5_CalculateDigest(void *digest, const void *input, size_t length) 29void MD5_CalculateDigest(void *digest, const void *input, size_t length)
29{ 30{
30 MD5().CalculateDigest((byte *)digest, (const byte *)input, length); 31 MD5().CalculateDigest((CryptoPP::byte *)digest, (const CryptoPP::byte *)input, length);
31} 32}
diff --git a/utils/nwztools/upgtools/mg.cpp b/utils/nwztools/upgtools/mg.cpp
index 79039702db..66566770f9 100644
--- a/utils/nwztools/upgtools/mg.cpp
+++ b/utils/nwztools/upgtools/mg.cpp
@@ -19,10 +19,10 @@
19 * 19 *
20 ****************************************************************************/ 20 ****************************************************************************/
21#include "mg.h" 21#include "mg.h"
22#include <crypto++/cryptlib.h> 22#include <cryptopp/cryptlib.h>
23#include <crypto++/modes.h> 23#include <cryptopp/modes.h>
24#include <crypto++/des.h> 24#include <cryptopp/des.h>
25#include <crypto++/aes.h> 25#include <cryptopp/aes.h>
26#include <stdio.h> 26#include <stdio.h>
27 27
28using namespace CryptoPP; 28using namespace CryptoPP;