1 # $NetBSD: sunpro.mk,v 1.44 2008/06/17 11:23:48 sketch Exp $
3 # This is the compiler definition for the SUNWspro C compiler.
5 # User-settable variables:
8 # The base directory where the compiler is installed.
10 # Keywords: sun sunpro sunwspro
13 .if !defined(COMPILER_SUNPRO_MK)
14 COMPILER_SUNPRO_MK= defined
16 .include "../../mk/bsd.prefs.mk"
18 SUNWSPROBASE?= /opt/SUNWspro
21 # XXX: should be moved to compiler.mk.
23 _COMPILER_TYPE.c++ = CXX
24 _COMPILER_TYPE.fortran= FC
26 # sunpro-specific definitions
27 _COMPILER_LANGS= c c++ fortran
29 _COMPILER_NAME.c++ = CC
30 _COMPILER_NAME.fortran= f77
32 # LANGUAGES.<compiler> is the list of supported languages by the
35 LANGUAGES.sunpro= # empty
37 # XXX: Should be moved to compiler.mk.
38 .for l in ${_COMPILER_LANGS}
39 . for t in ${_COMPILER_TYPE.${l}}
40 . for n in ${_COMPILER_NAME.${l}}
41 . if exists(${SUNWSPROBASE}/bin/${n})
42 LANGUAGES.sunpro+= ${l}
43 _COMPILER_STRIP_VARS+= ${t}
44 # XXX: What is the ${t}PATH variable used for? And why isn't it
45 # parameterized as usual? This makes searching for it very difficult.
47 ${t}PATH= ${SUNWSPROBASE}/bin/${n}
48 PKG_${t}:= ${SUNWSPROBASE}/bin/${n}
54 # Turn on C99 support if required
55 # XXX: What if a package needs both -- a c89 and a c99 compiler?
57 # Solaris SunPro Compiler 11/12 fails on Solaris 8/9 with -xc99
58 # The header files supplied by the OS are not c99 aware, the
59 # manpage suggests the setting: -xc99=all,no_lib
61 .if !empty(USE_LANGUAGES:Mc99)
62 _WRAP_EXTRA_ARGS.CC+= -xc99
63 . if !empty(MACHINE_PLATFORM:MSunOS-5.[89]-*)
64 _WRAP_EXTRA_ARGS.CC+= -xc99=all,no_lib
68 # The Solaris linker uses "-R" for rpath directives.
69 # XXX: This shouldn't be here, but in platform/SunOS.mk.
70 _LINKER_RPATH_FLAG= -R
72 # SunPro passes rpath directives to the linker using "-R", however
73 # some packages require the "-Wl," prefix to recognize linker options.
74 # This is transformed by the compiler wrapper to "-R".
75 _COMPILER_RPATH_FLAG= -Wl,-R
77 # XXX: What about the versions of the other compilers? Fortran and C++?
78 # XXX: should be moved to compiler.mk.
80 CC_VERSION_STRING!= ${CCPATH} -V 2>&1 || ${TRUE}
81 CC_VERSION!= ${CCPATH} -V 2>&1 | ${GREP} '^cc'
83 CC_VERSION_STRING?= ${CC_VERSION}
84 CC_VERSION?= cc: Sun C
87 # SunPro compiler must be passed certain flags to compile/link 64-bit code.
88 .if !empty(CC_VERSION:M5.9)
89 _COMPILER_ABI_FLAG.64= -m64
90 .elif ${MACHINE_ARCH} == "sparc"
91 _COMPILER_ABI_FLAG.64= -xtarget=ultra -xarch=v9
93 _COMPILER_ABI_FLAG.64= -xarch=amd64
96 # _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
97 # ones requested by the package in USE_LANGUAGES.
99 # XXX: should be moved to compiler.mk.
100 _LANGUAGES.sunpro= # empty
101 .for _lang_ in ${USE_LANGUAGES}
102 _LANGUAGES.sunpro+= ${LANGUAGES.sunpro:M${_lang_}}
105 .endif # COMPILER_SUNPRO_MK