mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
Add a build directory for libbearssl.a (#4736)
Simple git submodule and makefile for building the bearssl library from source in the Arduino tree.
This commit is contained in:
parent
529baabef8
commit
5a033835e1
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -1,3 +1,6 @@
|
|||||||
[submodule "lwip2"]
|
[submodule "lwip2"]
|
||||||
path = tools/sdk/lwip2/builder
|
path = tools/sdk/lwip2/builder
|
||||||
url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git
|
url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git
|
||||||
|
[submodule "tools/sdk/ssl/bearssl"]
|
||||||
|
path = tools/sdk/ssl/bearssl
|
||||||
|
url = https://github.com/earlephilhower/bearssl-esp8266
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include <core_version.h>
|
#include <core_version.h>
|
||||||
#include <lwip/init.h> // LWIP_VERSION_*
|
#include <lwip/init.h> // LWIP_VERSION_*
|
||||||
#include <lwipopts.h> // LWIP_HASH_STR (lwip2)
|
#include <lwipopts.h> // LWIP_HASH_STR (lwip2)
|
||||||
|
#include <bearssl/bearssl_git.h> // BEARSSL_GIT short hash
|
||||||
|
|
||||||
#define STRHELPER(x) #x
|
#define STRHELPER(x) #x
|
||||||
#define STR(x) STRHELPER(x) // stringifier
|
#define STR(x) STRHELPER(x) // stringifier
|
||||||
@ -31,6 +32,7 @@ static const char arduino_esp8266_git_ver [] PROGMEM = STR(ARDUINO_ESP8266_GIT_D
|
|||||||
#if LWIP_VERSION_MAJOR != 1
|
#if LWIP_VERSION_MAJOR != 1
|
||||||
static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION);
|
static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION);
|
||||||
#endif
|
#endif
|
||||||
|
static const char bearssl_version [] PROGMEM = "/BearSSL:" STR(BEARSSL_GIT);
|
||||||
|
|
||||||
String EspClass::getFullVersion()
|
String EspClass::getFullVersion()
|
||||||
{
|
{
|
||||||
@ -50,5 +52,6 @@ String EspClass::getFullVersion()
|
|||||||
#ifdef LWIP_HASH_STR
|
#ifdef LWIP_HASH_STR
|
||||||
+ "(" + F(LWIP_HASH_STR) + ")"
|
+ "(" + F(LWIP_HASH_STR) + ")"
|
||||||
#endif
|
#endif
|
||||||
|
+ FPSTR(bearssl_version)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
2
tools/sdk/include/bearssl/bearssl_git.h
Normal file
2
tools/sdk/include/bearssl/bearssl_git.h
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile
|
||||||
|
#define BEARSSL_GIT 94e9704
|
Binary file not shown.
22
tools/sdk/ssl/Makefile
Normal file
22
tools/sdk/ssl/Makefile
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
|
VER_H=../include/bearssl/bearssl_git.h
|
||||||
|
|
||||||
|
all T0 clean: bearssl/README.txt
|
||||||
|
PATH=$(PATH):$(PWD)/../../xtensa-lx106-elf/bin/ && cd bearssl && make CONF=esp8266 $@
|
||||||
|
|
||||||
|
install: all version-header
|
||||||
|
cp bearssl/esp8266/libbearssl.a ../lib/.
|
||||||
|
cp bearssl/inc/bearssl*.h ../include/bearssl/.
|
||||||
|
|
||||||
|
bearssl/README.txt:
|
||||||
|
git submodule update --init --recursive bearssl
|
||||||
|
cd bearssl && git remote add bearssl https://www.bearssl.org/git/BearSSL
|
||||||
|
|
||||||
|
merge-upstream:
|
||||||
|
cd bearssl && git pull bearssl master
|
||||||
|
|
||||||
|
version-header:
|
||||||
|
echo "// Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile" > $(VER_H)
|
||||||
|
echo -n "#define BEARSSL_GIT " >> $(VER_H)
|
||||||
|
cd bearssl && git rev-parse --short HEAD >> ../$(VER_H)
|
45
tools/sdk/ssl/README.md
Normal file
45
tools/sdk/ssl/README.md
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# BearSSL ESP8266 builder
|
||||||
|
|
||||||
|
This directory contains the git submodule for the ESP8266 ported bearssl low-level library, a port of [BearSSL](https://www.bearssl.org)
|
||||||
|
|
||||||
|
If you are only working on the `BearSSL::` namespace functions in the
|
||||||
|
Arduino `ESP8266WiFi` library (`BearSSL::WiFiClientSecure`,
|
||||||
|
`BearSSL::WiFiServerSecure`, etc.) you do _NOT_ need to work in this
|
||||||
|
directory.
|
||||||
|
|
||||||
|
Normal users can simply use the libbearssl.a file already included in
|
||||||
|
the `Arduino` repo. Experienced users looking to work on the underlying
|
||||||
|
BearSSL-ESP8266 ported library can use this directory to automate the
|
||||||
|
build flow.
|
||||||
|
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
The tools directory needs to be populated (i.e. Arduino IDE should be able
|
||||||
|
to compile an executable probect. `get.py` should ensure this).
|
||||||
|
|
||||||
|
### UNIX-like system (Linux, Mac):
|
||||||
|
If you need to change the *.t0 (Forth-like language) you will need a
|
||||||
|
.NET-compatible runtime (such as `mono` under Linux) to rebuild the
|
||||||
|
resulant `.c` files.
|
||||||
|
|
||||||
|
### For Windows (untested)
|
||||||
|
Microsoft's .NET runtime must be installed to run the `.t0`->`.c` workflow.
|
||||||
|
|
||||||
|
|
||||||
|
## Building
|
||||||
|
* `make all`: Init the submodule, if needed, then build _but do not install_ the library
|
||||||
|
* `make install`: Init the submodule, if needed, then build and copy the library to the standard location in `tools/sdk/lib`
|
||||||
|
|
||||||
|
## Editing the library
|
||||||
|
`https://github.com/earlephilhower/bearssl-esp8266` is the current repository
|
||||||
|
for this library. A `git remote` to the original BearSSL sources from
|
||||||
|
`https://bearssl.org/git/BearSSL` is added on submodule init. You can either
|
||||||
|
manually do pulls, or `make merge-upstream` to bring in any BearSSL upstream
|
||||||
|
changes.
|
||||||
|
|
||||||
|
Documentation in the library README-esp8266 and git log describes the changes done.
|
||||||
|
|
||||||
|
|
||||||
|
Feel free to drop me a line at <earlephilhower@yahoo.com> if you have questions.
|
||||||
|
|
||||||
|
-Earle F. Philhower, III
|
1
tools/sdk/ssl/bearssl
Submodule
1
tools/sdk/ssl/bearssl
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 94e97043bbdebed43ecd9372bd7fd21d45bd789f
|
Loading…
x
Reference in New Issue
Block a user