1 #===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===#
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===------------------------------------------------------------------------===#
10 # This file is included by Makefile.common. It defines paths and other
11 # values specific to a particular installation of LLVM.
13 #===------------------------------------------------------------------------===#
15 # Define LLVM specific info and directories based on the autoconf variables
16 LLVMPackageName := @PACKAGE_TARNAME@
17 LLVMVersion := @PACKAGE_VERSION@
18 LLVM_VERSION_MAJOR := @LLVM_VERSION_MAJOR@
19 LLVM_VERSION_MINOR := @LLVM_VERSION_MINOR@
20 LLVM_VERSION_PATCH := @LLVM_VERSION_PATCH@
21 LLVM_VERSION_SUFFIX := @LLVM_VERSION_SUFFIX@
22 LLVM_CONFIGTIME := @LLVM_CONFIGTIME@
24 ###########################################################################
25 # Directory Configuration
26 # This section of the Makefile determines what is where. To be
27 # specific, there are several locations that need to be defined:
29 # o LLVM_SRC_ROOT : The root directory of the LLVM source code.
30 # o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
32 # o PROJ_SRC_DIR : The directory containing the code to build.
33 # o PROJ_SRC_ROOT : The root directory of the code to build.
35 # o PROJ_OBJ_DIR : The directory in which compiled code will be placed.
36 # o PROJ_OBJ_ROOT : The root directory in which compiled code is placed.
38 ###########################################################################
41 # Set the project name to LLVM if its not defined
43 PROJECT_NAME := $(LLVMPackageName)
46 # The macro below is expanded when 'realpath' is not built-in.
47 # Built-in 'realpath' is available on GNU Make 3.81.
48 realpath = $(shell cd $(1); $(PWD))
50 PROJ_OBJ_DIR := $(call realpath, .)
51 PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL))
53 CLANG_SRC_ROOT := @CLANG_SRC_ROOT@
55 ifeq ($(PROJECT_NAME),$(LLVMPackageName))
56 LLVM_SRC_ROOT := $(call realpath, @abs_top_srcdir@)
57 LLVM_OBJ_ROOT := $(call realpath, @abs_top_builddir@)
58 PROJ_SRC_ROOT := $(LLVM_SRC_ROOT)
59 PROJ_SRC_DIR := $(LLVM_SRC_ROOT)$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR))
61 # See: http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20150323/268067.html
62 ifeq ($(LLVM_SRC_ROOT), $(LLVM_OBJ_ROOT))
63 $(error In-source builds are not allowed. Please configure from a separate build directory!)
66 ifneq ($(CLANG_SRC_ROOT),)
67 CLANG_SRC_ROOT:= $(call realpath, $(CLANG_SRC_ROOT))
68 PROJ_SRC_DIR := $(patsubst $(LLVM_SRC_ROOT)/tools/clang%,$(CLANG_SRC_ROOT)%,$(PROJ_SRC_DIR))
72 PROJ_prefix := $(prefix)
73 program_prefix := @program_prefix@
74 PROJ_VERSION := $(LLVMVersion)
77 $(error Projects must define PROJ_SRC_ROOT)
80 $(error Projects must define PROJ_OBJ_ROOT)
82 ifndef PROJ_INSTALL_ROOT
83 $(error Projects must define PROJ_INSTALL_ROOT)
86 $(error Projects must define LLVM_SRC_ROOT)
89 $(error Projects must define LLVM_OBJ_ROOT)
91 PROJ_SRC_DIR := $(call realpath, $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)))
92 prefix := $(PROJ_INSTALL_ROOT)
93 PROJ_prefix := $(prefix)
99 INTERNAL_PREFIX := @INTERNAL_PREFIX@
100 ifneq ($(INTERNAL_PREFIX),)
101 PROJ_internal_prefix := $(INTERNAL_PREFIX)
103 PROJ_internal_prefix := $(prefix)
106 PROJ_bindir := $(PROJ_prefix)/bin
107 PROJ_libdir := $(PROJ_prefix)/lib
108 PROJ_datadir := $(PROJ_prefix)/share
109 PROJ_docsdir := $(PROJ_prefix)/docs/llvm
110 PROJ_etcdir := $(PROJ_prefix)/etc/llvm
111 PROJ_includedir := $(PROJ_prefix)/include
112 PROJ_infodir := $(PROJ_prefix)/info
113 PROJ_mandir := $(PROJ_prefix)/share/man
115 # Determine if we're on a unix type operating system
116 LLVM_ON_UNIX:=@LLVM_ON_UNIX@
117 LLVM_ON_WIN32:=@LLVM_ON_WIN32@
119 # Host operating system for which LLVM will be run.
122 # Target operating system for which LLVM will compile for.
123 TARGET_OS=@TARGET_OS@
125 # Host hardware architecture
126 HOST_ARCH=@HOST_ARCH@
127 # Target hardware architecture
129 TARGET_NATIVE_ARCH := $(ARCH)
130 LLVM_NATIVE_ARCH := @LLVM_NATIVE_ARCH@
132 # Indicates, whether we're cross-compiling LLVM or not
133 LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@
135 # Executable file extension for build platform (mainly for
136 # tablegen call if we're cross-compiling).
137 BUILD_EXEEXT=@BUILD_EXEEXT@
139 # Compilers for the build platflorm (mainly for tablegen
140 # call if we're cross-compiling).
142 BUILD_CXX=@BUILD_CXX@
144 # Triple for configuring build tools when cross-compiling
147 # Target triple (cpu-vendor-os) which LLVM is compiled for
150 # Target triple (cpu-vendor-os) for which we should generate code
151 TARGET_TRIPLE=@target@
153 # Extra options to compile LLVM with
154 EXTRA_OPTIONS=@EXTRA_OPTIONS@
156 # Extra options to link LLVM with
157 EXTRA_LD_OPTIONS=@EXTRA_LD_OPTIONS@
159 # Endian-ness of the target
162 # Path to the C++ compiler to use. This is an optional setting, which defaults
163 # to whatever your gmake defaults to.
166 # Path to the CC binary, which use used by testcases for native builds.
169 # C/C++ preprocessor flags.
170 CPPFLAGS += @CPPFLAGS@
175 # C++ compiler flags.
176 CXXFLAGS += @CXXFLAGS@
181 # Path to the library archiver program.
185 # Path to the nm program
188 # The pathnames of the programs we require to build
195 MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs
203 # Paths to miscellaneous programs we hope are present but might not be
211 OCAMLFIND := @OCAMLFIND@
213 POD2HTML := @POD2HTML@
218 HAVE_LIBZ := @HAVE_LIBZ@
219 HAVE_DLOPEN := @HAVE_DLOPEN@
220 HAVE_PTHREAD := @HAVE_PTHREAD@
221 HAVE_TERMINFO := @HAVE_TERMINFO@
223 HAVE_OCAMLOPT := @HAVE_OCAMLOPT@
224 HAVE_OCAML_OUNIT := @HAVE_OCAML_OUNIT@
228 # Targets that are possible to build
229 ALL_TARGETS := @ALL_TARGETS@
231 # Targets that we should build
232 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@
234 # Targets supporting JIT
235 TARGETS_WITH_JIT := @TARGETS_WITH_JIT@
237 # Path to directory where object files should be stored during a build.
238 # Set OBJ_ROOT to "." if you do not want to use a separate place for
242 # What to pass as rpath flag to g++
245 # What to pass as -rdynamic flag to g++
246 RDYNAMIC := @RDYNAMIC@
248 # These are options that can either be enabled here, or can be enabled on the
249 # make command line (ie, make ENABLE_PROFILING=1):
251 # When ENABLE_LIBCPP is enabled, LLVM uses libc++ by default to build.
253 ENABLE_LIBCPP = @ENABLE_LIBCPP@
255 # When ENABLE_CXX1Y is enabled, LLVM uses c++1y mode by default to build.
256 # Otherwise it uses the baseline c++11.
257 ENABLE_CXX1Y = @ENABLE_CXX1Y@
259 # When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode.
260 ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@
262 # When enabled, clang will have plugin support.
263 CLANG_PLUGIN_SUPPORT = @CLANG_PLUGIN_SUPPORT@
265 # When ENABLE_CLANG_ARCMT is enabled, clang will have ARCMigrationTool.
266 ENABLE_CLANG_ARCMT = @ENABLE_CLANG_ARCMT@
268 # When ENABLE_CLANG_STATIC_ANALYZER is enabled, clang will have StaticAnalyzer.
269 ENABLE_CLANG_STATIC_ANALYZER = @ENABLE_CLANG_STATIC_ANALYZER@
271 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line
272 ENABLE_WERROR = @ENABLE_WERROR@
274 # When ENABLE_TERMINFO is enabled, we use terminfo.
275 ENABLE_TERMINFO = @ENABLE_TERMINFO@
277 # When ENABLE_OPTIMIZED is enabled, LLVM code is optimized and output is put
278 # into the "Release" directories. Otherwise, LLVM code is not optimized and
279 # output is put in the "Debug" directories.
280 #ENABLE_OPTIMIZED = 1
283 # When ENABLE_PROFILING is enabled, profile instrumentation is done
284 # and output is put into the "<Flavor>+Profile" directories, where
285 # <Flavor> is either Debug or Release depending on how other build
286 # flags are set. Otherwise, output is put in the <Flavor>
288 #ENABLE_PROFILING = 1
291 # When DISABLE_ASSERTIONS is enabled, builds of all of the LLVM code will
292 # exclude assertion checks, otherwise they are included.
293 #DISABLE_ASSERTIONS = 1
296 # When ENABLE_EXPENSIVE_CHECKS is enabled, builds of all of the LLVM
297 # code will include expensive checks, otherwise they are excluded.
298 #ENABLE_EXPENSIVE_CHECKS = 0
299 @ENABLE_EXPENSIVE_CHECKS@
301 # --enable-abi-breaking-checks : decide whether we should compile in asserts and
302 # checks that make the build ABI incompatible with an llvm built without these
304 ENABLE_ABI_BREAKING_CHECKS = @ENABLE_ABI_BREAKING_CHECKS@
306 # When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug
311 # When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug
316 # When KEEP_SYMBOLS is enabled, installed executables will never have their
321 # The compiler flags to use for optimized builds.
322 OPTIMIZE_OPTION := @OPTIMIZE_OPTION@
324 # When ENABLE_PROFILING is enabled, the llvm source base is built with profile
325 # information to allow gprof to be used to get execution frequencies.
326 #ENABLE_PROFILING = 1
328 # When ENABLE_DOCS is disabled, docs/ will not be built.
329 ENABLE_DOCS = @ENABLE_DOCS@
331 # When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built
332 ENABLE_DOXYGEN = @ENABLE_DOXYGEN@
334 # Do we want to enable threads?
335 ENABLE_THREADS := @LLVM_ENABLE_THREADS@
337 # Do we want to enable zlib?
338 ENABLE_ZLIB := @LLVM_ENABLE_ZLIB@
340 # Do we want to build with position independent code?
341 ENABLE_PIC := @ENABLE_PIC@
343 # Do we want to build a shared library and link the tools with it?
344 ENABLE_SHARED := @ENABLE_SHARED@
346 # Do we want to link the stdc++ into a shared library? (Cygming)
347 ENABLE_EMBED_STDCXX := @ENABLE_EMBED_STDCXX@
349 # Use -fvisibility-inlines-hidden?
350 ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@
352 # Do we want to allow timestamping information into builds?
353 ENABLE_TIMESTAMPS := @ENABLE_TIMESTAMPS@
355 # This option tells the Makefiles to produce verbose output.
356 # It essentially prints the commands that make is executing
359 # Enable JIT for this platform
360 TARGET_HAS_JIT = @TARGET_HAS_JIT@
362 # Shared library extension for host platform.
363 SHLIBEXT = @SHLIBEXT@
365 # Executable file extension for host platform.
368 # Things we just assume are "there"
371 # Get the options for causing archives to link all their content instead of
372 # just missing symbols, and the inverse of that. This is used for certain LLVM
373 # tools that permit loadable modules. It ensures that the LLVM symbols will be
374 # available to those loadable modules.
376 NOLINKALL := @NOLINKALL@
378 # Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending
380 HUGE_VAL_SANITY = @HUGE_VAL_SANITY@
382 # Bindings that we should build
383 BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@
384 OCAML_LIBDIR := @OCAML_LIBDIR@
386 # When compiling under Mingw/Cygwin, executables such as tblgen
387 # expect Windows paths, whereas the build system uses Unix paths.
388 # The function SYSPATH transforms Unix paths into Windows paths.
389 ifneq (,$(findstring -mno-cygwin, $(CXX)))
390 SYSPATH = $(shell echo $(1) | cygpath -m -f -)
395 # Location of the plugin header file for gold.
396 BINUTILS_INCDIR := @BINUTILS_INCDIR@
398 # Optional flags supported by the compiler
399 # -Wmissing-field-initializers
400 MISSING_FIELD_INITIALIZERS = @MISSING_FIELD_INITIALIZERS@
401 # -Wno-variadic-macros
402 NO_VARIADIC_MACROS = @NO_VARIADIC_MACROS@
403 # -Wcovered-switch-default
404 COVERED_SWITCH_DEFAULT = @COVERED_SWITCH_DEFAULT@
406 NO_UNINITIALIZED = @NO_UNINITIALIZED@
407 # -Wno-maybe-uninitialized
408 NO_MAYBE_UNINITIALIZED = @NO_MAYBE_UNINITIALIZED@
410 NO_COMMENT = @NO_COMMENT@
412 # Was polly found in tools/polly?
413 LLVM_HAS_POLLY = @LLVM_HAS_POLLY@
414 # Flags supported by the linker.
415 # bfd ld / gold --version-script=file
416 HAVE_LINK_VERSION_SCRIPT = @HAVE_LINK_VERSION_SCRIPT@
418 # Flags to control using libxml2
419 LIBXML2_LIBS := @LIBXML2_LIBS@
420 LIBXML2_INC := @LIBXML2_INC@
422 # Flags to control building support for Intel JIT Events API
423 USE_INTEL_JITEVENTS := @USE_INTEL_JITEVENTS@
424 INTEL_JITEVENTS_INCDIR := @INTEL_JITEVENTS_INCDIR@
425 INTEL_JITEVENTS_LIBDIR := @INTEL_JITEVENTS_LIBDIR@
427 # Flags to control building support for OProfile JIT API
428 USE_OPROFILE := @USE_OPROFILE@
430 ifeq ($(USE_INTEL_JITEVENTS), 1)
431 OPTIONAL_COMPONENTS += IntelJITEvents
433 ifeq ($(USE_OPROFILE), 1)
434 OPTIONAL_COMPONENTS += OProfileJIT