summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-04-22 14:59:29 +1000
committerDave Airlie <airlied@redhat.com>2010-04-24 18:55:50 +1000
commit81fe19843ac2afdc4fa1e1c87bc979b295af240e (patch)
treedfbd886ffdfef5fe4cc8f8aaca4377c8c410c90b /src
parente3eed8bf218c04127484e0664c67c100703fa1d8 (diff)
llvmpipe: add initial autoconf support.
allows the swrastg_dri.so to be built with llvmpipe, also links llvm to all dri drivers use --enable-gallium-llvm to use it. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/Makefile.template2
-rw-r--r--src/gallium/drivers/llvmpipe/Makefile5
-rw-r--r--src/gallium/targets/Makefile.dri15
3 files changed, 18 insertions, 4 deletions
diff --git a/src/gallium/Makefile.template b/src/gallium/Makefile.template
index b5a9938c74..1ba0724949 100644
--- a/src/gallium/Makefile.template
+++ b/src/gallium/Makefile.template
@@ -37,7 +37,7 @@ depend: $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(SYMLINKS) $(GENERATED_SOURC
$(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) $(CPP_SOURCES) $(ASM_SOURCES) $(GENERATED_SOURCES) 2> /dev/null
$(PROGS): % : %.o
- $(LD) $(filter %.o,$^) -o $@ -Wl,--start-group $(LIBS) -Wl,--end-group
+ $(LD) $(LDFLAGS) $(filter %.o,$^) -o $@ -Wl,--start-group $(LIBS) -Wl,--end-group
# Emacs tags
tags:
diff --git a/src/gallium/drivers/llvmpipe/Makefile b/src/gallium/drivers/llvmpipe/Makefile
index 4a3fc036c4..7bf5b09762 100644
--- a/src/gallium/drivers/llvmpipe/Makefile
+++ b/src/gallium/drivers/llvmpipe/Makefile
@@ -58,8 +58,9 @@ include ../../Makefile.template
lp_tile_soa.c: lp_tile_soa.py ../../auxiliary/util/u_format_parse.py ../../auxiliary/util/u_format_pack.py ../../auxiliary/util/u_format.csv
python lp_tile_soa.py ../../auxiliary/util/u_format.csv > $@
-
-LIBS += $(GL_LIB_DEPS) -L../../auxiliary/ -lgallium libllvmpipe.a
+LDFLAGS += $(LLVM_LDFLAGS)
+LIBS += $(GL_LIB_DEPS) -L../../auxiliary/ -lgallium libllvmpipe.a $(LLVM_LIBS)
+LD=g++
$(PROGS): lp_test_main.o libllvmpipe.a
diff --git a/src/gallium/targets/Makefile.dri b/src/gallium/targets/Makefile.dri
index 8efbf4e828..3cbaf615e2 100644
--- a/src/gallium/targets/Makefile.dri
+++ b/src/gallium/targets/Makefile.dri
@@ -1,5 +1,14 @@
# -*-makefile-*-
+ifeq ($(MESA_LLVM),1)
+DRIVER_DEFINES += -DGALLIUM_LLVMPIPE
+PIPE_DRIVERS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
+LDFLAGS += $(LLVM_LDFLAGS)
+LD = g++
+DRIVER_EXTRAS = $(LLVM_LIBS)
+USE_CXX=1
+endif
+
MESA_MODULES = \
$(TOP)/src/mesa/libmesagallium.a \
$(GALLIUM_AUXILIARIES)
@@ -69,7 +78,11 @@ $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) Makefile \
$(OBJECTS) $(PIPE_DRIVERS) \
-Wl,--start-group $(MESA_MODULES) -Wl,--end-group \
$(DRI_LIB_DEPS) $(DRIVER_EXTRAS)
- $(CC) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS)
+ if [ "x${USE_CXX}" == "x" ]; then \
+ $(CC) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS); \
+ else \
+ $(CXX) $(CFLAGS) -o $@.test $(TOP)/src/mesa/drivers/dri/common/dri_test.o $@.tmp $(DRI_LIB_DEPS); \
+ fi
@rm -f $@.test
mv -f $@.tmp $@