summaryrefslogtreecommitdiff
path: root/configs/linux-llvm
blob: 9b06be933d43a6ca5dd4d30087c9e03af21c0af6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# -*-makefile-*-
# Configuration for Linux and LLVM with optimizations
# Builds the llvmpipe gallium driver

include $(TOP)/configs/linux

CONFIG_NAME = linux-llvm

# Add llvmpipe driver
GALLIUM_DRIVERS_DIRS += llvmpipe

OPT_FLAGS = -O3 -ansi -pedantic
ARCH_FLAGS = -mmmx -msse -msse2 -mstackrealign

DEFINES += -DNDEBUG -DGALLIUM_LLVMPIPE -DHAVE_UDIS86 \
	-D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS

# override -std=c99
CFLAGS += -std=gnu99

LLVM_VERSION := $(shell llvm-config --version)

ifeq ($(LLVM_VERSION),)
  $(warning Could not find LLVM! Make Sure 'llvm-config' is in the path)
  MESA_LLVM=0
else
  MESA_LLVM=1
  HAVE_LLVM := 0x0$(subst .,0,$(LLVM_VERSION:svn=))
  DEFINES += -DHAVE_LLVM=$(HAVE_LLVM)
#  $(info Using LLVM version: $(LLVM_VERSION))
endif

ifeq ($(MESA_LLVM),1)
#  LLVM_CFLAGS=`llvm-config --cflags`
  LLVM_CXXFLAGS=`llvm-config --cxxflags backend bitreader engine ipo interpreter instrumentation` -Wno-long-long
  LLVM_LDFLAGS = $(shell llvm-config --ldflags backend bitreader engine ipo interpreter instrumentation)
  LLVM_LIBS = $(shell llvm-config --libs backend bitwriter bitreader engine ipo interpreter instrumentation)
  MKLIB_OPTIONS=-cplusplus
else
  LLVM_CFLAGS=
  LLVM_CXXFLAGS=
endif

LD = g++
GL_LIB_DEPS = $(LLVM_LDFLAGS) $(LLVM_LIBS) $(EXTRA_LIB_PATH) -lX11 -lXext -lm -lpthread -ltalloc -lstdc++ -ludis86