2004-08-27 08:29:06 +02:00
|
|
|
# $NetBSD: mipspro.mk,v 1.25 2004/08/27 06:29:09 jlam Exp $
|
New compiler specification framework, based on mk/compiler.mk. The
changes from the old compiler.mk are:
* Split apart the compiler-specific logic into separate files. This
should make supporting other compilers a bit easier.
* Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23],
USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER
variable.
* Clean up the GCC handling so that it's all controlled by a single
variable GCC_REQD. The following behaviour is expected:
(a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on
the system.
(b) If there is no GCC, then the appropriate GCC corresponding to
GCC_REQD is installed and used.
(c) If there is a GCC, if it satisfies GCC_REQD, then use it;
otherwise install and use the appropriate GCC package.
(d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3
is installed and used.
(e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is
still used instead of installing lang/gcc.
New features include:
* PKGSRC_COMPILER takes a list of values specifying the chain of
compilers to call when building packages. Valid values are:
distcc distributed C/C++ (chainable)
ccache compiler cache (chainable)
gcc GNU
mipspro Silicon Graphics, Inc. MIPSpro
sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun
ONE Studio
The default is "gcc". You can use ccache and/or distcc with an
appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
* Change GCC_REQD to hold a list of values that we scan through to
find the highest version of GCC required by the build. Package
Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
|
|
|
|
|
|
|
.if !defined(COMPILER_MIPSPRO_MK)
|
2004-02-18 14:32:38 +01:00
|
|
|
COMPILER_MIPSPRO_MK= defined
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
New compiler specification framework, based on mk/compiler.mk. The
changes from the old compiler.mk are:
* Split apart the compiler-specific logic into separate files. This
should make supporting other compilers a bit easier.
* Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23],
USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER
variable.
* Clean up the GCC handling so that it's all controlled by a single
variable GCC_REQD. The following behaviour is expected:
(a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on
the system.
(b) If there is no GCC, then the appropriate GCC corresponding to
GCC_REQD is installed and used.
(c) If there is a GCC, if it satisfies GCC_REQD, then use it;
otherwise install and use the appropriate GCC package.
(d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3
is installed and used.
(e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is
still used instead of installing lang/gcc.
New features include:
* PKGSRC_COMPILER takes a list of values specifying the chain of
compilers to call when building packages. Valid values are:
distcc distributed C/C++ (chainable)
ccache compiler cache (chainable)
gcc GNU
mipspro Silicon Graphics, Inc. MIPSpro
sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun
ONE Studio
The default is "gcc". You can use ccache and/or distcc with an
appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
* Change GCC_REQD to hold a list of values that we scan through to
find the highest version of GCC required by the build. Package
Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
|
|
|
|
2004-02-01 02:02:37 +01:00
|
|
|
MIPSPROBASE?= /usr
|
2004-02-01 01:59:51 +01:00
|
|
|
|
2004-02-02 11:03:46 +01:00
|
|
|
# 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.mipspro= c c++
|
|
|
|
_LANGUAGES.mipspro= # empty
|
2004-02-18 14:32:38 +01:00
|
|
|
.for _lang_ in ${USE_LANGUAGES}
|
2004-02-03 21:38:39 +01:00
|
|
|
_LANGUAGES.mipspro+= ${LANGUAGES.mipspro:M${_lang_}}
|
2004-02-18 14:32:38 +01:00
|
|
|
.endfor
|
2004-02-02 11:03:46 +01:00
|
|
|
|
2004-02-07 03:58:10 +01:00
|
|
|
_MIPSPRO_DIR= ${WRKDIR}/.mipspro
|
|
|
|
_MIPSPRO_LINKS= # empty
|
2004-02-18 14:32:38 +01:00
|
|
|
.if exists(${MIPSPROBASE}/bin/cc)
|
2004-02-07 03:58:10 +01:00
|
|
|
_MIPSPRO_CC= ${_MIPSPRO_DIR}/bin/cc
|
|
|
|
_MIPSPRO_LINKS+= _MIPSPRO_CC
|
2004-02-08 03:59:14 +01:00
|
|
|
PKG_CC= ${_MIPSPRO_CC}
|
|
|
|
CC= ${PKG_CC:T}
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif
|
|
|
|
.if exists(${MIPSPROBASE}/bin/CC)
|
2004-02-07 03:58:10 +01:00
|
|
|
_MIPSPRO_CXX= ${_MIPSPRO_DIR}/bin/CC
|
|
|
|
_MIPSPRO_LINKS+= _MIPSPRO_CXX
|
2004-02-08 03:59:14 +01:00
|
|
|
PKG_CXX= ${_MIPSPRO_CXX}
|
|
|
|
CXX= ${PKG_CXX:T}
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif
|
New compiler specification framework, based on mk/compiler.mk. The
changes from the old compiler.mk are:
* Split apart the compiler-specific logic into separate files. This
should make supporting other compilers a bit easier.
* Deprecate all of the USE_* compiler.mk variables, e.g. USE_GCC[23],
USE_SUNPRO, etc. It's all replaced with a new PKGSRC_COMPILER
variable.
* Clean up the GCC handling so that it's all controlled by a single
variable GCC_REQD. The following behaviour is expected:
(a) If USE_PKGSRC_GCC is defined, then pretend there is no GCC on
the system.
(b) If there is no GCC, then the appropriate GCC corresponding to
GCC_REQD is installed and used.
(c) If there is a GCC, if it satisfies GCC_REQD, then use it;
otherwise install and use the appropriate GCC package.
(d) If lang/gcc is installed and GCC_REQD > 2.95.3, then lang/gcc3
is installed and used.
(e) If lang/gcc3 is installed and GCC_REQD = 2.95.3, then gcc3 is
still used instead of installing lang/gcc.
New features include:
* PKGSRC_COMPILER takes a list of values specifying the chain of
compilers to call when building packages. Valid values are:
distcc distributed C/C++ (chainable)
ccache compiler cache (chainable)
gcc GNU
mipspro Silicon Graphics, Inc. MIPSpro
sunpro Sun Microsystems, Inc. WorkShip/Forte/Sun
ONE Studio
The default is "gcc". You can use ccache and/or distcc with an
appropriate PKGSRC_COMPILER setting, e.g. "ccache distcc gcc".
* Change GCC_REQD to hold a list of values that we scan through to
find the highest version of GCC required by the build. Package
Makefiles should now do "GCC_REQD+=..." instead of "GCC_REQD=...".
2004-02-01 01:31:00 +01:00
|
|
|
|
2004-02-18 14:32:38 +01:00
|
|
|
.if exists(${MIPSPROBASE}/bin/cc)
|
2004-02-05 23:05:42 +01:00
|
|
|
# MIPSpro Compilers: Version 7.3.1.2m
|
2004-02-12 12:50:46 +01:00
|
|
|
CC_VERSION_STRING!= ${MIPSPROBASE}/bin/cc -version 2>&1 || ${TRUE}
|
2004-02-12 09:54:48 +01:00
|
|
|
CC_VERSION!= ${MIPSPROBASE}/bin/cc -version 2>&1 | ${GREP} '^MIPSpro'
|
2004-02-18 14:32:38 +01:00
|
|
|
.else
|
2004-02-18 12:13:54 +01:00
|
|
|
CC_VERSION_STRING?= ${CC_VERSION}
|
|
|
|
CC_VERSION?= MIPSpro Compilers
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif
|
2004-02-05 04:35:20 +01:00
|
|
|
|
2004-08-27 08:29:06 +02:00
|
|
|
# MIPSPro linker option used to set the rpath.
|
|
|
|
_LINKER_RPATH_FLAG= -rpath
|
|
|
|
|
|
|
|
# MIPSPro passes rpath directives to the linker using "-Wl,-rpath,".
|
|
|
|
_COMPILER_RPATH_FLAG= -Wl,${_LINKER_RPATH_FLAG},
|
2004-05-06 16:25:02 +02:00
|
|
|
|
2004-02-05 04:35:20 +01:00
|
|
|
# Prepend the path to the compiler to the PATH.
|
2004-02-18 14:32:38 +01:00
|
|
|
.if !empty(_LANGUAGES.mipspro)
|
2004-02-07 03:58:10 +01:00
|
|
|
PREPEND_PATH+= ${_MIPSPRO_DIR}/bin
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif
|
2004-02-07 03:58:10 +01:00
|
|
|
|
2004-02-09 06:50:03 +01:00
|
|
|
# Create compiler driver scripts in ${WRKDIR}.
|
2004-02-18 14:32:38 +01:00
|
|
|
.for _target_ in ${_MIPSPRO_LINKS}
|
|
|
|
. if !target(${${_target_}})
|
2004-02-07 03:58:10 +01:00
|
|
|
override-tools: ${${_target_}}
|
|
|
|
${${_target_}}:
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
2004-02-09 06:50:03 +01:00
|
|
|
(${ECHO} '#!${TOOLS_SHELL}'; \
|
|
|
|
${ECHO} 'exec ${MIPSPROBASE}/bin/${${_target_}:T} "$$@"'; \
|
|
|
|
) > ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${CHMOD} +x ${.TARGET}
|
2004-02-18 14:32:38 +01:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2004-06-10 22:34:08 +02:00
|
|
|
.if defined(ABI)
|
|
|
|
MABIFLAG= -${ABI:C/^32$/n&/}
|
|
|
|
CFLAGS+= ${MABIFLAG}
|
|
|
|
LDFLAGS+= ${MABIFLAG}
|
|
|
|
.endif
|
|
|
|
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif # COMPILER_MIPSPRO_MK
|