[Mesa-dev] [PATCH 1/2] build libgallium shared by default.

Maarten Lankhorst maarten.lankhorst at canonical.com
Mon Mar 18 07:38:31 PDT 2013

This is one of the 2 patches used in ubuntu for decreasing size of mesa build.

The other one is more hacky, and links libmesagallium into libgallium,
and then links libgallium against libdricore too for minimal duplication.

This might mess up with static llvm, iirc static llvm is built wrong and
linking libgallium against it will cause it to export all llvm symbols too.
I believe that this is a bug in llvm though, not in mesa. The static libraries
should not export all llvm symbols.

I should probably change the default to not building shared gallium for the
same reason. :-)

Meant mostly for discussion purposes, although if there is no objection I'll
change the default to disabling shared gallium, and just let every distro enable
shared llvm and libgallium for themselves.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>

--- a/configure.ac
+++ b/configure.ac
@@ -733,6 +733,19 @@
 AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
+    [AS_HELP_STRING([--enable-shared-gallium],
+        [Enable shared gallium core @<:@default=yes@:>@])],
+    [enable_shared_gallium="$enableval"],
+    [enable_shared_gallium=yes])
+if test "x$enable_shared_gallium" = xyes; then
 dnl Driver specific build directories
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -3,13 +3,19 @@
 include Makefile.sources
 include $(top_srcdir)/src/gallium/Automake.inc
-noinst_LTLIBRARIES = libgallium.la
 	-I$(top_srcdir)/src/gallium/auxiliary/util \
+lib_LTLIBRARIES = libgallium.la
+noinst_LTLIBRARIES = libgallium.la
 libgallium_la_SOURCES = \
 	$(C_SOURCES) \
@@ -28,6 +34,8 @@
 AM_CXXFLAGS += -fno-rtti
+libgallium_la_LIBADD = $(LLVM_LIBS)
 libgallium_la_SOURCES += \

More information about the mesa-dev mailing list