From 389197fa8126aabd1378af3ee6f0a33db4ef2dce Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 5 Feb 2019 16:06:02 +0100 Subject: [PATCH] gitlab-ci: allow enabling/disabling building documentation in "nm-ci-run.sh" g-ir-scanner does not support building with clang, due to [1], [2], [3]. It triggers checking if /usr/bin/g-ir-scanner works... no (compiler failure -- check config.log) configure: error: introspection enabled but can't be used with clang-7: error: unknown argument: '-fstack-clash-protection' See also commit 99b92fd9920372e57bfe3a624b29915ca3335d99, which adds this configure check. Honor the environment variable WITH_DOCS to allow the caller to overwrite the automatic detection that the script does. [1] https://bugzilla.gnome.org/show_bug.cgi?id=757934 [2] https://gitlab.gnome.org/GNOME/gobject-introspection/issues/150 [3] https://gitlab.gnome.org/GNOME/gobject-introspection/commit/c14d0372283abc1b857e38517e791447233e4d62 --- contrib/scripts/nm-ci-run.sh | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/contrib/scripts/nm-ci-run.sh b/contrib/scripts/nm-ci-run.sh index 4ac5fd9684..188d631e55 100755 --- a/contrib/scripts/nm-ci-run.sh +++ b/contrib/scripts/nm-ci-run.sh @@ -5,6 +5,7 @@ # - CC # - BUILD_TYPE # - CFLAGS +# - WITH_DOCS set -exv @@ -13,6 +14,20 @@ die() { exit 1 } +_is_true() { + case "$1" in + 1|y|yes|YES|Yes|on) + return 0 + ;; + 0|n|no|NO|No|off) + return 1 + ;; + *) + die "not a boolean argument \"$1\"" + ;; + esac +} + ############################################################################### if [ "$BUILD_TYPE" == meson ]; then @@ -45,6 +60,14 @@ if [ "$CC" != gcc ]; then _WITH_CRYPTO=nss fi +if [ "$WITH_DOCS" != "" ]; then + if _is_true "$WITH_DOCS"; then + _WITH_DOCS="$_TRUE" + else + _WITH_DOCS="$_FALSE" + fi +fi + ############################################################################### _autotools_test_print_logs() {