From f1a62576cdbf79099be3d3067154df09ddc0f73d Mon Sep 17 00:00:00 2001 From: Junichi Uekawa Date: Tue, 26 Mar 2013 18:19:54 +0900 Subject: oops, typo in filename. --- examples/D65various-compiler-support | 70 ++++++++++++++++++++++++++++++++++++ examples/D65various-complier-support | 70 ------------------------------------ 2 files changed, 70 insertions(+), 70 deletions(-) create mode 100644 examples/D65various-compiler-support delete mode 100644 examples/D65various-complier-support (limited to 'examples') diff --git a/examples/D65various-compiler-support b/examples/D65various-compiler-support new file mode 100644 index 0000000..38aaf06 --- /dev/null +++ b/examples/D65various-compiler-support @@ -0,0 +1,70 @@ +#!/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, +# gcc-*, or other compilers (note: however, now only clang and gcc can works +# well and others fails to build). +# +# i.e.) +# $ sudo CHOOSE_COMPILER="clang" pbuilder --build foobar_1.0-1.dsc +# $ sudo CHOOSE_COMPILER="gcc-4.6" pbuilder --build foobar_1.0-1.dsc +# + +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}"++ + ;; + gcc-*) + use_gcc_version=$(echo ${CHOOSE_COMPILER} | sed -e s/gcc-//) + gxx_package=g++-"${use_gcc_version}" + newcc=/usr/bin/"${CHOOSE_COMPILER}" + newcxx=/usr/bin/g++-"${use_gcc_version}" + ;; + tcc) + newcc=/usr/bin/"${CHOOSE_COMPILER}" + newcxx=/bin/false + not_gcc_compat=1 + ;; + pcc) + newcc=/usr/bin/"${CHOOSE_COMPILER}" + newcxx=/bin/false + not_gcc_compat=1 + ;; + asn1c) + newcc=/usr/bin/"${CHOOSE_COMPILER}" + newcxx=/bin/false + not_gcc_compat=1 + ;; + *) + exit 0 + ;; +esac + +apt-get -y install "${CHOOSE_COMPILER}" ${gxx_package} + +if [ ! -x /usr/bin/"${CHOOSE_COMPILER}" ]; then + echo >&2 "E: Package ${CHOOSE_COMPILER} does not contain compiler driver?" + exit 1 +fi + +ln -sf "${newcc}" /usr/bin/cc +ln -sf "${newcxx}" /usr/bin/c++ + +if [ -z "${not_gcc_compat}" ]; then + ( + cd /usr/bin + ln -sf "$newcc" gcc + ln -sf "$newcxx" g++ + ) +else + rm -f /usr/bin/gcc /usr/bin/g++ +fi + +exit 0 diff --git a/examples/D65various-complier-support b/examples/D65various-complier-support deleted file mode 100644 index 38aaf06..0000000 --- a/examples/D65various-complier-support +++ /dev/null @@ -1,70 +0,0 @@ -#!/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, -# gcc-*, or other compilers (note: however, now only clang and gcc can works -# well and others fails to build). -# -# i.e.) -# $ sudo CHOOSE_COMPILER="clang" pbuilder --build foobar_1.0-1.dsc -# $ sudo CHOOSE_COMPILER="gcc-4.6" pbuilder --build foobar_1.0-1.dsc -# - -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}"++ - ;; - gcc-*) - use_gcc_version=$(echo ${CHOOSE_COMPILER} | sed -e s/gcc-//) - gxx_package=g++-"${use_gcc_version}" - newcc=/usr/bin/"${CHOOSE_COMPILER}" - newcxx=/usr/bin/g++-"${use_gcc_version}" - ;; - tcc) - newcc=/usr/bin/"${CHOOSE_COMPILER}" - newcxx=/bin/false - not_gcc_compat=1 - ;; - pcc) - newcc=/usr/bin/"${CHOOSE_COMPILER}" - newcxx=/bin/false - not_gcc_compat=1 - ;; - asn1c) - newcc=/usr/bin/"${CHOOSE_COMPILER}" - newcxx=/bin/false - not_gcc_compat=1 - ;; - *) - exit 0 - ;; -esac - -apt-get -y install "${CHOOSE_COMPILER}" ${gxx_package} - -if [ ! -x /usr/bin/"${CHOOSE_COMPILER}" ]; then - echo >&2 "E: Package ${CHOOSE_COMPILER} does not contain compiler driver?" - exit 1 -fi - -ln -sf "${newcc}" /usr/bin/cc -ln -sf "${newcxx}" /usr/bin/c++ - -if [ -z "${not_gcc_compat}" ]; then - ( - cd /usr/bin - ln -sf "$newcc" gcc - ln -sf "$newcxx" g++ - ) -else - rm -f /usr/bin/gcc /usr/bin/g++ -fi - -exit 0 -- cgit v1.2.3