docker_build_openssl.sh 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #!/bin/bash
  2. #
  3. # Copyright (c) Contributors to the Open 3D Engine Project.
  4. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  5. #
  6. # SPDX-License-Identifier: Apache-2.0 OR MIT
  7. #
  8. # Validate the bld path input
  9. BUILD_FOLDER=${DOCKER_BUILD_PATH}
  10. if [ "${BUILD_FOLDER}" == "" ]
  11. then
  12. echo "Missing required build target folder environment"
  13. exit 1
  14. elif [ "${BUILD_FOLDER}" == "temp" ]
  15. then
  16. echo "Build target folder environment cannot be 'temp'"
  17. exit 1
  18. fi
  19. # Copy the source folder from the read-only $WORKSPACE/temp/src to $WORKSPACE/src
  20. # since the build process will write/modify the source path
  21. echo "Preparing source folder '$WORKSPACE/src'"
  22. cp -r $WORKSPACE/temp/src $WORKSPACE/
  23. if [ $? -ne 0 ]
  24. then
  25. echo "Error copying src from $WORKSPACE/tempo"
  26. exit 1
  27. fi
  28. cd $WORKSPACE/src
  29. echo "Configuring OpenSSL"
  30. CMD="./config no-shared no-asm --prefix=${BUILD_FOLDER} --openssldir=/etc/ssl LDFLAGS='-Wl,-rpath=\$$ORIGIN'"
  31. echo $CMD
  32. eval $CMD
  33. if [ $? -ne 0 ]
  34. then
  35. echo "Error configuring OpenSSL"
  36. exit 1
  37. fi
  38. echo "Building OpenSSL"
  39. CMD="make"
  40. echo $CMD
  41. eval $CMD
  42. if [ $? -ne 0 ]
  43. then
  44. echo "Error building OpenSSL"
  45. exit 1
  46. fi
  47. echo "Running OpenSSL tests"
  48. CMD="make test"
  49. echo $CMD
  50. eval $CMD
  51. if [ $? -ne 0 ]
  52. then
  53. echo "OpenSSL failed tests"
  54. exit 1
  55. fi
  56. echo "Installing OpenSSL to ${BUILD_FOLDER}"
  57. CMD="make install"
  58. echo $CMD
  59. eval $CMD
  60. if [ $? -ne 0 ]
  61. then
  62. echo "OpenSSL failed to install"
  63. exit 1
  64. fi
  65. echo "Build complete. Build artifacts installed to ${BUILD_FOLDER}"
  66. exit 0