Mesa (master): targets/egl: Use C++ compiler to link GL/ES state trackers.

Chia-I Wu olv at kemper.freedesktop.org
Thu Sep 16 21:56:00 PDT 2010


Module: Mesa
Branch: master
Commit: cadc4ad963b5392c6f6729f01f01e377ea1e8c41
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cadc4ad963b5392c6f6729f01f01e377ea1e8c41

Author: Chia-I Wu <olv at lunarg.com>
Date:   Thu Sep 16 12:42:53 2010 +0800

targets/egl: Use C++ compiler to link GL/ES state trackers.

Otherwise, applications compiled with C compiler might have trouble
using them.

---

 src/gallium/targets/egl/Makefile |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/gallium/targets/egl/Makefile b/src/gallium/targets/egl/Makefile
index 78f7241..47c24ce 100644
--- a/src/gallium/targets/egl/Makefile
+++ b/src/gallium/targets/egl/Makefile
@@ -185,6 +185,13 @@ $(MKLIB) -o $(notdir $@) -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
 	$(common_SYS) $($(1)_SYS)
 endef
 
+define mklib-cxx
+$(MKLIB) -o $(notdir $@) -noprefix -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
+	-cplusplus -install $(OUTPUT_PATH) $(MKLIB_OPTIONS) $< \
+	-Wl,--start-group $(common_LIBS) $($(1)_LIBS) -Wl,--end-group \
+	$(common_SYS) $($(1)_SYS)
+endef
+
 # EGL driver
 $(OUTPUT_PATH)/egl_gallium.so: egl.o $(egl_LIBS)
 	$(call mklib,egl)
@@ -213,13 +220,13 @@ $(OUTPUT_PATH)/$(PIPE_PREFIX)swrast.so: pipe_swrast.o $(swrast_LIBS)
 
 # state trackers
 $(OUTPUT_PATH)/$(ST_PREFIX)$(GL_LIB).so: st_GL.o $(GL_LIBS)
-	$(call mklib,GL)
+	$(call mklib-cxx,GL)
 
 $(OUTPUT_PATH)/$(ST_PREFIX)$(GLESv1_CM_LIB).so: st_GLESv1_CM.o $(GLESv1_CM_LIBS)
-	$(call mklib,GLESv1_CM)
+	$(call mklib-cxx,GLESv1_CM)
 
 $(OUTPUT_PATH)/$(ST_PREFIX)$(GLESv2_LIB).so: st_GLESv2.o $(GLESv2_LIBS)
-	$(call mklib,GLESv2)
+	$(call mklib-cxx,GLESv2)
 
 $(OUTPUT_PATH)/$(ST_PREFIX)$(VG_LIB).so: st_OpenVG.o $(OpenVG_LIBS)
 	$(call mklib,OpenVG)



More information about the mesa-commit mailing list