aboutsummaryrefslogtreecommitdiff
path: root/gen_lws_config_h.sh
diff options
context:
space:
mode:
authorSteve Kim <kwstephenkim@google.com>2020-04-08 14:50:59 -0700
committerSteve Kim <kwstephenkim@google.com>2020-04-08 16:14:31 -0700
commit4e3c3e59be7209ae71a8855629b7dbf399fc5c17 (patch)
tree5ed74cb47b326202941f3f42067060d40330cc9f /gen_lws_config_h.sh
parent6379e25fe4aa9ef43c7311202c6487cc6440b07b (diff)
downloadlibwebsockets-4e3c3e59be7209ae71a8855629b7dbf399fc5c17.tar.gz
libsockets header generation resolves dependency automatically
Bug: 152085202 Test: removed out, see if the dependency build correctly Change-Id: Ib45db57357249186b77168cbe3739b34bf01a1e4
Diffstat (limited to 'gen_lws_config_h.sh')
-rwxr-xr-xgen_lws_config_h.sh22
1 files changed, 18 insertions, 4 deletions
diff --git a/gen_lws_config_h.sh b/gen_lws_config_h.sh
index 9d8d6d52..c7cc6833 100755
--- a/gen_lws_config_h.sh
+++ b/gen_lws_config_h.sh
@@ -62,18 +62,34 @@ function sed_in_cmake_android() {
sed -i "s/$from/$to/g" $cmake_android_file
}
+function build_prerequisites() {
+ local modules=("$@")
+ (
+ pushd ${ANDROID_ROOTDIR}
+ source ${ANDROID_ROOTDIR}/build/envsetup.sh
+ for mod in "${modules[@]}"; do
+ mmm $mod
+ done
+ popd
+ )
+}
+
function create_android_list() {
#
# by filling out the form in CMAKE_ANDROID_FILE_TEMPLATE,
# create CMAKE_ANDROID_FILE that is included in CMakeLists.txt
#
- # The CMAKE_ANDROID_FILE defines libray/include directories for
+ # The CMAKE_ANDROID_FILE defines library/include directories for
# libraries provided by somewhere in Android Root
#
rm -f ${CMAKE_ANDROID_FILE} || true
cp -f ${CMAKE_ANDROID_FILE_TEMPLATE} ${CMAKE_ANDROID_FILE}
sed_in_cmake_android "android_src_root_dir" ${ANDROID_ROOTDIR} ${CMAKE_ANDROID_FILE}
- libs=("libssl" "libcrypto" "libcap")
+ # libraries that libwebsockets would depend on
+ local libs=("libssl" "libcrypto" "libcap")
+ # Android components that provide the "libs" above
+ local components=("external/boringssl" "external/libcap")
+ build_prerequisites "${components[@]}"
for lib in ${libs[@]}; do
local libfile_path=$(find_lib_path $lib)
local libpath=$(dirname ${libfile_path})
@@ -83,8 +99,6 @@ function create_android_list() {
done
}
-# build required modules ahead by installing & build fake_module
-
# create CMakeAndroidLists.txt
create_android_list