diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/build.sh b/scripts/build.sh index df2dcd1c8..da68ea56f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -21,6 +21,16 @@ # # Build WeeChat with CMake or autotools, according to environment variable # $BUILDTOOL or first script argument (if given). +# The optional variable $BUILDARGS can be set with arguments for cmake or +# configure commands. +# +# Syntax to run the script with environment variables: +# BUILDTOOL=cmake|autotools ./build.sh +# BUILDTOOL=cmake|autotools BUILDARGS="arguments" ./build.sh +# +# Syntax to run the script with arguments on command line: +# ./build.sh cmake|autotools +# ./build.sh cmake|autotools arguments # # This script is used to build WeeChat in Travis CI environment. # @@ -38,7 +48,12 @@ run () BUILDDIR="build-tmp-$$" if [ $# -ge 1 ]; then - BUILDTOOL=$1 + BUILDTOOL="$1" + shift +fi + +if [ $# -ge 1 ]; then + BUILDARGS="$*" fi if [ -z "$BUILDTOOL" ]; then @@ -52,7 +67,7 @@ run "cd $BUILDDIR" if [ "$BUILDTOOL" = "cmake" ]; then # build with CMake - run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON" + run "cmake .. -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON ${BUILDARGS}" run "make VERBOSE=1 -j$(nproc)" run "sudo make install" run "ctest -V" @@ -61,7 +76,7 @@ fi if [ "$BUILDTOOL" = "autotools" ]; then # build with autotools run "../autogen.sh" - run "../configure --enable-man --enable-doc --enable-tests" + run "../configure --enable-man --enable-doc --enable-tests ${BUILDARGS}" run "make -j$(nproc)" run "sudo make install" run "./tests/tests -v" |