summaryrefslogtreecommitdiff
path: root/mk/compiler/mipspro.mk
diff options
context:
space:
mode:
authorjlam <jlam>2004-11-30 14:50:37 +0000
committerjlam <jlam>2004-11-30 14:50:37 +0000
commite0816cd38aa2ae18161632428746d5be7aaa3a3f (patch)
treefe0208b86b0f4fd875482f1d22c775959c8becd5 /mk/compiler/mipspro.mk
parent7c1706f998521d0013716738556e9998544afcfa (diff)
downloadpkgsrc-e0816cd38aa2ae18161632428746d5be7aaa3a3f.tar.gz
Modify the way that the toolchain variables, e.g. CC, CPP, CXX, LD, etc.,
are handled. The idea now is to simply remove the paths in the values of these variables, leaving behind only the basename plus any arguments, e.g.: CC= /usr/local/bin/gcc becomes CC= gcc CPP= /usr/local/bin/gcc -E becomes CPP= gcc -E The wrapper scripts are generated for every unique executable mentioned by the toolchain variables, so for the example above, only a "gcc" wrapper script is generated for ${CC} and ${CPP}. PKG_{CC,CPP,CXX,etc.} are the paths to the executables wrapped by the wrapper scripts. Note that it's now possible to set "CC" to something more than just the path to the compiler, e.g. CC= cc -ffast-math -funroll-loops -fomit-frame-pointer and the full value of ${CC} will be passed through via CONFIGURE_ENV and MAKE_ENV.
Diffstat (limited to 'mk/compiler/mipspro.mk')
-rw-r--r--mk/compiler/mipspro.mk39
1 files changed, 26 insertions, 13 deletions
diff --git a/mk/compiler/mipspro.mk b/mk/compiler/mipspro.mk
index ede75b5c689..694a66c7544 100644
--- a/mk/compiler/mipspro.mk
+++ b/mk/compiler/mipspro.mk
@@ -1,4 +1,4 @@
-# $NetBSD: mipspro.mk,v 1.28 2004/11/23 05:32:22 jlam Exp $
+# $NetBSD: mipspro.mk,v 1.29 2004/11/30 14:50:37 jlam Exp $
.if !defined(COMPILER_MIPSPRO_MK)
COMPILER_MIPSPRO_MK= defined
@@ -18,21 +18,28 @@ _LANGUAGES.mipspro+= ${LANGUAGES.mipspro:M${_lang_}}
.endfor
_MIPSPRO_DIR= ${WRKDIR}/.mipspro
-_MIPSPRO_LINKS= # empty
+_MIPSPRO_VARS= # empty
.if exists(${MIPSPROBASE}/bin/cc)
+_MIPSPRO_VARS+= CC
_MIPSPRO_CC= ${_MIPSPRO_DIR}/bin/cc
-_MIPSPRO_LINKS+= _MIPSPRO_CC
-PKG_CC= ${_MIPSPRO_CC}
-CC= ${PKG_CC:T}
+_ALIASES.CC= cc
CCPATH= ${MIPSPROBASE}/bin/cc
+PKG_CC:= ${_MIPSPRO_CC}
+. if !empty(CC:M*gcc)
+CC:= ${PKG_CC:T} # ${CC} should be named "cc".
+. endif
.endif
.if exists(${MIPSPROBASE}/bin/CC)
+_MIPSPRO_VARS+= CXX
_MIPSPRO_CXX= ${_MIPSPRO_DIR}/bin/CC
-_MIPSPRO_LINKS+= _MIPSPRO_CXX
-PKG_CXX= ${_MIPSPRO_CXX}
-CXX= ${PKG_CXX:T}
+_ALIASES.CXX= CC c++
CXXPATH= ${MIPSPROBASE}/bin/CC
+PKG_CXX:= ${_MIPSPRO_CXX}
+. if !empty(CXX:M*g++)
+CXX:= ${PKG_CXX:T} # ${CXX} should be named "CC"
+. endif
.endif
+_COMPILER_STRIP_VARS+= ${_MIPSPRO_VARS}
.if exists(${CCPATH})
# MIPSpro Compilers: Version 7.3.1.2m
@@ -63,16 +70,22 @@ PREPEND_PATH+= ${_MIPSPRO_DIR}/bin
.endif
# Create compiler driver scripts in ${WRKDIR}.
-.for _target_ in ${_MIPSPRO_LINKS}
-. if !target(${${_target_}})
-override-tools: ${${_target_}}
-${${_target_}}:
+.for _var_ in ${_MIPSPRO_VARS}
+. if !target(${_MIPSPRO_${_var_}})
+override-tools: ${_MIPSPRO_${_var_}}
+${_MIPSPRO_${_var_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
(${ECHO} '#!${TOOLS_SHELL}'; \
- ${ECHO} 'exec ${MIPSPROBASE}/bin/${${_target_}:T} "$$@"'; \
+ ${ECHO} 'exec ${MIPSPROBASE}/bin/${.TARGET:T} "$$@"'; \
) > ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
+. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
+ ${_PKG_SILENT}${_PKG_DEBUG} \
+ if [ ! -x "${_alias_}" ]; then \
+ ${LN} -f ${.TARGET} ${_alias_}; \
+ fi
+. endfor
. endif
.endfor