python-cryptography: bump to version 1.7.2
[buildroot-gz.git] / package / tinydtls / 0001-Update-Makefile.in-to-allow-cross-compilation.patch
blob5e91f2ee5d8e6e478c8a69c92b76ca285555ed98
1 From a6f312dfb4497d5e72664c4772a8b122e25b81d8 Mon Sep 17 00:00:00 2001
2 From: Fabrice Fontaine <fabrice.fontaine@orange.com>
3 Date: Tue, 26 Jul 2016 09:09:53 +0200
4 Subject: [PATCH] Update Makefile.in to allow cross-compilation
6 Use CC, CPP and DESTDIR environment variables passed to configure in Makefile.in files
7 Fix definition of LIBS and LDFLAGS (LDFLAGS was set to @LIBS@)
9 Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
10 ---
11 Makefile.in | 13 ++++++++-----
12 aes/Makefile.in | 7 +++++--
13 doc/Makefile.in | 4 ++--
14 ecc/Makefile.in | 7 +++++--
15 sha2/Makefile.in | 7 +++++--
16 tests/Makefile.in | 4 +++-
17 6 files changed, 28 insertions(+), 14 deletions(-)
19 diff --git a/Makefile.in b/Makefile.in
20 index 38cc665..7dcd424 100644
21 --- a/Makefile.in
22 +++ b/Makefile.in
23 @@ -40,7 +40,9 @@ OBJECTS:= $(patsubst %.c, %.o, $(SOURCES)) $(SUB_OBJECTS)
24 HEADERS:=dtls.h hmac.h dtls_debug.h dtls_config.h uthash.h numeric.h crypto.h global.h ccm.h \
25 netq.h alert.h utlist.h prng.h peer.h state.h dtls_time.h session.h \
26 tinydtls.h
27 +CC:=@CC@
28 CFLAGS:=-Wall -pedantic -std=c99 @CFLAGS@
29 +CPP:=@CPP@
30 CPPFLAGS:=@CPPFLAGS@ -DDTLS_CHECK_CONTENTTYPE
31 SUBDIRS:=tests doc platform-specific sha2 aes ecc
32 DISTSUBDIRS:=$(SUBDIRS)
33 @@ -48,7 +50,8 @@ DISTDIR=$(top_builddir)/$(package)
34 FILES:=Makefile.in configure configure.in dtls_config.h.in tinydtls.h.in \
35 Makefile.tinydtls $(SOURCES) $(HEADERS)
36 LIB:=libtinydtls.a
37 -LDFLAGS:=@LIBS@
38 +LDFLAGS:=@LDFLAGS@
39 +LIBS:=@LIBS@
40 ARFLAGS:=cru
41 doc:=doc
43 @@ -100,10 +103,10 @@ dist: $(FILES) $(DISTSUBDIRS)
44 tar czf $(package).tar.gz $(DISTDIR)
46 install: $(LIB) $(HEADERS) $(SUBDIRS)
47 - test -d $(libdir) || mkdir -p $(libdir)
48 - test -d $(includedir) || mkdir -p $(includedir)
49 - $(install) $(LIB) $(libdir)/
50 - $(install) $(HEADERS) $(includedir)/
51 + test -d $(DESTDIR)$(libdir) || mkdir -p $(DESTDIR)$(libdir)
52 + test -d $(DESTDIR)$(includedir) || mkdir -p $(DESTDIR)$(includedir)
53 + $(install) $(LIB) $(DESTDIR)$(libdir)/
54 + $(install) $(HEADERS) $(DESTDIR)$(includedir)/
55 for dir in $(SUBDIRS); do \
56 $(MAKE) -C $$dir install="$(install)" includedir=$(includedir) install; \
57 done
58 diff --git a/aes/Makefile.in b/aes/Makefile.in
59 index 7c9f6ef..9ff7799 100644
60 --- a/aes/Makefile.in
61 +++ b/aes/Makefile.in
62 @@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@
63 SOURCES:= rijndael.c
64 HEADERS:= rijndael.h
65 OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
66 +CPP=@CPP@
67 CPPFLAGS=@CPPFLAGS@
68 +CC=@CC@
69 CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@
70 +LDFLAGS=@LDFLAGS@
71 LDLIBS=@LIBS@
72 FILES:=Makefile.in $(SOURCES) $(HEADERS)
73 DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
74 @@ -60,8 +63,8 @@ dist: $(FILES)
75 cp -p $(FILES) $(DISTDIR)/aes
77 install: $(HEADERS)
78 - test -d $(includedir)/aes || mkdir -p $(includedir)/aes
79 - $(install) $(HEADERS) $(includedir)/aes
80 + test -d $(DESTDIR)$(includedir)/aes || mkdir -p $(DESTDIR)$(includedir)/aes
81 + $(install) $(HEADERS) $(DESTDIR)$(includedir)/aes
83 .gitignore:
84 echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@
85 diff --git a/doc/Makefile.in b/doc/Makefile.in
86 index a07101e..5ab0a35 100644
87 --- a/doc/Makefile.in
88 +++ b/doc/Makefile.in
89 @@ -32,5 +32,5 @@ dist: doc
90 cp -r $(FILES) $(DISTDIR)/doc
92 install: $(doc) html
93 - test -d $(htmldir) || mkdir -p $(htmldir)
94 - cp -r html/* $(htmldir)
95 + test -d $(DESTDIR)$(htmldir) || mkdir -p $(DESTDIR)$(htmldir)
96 + cp -r html/* $(DESTDIR)$(htmldir)
97 diff --git a/ecc/Makefile.in b/ecc/Makefile.in
98 index 2ba17a1..2086d4f 100644
99 --- a/ecc/Makefile.in
100 +++ b/ecc/Makefile.in
101 @@ -36,8 +36,11 @@ include Makefile.contiki
102 else
103 ECC_OBJECTS:= $(patsubst %.c, %.o, $(ECC_SOURCES)) ecc_test.o
104 PROGRAMS:= testecc testfield
105 +CPP=@CPP@
106 CPPFLAGS=@CPPFLAGS@
107 +CC=@CC@
108 CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@ -DTEST_INCLUDE
109 +LDFLAGS=@LDFLAGS@
110 LDLIBS=@LIBS@
112 .PHONY: all dirs clean install distclean .gitignore doc
113 @@ -74,8 +77,8 @@ dist: $(FILES)
114 cp -p $(FILES) $(DISTDIR)/ecc
116 install: $(HEADERS)
117 - test -d $(includedir)/ecc || mkdir -p $(includedir)/ecc
118 - $(install) $(HEADERS) $(includedir)/ecc
119 + test -d $(DESTDIR)$(includedir)/ecc || mkdir -p $(DESTDIR)$(includedir)/ecc
120 + $(install) $(ECC_HEADERS) $(DESTDIR)$(includedir)/ecc
122 .gitignore:
123 echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@
124 diff --git a/sha2/Makefile.in b/sha2/Makefile.in
125 index 9f19314..69f8793 100644
126 --- a/sha2/Makefile.in
127 +++ b/sha2/Makefile.in
128 @@ -28,8 +28,11 @@ top_srcdir:= @top_srcdir@
129 SOURCES:= sha2.c
130 HEADERS:=sha2.h
131 OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
132 +CPP=@CPP@
133 CPPFLAGS=@CPPFLAGS@ -I$(top_srcdir)
134 +CC=@CC@
135 CFLAGS=-Wall -std=c99 -pedantic @CFLAGS@
136 +LDFLAGS=@LDFLAGS@
137 LDLIBS=@LIBS@
138 FILES:=Makefile.in $(SOURCES) $(HEADERS) README sha2prog.c sha2speed.c sha2test.pl
139 DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
140 @@ -62,8 +65,8 @@ dist: $(FILES)
141 cp -pr testvectors $(DISTDIR)/sha2/testvectors
143 install: $(HEADERS)
144 - test -d $(includedir)/sha2 || mkdir -p $(includedir)/sha2
145 - $(install) $(HEADERS) $(includedir)/sha2
146 + test -d $(DESTDIR)$(includedir)/sha2 || mkdir -p $(DESTDIR)$(includedir)/sha2
147 + $(install) $(HEADERS) $(DESTDIR)$(includedir)/sha2
149 .gitignore:
150 echo "core\n*~\n*.[oa]\n*.gz\n*.cap\n$(PROGRAM)\n$(DISTDIR)\n.gitignore" >$@
151 diff --git a/tests/Makefile.in b/tests/Makefile.in
152 index a8a2ed0..b45f440 100644
153 --- a/tests/Makefile.in
154 +++ b/tests/Makefile.in
155 @@ -32,9 +32,11 @@ SOURCES:= dtls-server.c ccm-test.c prf-test.c \
156 OBJECTS:= $(patsubst %.c, %.o, $(SOURCES))
157 PROGRAMS:= $(patsubst %.c, %, $(SOURCES))
158 HEADERS:=
159 +CC:=@CC@
160 CFLAGS:=-Wall @CFLAGS@
161 +CPP:=@CPP@
162 CPPFLAGS:=-I$(top_srcdir) @CPPFLAGS@
163 -LDFLAGS:=-L$(top_builddir)
164 +LDFLAGS:=-L$(top_builddir) @LDFLAGS@
165 LDLIBS:=-ltinydtls @LIBS@
166 DISTDIR=$(top_builddir)/@PACKAGE_TARNAME@-@PACKAGE_VERSION@
167 FILES:=Makefile.in $(SOURCES) ccm-testdata.c #cbc_aes128-testdata.c
169 2.7.4