2005-01-12 18:27:50 +01:00
|
|
|
# $NetBSD: xlc.mk,v 1.9 2005/01/12 17:27:50 jlam Exp $
|
2004-10-06 11:49:53 +02:00
|
|
|
|
|
|
|
.if !defined(COMPILER_XLC_MK)
|
|
|
|
COMPILER_XLC_MK= defined
|
|
|
|
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
|
|
|
|
XLCBASE?= /opt/ibmcmp/vacpp/6.0
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
#
|
2004-11-23 06:24:28 +01:00
|
|
|
LANGUAGES.xlc= c c++
|
|
|
|
_LANGUAGES.xlc= # empty
|
2004-10-06 11:49:53 +02:00
|
|
|
.for _lang_ in ${USE_LANGUAGES}
|
|
|
|
_LANGUAGES.xlc+= ${LANGUAGES.xlc:M${_lang_}}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
_XLC_DIR= ${WRKDIR}/.xlc
|
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
|
|
|
_XLC_VARS= # empty
|
2004-10-06 15:56:46 +02:00
|
|
|
.if exists(${XLCBASE}/bin/xlc)
|
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
|
|
|
_XLC_VARS+= CC
|
2004-10-06 15:56:46 +02:00
|
|
|
_XLC_CC= ${_XLC_DIR}/bin/xlc
|
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
|
|
|
_ALIASES.CC= cc xlc
|
2004-11-23 01:46:26 +01:00
|
|
|
CCPATH= ${XLCBASE}/bin/xlc
|
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
|
|
|
PKG_CC:= ${_XLC_CC}
|
2004-10-06 11:49:53 +02:00
|
|
|
.endif
|
|
|
|
.if exists(${XLCBASE}/bin/xlc++)
|
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
|
|
|
_XLC_VARS+= CXX
|
2004-10-06 11:49:53 +02:00
|
|
|
_XLC_CXX= ${_XLC_DIR}/bin/xlc++
|
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
|
|
|
_ALIASES.CXX= c++ xlc++
|
2004-11-23 01:46:26 +01:00
|
|
|
CXXPATH= ${XLCBASE}/bin/xlc++
|
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
|
|
|
PKG_CXX:= ${_XLC_CXX}
|
2004-10-06 11:49:53 +02: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+= ${_XLC_VARS}
|
2004-10-06 11:49:53 +02:00
|
|
|
|
2004-11-23 06:32:22 +01:00
|
|
|
.if exists(${CCPATH})
|
|
|
|
CC_VERSION_STRING!= ${CCPATH} -V 2>&1 | ${GREP} 'IBM XL C.*for' | ${SED} -e 's/^ *//' || ${TRUE}
|
2004-10-06 11:49:53 +02:00
|
|
|
CC_VERSION= ${CC_VERSION_STRING}
|
|
|
|
.else
|
|
|
|
CC_VERSION_STRING?= ${CC_VERSION}
|
|
|
|
CC_VERSION?= IBM XL C
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Prepend the path to the compiler to the PATH.
|
|
|
|
.if !empty(_LANGUAGES.xlc)
|
|
|
|
PREPEND_PATH+= ${_XLC_DIR}/bin
|
|
|
|
.endif
|
|
|
|
|
2004-11-27 16:28:34 +01:00
|
|
|
# Most packages assume alloca is available without #pragma alloca, so
|
|
|
|
# make it the default.
|
|
|
|
CFLAGS+=-ma
|
|
|
|
|
2004-10-06 11:49:53 +02: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 ${_XLC_VARS}
|
|
|
|
. if !target(${_XLC_${_var_}})
|
|
|
|
override-tools: ${_XLC_${_var_}}
|
|
|
|
${_XLC_${_var_}}:
|
2004-10-06 11:49:53 +02:00
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${.TARGET:H}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
(${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 ${XLCBASE}/bin/${.TARGET:T} "$$@"'; \
|
2004-10-06 11:49:53 +02:00
|
|
|
) > ${.TARGET}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG}${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}\//}
|
|
|
|
${_PKG_SILENT}${_PKG_DEBUG} \
|
|
|
|
if [ ! -x "${_alias_}" ]; then \
|
|
|
|
${LN} -f ${.TARGET} ${_alias_}; \
|
|
|
|
fi
|
|
|
|
. endfor
|
2004-10-06 11:49:53 +02:00
|
|
|
. endif
|
|
|
|
.endfor
|
|
|
|
|
2005-01-12 16:31:58 +01:00
|
|
|
# Force the use of f2c-f77 for compiling Fortran.
|
|
|
|
_XLC_USE_F2C= no
|
|
|
|
FCPATH= /nonexistent
|
|
|
|
.if !exists(${FCPATH})
|
|
|
|
_XLC_USE_F2C= yes
|
|
|
|
.endif
|
|
|
|
.if !empty(_XLC_USE_F2C:M[yY][eE][sS])
|
|
|
|
. include "../../mk/compiler/f2c.mk"
|
|
|
|
.endif
|
|
|
|
|
2004-10-06 11:49:53 +02:00
|
|
|
.endif # COMPILER_XLC_MK
|