Makefile.inc revision 1.2 1 1.2 martin # $NetBSD: Makefile.inc,v 1.2 2019/11/14 13:16:35 martin Exp $
2 1.1 joerg
3 1.1 joerg .if !defined(LLVM_TOPLEVEL_MK)
4 1.1 joerg LLVM_TOPLEVEL_MK=
5 1.1 joerg
6 1.1 joerg .include <bsd.own.mk>
7 1.1 joerg
8 1.1 joerg COMMON_REVISION= 01f3a59fb3e2542fce74c768718f594d0debd0da
9 1.1 joerg CLANG_REVISION= ${COMMON_REVISION}
10 1.1 joerg LLVM_REVISION= ${COMMON_REVISION}
11 1.1 joerg
12 1.1 joerg LLVM_VERSION= 9.0.0
13 1.1 joerg CLANG_VERSION= 9.0.0
14 1.1 joerg
15 1.1 joerg CLANG_SRCDIR:= ${.PARSEDIR}/dist/clang
16 1.1 joerg LLVM_SRCDIR:= ${.PARSEDIR}/dist/llvm
17 1.1 joerg LLVM_TOPLEVEL:= ${.PARSEDIR}
18 1.1 joerg CONFIG_DIR:= ${.PARSEDIR}/autoconf
19 1.1 joerg
20 1.1 joerg CPPFLAGS+= -I. -I${CLANG_SRCDIR}/include -I${LLVM_SRCDIR}/include
21 1.1 joerg
22 1.2 martin # Bogus warning with -O2 in GCC 7 and 8.
23 1.2 martin CWARNFLAGS.gcc+= ${${ACTIVE_CC} == "gcc" && ${HAVE_GCC:U0} < 9:? -Wno-stringop-overflow :}
24 1.2 martin
25 1.1 joerg .if defined(HOSTLIB) || defined(HOSTPROG) || defined(_BSD_HOSTINIT_MK_)
26 1.1 joerg LLVM_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/include
27 1.1 joerg CLANG_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include
28 1.1 joerg LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
29 1.1 joerg LLVM_TOOLCONF_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
30 1.1 joerg HOST_CPPFLAGS+= ${CPPFLAGS}
31 1.1 joerg HOST_CXXFLAGS+= -O2 -fno-rtti -fno-exceptions
32 1.1 joerg HOST_CPPFLAGS+= -std=c++14
33 1.1 joerg LLVM_TARGETS= x86,powerpc,sparc,aarch64,arm,mips
34 1.1 joerg .else
35 1.1 joerg LLVM_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config
36 1.1 joerg CLANG_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config
37 1.1 joerg LLVM_INCLUDE_OBJDIR!= cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR}
38 1.1 joerg LLVM_TARGETS= x86,powerpc,sparc,aarch64,arm,mips,amdgpu
39 1.1 joerg
40 1.1 joerg CXXFLAGS+= -std=c++14
41 1.1 joerg CXXFLAGS+= -fno-rtti -fno-exceptions
42 1.1 joerg CXXFLAGS+= -ffunction-sections -fdata-sections
43 1.1 joerg LDFLAGS+= -Wl,--gc-sections
44 1.1 joerg DPADD+= ${LIBEXECINFO}
45 1.1 joerg LDADD+= -lexecinfo
46 1.1 joerg .endif
47 1.1 joerg CPPFLAGS+= -I${LLVM_INCLUDE_OBJDIR} -I${LLVM_INCLUDE_CONFIG} \
48 1.1 joerg -I${CLANG_INCLUDE_CONFIG}
49 1.1 joerg
50 1.1 joerg LLVM_PLATFORM=${MACHINE_GNU_ARCH}--netbsd
51 1.1 joerg
52 1.1 joerg LLVM_CONFIGURE_ARGS= \
53 1.1 joerg --enable-targets=${LLVM_TARGETS} \
54 1.1 joerg --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION:R}:/usr/include \
55 1.1 joerg --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
56 1.1 joerg --with-clang-default-openmp-runtime=libomp \
57 1.1 joerg --with-llvm-srcdir=${LLVM_SRCDIR} \
58 1.1 joerg --with-clang-srcdir=${CLANG_SRCDIR} \
59 1.1 joerg --host=${LLVM_PLATFORM} --disable-compiler-version-checks \
60 1.1 joerg --disable-bindings llvm_cv_gnu_make_command=${MAKE}
61 1.1 joerg
62 1.1 joerg .for tool in circo dot dotty fdp neato twopi xdot
63 1.1 joerg LLVM_CONFIGURE_ARGS+= ac_cv_path_${tool:tu}="echo ${tool}"
64 1.1 joerg .endfor
65 1.1 joerg
66 1.1 joerg .endif
67