pkgsrc/mk/compiler/sunpro.mk
jlam c40ee95964 * Move pkgsrc/mk/compiler/bsd.compiler.mk to pkgsrc/mk/compiler.mk.
Package Makefiles may now directly include compiler.mk.

* Don't include compiler.mk within bsd.prefs.mk any longer.  It was only
  included for the purposes of defining CC_VERSION.  Packages that want
  to test the value of CC_VERSION should now first include
  "../../mk/compiler.mk".  Any GCC_REQD statements in package Makefiles
  should be set before compiler.mk is included.

* Simpllfy pkgsrc/mk/compiler/*.mk files as a result of not needing to
  be included indirectly by bsd.prefs.mk.  We remove the special handling
  associated with detecting whether the file was included from within
  bsd.prefs.mk.  These files are now much more straightforward to write
  and understand.

* G/C the BSD_PREFS_MK stack mechanism as the only users (compiler/*)
  no longer need it.

* Ensure that directories are prepended to the PATH only from within
  bsd.pkg.mk.
2004-02-18 13:32:38 +00:00

64 lines
1.7 KiB
Makefile

# $NetBSD: sunpro.mk,v 1.20 2004/02/18 13:32:38 jlam Exp $
.if !defined(COMPILER_SUNPRO_MK)
COMPILER_SUNPRO_MK= defined
.include "../../mk/bsd.prefs.mk"
SUNWSPROBASE?= /opt/SUNWspro
# LANGUAGES.<compiler> is the list of supported languages by the compiler.
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the ones
# requested by the package in USE_LANGUAGES.
#
LANGUAGES.sunpro= c c++
_LANGUAGES.sunpro= # empty
.for _lang_ in ${USE_LANGUAGES}
_LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}}
.endfor
_SUNPRO_DIR= ${WRKDIR}/.sunpro
_SUNPRO_LINKS= # empty
.if exists(${SUNWSPROBASE}/bin/cc)
_SUNPRO_CC= ${_SUNPRO_DIR}/bin/cc
_SUNPRO_LINKS+= _SUNPRO_CC
PKG_CC= ${_SUNPRO_CC}
CC= ${PKG_CC:T}
.endif
.if exists(${SUNWSPROBASE}/bin/CC)
_SUNPRO_CXX= ${_SUNPRO_DIR}/bin/CC
_SUNPRO_LINKS+= _SUNPRO_CXX
PKG_CXX= ${_SUNPRO_CXX}
CXX= ${PKG_CXX:T}
.endif
_COMPILER_LD_FLAG= # empty
.if exists(${SUNWSPROBASE}/bin/cc)
CC_VERSION_STRING!= ${SUNWSPROBASE}/bin/cc -V 2>&1 || ${TRUE}
CC_VERSION!= ${SUNWSPROBASE}/bin/cc -V 2>&1 | ${GREP} '^cc'
.else
CC_VERSION_STRING?= ${CC_VERSION}
CC_VERSION?= cc: Sun C
.endif
# Prepend the path to the compiler to the PATH.
.if !empty(_LANGUAGES.sunpro)
PREPEND_PATH+= ${_SUNPRO_DIR}/bin
.endif
# Create compiler driver scripts in ${WRKDIR}.
.for _target_ in ${_SUNPRO_LINKS}
. if !target(${${_target_}})
override-tools: ${${_target_}}
${${_target_}}:
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
${_PKG_SILENT}${_PKG_DEBUG} \
(${ECHO} '#!${TOOLS_SHELL}'; \
${ECHO} 'exec ${SUNWSPROBASE}/bin/${${_target_}:T} "$$@"'; \
) > ${.TARGET}
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
. endif
.endfor
.endif # COMPILER_SUNPRO_MK