Browse Source

Update AWSNativeSDK scripts to support building based on OpenSSL1 and 3 (#126)

Signed-off-by: Steve Pham <[email protected]>
Steve Pham 3 năm trước cách đây
mục cha
commit
5165bfa399

+ 97 - 0
package-system/AWSNativeSDK/AWSNativeSDK-1.9.50-linux-openssl3.patch

@@ -0,0 +1,97 @@
+diff --git a/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp b/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
+index 3855dda43e..87c75f2db1 100644
+--- a/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
++++ b/aws-cpp-sdk-core/source/utils/crypto/openssl/CryptoImpl.cpp
+@@ -51,6 +51,11 @@ namespace Aws
+ #define OPENSSL_VERSION_NUMBER 0x1000107fL
+ #endif
+ #define OPENSSL_VERSION_LESS_1_1 (OPENSSL_VERSION_NUMBER < 0x10100003L)
++#define OPENSSL_VERSION_LESS_3_0 (OPENSSL_VERSION_NUMBER < 0x30000000L)
++
++#if !OPENSSL_VERSION_LESS_3_0
++#include <openssl/core_names.h>
++#endif
+ 
+ #if OPENSSL_VERSION_LESS_1_1
+                 static const char* OPENSSL_INTERNALS_TAG = "OpenSSLCallbackState";
+@@ -412,8 +417,11 @@ namespace Aws
+                 HMACRAIIGuard() {
+ #if OPENSSL_VERSION_LESS_1_1
+                     m_ctx = Aws::New<HMAC_CTX>("AllocSha256HAMCOpenSSLContext");
+-#else
++#elif OPENSSL_VERSION_LESS_3_0
+                     m_ctx = HMAC_CTX_new();
++#else
++                    mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
++                    m_ctx = EVP_MAC_CTX_new(mac);
+ #endif
+                     assert(m_ctx != nullptr);
+                 }
+@@ -421,17 +429,28 @@ namespace Aws
+                 ~HMACRAIIGuard() {
+ #if OPENSSL_VERSION_LESS_1_1
+                     Aws::Delete<HMAC_CTX>(m_ctx);
+-#else
++#elif OPENSSL_VERSION_LESS_3_0
+                     HMAC_CTX_free(m_ctx);
++#else
++                    EVP_MAC_CTX_free(m_ctx);
+ #endif
+                     m_ctx = nullptr;
+                 }
+ 
++#if OPENSSL_VERSION_LESS_3_0
+                 HMAC_CTX* getResource() {
++#else
++                EVP_MAC_CTX* getResource() {
++#endif
+                     return m_ctx;
+                 }
+             private:
++#if OPENSSL_VERSION_LESS_3_0
+                 HMAC_CTX *m_ctx;
++#else
++                EVP_MAC *mac;
++                EVP_MAC_CTX *m_ctx;
++#endif
+             };
+ 
+             HashResult Sha256HMACOpenSSLImpl::Calculate(const ByteBuffer& toSign, const ByteBuffer& secret)
+@@ -441,20 +460,36 @@ namespace Aws
+                 memset(digest.GetUnderlyingData(), 0, length);
+ 
+                 HMACRAIIGuard guard;
++#if OPENSSL_VERSION_LESS_3_0
+                 HMAC_CTX* m_ctx = guard.getResource();
++#else
++                EVP_MAC_CTX* m_ctx = guard.getResource();
++#endif
+ 
+ #if OPENSSL_VERSION_LESS_1_1
+                 HMAC_CTX_init(m_ctx);
+ #endif
+ 
++#if OPENSSL_VERSION_LESS_3_0
+                 HMAC_Init_ex(m_ctx, secret.GetUnderlyingData(), static_cast<int>(secret.GetLength()), EVP_sha256(),
+                              NULL);
+                 HMAC_Update(m_ctx, toSign.GetUnderlyingData(), toSign.GetLength());
+                 HMAC_Final(m_ctx, digest.GetUnderlyingData(), &length);
++#else
++                char sha256[] {"SHA256"};
++                OSSL_PARAM ossl_params[2];
++                ossl_params[0] =
++                  OSSL_PARAM_construct_utf8_string(OSSL_MAC_PARAM_DIGEST, sha256, 0);
++                ossl_params[1] = OSSL_PARAM_construct_end();
++                EVP_MAC_init(m_ctx, secret.GetUnderlyingData(),
++                             static_cast<int>(secret.GetLength()), ossl_params);
++                EVP_MAC_update(m_ctx, toSign.GetUnderlyingData(), toSign.GetLength());
++                EVP_MAC_final(m_ctx, digest.GetUnderlyingData(), NULL, length);
++#endif
+ 
+ #if OPENSSL_VERSION_LESS_1_1
+                 HMAC_CTX_cleanup(m_ctx);
+-#else
++#elif OPENSSL_VERSION_LESS_3_0
+                 HMAC_CTX_reset(m_ctx);
+ #endif
+                 return HashResult(std::move(digest));

+ 48 - 0
package-system/AWSNativeSDK/Dockerfile.ubuntu.2004

@@ -0,0 +1,48 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# This docker file uses ubuntu 20.04 as the base image so that the AWS Native C++ libraries will use OpenSSL 3 as the base
+# for its dependencies
+#
+
+FROM public.ecr.aws/ubuntu/ubuntu:20.04_stable
+ 
+WORKDIR /data/workspace
+
+# Initilize apt cache
+RUN apt-get clean && apt-get update
+
+# Setup time zone and locale data (necessary for SSL and HTTPS packages)
+RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
+
+RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
+    dpkg-reconfigure --frontend=noninteractive locales && \
+    update-locale LANG=en_US.UTF-8
+
+ENV LANG=en_US.UTF-8
+
+# Install the development packages needed to build AWS Native C++ SDK
+RUN apt-get install -y cmake clang-12 ninja-build
+RUN apt-get install -y libssl-dev
+RUN apt-get install -y libssh-dev
+RUN apt-get install -y zlib1g-dev
+RUN apt-get install -y libcurl4-openssl-dev
+
+# Prevent the copying of the src folder from being cached
+ARG CACHEBUST=1
+
+RUN cd /data/workspace && \
+    mkdir src
+
+# Copy the git synced source from the context base to this container
+COPY src  /data/workspace/src/
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY docker_build_aws_sdk.sh /data/workspace/
+
+
+

+ 48 - 0
package-system/AWSNativeSDK/Dockerfile.ubuntu.2204

@@ -0,0 +1,48 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# This docker file uses ubuntu 22.04 as the base image so that the AWS Native C++ libraries will use OpenSSL 3 as the base
+# for its dependencies
+#
+
+FROM public.ecr.aws/ubuntu/ubuntu:22.04_stable
+ 
+WORKDIR /data/workspace
+
+# Initilize apt cache
+RUN apt-get clean && apt-get update
+
+# Setup time zone and locale data (necessary for SSL and HTTPS packages)
+RUN DEBIAN_FRONTEND="noninteractive" apt-get -y install tzdata locales keyboard-configuration
+
+RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
+    dpkg-reconfigure --frontend=noninteractive locales && \
+    update-locale LANG=en_US.UTF-8
+
+ENV LANG=en_US.UTF-8
+
+# Install the development packages needed to build AWS Native C++ SDK
+RUN apt-get install -y cmake clang-12 ninja-build
+RUN apt-get install -y libssl-dev
+RUN apt-get install -y libssh-dev
+RUN apt-get install -y zlib1g-dev
+RUN apt-get install -y libcurl4-openssl-dev
+
+# Prevent the copying of the src folder from being cached
+ARG CACHEBUST=1
+
+RUN cd /data/workspace && \
+    mkdir src
+
+# Copy the git synced source from the context base to this container
+COPY src  /data/workspace/src/
+
+# Copy the build script specific to this Docker script in order to execute the build
+COPY docker_build_aws_sdk.sh /data/workspace/
+
+
+

+ 74 - 56
package-system/AWSNativeSDK/build_AWSNativeSDK_linux.sh

@@ -6,72 +6,90 @@
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 # SPDX-License-Identifier: Apache-2.0 OR MIT
 #
 #
 
 
-if ! dpkg-query -W -f'${Status}' "zlib1g-dev" 2>/dev/null | grep -q "ok installed"
+# Read the Ubuntu and OpenSSL version from the command line
+UBUNTU_VERSION=$1
+OPENSSL_MAJOR_VERSION=$2
+
+if [ "$UBUNTU_VERSION" == "2004" ]
+then
+    echo "Preparing Docker Build based on Ubuntu 20.04 LTS"
+elif [ "$UBUNTU_VERSION" == "2204" ]
+then
+    echo "Preparing Docker Build based on Ubuntu 22.04 LTS"
+else
+    echo "Unsupported Ubuntu Version: $UBUNTU_VERSION"
+    exit 1
+fi
+
+if [ "$OPENSSL_MAJOR_VERSION" == "1" ]
 then
 then
-    echo "Required package zlib1g-dev is not installed"
+    echo "Build based on OpenSSL 1.1.1"
+elif [ "$OPENSSL_MAJOR_VERSION" == "3" ]
+then
+    echo "Build based on OpenSSL 3.0"
+else
+    echo "Unsupported OpenSSL Major Version: $OPENSSL_MAJOR_VERSION"
+    exit 1
+fi
+
+# Make sure docker is installed
+if ! dpkg-query -W -f'${Status}' "docker" 2>/dev/null | grep -q "ok installed"
+then
+    echo "Required package docker is not installed"
     exit 1 
     exit 1 
 fi
 fi
 
 
-if ! dpkg-query -W -f'${Status}' "libssl-dev" 2>/dev/null | grep -q "ok installed"
+# Prepare the docker file and use the temp folder as the context root
+cp Dockerfile.ubuntu.${UBUNTU_VERSION} temp/Dockerfile
+cp docker_build_aws_sdk.sh temp/
+
+
+pushd temp
+
+
+# Build the Docker Image
+echo "Building the docker build script"
+DOCKER_IMAGE_NAME=aws_native_sdk_ubuntu_${UBUNTU_VERSION}_openssl1
+docker build -t ${DOCKER_IMAGE_NAME}:latest . || (echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
 then
 then
-    echo "Required package libssl-dev is not installed"
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
     exit 1
     exit 1
 fi
 fi
 
 
-if ! dpkg-query -W -f'${Status}' "libcurl4-openssl-dev" 2>/dev/null | grep -q "ok installed"
+# Run the Docker Image
+echo "Running docker build script"
+docker run --tty ${DOCKER_IMAGE_NAME}:latest ./docker_build_aws_sdk.sh $OPENSSL_MAJOR_VERSION || (echo "Error occurred running Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
 then
 then
-    echo "Required package libcurl4-openssl-dev is not installed"
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
     exit 1
     exit 1
 fi
 fi
 
 
-src_path=temp/src
-bld_path=temp/build
-inst_path=temp/install
-
-echo "Command: rm -rf $inst_path"
-rm -rf $inst_path || (echo "Command: rm -rf $inst_path failed" ; exit 1)
-
-configure_and_build() {
-    build_type=$1
-    lib_type=$2
-    build_shared=OFF
-    if [ "$lib_type" == "Shared" ]
-    then
-        build_shared=ON
-    fi
-
-    echo "CMake Configure $build_type $lib_type"
-    CC=/usr/lib/llvm-12/bin/clang CXX=/usr/lib/llvm-12/bin/clang++ cmake -S "$src_path" -B "$bld_path/${build_type}_${lib_type}" \
-          -G "Unix Makefiles" \
-          -DTARGET_ARCH=LINUX \
-          -DCMAKE_CXX_STANDARD=17 \
-          -DCPP_STANDARD=17 \
-          -DCMAKE_C_FLAGS="-fPIC" \
-          -DCMAKE_CXX_FLAGS="-fPIC" \
-          -DENABLE_TESTING=OFF \
-          -DENABLE_RTTI=ON \
-          -DCUSTOM_MEMORY_MANAGEMENT=ON \
-          -DBUILD_ONLY="access-management;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;mobileanalytics;queues;s3;sns;sqs;sts;transfer" \
-          -DBUILD_SHARED_LIBS=$build_shared \
-          -DCMAKE_BUILD_TYPE=$build_type \
-          -DCMAKE_INSTALL_BINDIR="bin" \
-          -DCMAKE_INSTALL_LIBDIR="lib" || (echo "CMake Configure $build_type $lib_type failed" ; exit 1)
-
-    echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type}"
-    cmake --build "$bld_path/${build_type}_${lib_type}" --config $build_type -j 12 || (echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type} failed" ; exit 1)
-}
-
-# Debug Shared
-configure_and_build Debug Shared || exit 1
-
-# Debug Static
-configure_and_build Debug Static || exit 1
-
-# Release Shared
-configure_and_build Release Shared || exit 1
-
-# Release Static
-configure_and_build Release Static || exit 1
-
-echo "Custom Build for AWSNativeSDK finished successfully"
+# Copy the build artifacts from the Docker Container
+echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}"
+
+rm -rf install
+mkdir install
+
+docker cp $CONTAINER_ID:/data/workspace/install/Debug_Static install/ || (echo "Error occurred copying Debug_Static artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Debug_Shared install/ || (echo "Error occurred copying Debug_Shared artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Release_Static install/ || (echo "Error occurred copying Release_Static artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Release_Shared install/ || (echo "Error occurred copying Release_Shared artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+# Clean up the docker image and container
+echo "Cleaning up containers"
+docker container rm $CONTAINER_ID || (echo "Error occurred trying to clean up container for image ${DOCKER_IMAGE_NAME}")
+
+echo "Cleaning up image"
+docker rmi $IMAGE_ID  || (echo "Error occurred trying to clean up image ${DOCKER_IMAGE_NAME}")
+
+popd
+
 exit 0
 exit 0

+ 95 - 0
package-system/AWSNativeSDK/build_AWSNativeSDK_linux_OpenSSL3.sh

@@ -0,0 +1,95 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+# Read the Ubuntu and OpenSSL version from the command line
+UBUNTU_VERSION=$1
+OPENSSL_MAJOR_VERSION=$2
+
+if [ "$UBUNTU_VERSION" == "2004" ]
+then
+    echo "Preparing Docker Build based on Ubuntu 20.04 LTS"
+elif [ "$UBUNTU_VERSION" == "2204" ]
+then
+    echo "Preparing Docker Build based on Ubuntu 22.04 LTS"
+else
+    echo "Unsupported Ubuntu Version: $UBUNTU_VERSION"
+    exit 1
+endif 
+
+if [ "$OPENSSL_MAJOR_VERSION" == "1" ]
+then
+    echo "Build based on OpenSSL 1.1.1"
+elif [ "$OPENSSL_MAJOR_VERSION" == "3" ]
+then
+    echo "Build based on OpenSSL 3.0"
+else
+    echo "Unsupported OpenSSL Major Version: $OPENSSL_MAJOR_VERSION"
+    exit 1
+endif 
+
+# Make sure docker is installed
+if ! dpkg-query -W -f'${Status}' "docker" 2>/dev/null | grep -q "ok installed"
+then
+    echo "Required package docker is not installed"
+    exit 1 
+fi
+
+# Prepare the docker file and use the temp folder as the context root
+cp Dockerfile.ubuntu.${UBUNTU_VERSION} temp/Dockerfile
+cp docker_build_aws_sdk.sh temp/
+
+
+pushd temp
+
+
+# Build the Docker Image
+echo "Building the docker build script"
+DOCKER_IMAGE_NAME=aws_native_sdk_ubuntu_${UBUNTU_VERSION}_openssl1
+docker build -t ${DOCKER_IMAGE_NAME}:latest . || (echo "Error occurred creating Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+# Capture the Docker Image ID
+IMAGE_ID=$(docker images -q ${DOCKER_IMAGE_NAME}:latest)
+if [ -z $IMAGE_ID ]
+then
+    echo "Error: Cannot find Image ID for ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+# Run the Docker Image
+echo "Running docker build script"
+docker run --tty ${DOCKER_IMAGE_NAME}:latest ./docker_build_aws_sdk.sh $OPENSSL_MAJOR_VERSION || (echo "Error occurred running Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+echo "Capturing the Container ID"
+CONTAINER_ID=$(docker container ls -l -q --filter "ancestor=${DOCKER_IMAGE_NAME}:latest")
+if [ -z $CONTAINER_ID ]
+then
+    echo "Error: Cannot find Container ID for Image ${DOCKER_IMAGE_NAME}"
+    exit 1
+fi
+
+# Copy the build artifacts from the Docker Container
+echo "Copying the built contents from the docker container for image ${DOCKER_IMAGE_NAME}"
+
+rm -rf install
+mkdir install
+
+docker cp $CONTAINER_ID:/data/workspace/install/Debug_Static install/ || (echo "Error occurred copying Debug_Static artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Debug_Shared install/ || (echo "Error occurred copying Debug_Shared artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Release_Static install/ || (echo "Error occurred copying Release_Static artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+docker cp $CONTAINER_ID:/data/workspace/install/Release_Shared install/ || (echo "Error occurred copying Release_Shared artifacts from Docker image ${DOCKER_IMAGE_NAME}:latest." ; exit 1)
+
+# Clean up the docker image and container
+echo "Cleaning up containers"
+docker container rm $CONTAINER_ID || (echo "Error occurred trying to clean up container for image ${DOCKER_IMAGE_NAME}")
+
+echo "Cleaning up image"
+docker rmi $IMAGE_ID  || (echo "Error occurred trying to clean up image ${DOCKER_IMAGE_NAME}")
+
+popd
+
+exit 0

+ 16 - 2
package-system/AWSNativeSDK/build_config.json

@@ -60,15 +60,29 @@
          }
          }
       },
       },
       "Linux":{
       "Linux":{
-         "Linux":{
+         "Linux-OpenSSL-1":{
+            "package_version":"1.9.50-rev2",
+            "cmake_find_source":"FindAWSNativeSDK.cmake.Linux",
+            "custom_build_cmd": [
+               "./build_AWSNativeSDK_linux.sh 2004 1"
+            ],
+            "custom_install_cmd": [
+               "./install_AWSNativeSDK_linux.sh"
+            ]
+         },
+         "Linux-OpenSSL-3":{
+            "package_version":"1.9.50-rev2",
+            "patch_file":"AWSNativeSDK-1.9.50-linux-openssl3.patch",
             "cmake_find_source":"FindAWSNativeSDK.cmake.Linux",
             "cmake_find_source":"FindAWSNativeSDK.cmake.Linux",
             "custom_build_cmd": [
             "custom_build_cmd": [
-               "./build_AWSNativeSDK_linux.sh"
+               "./build_AWSNativeSDK_linux.sh 2204 3"
             ],
             ],
             "custom_install_cmd": [
             "custom_install_cmd": [
                "./install_AWSNativeSDK_linux.sh"
                "./install_AWSNativeSDK_linux.sh"
             ]
             ]
          }
          }
+
+
       }
       }
    }
    }
 }
 }

+ 112 - 0
package-system/AWSNativeSDK/docker_build_aws_sdk.sh

@@ -0,0 +1,112 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+
+# Make sure we have all the required dev packages
+REQUIRED_DEV_PACKAGES="zlib1g-dev libssh-dev libssl-dev libcurl4-openssl-dev"
+ALL_PACKAGES=`apt list 2>/dev/null`
+for req_package in $REQUIRED_DEV_PACKAGES
+do
+    PACKAGE_COUNT=`echo $ALL_PACKAGES | grep $req_package | wc -l`
+    if [[ $PACKAGE_COUNT -eq 0 ]]; then
+        echo Missing required package $req_package
+        exit 1
+    fi
+done
+
+
+# Validate the expected version of OpenSSL for this script from the argument
+EXPECTED_OPENSSL_MAJOR=$1
+if [ -z $EXPECTED_OPENSSL_MAJOR ]
+then
+    echo "Missing OpenSSL Major version argument"
+    exit 1
+fi
+
+OPENSSL_MAJORVERSION=`openssl version | awk '{print $2}' | awk '{print substr($0,1,1)}'`
+if [ $OPENSSL_MAJORVERSION -eq $EXPECTED_OPENSSL_MAJOR ]
+then
+    echo "Validated OpenSSL version $OPENSSL_MAJORVERSION == $EXPECTED_OPENSSL_MAJOR"
+else
+    echo "Error, expected OpenSSL major version $EXPECTED_OPENSSL_MAJOR, but got $OPENSSL_MAJORVERSION"
+    exit 1
+fi
+
+
+# Validate the src path
+src_path=src
+if [ ! -d $src_path ]
+then
+    echo "Missing src path"
+    exit 1
+fi
+
+
+# Make sure the build path is clear
+bld_path=build
+rm -rf $bld_path || (echo "Command: rm -rf $bld_path failed" ; exit 1)
+mkdir $bld_path
+
+
+# Make sure the install path is clear
+inst_path=install
+echo "Command: rm -rf $inst_path"
+rm -rf $inst_path || (echo "Command: rm -rf $inst_path failed" ; exit 1)
+mkdir $inst_path
+
+
+configure_and_build() {
+    build_type=$1
+    lib_type=$2
+    build_shared=OFF
+    if [ "$lib_type" == "Shared" ]
+    then
+        build_shared=ON
+    fi
+
+    echo "CMake Configure $build_type $lib_type"
+    CC=/usr/lib/llvm-12/bin/clang CXX=/usr/lib/llvm-12/bin/clang++ cmake -S "$src_path" -B "$bld_path/${build_type}_${lib_type}" \
+          -G "Unix Makefiles" \
+          -DTARGET_ARCH=LINUX \
+          -DCMAKE_CXX_STANDARD=17 \
+          -DCPP_STANDARD=17 \
+          -DCMAKE_C_FLAGS="-fPIC" \
+          -DCMAKE_CXX_FLAGS="-fPIC" \
+          -DENABLE_TESTING=OFF \
+          -DENABLE_RTTI=ON \
+          -DCUSTOM_MEMORY_MANAGEMENT=ON \
+          -DBUILD_ONLY="access-management;cognito-identity;cognito-idp;core;devicefarm;dynamodb;gamelift;identity-management;kinesis;lambda;mobileanalytics;queues;s3;sns;sqs;sts;transfer" \
+          -DBUILD_SHARED_LIBS=$build_shared \
+          -DCMAKE_BUILD_TYPE=$build_type \
+          -DCMAKE_INSTALL_BINDIR="bin" \
+          -DCMAKE_INSTALL_LIBDIR="lib" || (echo "CMake Configure $build_type $lib_type failed" ; exit 1)
+
+    echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type}"
+
+    cmake --build "$bld_path/${build_type}_${lib_type}" -j 12 || (echo "CMake Build $build_type $lib_type to $bld_path/${build_type}_${lib_type} failed" ; exit 1)
+
+    cmake --install "$bld_path/${build_type}_${lib_type}" --prefix "$inst_path/${build_type}_${lib_type}" || (echo "CMake Install $build_type $lib_type to $inst_path/${build_type}_${lib_type} failed" ; exit 1)
+
+}
+
+# Debug Shared
+configure_and_build Debug Shared || exit 1
+
+# Debug Static
+configure_and_build Debug Static || exit 1
+
+# Release Shared
+configure_and_build Release Shared || exit 1
+
+# Release Static
+configure_and_build Release Static || exit 1
+
+echo "Custom Build for AWSNativeSDK finished successfully"
+
+
+exit 0

+ 0 - 12
package-system/AWSNativeSDK/install_AWSNativeSDK_linux.sh

@@ -31,21 +31,9 @@ copy_shared_and_static_libs() {
 }
 }
 
 
 # Debug
 # Debug
-echo "CMake Install Debug Shared to $inst_path"
-cmake --install $bld_path/Debug_Shared --prefix $inst_path/Debug_Shared --config Debug || (echo "CMake Install Debug Shared to $inst_path failed" ; exit 1)
-
-echo "CMake Install Debug Static to $inst_path"
-cmake --install $bld_path/Debug_Static --prefix $inst_path/Debug_Static --config Debug || (echo "CMake Install Debug Static to $inst_path failed" ; exit 1)
-
 copy_shared_and_static_libs Debug || exit 1
 copy_shared_and_static_libs Debug || exit 1
 
 
 # Release
 # Release
-echo "CMake Install Release Shared to $inst_path"
-cmake --install $bld_path/Release_Shared --prefix $inst_path/Release_Shared --config Release || (echo "CMake Install Release Shared to $inst_path failed" ; exit 1)
-
-echo "CMake Install Release Static to $inst_path"
-cmake --install $bld_path/Release_Static --prefix $inst_path/Release_Static --config Release || (echo "CMake Install Release Static to $inst_path failed" ; exit 1)
-
 copy_shared_and_static_libs Release || exit 1
 copy_shared_and_static_libs Release || exit 1
 
 
 echo "Copying include headers to $out_include_path"
 echo "Copying include headers to $out_include_path"

+ 46 - 0
package-system/AWSNativeSDK/install_AWSNativeSDK_linux_OpenSSL3.sh

@@ -0,0 +1,46 @@
+#!/bin/bash
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+
+src_path=temp/src
+bld_path=temp/build
+inst_path=temp/install
+
+out_bin_path=$TARGET_INSTALL_ROOT/bin
+mkdir -p $out_bin_path/Debug
+mkdir -p $out_bin_path/Release
+
+out_include_path=$TARGET_INSTALL_ROOT/include
+mkdir -p $out_include_path
+
+out_lib_path=$TARGET_INSTALL_ROOT/lib
+mkdir -p $out_lib_path/Debug
+mkdir -p $out_lib_path/Release
+
+copy_shared_and_static_libs() {
+    local bld_type=$1
+    echo "Copying shared .so to $out_bin_path/$bld_type"
+    cp -f "$inst_path/${bld_type}_Shared/lib/"*".so"* $out_bin_path/$bld_type/ || (echo "Copying shared .so to $out_bin_path/$bld_type failed" ; exit 1)
+
+    echo "Copying static .a to $out_lib_path/$bld_type"
+    cp -f "$inst_path/${bld_type}_Static/lib/"*".a" $out_lib_path/$bld_type/ || (echo "Copying static .a to $out_lib_path/$bld_type failed" ; exit 1)
+}
+
+# Debug
+copy_shared_and_static_libs Debug || exit 1
+
+# Release
+copy_shared_and_static_libs Release || exit 1
+
+echo "Copying include headers to $out_include_path"
+cp -f -R "$inst_path/Release_Static/include/"* $out_include_path/ || (echo "Copying include headers to $out_include_path failed" ; exit 1)
+
+echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT"
+cp -f $src_path/LICENSE.txt $TARGET_INSTALL_ROOT/ || (echo "Copying LICENSE.txt to $TARGET_INSTALL_ROOT failed" ; exit 1)
+
+echo "Custom Install for AWSNativeSDK finished successfully"
+exit 0

+ 4 - 2
package_build_list_host_linux.json

@@ -6,7 +6,8 @@
     "build_from_source": {
     "build_from_source": {
         "assimp-5.1.6-rev1-linux":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
         "assimp-5.1.6-rev1-linux":  "Scripts/extras/pull_and_build_from_git.py ../../package-system/assimp --platform-name Linux --package-root ../../package-system --clean",
         "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name linux",
         "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK/build_package_image.py --platform-name linux",
-        "AWSNativeSDK-1.9.50-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux --package-root ../../package-system --clean",
+        "AWSNativeSDK-1.9.50-rev2-linux-openssl-1": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-OpenSSL-1 --package-root ../../package-system/AWSNativeSDK/temp --clean",
+        "AWSNativeSDK-1.9.50-rev2-linux-openssl-3": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AWSNativeSDK --platform-name Linux-OpenSSL-3 --package-root ../../package-system/AWSNativeSDK/temp --clean",
         "Lua-5.4.4-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Linux --package-root ../../package-system/Lua/temp --clean",
         "Lua-5.4.4-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/Lua --platform-name Linux --package-root ../../package-system/Lua/temp --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux --package-root ../../package-system --clean",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/AwsIotDeviceSdkCpp --platform-name Linux --package-root ../../package-system --clean",
         "freetype-2.11.1-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/freetype --platform-name Linux --package-root ../../package-system/freetype/temp --clean",
         "freetype-2.11.1-rev1-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/freetype --platform-name Linux --package-root ../../package-system/freetype/temp --clean",
@@ -42,7 +43,8 @@
     "build_from_folder": {
     "build_from_folder": {
         "assimp-5.1.6-rev1-linux": "package-system/assimp-linux",
         "assimp-5.1.6-rev1-linux": "package-system/assimp-linux",
         "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK-linux",
         "AWSGameLiftServerSDK-3.4.2-rev1-linux": "package-system/AWSGameLiftServerSDK-linux",
-        "AWSNativeSDK-1.9.50-rev1-linux": "package-system/AWSNativeSDK-linux",
+        "AWSNativeSDK-1.9.50-rev2-linux-openssl-1": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-openssl-1",
+        "AWSNativeSDK-1.9.50-rev2-linux-openssl-3": "package-system/AWSNativeSDK/temp/AWSNativeSDK-linux-openssl-3",
         "Lua-5.4.4-rev1-linux": "package-system/Lua/temp/Lua-linux",
         "Lua-5.4.4-rev1-linux": "package-system/Lua/temp/Lua-linux",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "package-system/AwsIotDeviceSdkCpp-linux",
         "AwsIotDeviceSdkCpp-1.15.2-rev1-linux": "package-system/AwsIotDeviceSdkCpp-linux",
         "freetype-2.11.1-rev1-linux": "package-system/freetype/temp/freetype-linux",
         "freetype-2.11.1-rev1-linux": "package-system/freetype/temp/freetype-linux",