summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/gbm
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2011-10-13 21:45:45 +0200
committerMarcin Slusarz <marcin.slusarz@gmail.com>2011-10-17 22:57:27 +0200
commit757390491cfa3b861fab76940a8c6e508d1f1a25 (patch)
treea69fb54b0b227d8131cd057f653dbc61d1113ae2 /src/gallium/targets/gbm
parentc0573fb29df6defe58f4898f0b8a42e8b9214d36 (diff)
downloadexternal_mesa3d-757390491cfa3b861fab76940a8c6e508d1f1a25.zip
external_mesa3d-757390491cfa3b861fab76940a8c6e508d1f1a25.tar.gz
external_mesa3d-757390491cfa3b861fab76940a8c6e508d1f1a25.tar.bz2
gallium/targets: use c++ compiler for linking
As pointed out by Michel Dänzer, gcc -lstdc++ doesn't work on all systems, because it may require other libraries which are only pulled in implicitly by g++. And libstdc++ is available only with GNU compiler. Use c++ compiler for linking and remove redundant LDFLAGS += -lstdc++ all over the tree.
Diffstat (limited to 'src/gallium/targets/gbm')
-rw-r--r--src/gallium/targets/gbm/Makefile34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/gallium/targets/gbm/Makefile b/src/gallium/targets/gbm/Makefile
index 3f52aae..15618a6 100644
--- a/src/gallium/targets/gbm/Makefile
+++ b/src/gallium/targets/gbm/Makefile
@@ -103,48 +103,55 @@ pipe_LIBS += $(TOP)/src/gallium/drivers/llvmpipe/libllvmpipe.a
endif
# determine the targets/sources
-pipe_TARGETS =
+_pipe_TARGETS_CC =
+_pipe_TARGETS_CXX =
pipe_SOURCES =
ifneq ($(findstring i915/drm,$(GALLIUM_WINSYS_DIRS)),)
-pipe_TARGETS += $(PIPE_PREFIX)i915.so
+_pipe_TARGETS_CC += $(PIPE_PREFIX)i915.so
pipe_SOURCES += pipe_i915.c
endif
ifneq ($(findstring i965/drm,$(GALLIUM_WINSYS_DIRS)),)
-pipe_TARGETS += $(PIPE_PREFIX)i965.so
+_pipe_TARGETS_CC += $(PIPE_PREFIX)i965.so
pipe_SOURCES += pipe_i965.c
endif
ifneq ($(findstring nouveau/drm,$(GALLIUM_WINSYS_DIRS)),)
-LDFLAGS += -lstdc++
-pipe_TARGETS += $(PIPE_PREFIX)nouveau.so
+_pipe_TARGETS_CXX += $(PIPE_PREFIX)nouveau.so
pipe_SOURCES += pipe_nouveau.c
endif
ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
ifneq ($(findstring r300,$(GALLIUM_DRIVERS_DIRS)),)
-pipe_TARGETS += $(PIPE_PREFIX)r300.so
+_pipe_TARGETS_CC += $(PIPE_PREFIX)r300.so
pipe_SOURCES += pipe_r300.c
endif
endif
ifneq ($(findstring radeon/drm,$(GALLIUM_WINSYS_DIRS)),)
ifneq ($(findstring r600,$(GALLIUM_DRIVERS_DIRS)),)
-pipe_TARGETS += $(PIPE_PREFIX)r600.so
+_pipe_TARGETS_CC += $(PIPE_PREFIX)r600.so
pipe_SOURCES += pipe_r600.c
endif
endif
ifneq ($(findstring svga/drm,$(GALLIUM_WINSYS_DIRS)),)
-pipe_TARGETS += $(PIPE_PREFIX)vmwgfx.so
+_pipe_TARGETS_CC += $(PIPE_PREFIX)vmwgfx.so
pipe_SOURCES += pipe_vmwgfx.c
endif
pipe_OBJECTS = $(pipe_SOURCES:.c=.o)
+ifeq ($(MESA_LLVM),1)
+pipe_TARGETS_CXX = $(_pipe_TARGETS_CXX) $(_pipe_TARGETS_CC)
+pipe_TARGETS_CC =
+else
+pipe_TARGETS_CXX = $(_pipe_TARGETS_CXX)
+pipe_TARGETS_CC = $(_pipe_TARGETS_CC)
+endif
-GBM_EXTRA_TARGETS = $(addprefix $(TOP)/$(LIB_DIR)/gbm/, $(pipe_TARGETS))
+GBM_EXTRA_TARGETS = $(addprefix $(TOP)/$(LIB_DIR)/gbm/, $(pipe_TARGETS_CC)) $(addprefix $(TOP)/$(LIB_DIR)/gbm/, $(pipe_TARGETS_CXX))
GBM_EXTRA_INSTALL = install-pipes
GBM_EXTRA_CLEAN = clean-pipes
GBM_EXTRA_SOURCES = $(pipe_SOURCES)
@@ -156,13 +163,20 @@ $(GBM_EXTRA_TARGETS): $(TOP)/$(LIB_DIR)/gbm/%: %
@$(INSTALL) -d $(dir $@)
$(INSTALL) $< $(dir $@)
-$(pipe_TARGETS): $(PIPE_PREFIX)%.so: pipe_%.o $(pipe_LIBS) $($*_LIBS)
+$(pipe_TARGETS_CC): $(PIPE_PREFIX)%.so: pipe_%.o $(pipe_LIBS) $($*_LIBS)
$(MKLIB) -o $@ -noprefix -linker '$(CC)' \
-ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
$(MKLIB_OPTIONS) $< \
-Wl,--start-group $(pipe_LIBS) $($*_LIBS) -Wl,--end-group \
$(pipe_SYS) $($*_SYS)
+$(pipe_TARGETS_CXX): $(PIPE_PREFIX)%.so: pipe_%.o $(pipe_LIBS) $($*_LIBS)
+ $(MKLIB) -o $@ -noprefix -linker '$(CXX)' \
+ -ldflags '-L$(TOP)/$(LIB_DIR) $(pipe_LDFLAGS) $(LDFLAGS)' \
+ $(MKLIB_OPTIONS) $< \
+ -Wl,--start-group $(pipe_LIBS) $($*_LIBS) -Wl,--end-group \
+ $(pipe_SYS) $($*_SYS)
+
$(pipe_OBJECTS): %.o: %.c
$(CC) -c -o $@ $< $(pipe_INCLUDES) $(pipe_CFLAGS) $(CFLAGS)