1 # $NetBSD: Makefile.inc,v 1.63 2013/11/28 14:19:59 joerg Exp $
3 .if !defined(LLVM_TOPLEVEL_MK)
8 SVN_ROOT= http://llvm.org/svn/llvm-project
9 SVN_BRANCH= branches/release_34
11 COMMON_REVISION= 195771
12 CLANG_REVISION= ${COMMON_REVISION}
13 COMPILER_RT_REVISION= ${COMMON_REVISION}
14 LLD_REVISION= ${COMMON_REVISION}
15 LLDB_REVISION= ${COMMON_REVISION}
16 LLVM_REVISION= ${COMMON_REVISION}
18 MCLINKER_REVISION= deeb2a77b4165827316f88e0a7ba4ba6b743a080
19 MCLINKER_ROOT= https://code.google.com/p/mclinker/
24 COMPILER_RT_SRCDIR:= ${.PARSEDIR}/dist/compiler-rt
25 CLANG_SRCDIR:= ${.PARSEDIR}/dist/clang
26 LLD_SRCDIR:= ${.PARSEDIR}/dist/lld
27 LLDB_SRCDIR:= ${.PARSEDIR}/dist/lldb
28 LLVM_SRCDIR:= ${.PARSEDIR}/dist/llvm
29 MCLINKER_SRCDIR:= ${.PARSEDIR}/dist/mclinker
30 LLVM_TOPLEVEL:= ${.PARSEDIR}
32 CPPFLAGS+= -I. -I${CLANG_SRCDIR}/include -I${LLD_SRCDIR}/include \
33 -I${LLVM_SRCDIR}/include -I${MCLINKER_SRCDIR}/include \
34 -I${LLDB_SRCDIR}/include \
35 -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS \
36 -D__STDC_FORMAT_MACROS -DCLANG_ENABLE_STATIC_ANALYZER
38 .if defined(HOSTLIB) || defined(HOSTPROG)
39 LLVM_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/include
40 CLANG_INCLUDE_CONFIG= ${LLVM_TOOLCONF_OBJDIR}/config/tools/clang/include
41 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
42 LLVM_INCLUDE_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm-include && ${PRINTOBJDIR}
43 LLVM_TOOLCONF_OBJDIR!= cd ${NETBSDSRCDIR}/tools/llvm && ${PRINTOBJDIR}
44 HOST_CPPFLAGS+= ${CPPFLAGS}
46 HOST_CXXFLAGS+= -O2 -g -fno-rtti -fno-exceptions
48 HOST_CXXFLAGS+= -O2 -fno-rtti -fno-exceptions
49 .endif # !defined(__MINIX)
50 .if ${MKLLD:Uno} == "yes"
51 HOST_CPPFLAGS+= -std=c++11
54 LLVM_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config
55 CLANG_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config
56 MCLINKER_INCLUDE_CONFIG= ${LLVM_TOPLEVEL}/config/mclinker
57 LLVM_INCLUDE_OBJDIR!= cd ${LLVM_TOPLEVEL}/include && ${PRINTOBJDIR}
59 .if ${MKLLD:Uno} == "yes" || ${MKLLDB:Uno} == "yes"
62 .if ${MKLLDB:Uno} == "yes"
63 CPPFLAGS+= -DLLDB_DISABLE_PYTHON
65 CXXFLAGS+= -fno-rtti -fno-exceptions
66 CXXFLAGS+= -ffunction-sections -fdata-sections
67 LDFLAGS+= -Wl,--gc-sections
69 CPPFLAGS+= -I${LLVM_INCLUDE_OBJDIR} -I${LLVM_INCLUDE_CONFIG} \
70 -I${CLANG_INCLUDE_CONFIG} -I${MCLINKER_INCLUDE_CONFIG}
73 LLVM_CONFIGURE_ARGS= \
74 --enable-targets=x86,powerpc,sparc,aarch64,arm,mips \
75 --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION}:/usr/include \
76 --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
77 --with-clang-srcdir=${CLANG_SRCDIR} \
78 --host=${MACHINE_GNU_PLATFORM} \
79 llvm_cv_gnu_make_command=${MAKE}
81 # LSC: Compile LLVM only with the target platform
82 .if ${MACHINE_ARCH:Mi*86} != ""
84 .elif ${MACHINE_ARCH:M*arm*} != ""
87 .error Modify this or add support for all platform, at your convenience.
90 LLVM_CONFIGURE_ARGS= \
91 --enable-targets=${_LLVM_TARGET} \
92 --with-c-include-dirs=/usr/include/clang-${CLANG_VERSION}:/usr/include \
93 --disable-timestamps --prefix=/usr --sysconfdir=/etc/llvm \
94 --with-clang-srcdir=${CLANG_SRCDIR} \
95 --host=${MACHINE_GNU_PLATFORM} \
96 --with-binutils-include=${NETBSDSRCDIR}/external/gpl3/binutils/dist/include \
97 --disable-debug-symbols --enable-assertions --enable-bindings=none \
98 llvm_cv_gnu_make_command=${MAKE}
100 .if ${HOST_OSTYPE:C/\-.*//} == "Minix"
101 LLVM_CONFIGURE_ARGS+= --disable-threads
102 CPPFLAGS+= -D_NLS_PRIVATE=1
103 .endif # ${HOST_OSTYPE:C/\-.*//} == "Minix"
104 .endif # !defined(__MINIX)
106 .for tool in circo dot dotty fdp neato twopi xdot
107 LLVM_CONFIGURE_ARGS+= ac_cv_path_${tool:tu}="echo ${tool}"