From da2e2cca504e0ed7296edff128f5ac76f0fe1439 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 14 Jun 2018 10:14:18 +0200 Subject: Add support for passing compile options to build script --- build.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'build.sh') 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] [] " +usage="Usage: $0 [-h|--help] [] []" # 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, 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 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" -- cgit v1.1