diff options
author | Sylvestre Ledru <sylvestre@debian.org> | 2014-05-15 18:48:37 +0200 |
---|---|---|
committer | Mattia Rizzolo <mattia@mapreri.org> | 2015-07-04 21:50:05 +0000 |
commit | 7e9838a35659afdedcaae59e9074bf783f567ffe (patch) | |
tree | b916682ff0fe0384585feb1b1f9c39976187766c /examples | |
parent | 200e1104b317acfd36addb59ce160f45ccd93c55 (diff) | |
download | pbuilder-7e9838a35659afdedcaae59e9074bf783f567ffe.tar pbuilder-7e9838a35659afdedcaae59e9074bf783f567ffe.tar.gz |
ex/D65various-compiler-support: manage the different version of clang-X.Y
Closes: #748251
Diffstat (limited to 'examples')
-rw-r--r-- | examples/D65various-compiler-support | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/examples/D65various-compiler-support b/examples/D65various-compiler-support index e65d70f..bc86ccd 100644 --- a/examples/D65various-compiler-support +++ b/examples/D65various-compiler-support @@ -1,7 +1,7 @@ #!/bin/sh # # pbuilder hook script: choose optional compiler rather than default one -# +# # Sometimes we want to choose other compiler than default, because of improving # code to conform to standard, check compiler quality or so. This script will # ease it. Try enable hook script and set "CHOOSE_COMPILER" variables as clang, @@ -18,8 +18,14 @@ set -e # check whether we are asked to change the compiler. case "${CHOOSE_COMPILER}" in clang) - newcc=/usr/bin/"${CHOOSE_COMPILER}" - newcxx=/usr/bin/"${CHOOSE_COMPILER}"++ + newcc=/usr/bin/"${CHOOSE_COMPILER}" + newcxx=/usr/bin/"${CHOOSE_COMPILER}"++ + ;; + clang-*) + use_clang_version=$(echo ${CHOOSE_COMPILER} | sed -e s/clang-//) + clang_package=clang-"${use_clang_version}" + newcc=/usr/bin/clang-"${use_clang_version}" + newcxx=/usr/bin/clang++-"${use_clang_version}" ;; gcc-*) use_gcc_version=$(echo ${CHOOSE_COMPILER} | sed -e s/gcc-//) @@ -42,7 +48,7 @@ case "${CHOOSE_COMPILER}" in ;; esac -apt-get -y install "${CHOOSE_COMPILER}" ${gxx_package} +apt-get -y install "${CHOOSE_COMPILER}" ${gxx_package} ${clang_package} if [ ! -x /usr/bin/"${CHOOSE_COMPILER}" ]; then echo >&2 "E: Package ${CHOOSE_COMPILER} does not contain compiler driver?" |