Merge remote branch 'origin/master' into nv50-compiler
[mesa.git] / configs / linux-llvm
1 # -*-makefile-*-
2 # Configuration for Linux and LLVM with optimizations
3 # Builds the llvmpipe gallium driver
4
5 include $(TOP)/configs/linux
6
7 CONFIG_NAME = linux-llvm
8
9 # Add llvmpipe driver
10 GALLIUM_DRIVERS_DIRS += llvmpipe
11
12 OPT_FLAGS = -O3 -ansi -pedantic
13 ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign
14
15 DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86
16
17 # override -std=c99
18 CFLAGS += -std=gnu99 -D__STDC_CONSTANT_MACROS
19
20 LLVM_VERSION := $(shell llvm-config --version)
21
22 ifeq ($(LLVM_VERSION),)
23 $(warning Could not find LLVM! Make Sure 'llvm-config' is in the path)
24 MESA_LLVM=0
25 else
26 MESA_LLVM=1
27 HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
28 DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
29 # $(info Using LLVM version: $(LLVM_VERSION))
30 endif
31
32 ifeq ($(MESA_LLVM),1)
33 # LLVM_CFLAGS=`llvm-config --cflags`
34 LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
35 LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
36 LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
37 MKLIB_OPTIONS=-cplusplus
38 else
39 LLVM_CFLAGS=
40 LLVM_CXXFLAGS=
41 endif
42
43 LD = g++
44 GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86