diff options
author | Marvin W <git@larma.de> | 2020-01-21 21:30:21 +0100 |
---|---|---|
committer | Marvin W <git@larma.de> | 2020-01-21 21:55:08 +0100 |
commit | 55b148a0f78c1abef57c21b2a84d97cad32b2290 (patch) | |
tree | 8b3db2a9e9594316e281e3006b098f2762e8b3b8 /configure | |
parent | 4c3800c688f87482cdf79c4ecb1c7764ff01e213 (diff) | |
download | dino-55b148a0f78c1abef57c21b2a84d97cad32b2290.tar.gz dino-55b148a0f78c1abef57c21b2a84d97cad32b2290.zip |
Use system provided libsignal-protocol-c by default
You can still compile in tree by using --with-libsignal-in-tree flag
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 77 |
1 files changed, 42 insertions, 35 deletions
@@ -1,7 +1,7 @@ #!/bin/sh OPTS=`getopt -o "h" --long \ -help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,\ +help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,\ enable-plugin:,disable-plugin:,\ prefix:,program-prefix:,exec-prefix:,lib-suffix:,\ bindir:,libdir:,includedir:,datadir:,\ @@ -17,6 +17,7 @@ eval set -- "$OPTS" PREFIX=${PREFIX:-/usr/local} ENABLED_PLUGINS= DISABLED_PLUGINS= +BUILD_LIBSIGNAL_IN_TREE= BUILD_TESTS= BUILD_TYPE=Debug DISABLE_FAST_VAPI= @@ -52,9 +53,11 @@ Configuration: clean builds, but faster when doing incremental builds (during development). --fetch-only Only fetch the files required to run ./configure - without network access later and exit + without network access later and exit. --no-debug Build without debug symbols --release Configure to build an optimized release version + --with-libsignal-in-tree Build libsignal-protocol-c in tree and link it + statically. --with-tests Also build tests. Plugin configuration: @@ -110,6 +113,7 @@ while true; do --valac ) VALA_EXECUTABLE="$2"; shift; shift ;; --valac-flags ) VALAC_FLAGS="$2"; shift; shift ;; --lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;; + --with-libsignal-in-tree ) BUILD_LIBSIGNAL_IN_TREE=yes; shift ;; --disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;; --no-debug ) NO_DEBUG=yes; shift ;; --fetch-only ) FETCH_ONLY=yes; shift ;; @@ -141,44 +145,46 @@ while true; do esac done -if [ -d ".git" ]; then - git submodule update --init 2>/dev/null -else - tmp=0 - for i in $(cat .gitmodules | grep -n submodule | awk -F ':' '{print $1}') $(wc -l .gitmodules | awk '{print $1}'); do - if ! [ $tmp -eq 0 ]; then - name=$(cat .gitmodules | head -n $tmp | tail -n 1 | awk -F '"' '{print $2}') - def=$(cat .gitmodules | head -n $i | tail -n $(expr "$i" - "$tmp") | awk -F ' ' '{print $1 $2 $3}') - path=$(echo "$def" | grep '^path=' | awk -F '=' '{print $2}') - url=$(echo "$def" | grep '^url=' | awk -F '=' '{print $2}') - branch=$(echo "$def" | grep '^branch=' | awk -F '=' '{print $2}') - - if ! ls "$path"/* >/dev/null 2>/dev/null; then - git=$(which git) - if ! [ $? -eq 0 ] || ! [ -x $git ]; then - echo "Failed retrieving missing files" - exit 5 - fi - res=$(git clone "$url" "$path" 2>&1) - if ! [ $? -eq 0 ] || ! [ -d $path ]; then - echo "Failed retrieving missing files: $res" - exit 5 - fi - if [ -n "$branch" ]; then - olddir="$(pwd)" - cd "$path" - res=$(git checkout "$branch" 2>&1) - if ! [ $? -eq 0 ]; then +if [ "$BUILD_LIBSIGNAL_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then + if [ -d ".git" ]; then + git submodule update --init 2>/dev/null + else + tmp=0 + for i in $(cat .gitmodules | grep -n submodule | awk -F ':' '{print $1}') $(wc -l .gitmodules | awk '{print $1}'); do + if ! [ $tmp -eq 0 ]; then + name=$(cat .gitmodules | head -n $tmp | tail -n 1 | awk -F '"' '{print $2}') + def=$(cat .gitmodules | head -n $i | tail -n $(expr "$i" - "$tmp") | awk -F ' ' '{print $1 $2 $3}') + path=$(echo "$def" | grep '^path=' | awk -F '=' '{print $2}') + url=$(echo "$def" | grep '^url=' | awk -F '=' '{print $2}') + branch=$(echo "$def" | grep '^branch=' | awk -F '=' '{print $2}') + + if ! ls "$path"/* >/dev/null 2>/dev/null; then + git=$(which git) + if ! [ $? -eq 0 ] || ! [ -x $git ]; then + echo "Failed retrieving missing files" + exit 5 + fi + res=$(git clone "$url" "$path" 2>&1) + if ! [ $? -eq 0 ] || ! [ -d $path ]; then echo "Failed retrieving missing files: $res" exit 5 fi - cd "$olddir" + if [ -n "$branch" ]; then + olddir="$(pwd)" + cd "$path" + res=$(git checkout "$branch" 2>&1) + if ! [ $? -eq 0 ]; then + echo "Failed retrieving missing files: $res" + exit 5 + fi + cd "$olddir" + fi + echo "Submodule path '$path': checked out '$branch' (via git clone)" fi - echo "Submodule path '$path': checked out '$branch' (via git clone)" fi - fi - tmp=$i - done + tmp=$i + done + fi fi if [ "$FETCH_ONLY" = "yes" ]; then exit 0; fi @@ -256,6 +262,7 @@ cmake -G "$cmake_type" \ -DENABLED_PLUGINS="$ENABLED_PLUGINS" \ -DDISABLED_PLUGINS="$DISABLED_PLUGINS" \ -DBUILD_TESTS="$BUILD_TESTS" \ + -DBUILD_LIBSIGNAL_IN_TREE="$BUILD_LIBSIGNAL_IN_TREE" \ -DVALA_EXECUTABLE="$VALAC" \ -DCMAKE_VALA_FLAGS="$VALACFLAGS" \ -DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" \ |