diff options
-rw-r--r-- | rbutil/mkimxboot/Makefile | 12 | ||||
-rw-r--r-- | rbutil/mknwzboot/Makefile | 18 | ||||
-rw-r--r-- | rbutil/rbutilqt/rbutilqt.pro | 4 | ||||
-rw-r--r-- | utils/nwztools/upgtools/Makefile | 20 | ||||
-rw-r--r-- | utils/nwztools/upgtools/md5.cpp | 5 | ||||
-rw-r--r-- | utils/nwztools/upgtools/mg.cpp | 8 |
6 files changed, 53 insertions, 14 deletions
diff --git a/rbutil/mkimxboot/Makefile b/rbutil/mkimxboot/Makefile index b584084811..9ad21a1966 100644 --- a/rbutil/mkimxboot/Makefile +++ b/rbutil/mkimxboot/Makefile | |||
@@ -6,17 +6,26 @@ | |||
6 | # \/ \/ \/ \/ \/ | 6 | # \/ \/ \/ \/ \/ |
7 | 7 | ||
8 | # We use the SB code available in the Rockbox utils/sbtools directory | 8 | # We use the SB code available in the Rockbox utils/sbtools directory |
9 | |||
9 | IMXTOOLS_DIR=../../utils/imxtools/sbtools/ | 10 | IMXTOOLS_DIR=../../utils/imxtools/sbtools/ |
10 | CFLAGS += -I$(IMXTOOLS_DIR) -Wall | 11 | CFLAGS += -I$(IMXTOOLS_DIR) -Wall |
11 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) | 12 | # std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE) |
12 | CFLAGS += -std=gnu99 -g -O3 | 13 | CFLAGS += -std=gnu99 -g -O3 |
13 | 14 | ||
15 | # Location to pkg-config binary. | ||
16 | PKGCONFIG := pkg-config | ||
17 | |||
14 | # Distros could use different names for the crypto library. We try a list | 18 | # Distros could use different names for the crypto library. We try a list |
15 | # of candidate names, only one of them should be the valid one. | 19 | # of candidate names, only one of them should be the valid one. |
16 | PKGCONFIG := $(CROSS)pkg-config | ||
17 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ | 20 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ |
21 | |||
18 | $(foreach l,$(LIBCRYPTO_NAMES),\ | 22 | $(foreach l,$(LIBCRYPTO_NAMES),\ |
19 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) | 23 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) |
24 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
25 | $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
26 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
27 | $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
28 | LDOPTS += -lpthread | ||
20 | 29 | ||
21 | OUTPUT = mkimxboot | 30 | OUTPUT = mkimxboot |
22 | 31 | ||
@@ -34,4 +43,3 @@ include ../libtools.make | |||
34 | # explicit dependencies on dualboot.{c,h} and mkimxboot.h | 43 | # explicit dependencies on dualboot.{c,h} and mkimxboot.h |
35 | $(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h | 44 | $(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h |
36 | $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h | 45 | $(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h |
37 | |||
diff --git a/rbutil/mknwzboot/Makefile b/rbutil/mknwzboot/Makefile index fd80106b83..3cbb2ef9dd 100644 --- a/rbutil/mknwzboot/Makefile +++ b/rbutil/mknwzboot/Makefile | |||
@@ -12,7 +12,21 @@ CFLAGS += -I$(UPGTOOLS_DIR) -Wall | |||
12 | CFLAGS += -std=gnu99 -g -O3 | 12 | CFLAGS += -std=gnu99 -g -O3 |
13 | # dependencies | 13 | # dependencies |
14 | # FIXME make it work for windows and maybe embed crypto++ | 14 | # FIXME make it work for windows and maybe embed crypto++ |
15 | LDOPTS += `pkg-config --libs libcrypto++` | 15 | |
16 | # Location to pkg-config binary. | ||
17 | PKGCONFIG := pkg-config | ||
18 | |||
19 | # Distros could use different names for the crypto library. We try a list | ||
20 | # of candidate names, only one of them should be the valid one. | ||
21 | LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++ | ||
22 | |||
23 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
24 | $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) | ||
25 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
26 | $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
27 | $(foreach l,$(LIBCRYPTO_NAMES),\ | ||
28 | $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l)))) | ||
29 | LDOPTS += -lpthread | ||
16 | 30 | ||
17 | OUTPUT = mknwzboot | 31 | OUTPUT = mknwzboot |
18 | 32 | ||
@@ -23,7 +37,7 @@ LIBSOURCES := mknwzboot.c install_script.c uninstall_script.c \ | |||
23 | # inputs for binary only | 37 | # inputs for binary only |
24 | SOURCES := $(LIBSOURCES) main.c | 38 | SOURCES := $(LIBSOURCES) main.c |
25 | # dependencies for binary | 39 | # dependencies for binary |
26 | EXTRADEPS := | 40 | EXTRADEPS := |
27 | 41 | ||
28 | include ../libtools.make | 42 | include ../libtools.make |
29 | 43 | ||
diff --git a/rbutil/rbutilqt/rbutilqt.pro b/rbutil/rbutilqt/rbutilqt.pro index 0b1f5fde54..745d9887b5 100644 --- a/rbutil/rbutilqt/rbutilqt.pro +++ b/rbutil/rbutilqt/rbutilqt.pro | |||
@@ -135,6 +135,9 @@ for(rblib, RBLIBS) { | |||
135 | LIBS += -l$$rblib | 135 | LIBS += -l$$rblib |
136 | } | 136 | } |
137 | 137 | ||
138 | # We need libcrypto++ | ||
139 | LIBS += -lcryptopp | ||
140 | |||
138 | # on win32 libz is linked implicitly. | 141 | # on win32 libz is linked implicitly. |
139 | !win32 { | 142 | !win32 { |
140 | LIBS += -lz | 143 | LIBS += -lz |
@@ -264,4 +267,3 @@ unix { | |||
264 | include(rbutilqt.pri) | 267 | include(rbutilqt.pri) |
265 | include(quazip/quazip.pri) | 268 | include(quazip/quazip.pri) |
266 | include(logger/logger.pri) | 269 | include(logger/logger.pri) |
267 | |||
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 | |||
3 | CXX=g++ | 3 | CXX=g++ |
4 | LD=g++ | 4 | LD=g++ |
5 | PROFILE= | 5 | PROFILE= |
6 | CFLAGS=-g $(PROFILE) -std=c99 -Wall $(DEFINES) `pkg-config --cflags libcrypto++` | 6 | PKGCONFIG := $(CROSS)pkg-config |
7 | CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES) `pkg-config --cflags libcrypto++` | 7 | |
8 | LDFLAGS=$(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. | ||
10 | LIBCRYPTO_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 | |||
19 | CXXFLAGS=-g $(PROFILE) -Wall $(DEFINES) | ||
20 | CFLAGS=-g $(PROFILE) -Wall -std=c99 $(DEFINES) | ||
21 | LDFLAGS=$(PROFILE) $(LDOPTS) -lpthread | ||
22 | |||
9 | BINS=upgtool | 23 | BINS=upgtool |
10 | 24 | ||
11 | all: $(BINS) | 25 | all: $(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 | ||
26 | using namespace CryptoPP::Weak; | 27 | using namespace CryptoPP::Weak; |
27 | 28 | ||
28 | void MD5_CalculateDigest(void *digest, const void *input, size_t length) | 29 | void 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 | ||
28 | using namespace CryptoPP; | 28 | using namespace CryptoPP; |