2015-05-04 01:16:41 +02:00
|
|
|
# $NetBSD: sunpro.mk,v 1.49 2015/05/03 23:16:41 joerg Exp $
|
2006-10-22 02:14:17 +02:00
|
|
|
#
|
|
|
|
# This is the compiler definition for the SUNWspro C compiler.
|
|
|
|
#
|
|
|
|
# User-settable variables:
|
|
|
|
#
|
|
|
|
# SUNWSPROBASE
|
|
|
|
# The base directory where the compiler is installed.
|
|
|
|
#
|
2009-05-12 07:44:02 +02:00
|
|
|
# Keywords: sun sunpro sunwspro
|
|
|
|
#
|
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_SUNPRO_MK)
|
2004-02-18 14:32:38 +01:00
|
|
|
COMPILER_SUNPRO_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
|
|
|
|
2007-03-09 10:59:21 +01:00
|
|
|
SUNWSPROBASE?= /opt/SUNWspro
|
2015-05-04 01:16:41 +02:00
|
|
|
.if !exists(${SUNWSPROBASE})
|
2013-04-06 20:09:43 +02:00
|
|
|
SUNWSPROBASE!= /bin/ls -d /opt/solstudio*
|
|
|
|
.endif
|
2007-03-09 10:59:21 +01:00
|
|
|
|
|
|
|
# common definitions
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: should be moved to compiler.mk.
|
2007-03-09 10:59:21 +01:00
|
|
|
_COMPILER_TYPE.c= CC
|
|
|
|
_COMPILER_TYPE.c++ = CXX
|
|
|
|
_COMPILER_TYPE.fortran= FC
|
|
|
|
|
|
|
|
# sunpro-specific definitions
|
2010-07-30 09:58:58 +02:00
|
|
|
_COMPILER_LANGS= c c++ fortran fortran77
|
2007-03-09 10:59:21 +01:00
|
|
|
_COMPILER_NAME.c= cc
|
|
|
|
_COMPILER_NAME.c++ = CC
|
|
|
|
_COMPILER_NAME.fortran= f77
|
2010-07-30 09:58:58 +02:00
|
|
|
_COMPILER_NAME.fortran77= f77
|
2004-02-01 01:57:26 +01:00
|
|
|
|
2005-01-12 19:37:52 +01:00
|
|
|
# LANGUAGES.<compiler> is the list of supported languages by the
|
|
|
|
# compiler.
|
2004-02-02 11:03:46 +01:00
|
|
|
#
|
2005-01-12 19:37:52 +01:00
|
|
|
LANGUAGES.sunpro= # empty
|
2004-02-02 11:03:46 +01:00
|
|
|
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: Should be moved to compiler.mk.
|
2007-03-09 10:59:21 +01:00
|
|
|
.for l in ${_COMPILER_LANGS}
|
|
|
|
. for t in ${_COMPILER_TYPE.${l}}
|
|
|
|
. for n in ${_COMPILER_NAME.${l}}
|
|
|
|
. if exists(${SUNWSPROBASE}/bin/${n})
|
|
|
|
LANGUAGES.sunpro+= ${l}
|
2007-03-09 11:58:20 +01:00
|
|
|
_COMPILER_STRIP_VARS+= ${t}
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: What is the ${t}PATH variable used for? And why isn't it
|
|
|
|
# parameterized as usual? This makes searching for it very difficult.
|
|
|
|
# Same for PKG_${t}.
|
2007-03-09 10:59:21 +01:00
|
|
|
${t}PATH= ${SUNWSPROBASE}/bin/${n}
|
2007-03-09 11:29:29 +01:00
|
|
|
PKG_${t}:= ${SUNWSPROBASE}/bin/${n}
|
2007-03-09 10:59:21 +01:00
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
. endfor
|
|
|
|
.endfor
|
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
|
|
|
|
2007-05-23 10:42:36 +02:00
|
|
|
# Turn on C99 support if required
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: What if a package needs both -- a c89 and a c99 compiler?
|
2007-11-30 17:55:28 +01:00
|
|
|
#
|
|
|
|
# Solaris SunPro Compiler 11/12 fails on Solaris 8/9 with -xc99
|
|
|
|
# The header files supplied by the OS are not c99 aware, the
|
|
|
|
# manpage suggests the setting: -xc99=all,no_lib
|
|
|
|
# See PR 37200
|
2007-05-23 10:42:36 +02:00
|
|
|
.if !empty(USE_LANGUAGES:Mc99)
|
|
|
|
_WRAP_EXTRA_ARGS.CC+= -xc99
|
2007-11-30 17:55:28 +01:00
|
|
|
. if !empty(MACHINE_PLATFORM:MSunOS-5.[89]-*)
|
|
|
|
_WRAP_EXTRA_ARGS.CC+= -xc99=all,no_lib
|
|
|
|
. endif
|
2007-05-23 10:42:36 +02:00
|
|
|
.endif
|
|
|
|
|
2005-07-21 03:36:25 +02:00
|
|
|
# The Solaris linker uses "-R" for rpath directives.
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: This shouldn't be here, but in platform/SunOS.mk.
|
2004-08-27 08:29:06 +02:00
|
|
|
_LINKER_RPATH_FLAG= -R
|
|
|
|
|
2005-07-21 03:36:25 +02:00
|
|
|
# SunPro passes rpath directives to the linker using "-R", however
|
|
|
|
# some packages require the "-Wl," prefix to recognize linker options.
|
|
|
|
# This is transformed by the compiler wrapper to "-R".
|
|
|
|
_COMPILER_RPATH_FLAG= -Wl,-R
|
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
|
|
|
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: What about the versions of the other compilers? Fortran and C++?
|
|
|
|
# XXX: should be moved to compiler.mk.
|
2004-11-23 06:32:22 +01:00
|
|
|
.if exists(${CCPATH})
|
|
|
|
CC_VERSION_STRING!= ${CCPATH} -V 2>&1 || ${TRUE}
|
|
|
|
CC_VERSION!= ${CCPATH} -V 2>&1 | ${GREP} '^cc'
|
2004-02-18 14:32:38 +01:00
|
|
|
.else
|
2004-02-18 12:13:54 +01:00
|
|
|
CC_VERSION_STRING?= ${CC_VERSION}
|
|
|
|
CC_VERSION?= cc: Sun C
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif
|
2004-02-05 04:35:20 +01:00
|
|
|
|
2008-06-17 13:23:48 +02:00
|
|
|
# SunPro compiler must be passed certain flags to compile/link 64-bit code.
|
2009-10-25 18:15:44 +01:00
|
|
|
.if !empty(CC_VERSION:M5.9) || !empty(CC_VERSION:M5.1[0-9])
|
2008-06-17 13:23:48 +02:00
|
|
|
_COMPILER_ABI_FLAG.64= -m64
|
|
|
|
.elif ${MACHINE_ARCH} == "sparc"
|
|
|
|
_COMPILER_ABI_FLAG.64= -xtarget=ultra -xarch=v9
|
|
|
|
.else
|
|
|
|
_COMPILER_ABI_FLAG.64= -xarch=amd64
|
|
|
|
.endif
|
|
|
|
|
2005-01-12 19:37:52 +01:00
|
|
|
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
|
|
|
|
# ones requested by the package in USE_LANGUAGES.
|
|
|
|
#
|
2007-10-06 00:09:09 +02:00
|
|
|
# XXX: should be moved to compiler.mk.
|
2005-01-12 19:37:52 +01:00
|
|
|
_LANGUAGES.sunpro= # empty
|
|
|
|
.for _lang_ in ${USE_LANGUAGES}
|
|
|
|
_LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}}
|
|
|
|
.endfor
|
|
|
|
|
2004-02-18 14:32:38 +01:00
|
|
|
.endif # COMPILER_SUNPRO_MK
|