743f365cee
Default to f2c for Fortran, mirroring gcc. Append -Qunused-arguments in the wrappers to unbreak many stupid configure checks that get confused by the (also added) -L options.
73 lines
1.7 KiB
Makefile
73 lines
1.7 KiB
Makefile
# $NetBSD: clang.mk,v 1.7 2011/07/19 14:02:47 joerg Exp $
|
|
#
|
|
# This is the compiler definition for the clang compiler.
|
|
#
|
|
# User-settable variables:
|
|
#
|
|
# CLANGBASE
|
|
# The base directory where the compiler is installed.
|
|
#
|
|
|
|
.if !defined(COMPILER_CLANG_MK)
|
|
COMPILER_CLANG_MK= defined
|
|
|
|
# Add the dependency on clang
|
|
# TODO: may be installed already, check for this
|
|
#BUILD_DEPENDS+= clang-[0-9]*:../../lang/clang
|
|
|
|
.include "../../mk/bsd.prefs.mk"
|
|
|
|
CLANGBASE?= ${LOCALBASE}
|
|
LANGUAGES.clang= # empty
|
|
|
|
.if exists(${CLANGBASE}/bin/clang)
|
|
LANGUAGES.clang+= c objc
|
|
_COMPILER_STRIP_VARS+= CC
|
|
CCPATH= ${CLANGBASE}/bin/clang
|
|
PKG_CC:= ${CCPATH}
|
|
.endif
|
|
|
|
.if exists(${CLANGBASE}/bin/clang++)
|
|
LANGUAGES.clang+= c++
|
|
_COMPILER_STRIP_VARS+= CXX
|
|
CXXPATH= ${CLANGBASE}/bin/clang++
|
|
PKG_CXX:= ${CXXPATH}
|
|
.endif
|
|
|
|
.if exists(${CLANGBASE}/bin/clang-cpp)
|
|
CPPPATH= ${CLANGBASE}/bin/clang-cpp
|
|
PKG_CPP:= ${CPPPATH}
|
|
.endif
|
|
|
|
.if exists(${CCPATH})
|
|
CC_VERSION_STRING!= ${CCPATH} -v 2>&1
|
|
CC_VERSION!= ${CCPATH} -dumpversion 2>&1
|
|
.else
|
|
CC_VERSION_STRING?= ${CC_VERSION}
|
|
CC_VERSION?= clang
|
|
.endif
|
|
|
|
_COMPILER_ABI_FLAG.32= -m32
|
|
_COMPILER_ABI_FLAG.64= -m64
|
|
_COMPILER_LD_FLAG= -Wl,
|
|
_LINKER_RPATH_FLAG= -rpath
|
|
_COMPILER_RPATH_FLAG= ${_COMPILER_LD_FLAG}${_LINKER_RPATH_FLAG},
|
|
|
|
# _LANGUAGES.<compiler> is ${LANGUAGES.<compiler>} restricted to the
|
|
# ones requested by the package in USE_LANGUAGES.
|
|
#
|
|
_LANGUAGES.clang= # empty
|
|
.for _lang_ in ${USE_LANGUAGES}
|
|
_LANGUAGES.clang+= ${LANGUAGES.clang:M${_lang_}}
|
|
.endfor
|
|
|
|
PKGSRC_FORTRAN?=f2c
|
|
|
|
.if !empty(PKGSRC_FORTRAN)
|
|
. include "../../mk/compiler/${PKGSRC_FORTRAN}.mk"
|
|
.endif
|
|
|
|
_WRAP_EXTRA_ARGS.CC+= -Qunused-arguments
|
|
_WRAP_EXTRA_ARGS.CXX+= -Qunused-arguments
|
|
|
|
.endif # COMPILER_CLANG_MK
|