1 #===-- Makefile.config - Local configuration for LLVM ------*- Makefile -*--===# 2 # 3 # The LLVM Compiler Infrastructure 4 # 5 # This file is distributed under the University of Illinois Open Source 6 # License. See LICENSE.TXT for details. 7 # 8 #===------------------------------------------------------------------------===# 9 # 10 # This file is included by Makefile.common. It defines paths and other 11 # values specific to a particular installation of LLVM. 12 # 13 #===------------------------------------------------------------------------===# 14 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@ 23 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: 28 # 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. 31 # 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. 34 # 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. 37 # 38 ########################################################################### 39 40 PWD := @BINPWD@ 41 # Set the project name to LLVM if its not defined 42 ifndef PROJECT_NAME 43 PROJECT_NAME := $(LLVMPackageName) 44 endif 45 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)) 49 50 PROJ_OBJ_DIR := $(call realpath, .) 51 PROJ_OBJ_ROOT := $(call realpath, $(PROJ_OBJ_DIR)/$(LEVEL)) 52 53 CLANG_SRC_ROOT := @CLANG_SRC_ROOT@ 54 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)) 60 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!) 64 endif 65 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)) 69 endif 70 71 prefix := @prefix@ 72 PROJ_prefix := $(prefix) 73 program_prefix := @program_prefix@ 74 PROJ_VERSION := $(LLVMVersion) 75 else 76 ifndef PROJ_SRC_ROOT 77 $(error Projects must define PROJ_SRC_ROOT) 78 endif 79 ifndef PROJ_OBJ_ROOT 80 $(error Projects must define PROJ_OBJ_ROOT) 81 endif 82 ifndef PROJ_INSTALL_ROOT 83 $(error Projects must define PROJ_INSTALL_ROOT) 84 endif 85 ifndef LLVM_SRC_ROOT 86 $(error Projects must define LLVM_SRC_ROOT) 87 endif 88 ifndef LLVM_OBJ_ROOT 89 $(error Projects must define LLVM_OBJ_ROOT) 90 endif 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) 94 ifndef PROJ_VERSION 95 PROJ_VERSION := 1.0 96 endif 97 endif 98 99 INTERNAL_PREFIX := @INTERNAL_PREFIX@ 100 ifneq ($(INTERNAL_PREFIX),) 101 PROJ_internal_prefix := $(INTERNAL_PREFIX) 102 else 103 PROJ_internal_prefix := $(prefix) 104 endif 105 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 114 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@ 118 119 # Host operating system for which LLVM will be run. 120 OS=@OS@ 121 HOST_OS=@HOST_OS@ 122 # Target operating system for which LLVM will compile for. 123 TARGET_OS=@TARGET_OS@ 124 125 # Host hardware architecture 126 HOST_ARCH=@HOST_ARCH@ 127 # Target hardware architecture 128 ARCH=@ARCH@ 129 TARGET_NATIVE_ARCH := $(ARCH) 130 LLVM_NATIVE_ARCH := @LLVM_NATIVE_ARCH@ 131 132 # Indicates, whether we're cross-compiling LLVM or not 133 LLVM_CROSS_COMPILING=@LLVM_CROSS_COMPILING@ 134 135 # Executable file extension for build platform (mainly for 136 # tablegen call if we're cross-compiling). 137 BUILD_EXEEXT=@BUILD_EXEEXT@ 138 139 # Compilers for the build platflorm (mainly for tablegen 140 # call if we're cross-compiling). 141 BUILD_CC=@BUILD_CC@ 142 BUILD_CXX=@BUILD_CXX@ 143 144 # Triple for configuring build tools when cross-compiling 145 BUILD_TRIPLE=@build@ 146 147 # Target triple (cpu-vendor-os) which LLVM is compiled for 148 HOST_TRIPLE=@host@ 149 150 # Target triple (cpu-vendor-os) for which we should generate code 151 TARGET_TRIPLE=@target@ 152 153 # Extra options to compile LLVM with 154 EXTRA_OPTIONS=@EXTRA_OPTIONS@ 155 156 # Extra options to link LLVM with 157 EXTRA_LD_OPTIONS=@EXTRA_LD_OPTIONS@ 158 159 # Endian-ness of the target 160 ENDIAN=@ENDIAN@ 161 162 # Path to the C++ compiler to use. This is an optional setting, which defaults 163 # to whatever your gmake defaults to. 164 CXX = @CXX@ 165 166 # Path to the CC binary, which use used by testcases for native builds. 167 CC := @CC@ 168 169 # C/C++ preprocessor flags. 170 CPPFLAGS += @CPPFLAGS@ 171 172 # C compiler flags. 173 CFLAGS += @CFLAGS@ 174 175 # C++ compiler flags. 176 CXXFLAGS += @CXXFLAGS@ 177 178 # Linker flags. 179 LDFLAGS += @LDFLAGS@ 180 181 # Path to the library archiver program. 182 AR_PATH = @AR@ 183 AR = @AR@ 184 185 # Path to the nm program 186 NM_PATH = @NM@ 187 188 # The pathnames of the programs we require to build 189 CMP := @CMP@ 190 CP := @CP@ 191 DATE := @DATE@ 192 FIND := @FIND@ 193 GREP := @GREP@ 194 INSTALL := @INSTALL@ 195 MKDIR := $(LLVM_SRC_ROOT)/autoconf/mkinstalldirs 196 MV := @MV@ 197 RANLIB := @RANLIB@ 198 RM := @RM@ 199 SED := @SED@ 200 TAR := @TAR@ 201 PYTHON := @PYTHON@ 202 203 # Paths to miscellaneous programs we hope are present but might not be 204 BZIP2 := @BZIP2@ 205 CAT := @CAT@ 206 DOT := @DOT@ 207 DOXYGEN := @DOXYGEN@ 208 GROFF := @GROFF@ 209 GZIPBIN := @GZIPBIN@ 210 GO := @GO@ 211 OCAMLFIND := @OCAMLFIND@ 212 GAS := @GAS@ 213 POD2HTML := @POD2HTML@ 214 POD2MAN := @POD2MAN@ 215 PDFROFF := @PDFROFF@ 216 ZIP := @ZIP@ 217 218 HAVE_LIBZ := @HAVE_LIBZ@ 219 HAVE_DLOPEN := @HAVE_DLOPEN@ 220 HAVE_PTHREAD := @HAVE_PTHREAD@ 221 HAVE_TERMINFO := @HAVE_TERMINFO@ 222 223 HAVE_OCAMLOPT := @HAVE_OCAMLOPT@ 224 HAVE_OCAML_OUNIT := @HAVE_OCAML_OUNIT@ 225 226 LIBS := @LIBS@ 227 228 # Targets that are possible to build 229 ALL_TARGETS := @ALL_TARGETS@ 230 231 # Targets that we should build 232 TARGETS_TO_BUILD=@TARGETS_TO_BUILD@ 233 234 # Targets supporting JIT 235 TARGETS_WITH_JIT := @TARGETS_WITH_JIT@ 236 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 239 # object files. 240 OBJ_ROOT := . 241 242 # What to pass as rpath flag to g++ 243 RPATH := @RPATH@ 244 245 # What to pass as -rdynamic flag to g++ 246 RDYNAMIC := @RDYNAMIC@ 247 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): 250 251 # When ENABLE_LIBCPP is enabled, LLVM uses libc++ by default to build. 252 #ENABLE_LIBCPP = 0 253 ENABLE_LIBCPP = @ENABLE_LIBCPP@ 254 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@ 258 259 # When ENABLE_SPLIT_DWARF is enabled, LLVM uses -gfission to build in debug mode. 260 ENABLE_SPLIT_DWARF = @ENABLE_SPLIT_DWARF@ 261 262 # When enabled, clang will have plugin support. 263 CLANG_PLUGIN_SUPPORT = @CLANG_PLUGIN_SUPPORT@ 264 265 # When ENABLE_CLANG_ARCMT is enabled, clang will have ARCMigrationTool. 266 ENABLE_CLANG_ARCMT = @ENABLE_CLANG_ARCMT@ 267 268 # When ENABLE_CLANG_STATIC_ANALYZER is enabled, clang will have StaticAnalyzer. 269 ENABLE_CLANG_STATIC_ANALYZER = @ENABLE_CLANG_STATIC_ANALYZER@ 270 271 # When ENABLE_WERROR is enabled, we'll pass -Werror on the command line 272 ENABLE_WERROR = @ENABLE_WERROR@ 273 274 # When ENABLE_TERMINFO is enabled, we use terminfo. 275 ENABLE_TERMINFO = @ENABLE_TERMINFO@ 276 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 281 @ENABLE_OPTIMIZED@ 282 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> 287 # directories. 288 #ENABLE_PROFILING = 1 289 @ENABLE_PROFILING@ 290 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 294 @DISABLE_ASSERTIONS@ 295 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@ 300 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 303 # checks enabled. 304 ENABLE_ABI_BREAKING_CHECKS = @ENABLE_ABI_BREAKING_CHECKS@ 305 306 # When DEBUG_RUNTIME is enabled, the runtime libraries will retain debug 307 # symbols. 308 #DEBUG_RUNTIME = 1 309 @DEBUG_RUNTIME@ 310 311 # When DEBUG_SYMBOLS is enabled, the compiler libraries will retain debug 312 # symbols. 313 #DEBUG_SYMBOLS = 1 314 @DEBUG_SYMBOLS@ 315 316 # When KEEP_SYMBOLS is enabled, installed executables will never have their 317 # symbols stripped. 318 #KEEP_SYMBOLS = 1 319 @KEEP_SYMBOLS@ 320 321 # The compiler flags to use for optimized builds. 322 OPTIMIZE_OPTION := @OPTIMIZE_OPTION@ 323 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 327 328 # When ENABLE_DOCS is disabled, docs/ will not be built. 329 ENABLE_DOCS = @ENABLE_DOCS@ 330 331 # When ENABLE_DOXYGEN is enabled, the doxygen documentation will be built 332 ENABLE_DOXYGEN = @ENABLE_DOXYGEN@ 333 334 # Do we want to enable threads? 335 ENABLE_THREADS := @LLVM_ENABLE_THREADS@ 336 337 # Do we want to enable zlib? 338 ENABLE_ZLIB := @LLVM_ENABLE_ZLIB@ 339 340 # Do we want to build with position independent code? 341 ENABLE_PIC := @ENABLE_PIC@ 342 343 # Do we want to build a shared library and link the tools with it? 344 ENABLE_SHARED := @ENABLE_SHARED@ 345 346 # Do we want to link the stdc++ into a shared library? (Cygming) 347 ENABLE_EMBED_STDCXX := @ENABLE_EMBED_STDCXX@ 348 349 # Use -fvisibility-inlines-hidden? 350 ENABLE_VISIBILITY_INLINES_HIDDEN := @ENABLE_VISIBILITY_INLINES_HIDDEN@ 351 352 # Do we want to allow timestamping information into builds? 353 ENABLE_TIMESTAMPS := @ENABLE_TIMESTAMPS@ 354 355 # This option tells the Makefiles to produce verbose output. 356 # It essentially prints the commands that make is executing 357 #VERBOSE = 1 358 359 # Enable JIT for this platform 360 TARGET_HAS_JIT = @TARGET_HAS_JIT@ 361 362 # Shared library extension for host platform. 363 SHLIBEXT = @SHLIBEXT@ 364 365 # Executable file extension for host platform. 366 EXEEXT = @EXEEXT@ 367 368 # Things we just assume are "there" 369 ECHO := echo 370 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. 375 LINKALL := @LINKALL@ 376 NOLINKALL := @NOLINKALL@ 377 378 # Get the value of HUGE_VAL_SANITY which will be either "yes" or "no" depending 379 # on the check. 380 HUGE_VAL_SANITY = @HUGE_VAL_SANITY@ 381 382 # Bindings that we should build 383 BINDINGS_TO_BUILD := @BINDINGS_TO_BUILD@ 384 OCAML_LIBDIR := @OCAML_LIBDIR@ 385 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 -) 391 else 392 SYSPATH = $(1) 393 endif 394 395 # Location of the plugin header file for gold. 396 BINUTILS_INCDIR := @BINUTILS_INCDIR@ 397 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@ 405 # -Wno-uninitialized 406 NO_UNINITIALIZED = @NO_UNINITIALIZED@ 407 # -Wno-maybe-uninitialized 408 NO_MAYBE_UNINITIALIZED = @NO_MAYBE_UNINITIALIZED@ 409 # -Wno-comment 410 NO_COMMENT = @NO_COMMENT@ 411 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@ 417 418 # Flags to control using libxml2 419 LIBXML2_LIBS := @LIBXML2_LIBS@ 420 LIBXML2_INC := @LIBXML2_INC@ 421 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@ 426 427 # Flags to control building support for OProfile JIT API 428 USE_OPROFILE := @USE_OPROFILE@ 429 430 ifeq ($(USE_INTEL_JITEVENTS), 1) 431 OPTIONAL_COMPONENTS += IntelJITEvents 432 endif 433 ifeq ($(USE_OPROFILE), 1) 434 OPTIONAL_COMPONENTS += OProfileJIT 435 endif 436