summaryrefslogtreecommitdiff
path: root/mk/compiler/sunpro.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2004-11-30 14:50:37 +0000
committerjlam <jlam@pkgsrc.org>2004-11-30 14:50:37 +0000
commiteb9034727a3c852536168fbc70313810d2e699b8 (patch)
treefe0208b86b0f4fd875482f1d22c775959c8becd5 /mk/compiler/sunpro.mk
parent96abea24a92e1217158cec37e0984afa162a0dba (diff)
downloadpkgsrc-eb9034727a3c852536168fbc70313810d2e699b8.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/sunpro.mk')
-rw-r--r--mk/compiler/sunpro.mk39
1 files changed, 26 insertions, 13 deletions
diff --git a/mk/compiler/sunpro.mk b/mk/compiler/sunpro.mk
index 79fbb65c42e..85b0a0306d7 100644
--- a/mk/compiler/sunpro.mk
+++ b/mk/compiler/sunpro.mk
@@ -1,4 +1,4 @@
-# $NetBSD: sunpro.mk,v 1.24 2004/11/23 05:32:22 jlam Exp $
+# $NetBSD: sunpro.mk,v 1.25 2004/11/30 14:50:37 jlam Exp $
.if !defined(COMPILER_SUNPRO_MK)
COMPILER_SUNPRO_MK= defined
@@ -18,21 +18,28 @@ _LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}}
.endfor
_SUNPRO_DIR= ${WRKDIR}/.sunpro
-_SUNPRO_LINKS= # empty
+_SUNPRO_VARS= # empty
.if exists(${SUNWSPROBASE}/bin/cc)
+_SUNPRO_VARS+= CC
_SUNPRO_CC= ${_SUNPRO_DIR}/bin/cc
-_SUNPRO_LINKS+= _SUNPRO_CC
-PKG_CC= ${_SUNPRO_CC}
-CC= ${PKG_CC:T}
+_ALIASES.CC= cc
CCPATH= ${SUNWSPROBASE}/bin/cc
+PKG_CC:= ${_SUNPRO_CC}
+. if !empty(CC:M*gcc)
+CC:= ${PKG_CC:T} # ${CC} should be named "cc".
+. endif
.endif
.if exists(${SUNWSPROBASE}/bin/CC)
+_SUNPRO_VARS+= CXX
_SUNPRO_CXX= ${_SUNPRO_DIR}/bin/CC
-_SUNPRO_LINKS+= _SUNPRO_CXX
-PKG_CXX= ${_SUNPRO_CXX}
-CXX= ${PKG_CXX:T}
+_ALIASES.CXX= CC c++
CXXPATH= ${SUNWSPROBASE}/bin/CC
+PKG_CXX:= ${_SUNPRO_CXX}
+. if !empty(CXX:M*g++)
+CXX:= ${PKG_CXX:T} # ${CXX} should be named "CC".
+. endif
.endif
+_COMPILER_STRIP_VARS+= ${_SUNPRO_VARS}
# SunPro passes rpath directives to the linker using "-R".
_LINKER_RPATH_FLAG= -R
@@ -57,16 +64,22 @@ PREPEND_PATH+= ${_SUNPRO_DIR}/bin
.endif
# Create compiler driver scripts in ${WRKDIR}.
-.for _target_ in ${_SUNPRO_LINKS}
-. if !target(${${_target_}})
-override-tools: ${${_target_}}
-${${_target_}}:
+.for _var_ in ${_SUNPRO_VARS}
+. if !target(${_SUNPRO_${_var_}})
+override-tools: ${_SUNPRO_${_var_}}
+${_SUNPRO_${_var_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
(${ECHO} '#!${TOOLS_SHELL}'; \
- ${ECHO} 'exec ${SUNWSPROBASE}/bin/${${_target_}:T} "$$@"'; \
+ ${ECHO} 'exec ${SUNWSPROBASE}/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