2
0

mkmbedtls 730 B

123456789101112131415161718192021222324252627
  1. #!/bin/sh
  2. while getopts s:i:t:n:a: option
  3. do
  4. case "${option}"
  5. in
  6. s) SRC_DIR=${OPTARG};;
  7. i) INSTALL_DIR=${OPTARG};;
  8. t) ARCH_ABI=${OPTARG};;
  9. n) NDK_ROOT=${OPTARG};;
  10. a) API_LEVEL=${OPTARG};;
  11. *) twentytwo=${OPTARG};;
  12. esac
  13. done
  14. BUILD_DIR=/tmp/mbedtls_android_build
  15. rm -rf $BUILD_DIR
  16. mkdir $BUILD_DIR
  17. cd $BUILD_DIR
  18. cmake -DENABLE_TESTING=Off -DUSE_SHARED_MBEDTLS_LIBRARY=On \
  19. -DCMAKE_PREFIX_PATH=$INSTALL_DIR -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR -DCMAKE_ANDROID_NDK=$NDK_ROOT \
  20. -DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=$API_LEVEL -DCMAKE_ANDROID_ARCH_ABI=$ARCH_ABI \
  21. -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--build-id" \
  22. -DCMAKE_BUILD_TYPE=RelWithDebInfo $SRC_DIR
  23. cmake --build .
  24. cmake --install .