diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-02-05 16:02:21 +0100 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2013-02-05 18:54:14 +0100 |
commit | 5d2ac28b24b66386b81be26db225326fdaf2d48a (patch) | |
tree | 164b615fe3a86f20e36f86d94306bf40838a23fb /bin | |
parent | 722b44bef47d9de96fcda9865541a1d45b342bc4 (diff) | |
download | ptxdist-5d2ac28b24b66386b81be26db225326fdaf2d48a.tar.gz ptxdist-5d2ac28b24b66386b81be26db225326fdaf2d48a.tar.xz |
ptxdist: use host compiler wrapper
- create links to wrapper scripts and real components
- use gcc, g++ for HOSTCC, HOSTCXX
- remove HOST_*
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index bf55b5821..2c6f66aa5 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -551,24 +551,27 @@ check_dirs() { # This only should be done when we build userland (chicken egg problem) # check_compiler() { - local cc + local cc_ptr cc cc_abs cc_default cc_alternate - for cc in \ + for cc_ptr in \ + PTXCONF_SETUP_HOST_CPP \ PTXCONF_SETUP_HOST_CC \ PTXCONF_SETUP_HOST_CXX \ ; do - if [ -z "${!cc}" ]; then + cc="${!cc_ptr}" + if [ -z "${cc}" ]; then echo - echo "${PTXDIST_LOG_PROMPT}error: undefined host ${cc##*_} compiler" + echo "${PTXDIST_LOG_PROMPT}error: undefined host ${cc_ptr##*_} compiler" echo "${PTXDIST_LOG_PROMPT}error: run 'ptxdist setup' and enter the 'Developer Options' menu" echo "${PTXDIST_LOG_PROMPT}error: and specify the compiler" echo exit 1 fi - if [ \! -x "$(which "${!cc}" 2>/dev/null)" ]; then + cc_abs="$(which "${cc}" 2>/dev/null)" + if [ \! -x "${cc_abs}" ]; then echo - echo "${PTXDIST_LOG_PROMPT}error: your host ${cc##*_} compiler: '${!cc}'" + echo "${PTXDIST_LOG_PROMPT}error: your host ${cc_ptr##*_} compiler: '${cc}'" echo "${PTXDIST_LOG_PROMPT}error: cannot be found or isn't executable" echo "${PTXDIST_LOG_PROMPT}error: run 'ptxdist setup' and enter the 'Developer Options' menu" echo "${PTXDIST_LOG_PROMPT}error: and specify the compiler" @@ -576,6 +579,30 @@ check_compiler() { exit 1 fi + case "${cc_ptr}" in + PTXCONF_SETUP_HOST_CPP) + cc_default=cpp + unset cc_alternate + ;; + PTXCONF_SETUP_HOST_CC) + cc_default=gcc + cc_alternate=cc + ;; + PTXCONF_SETUP_HOST_CXX) + cc_default=g++ + cc_alternate=c++ + ;; + esac + + ln -sf "${cc_abs}" "${PTX_WRAPPER_DIR}/${cc_default}.real" && + ln -sf "${SCRIPTSDIR}/wrapper/host-${cc_default}-wrapper" "${PTX_WRAPPER_DIR}/${cc_default}" && + + if [ -n "${cc_alternate}" ]; then + ln -sf "${cc_default}" "${PTX_WRAPPER_DIR}/${cc_alternate}" && + ln -sf "${cc_default}.real" "${PTX_WRAPPER_DIR}/${cc_alternate}.real" + fi || \ + ptxd_bailout "unable to create compiler wrapper link" + if [ -n "${PTX_CCACHE_DIR}" ]; then ln -sf "$(which "ccache")" "${PTX_CCACHE_DIR}/${!cc}" || ptxd_bailout "unable to create ccache link" fi |