aboutsummaryrefslogtreecommitdiff
path: root/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh18
1 files changed, 16 insertions, 2 deletions
diff --git a/build.sh b/build.sh
index 00b2675..51ad6b9 100755
--- a/build.sh
+++ b/build.sh
@@ -4,7 +4,7 @@
# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
# license : MIT; see accompanying LICENSE file
-usage="Usage: $0 [-h|--help] [<options>] <c++-compiler>"
+usage="Usage: $0 [-h|--help] [<options>] <c++-compiler> [<compile-options>]"
# Package repository URL (or path).
#
@@ -75,6 +75,13 @@ while test $# -ne 0; do
diag
diag "$0 --make gmake --make -j8 g++"
diag
+ diag "If specified, <compile-options> override the default (-O3) compile"
+ diag "options (config.cc.coptions) in the bpkg configuration used to build"
+ diag "and install the final toolchain. For example, to build with the debug"
+ diag "information (and without optimization):"
+ diag
+ diag "$0 g++ -g"
+ diag
diag "See the BOOTSTRAP-UNIX file for details."
diag
exit 0
@@ -151,6 +158,7 @@ while test $# -ne 0; do
;;
*)
cxx="$1"
+ shift
break
;;
esac
@@ -162,6 +170,12 @@ if test -z "$cxx"; then
exit 1
fi
+# Place default <compile-options> into the $@ array.
+#
+if test $# -eq 0; then
+ set -- -O3
+fi
+
# Only use default sudo for the default installation directory and only if
# it wasn't specified by the user.
#
@@ -280,7 +294,7 @@ cdir="$(pwd)" # Save full path for later.
run bpkg-stage $verbose create \
cc \
config.cxx="$cxx" \
-config.cc.coptions=-O3 \
+config.cc.coptions="'$@'" \
config.bin.rpath="$conf_rpath" \
config.install.root="$idir" \
config.install.sudo="$conf_sudo"