etc/services - sync with NetBSD-8
[minix.git] / external / bsd / llvm / Makefile.inc
blob30964712fb1e6b108eea9147f18687b976c33436
1 #       $NetBSD: Makefile.inc,v 1.79 2015/05/29 17:37:50 joerg Exp $
3 .if !defined(LLVM_TOPLEVEL_MK)
4 LLVM_TOPLEVEL_MK=
6 .include <bsd.own.mk>
8 SVN_ROOT=               http://llvm.org/svn/llvm-project
9 SVN_BRANCH=             branches/release_36
11 COMMON_REVISION=        237755
12 CLANG_REVISION=         ${COMMON_REVISION}
13 LLD_REVISION=           ${COMMON_REVISION}
14 LLDB_REVISION=          ${COMMON_REVISION}
15 LLVM_REVISION=          ${COMMON_REVISION}
17 MCLINKER_REVISION=      deeb2a77b4165827316f88e0a7ba4ba6b743a080
18 MCLINKER_ROOT=          https://code.google.com/p/mclinker/
20 LLVM_VERSION=           3.6.1
21 CLANG_VERSION=          3.6.1
22 LLD_VERSION=            3.6.1
24 CLANG_SRCDIR:=  ${.PARSEDIR}/dist/clang
25 LLD_SRCDIR:=    ${.PARSEDIR}/dist/lld
26 LLDB_SRCDIR:=   ${.PARSEDIR}/dist/lldb
27 LLVM_SRCDIR:=   ${.PARSEDIR}/dist/llvm
28 MCLINKER_SRCDIR:=       ${.PARSEDIR}/dist/mclinker
29 LLVM_TOPLEVEL:= ${.PARSEDIR}
31 CPPFLAGS+=      -I. -I${CLANG_SRCDIR}/include -I${LLD_SRCDIR}/include \
32                 -I${LLVM_SRCDIR}/include -I${MCLINKER_SRCDIR}/include \
33                 -I${LLDB_SRCDIR}/include \
34                 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS \
35                 -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER
37 .if defined(HOSTLIB) || defined(HOSTPROG)
38 LLVM_INCLUDE_CONFIG=    ${LLVM_TOOLCONF_OBJDIR}/config/include
39 CLANG_INCLUDE_CONFIG=   ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include
40 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
41 LLVM_INCLUDE_OBJDIR!=   cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
42 LLVM_TOOLCONF_OBJDIR!=  cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
43 HOST_CPPFLAGS+= ${CPPFLAGS}
44 HOST_CXXFLAGS+= -O2 -fno-rtti -fno-exceptions
45 HOST_CPPFLAGS+= -std=c++11
46 .else
47 LLVM_INCLUDE_CONFIG=    ${LLVM_TOPLEVEL}/config
48 CLANG_INCLUDE_CONFIG=   ${LLVM_TOPLEVEL}/config
49 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
50 LLVM_INCLUDE_OBJDIR!=   cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR}
52 .if ${MKLLDB:Uno} == "yes"
53 CPPFLAGS+=      -DLLDB_DISABLE_PYTHON
54 .endif
55 CXXFLAGS+=      -std=c++11
56 CXXFLAGS+=      -fno-rtti -fno-exceptions
57 CXXFLAGS+=      -ffunction-sections -fdata-sections
58 LDFLAGS+=       -Wl,--gc-sections
59 .endif
60 CPPFLAGS+=      -I${LLVM_INCLUDE_OBJDIR} -I${LLVM_INCLUDE_CONFIG} \
61                 -I${CLANG_INCLUDE_CONFIG} -I${MCLINKER_INCLUDE_CONFIG}
63 .if !defined(__MINIX)
64 LLVM_PLATFORM=${MACHINE_GNU_ARCH}--netbsd
65 .else
66 LLVM_PLATFORM=${MACHINE_GNU_ARCH}-elf32-minix
68 LLVM_CONFIGURE_ARGS+=   \
69         --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \
70         #--disable-debug-symbols --enable-assertions
72 .if ${HOST_OSTYPE:C/\-.*//} == "Minix"
73 LLVM_CONFIGURE_ARGS+= --disable-threads
74 CPPFLAGS+= -D_NLS_PRIVATE=1
75 .endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
76 .endif # !defined(__MINIX)
78 LLVM_CONFIGURE_ARGS+=   \
79         --enable-targets=x86,powerpc,sparc,aarch64,arm,mips \
80         --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION:R}:/usr/include \
81         --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
82         --with-clang-srcdir=${CLANG_SRCDIR} \
83         --host=${LLVM_PLATFORM} --disable-compiler-version-checks \
84         --disable-bindings llvm_cv_gnu_make_command=${MAKE}
86 .for tool in circo dot dotty fdp neato twopi xdot
87 LLVM_CONFIGURE_ARGS+= ac_cv_path_${tool:tu}="echo ${tool}"
88 .endfor
90 .endif