These Project Generate a Single Unit Compilation for BearrSSL allowing you build projects with a single gcc main.c compilation
item | What Is |
---|---|
BearSSLSingleUnit.zip | Full Folder Mode |
BearSSLSingleUnitOne.c | Single File Version |
BearSSLSingleUnit.h | Declaration |
BearSSLSingleUnit.c | Definition |
Its The final version of the project as a zip file , to use just extract the zip file and compile with
#include "BearSSLSingleUnit/one.c"
Its the same as the zip file , but amalgamated in one single file, you can include with
#include "BearSSLone.c"
its the "C style" Version, designed if you want to use in more than one compilation unity for use, in your C code
#include "release/BearSSL.h"
``
and compile with
```shell
gcc -c BearSSLSingleUnit.c -o BearSSL.o
gcc main.c BearSSL.o
- a lot of functions and structures were renamed to avoid namespaces conflicts you can check in patchs dir
- some cast were added to make code valid in C++ and C
- The flag BR_ENABLE_INTRINSICS its set to 1 by default to allow single unit compilation
just for testing , you have in micro_client_sample a micro https client example, put the BearSSLSingleUnitOne.c in the same folder and you can compile with:
gcc micro_client_sample/main.c -o client.o
and you can test with
./client.o example.com 443
Note that these example was taken from the original BearrSSL samples page and the BearSSLTrustedAnchors.h was taken from the oficial arduino Github Organization
if you want to build the hole project from scracth you must have diff,patch and Darwin on version 0.016 clone the repon and type:
darwin run_blueprint --mode folder build/ update_bear create_patch build generate_release
the build code its located in build and uses Darwin on blueprint mode to build the project