From 0b1b368a8fe8f2232372f56a71b8b9a41b5de48b Mon Sep 17 00:00:00 2001 From: Justin Boswell Date: Fri, 22 Jan 2021 09:35:39 -0800 Subject: [PATCH] Imported aws-crt-ffi as submodule (#6) * Removed direct submodules * Added aws-crt-ffi as submodule * updated makefile to build aws-crt-ffi --- .gitmodules | 24 +++-------------- Makefile.frag | 61 +++++++------------------------------------ crt/aws-c-auth | 1 - crt/aws-c-cal | 1 - crt/aws-c-common | 1 - crt/aws-c-compression | 1 - crt/aws-c-http | 1 - crt/aws-c-io | 1 - crt/aws-crt-ffi | 1 + crt/s2n | 1 - 10 files changed, 13 insertions(+), 80 deletions(-) delete mode 160000 crt/aws-c-auth delete mode 160000 crt/aws-c-cal delete mode 160000 crt/aws-c-common delete mode 160000 crt/aws-c-compression delete mode 160000 crt/aws-c-http delete mode 160000 crt/aws-c-io create mode 160000 crt/aws-crt-ffi delete mode 160000 crt/s2n diff --git a/.gitmodules b/.gitmodules index 113e859..bce5a6a 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,21 +1,3 @@ -[submodule "aws-c-common"] - path = crt/aws-c-common - url = https://github.com/awslabs/aws-c-common.git -[submodule "aws-c-io"] - path = crt/aws-c-io - url = https://github.com/awslabs/aws-c-io.git -[submodule "aws-c-http"] - path = crt/aws-c-http - url = https://github.com/awslabs/aws-c-http.git -[submodule "aws-c-compression"] - path = crt/aws-c-compression - url = https://github.com/awslabs/aws-c-compression.git -[submodule "aws-c-auth"] - path = crt/aws-c-auth - url = https://github.com/awslabs/aws-c-auth.git -[submodule "aws-c-cal"] - path = crt/aws-c-cal - url = https://github.com/awslabs/aws-c-cal.git -[submodule "s2n"] - path = crt/s2n - url = https://github.com/awslabs/s2n.git +[submodule "crt/aws-crt-ffi"] + path = crt/aws-crt-ffi + url = https://github.com/awslabs/aws-crt-ffi.git diff --git a/Makefile.frag b/Makefile.frag index bf9e3b2..7668383 100644 --- a/Makefile.frag +++ b/Makefile.frag @@ -1,16 +1,7 @@ INSTALL_DIR=$(shell pwd)/build/install -crt_libs=$(INSTALL_DIR)/lib/libaws-c-common.a \ - $(INSTALL_DIR)/lib/libaws-c-cal.a \ - $(INSTALL_DIR)/lib/libaws-c-io.a \ - $(INSTALL_DIR)/lib/libaws-c-compression.a \ - $(INSTALL_DIR)/lib/libaws-c-http.a \ - $(INSTALL_DIR)/lib/libaws-c-auth.a \ - $(INSTALL_DIR)/lib/libs2n.a - -crt-static: $(crt_libs) $(INSTALL_DIR)/lib/libcrypto.a - +# download and build libcrypto.a for the CRT with -fPIC build/deps/openssl: @echo Fetching libcrypto source git clone --depth=1 --single-branch --branch OpenSSL_1_1_1-stable https://github.com/openssl/openssl.git build/deps/openssl @@ -31,47 +22,13 @@ CMAKE_BUILD = cmake --build CMAKE_BUILD_TYPE ?= RelWithDebInfo CMAKE_TARGET = --config $CMAKE_BUILD_TYPE --target install -build/aws-c-common/CMakeCache.txt: $(INSTALL_DIR)/lib/libcrypto.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-common -Bbuild/aws-c-common +# cmake configure depends on libcrypto above +build/aws-crt-ffi/CMakeCache.txt: $(INSTALL_DIR)/lib/libcrypto.a + $(CMAKE_CONFIGURE) -Hcrt/aws-crt-ffi -Bbuild/aws-crt-ffi -$(INSTALL_DIR)/lib/libaws-c-common.a: build/aws-c-common/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-common $(CMAKE_TARGET) +# build the FFI library +$(INSTALL_DIR)/lib/libaws-crt-ffi.so: build/aws-crt-ffi/CMakeCache.txt + $(CMAKE_BUILD) build/aws-crt-ffi $(CMAKE_TARGET) -build/s2n/CMakeCache.txt: $(INSTALL_DIR)/lib/libcrypto.a - $(CMAKE_CONFIGURE) -Hcrt/s2n -Bbuild/s2n - -$(INSTALL_DIR)/lib/libs2n.a: build/s2n/CMakeCache.txt - $(CMAKE_BUILD) build/s2n $(CMAKE_TARGET) - -build/aws-c-io/CMakeCache.txt: $(INSTALL_DIR)/lib/libaws-c-common.a $(INSTALL_DIR)/lib/libcrypto.a $(INSTALL_DIR)/lib/libs2n.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-io -Bbuild/aws-c-io - -$(INSTALL_DIR)/lib/libaws-c-io.a: build/aws-c-io/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-io $(CMAKE_TARGET) - -build/aws-c-cal/CMakeCache.txt: $(INSTALL_DIR)/lib/libaws-c-common.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-cal -Bbuild/aws-c-cal - -$(INSTALL_DIR)/lib/libaws-c-cal.a: build/aws-c-cal/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-cal $(CMAKE_TARGET) - -build/aws-c-compression/CMakeCache.txt: $(INSTALL_DIR)/lib/libaws-c-common.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-compression -Bbuild/aws-c-compression - -$(INSTALL_DIR)/lib/libaws-c-compression.a: build/aws-c-compression/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-compression $(CMAKE_TARGET) - -build/aws-c-http/CMakeCache.txt: $(INSTALL_DIR)/lib/libaws-c-compression.a $(INSTALL_DIR)/lib/libaws-c-io.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-http -Bbuild/aws-c-http - -$(INSTALL_DIR)/lib/libaws-c-http.a: build/aws-c-http/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-http $(CMAKE_TARGET) - -build/aws-c-auth/CMakeCache.txt: $(INSTALL_DIR)/lib/libaws-c-http.a - $(CMAKE_CONFIGURE) -Hcrt/aws-c-auth -Bbuild/aws-c-auth - -$(INSTALL_DIR)/lib/libaws-c-auth.a: build/aws-c-auth/CMakeCache.txt - $(CMAKE_BUILD) build/aws-c-auth $(CMAKE_TARGET) - -# Force the crt object target to depend on all of the libraries above -src/crt.lo: crt-static +# Force the crt object target to depend on the FFI library +src/crt.lo: $(INSTALL_DIR)/lib/libaws-crt-ffi.so diff --git a/crt/aws-c-auth b/crt/aws-c-auth deleted file mode 160000 index f58e202..0000000 --- a/crt/aws-c-auth +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f58e2028d183e0e889728249a5aa5097d58a5e5c diff --git a/crt/aws-c-cal b/crt/aws-c-cal deleted file mode 160000 index 61d6674..0000000 --- a/crt/aws-c-cal +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 61d66740b1469a0caef09932621e3e92ee3967e2 diff --git a/crt/aws-c-common b/crt/aws-c-common deleted file mode 160000 index fe6ff91..0000000 --- a/crt/aws-c-common +++ /dev/null @@ -1 +0,0 @@ -Subproject commit fe6ff914db8211e3e03da2d730cfefa4d151892b diff --git a/crt/aws-c-compression b/crt/aws-c-compression deleted file mode 160000 index f2be13a..0000000 --- a/crt/aws-c-compression +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f2be13afe410611fcac07b6519b96ce1ad4e4831 diff --git a/crt/aws-c-http b/crt/aws-c-http deleted file mode 160000 index 3836661..0000000 --- a/crt/aws-c-http +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3836661844973ae270c8d0beba5273415c5313d7 diff --git a/crt/aws-c-io b/crt/aws-c-io deleted file mode 160000 index 3baeef9..0000000 --- a/crt/aws-c-io +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3baeef9906519363c0e72e3851bf31c9d656af37 diff --git a/crt/aws-crt-ffi b/crt/aws-crt-ffi new file mode 160000 index 0000000..f865650 --- /dev/null +++ b/crt/aws-crt-ffi @@ -0,0 +1 @@ +Subproject commit f865650224ad9b2b3ee6895b6fe2508b80582e45 diff --git a/crt/s2n b/crt/s2n deleted file mode 160000 index 3c7ae5f..0000000 --- a/crt/s2n +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 3c7ae5f57aadf53d85e134e6057b45cbec80ca35