wolfssl-arduino.sh 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # this script will reformat the wolfSSL source code to be compatible with
  3. # an Arduino project
  4. # run as bash ./wolfssl-arduino.sh
  5. DIR=${PWD##*/}
  6. if [ "$DIR" = "ARDUINO" ]; then
  7. rm -rf wolfSSL
  8. mkdir wolfSSL
  9. cp ../../src/*.c ./wolfSSL
  10. cp ../../wolfcrypt/src/*.c ./wolfSSL
  11. mkdir wolfSSL/wolfssl
  12. cp ../../wolfssl/*.h ./wolfSSL/wolfssl
  13. mkdir wolfSSL/wolfssl/wolfcrypt
  14. cp ../../wolfssl/wolfcrypt/*.h ./wolfSSL/wolfssl/wolfcrypt
  15. # support misc.c as include in wolfcrypt/src
  16. mkdir ./wolfSSL/wolfcrypt
  17. mkdir ./wolfSSL/wolfcrypt/src
  18. cp ../../wolfcrypt/src/misc.c ./wolfSSL/wolfcrypt/src
  19. # put bio and evp as includes
  20. mv ./wolfSSL/bio.c ./wolfSSL/wolfssl
  21. mv ./wolfSSL/evp.c ./wolfSSL/wolfssl
  22. echo "/* Generated wolfSSL header file for Arduino */" >> ./wolfSSL/wolfssl.h
  23. echo "#include <wolfssl/wolfcrypt/settings.h>" >> ./wolfSSL/wolfssl.h
  24. echo "#include <wolfssl/ssl.h>" >> ./wolfSSL/wolfssl.h
  25. else
  26. echo "ERROR: You must be in the IDE/ARDUINO directory to run this script"
  27. fi