2008-02-07 21:59:05 +01:00
|
|
|
# $NetBSD: ccc.mk,v 1.17 2008/02/07 20:59:05 rillig Exp $
|
2006-10-22 02:14:17 +02:00
|
|
|
#
|
|
|
|
# This is the compiler definition for the Compaq C Compilers.
|
|
|
|
#
|
2004-11-20 05:37:08 +01:00
|
|
|
|
|
|
|
.if !defined(COMPILER_CCC_MK)
|
|
|
|
COMPILER_CCC_MK= defined
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
2005-01-12 19:37:52 +01:00
|
|
|
# LANGUAGES.<compiler> is the list of supported languages by the
|
|
|
|
# compiler.
|
|
|
|
#
|
|
|
|
LANGUAGES.ccc= # empty
|
2004-11-20 05:37:08 +01:00
|
|
|
|
2005-01-12 18:40:01 +01:00
|
|
|
_CCC_DIR= ${WRKDIR}/.ccc
|
|
|
|
_CCC_VARS= # empty
|
2004-11-20 05:37:08 +01:00
|
|
|
.if exists(/usr/bin/cc)
|
2005-01-12 19:37:52 +01:00
|
|
|
LANGUAGES.ccc+= c
|
2005-01-12 18:40:01 +01:00
|
|
|
_CCC_VARS+= CC
|
|
|
|
_CCC_CC= ${_CCC_DIR}/cc
|
|
|
|
_ALIASES.CC= cc
|
|
|
|
CCPATH= /usr/bin/cc
|
|
|
|
PKG_CC:= ${_CCC_CC}
|
2004-11-20 05:37:08 +01:00
|
|
|
.endif
|
2005-01-12 19:37:52 +01:00
|
|
|
.if exists(/usr/bin/cxx) && exists(/usr/lib/cmplrs/cxx)
|
|
|
|
LANGUAGES.ccc+= c++
|
2005-01-12 18:40:01 +01:00
|
|
|
_CCC_VARS+= CXX
|
|
|
|
_CCC_CXX= ${_CCC_DIR}/cxx
|
|
|
|
_ALIASES.CXX= c++ cxx
|
|
|
|
CXXPATH= /usr/bin/cxx
|
|
|
|
PKG_CXX:= ${_CCC_CXX}
|
2004-11-20 05:37:08 +01:00
|
|
|
.endif
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
_COMPILER_STRIP_VARS+= ${_CCC_VARS}
|
2004-11-20 05:37:08 +01:00
|
|
|
|
2004-11-23 06:32:22 +01:00
|
|
|
.if exists(${CCPATH}) && !defined(CC_VERSION_STRING)
|
2005-01-12 19:42:42 +01:00
|
|
|
CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${AWK} '{print; exit(0);}'
|
|
|
|
CC_VERSION!= ${CCPATH} -V 2>&1 | ${AWK} '{print "CCC-"$3; exit(0);}'
|
2004-11-20 05:37:08 +01:00
|
|
|
.else
|
|
|
|
CC_VERSION_STRING?= ${CC_VERSION}
|
|
|
|
CC_VERSION?= CCC
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# CCC passes rpath directives to the linker using "-rpath".
|
|
|
|
_LINKER_RPATH_FLAG= -rpath
|
|
|
|
|
|
|
|
# CCC passes rpath directives to the linker using "-rpath" tailing ",".
|
2007-03-15 23:33:42 +01:00
|
|
|
_COMPILER_RPATH_FLAG= -Wl,${_LINKER_RPATH_FLAG},
|
2004-11-20 05:37:08 +01:00
|
|
|
|
|
|
|
# Most packages assume ieee floats, make that the default.
|
2005-01-12 18:39:34 +01:00
|
|
|
CFLAGS+= -ieee
|
|
|
|
CXXFLAGS+= -ieee
|
2004-11-20 05:37:08 +01:00
|
|
|
|
2005-01-12 19:37:52 +01:00
|
|
|
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
|
|
|
|
# ones requested by the package in USE_LANGUAGES.
|
2006-12-15 13:46:23 +01:00
|
|
|
#
|
2005-01-12 19:37:52 +01:00
|
|
|
_LANGUAGES.ccc= # empty
|
|
|
|
.for _lang_ in ${USE_LANGUAGES}
|
|
|
|
_LANGUAGES.ccc+= ${LANGUAGES.ccc:M${_lang_}}
|
|
|
|
.endfor
|
|
|
|
|
2005-01-12 18:39:18 +01:00
|
|
|
# Prepend the path to the compiler to the PATH.
|
|
|
|
.if !empty(_LANGUAGES.ccc)
|
|
|
|
PREPEND_PATH+= ${_CCC_DIR}/bin
|
|
|
|
.endif
|
|
|
|
|
2004-11-20 05:37:08 +01:00
|
|
|
# Create compiler driver scripts in ${WRKDIR}.
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
.for _var_ in ${_CCC_VARS}
|
|
|
|
. if !target(${_CCC_${_var_}})
|
2006-12-15 13:46:23 +01:00
|
|
|
override-tools: ${_CCC_${_var_}}
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
${_CCC_${_var_}}:
|
2008-02-07 21:59:05 +01:00
|
|
|
${RUN}${MKDIR} ${.TARGET:H}
|
|
|
|
${RUN} \
|
2004-11-20 05:37:08 +01:00
|
|
|
(${ECHO} '#!${TOOLS_SHELL}'; \
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
${ECHO} 'exec /usr/bin/${.TARGET:T} "$$@"'; \
|
2004-11-20 05:37:08 +01:00
|
|
|
) > ${.TARGET}
|
2008-02-07 21:59:05 +01:00
|
|
|
${RUN}${CHMOD} +x ${.TARGET}
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
. for _alias_ in ${_ALIASES.${_var_}:S/^/${.TARGET:H}\//}
|
2008-02-07 21:59:05 +01:00
|
|
|
${RUN} \
|
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.
2004-11-30 15:50:37 +01:00
|
|
|
if [ ! -x "${_alias_}" ]; then \
|
|
|
|
${LN} -f ${.TARGET} ${_alias_}; \
|
|
|
|
fi
|
|
|
|
. endfor
|
2004-11-20 05:37:08 +01:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2005-01-12 16:31:58 +01:00
|
|
|
# Force the use of f2c-f77 for compiling Fortran.
|
|
|
|
_CCC_USE_F2C= no
|
|
|
|
FCPATH= /nonexistent
|
|
|
|
.if !exists(${FCPATH})
|
|
|
|
_CCC_USE_F2C= yes
|
|
|
|
.endif
|
|
|
|
.if !empty(_CCC_USE_F2C:M[yY][eE][sS])
|
|
|
|
. include "../../mk/compiler/f2c.mk"
|
|
|
|
.endif
|
|
|
|
|
2004-11-20 05:37:08 +01:00
|
|
|
.endif # COMPILER_CCC_MK
|