summaryrefslogtreecommitdiff
path: root/rbutil/mkimxboot
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2020-08-08 18:46:43 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2020-10-18 19:08:32 +0200
commit2037b837f81485770fcb066adea70b1d22e9b727 (patch)
tree41d15b95f38843dfe5fb45327c25d3a116731b05 /rbutil/mkimxboot
parent815b289cb3438ed566b3e9dc5074fe12e4b98f46 (diff)
downloadrockbox-2037b837f81485770fcb066adea70b1d22e9b727.tar.gz
rockbox-2037b837f81485770fcb066adea70b1d22e9b727.zip
sbtools: convert crypto to libtomcrypt.
Replace the use of crypto++ with tomcrypt, which is much smaller and C. This gets rid of various build issues for systems that don't ship crypo++ (i.e. everything except Linux.) Change-Id: Ic0799e17b94935c71b14765cf9a2a7ea2b0adc7a
Diffstat (limited to 'rbutil/mkimxboot')
-rw-r--r--rbutil/mkimxboot/Makefile33
1 files changed, 18 insertions, 15 deletions
diff --git a/rbutil/mkimxboot/Makefile b/rbutil/mkimxboot/Makefile
index 9ad21a1966..d2c487c475 100644
--- a/rbutil/mkimxboot/Makefile
+++ b/rbutil/mkimxboot/Makefile
@@ -8,24 +8,18 @@
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
10IMXTOOLS_DIR=../../utils/imxtools/sbtools/ 10IMXTOOLS_DIR=../../utils/imxtools/sbtools/
11CFLAGS += -I$(IMXTOOLS_DIR) -Wall
12# std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE)
13CFLAGS += -std=gnu99 -g -O3
14 11
15# Location to pkg-config binary. 12COMPILEFLAGS := -Wall -g -O3 -I$(IMXTOOLS_DIR)
16PKGCONFIG := pkg-config 13
14# std=gnu99 is required by MinGW on Windows (c99 is sufficient for Linux / MXE)
15CFLAGS += -std=gnu99 $(COMPILEFLAGS)
16CXXFLAGS += $(COMPILEFLAGS)
17 17
18# Distros could use different names for the crypto library. We try a list 18TOMCRYPT_DIR := ../../utils/tomcrypt
19# of candidate names, only one of them should be the valid one.
20LIBCRYPTO_NAMES = libcryptopp libcrypto++ cryptopp crypto++
21 19
22$(foreach l,$(LIBCRYPTO_NAMES),\ 20CXXFLAGS += -I$(TOMCRYPT_DIR)/src/headers
23 $(eval LDOPTS += $(shell $(PKGCONFIG) --silence-errors --libs $(l)))) 21CFLAGS += -I$(TOMCRYPT_DIR)/src/headers
24$(foreach l,$(LIBCRYPTO_NAMES),\ 22LDOPTS += -lpthread $(TOMCRYPT_DIR)/librbtomcrypt.a
25 $(eval CFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
26$(foreach l,$(LIBCRYPTO_NAMES),\
27 $(eval CXXFLAGS += $(shell $(PKGCONFIG) --silence-errors --cflags $(l))))
28LDOPTS += -lpthread
29 23
30OUTPUT = mkimxboot 24OUTPUT = mkimxboot
31 25
@@ -33,6 +27,10 @@ OUTPUT = mkimxboot
33IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c 27IMXTOOLS_SOURCES = misc.c sb.c crypto.cpp crc.c elf.c
34LIBSOURCES := dualboot.c mkimxboot.c md5.c \ 28LIBSOURCES := dualboot.c mkimxboot.c md5.c \
35 $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES)) 29 $(addprefix $(IMXTOOLS_DIR),$(IMXTOOLS_SOURCES))
30
31# for now build tomcrypt as part of the lib.
32LIBSOURCES += $(addprefix $(TOMCRYPT_DIR),$(TOMCRYPT_SOURCES))
33
36# inputs for binary only 34# inputs for binary only
37SOURCES := $(LIBSOURCES) main.c 35SOURCES := $(LIBSOURCES) main.c
38# dependencies for binary 36# dependencies for binary
@@ -43,3 +41,8 @@ include ../libtools.make
43# explicit dependencies on dualboot.{c,h} and mkimxboot.h 41# explicit dependencies on dualboot.{c,h} and mkimxboot.h
44$(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h 42$(OBJDIR)mkimxboot.o: dualboot.h dualboot.c mkimxboot.c mkimxboot.h
45$(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h 43$(OBJDIR)main.o: dualboot.h dualboot.c main.c mkimxboot.h
44$(BINARY): librbtomcrypt.a
45
46librbtomcrypt.a:
47 $(MAKE) -C ../../utils/tomcrypt
48