[Mesa-dev] [PATCH 2/4] build: Use new -whole-archive support to fold libglsl.so into libdricore.so
Christopher James Halse Rogers
christopher.halse.rogers at canonical.com
Fri Aug 26 01:03:21 PDT 2011
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers at canonical.com>
---
configs/autoconf.in | 2 +-
configure.ac | 10 ++++------
src/glsl/Makefile | 9 +++------
src/mesa/Makefile | 3 ++-
src/mesa/sources.mak | 2 ++
5 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/configs/autoconf.in b/configs/autoconf.in
index 37b7ea5..406e339 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -118,7 +118,7 @@ GALLIUM_DRIVERS = $(foreach DIR,$(GALLIUM_DRIVERS_DIRS),$(TOP)/src/gallium/drive
# Driver specific build vars
DRI_DIRS = @DRI_DIRS@
-DRICORE_GLSL_LIBS = @DRICORE_GLSL_LIBS@
+BUILD_DRICORE_GLSL_LIBS = @BUILD_DRICORE_GLSL_LIBS@
DRICORE_LIBS = @DRICORE_LIBS@
DRICORE_LIB_DEPS = @DRICORE_LIB_DEPS@
EGL_PLATFORMS = @EGL_PLATFORMS@
diff --git a/configure.ac b/configure.ac
index ea58dae..8033f47 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1050,19 +1050,17 @@ if test "x$enable_dri" = xyes ; then
AC_MSG_WARN([Shared dricore requires GCC-compatible rpath handling. Disabling shared dricore])
enable_dricore=no
else
- DRICORE_GLSL_LIBS='$(TOP)/$(LIB_DIR)/libglsl.so'
+ BUILD_DRICORE_GLSL_LIBS='libglslcore.a'
DRICORE_LIBS='$(TOP)/$(LIB_DIR)/libdricore.so'
- DRICORE_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -lglsl'
- DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore -lglsl'
+ DRI_LIB_DEPS='-L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore'
DRI_CFLAGS='$(CFLAGS_NOVISIBILITY) -DUSE_DRICORE'
DRI_CXXFLAGS='$(CXXFLAGS_NOVISIBILITY) -DUSE_DRICORE'
- MESA_MODULES='$(DRICORE_LIBS) $(DRICORE_GLSL_LIBS)'
+ MESA_MODULES='$(DRICORE_LIBS)'
fi
fi
fi
+AC_SUBST([BUILD_DRICORE_GLSL_LIBS])
AC_SUBST([DRICORE_LIBS])
-AC_SUBST([DRICORE_GLSL_LIBS])
-AC_SUBST([DRICORE_LIB_DEPS])
AC_SUBST([DRI_CXXFLAGS])
AC_SUBST([DRI_CFLAGS])
AC_SUBST([MESA_MODULES])
diff --git a/src/glsl/Makefile b/src/glsl/Makefile
index c20a6c9..1fa6dc4 100644
--- a/src/glsl/Makefile
+++ b/src/glsl/Makefile
@@ -149,13 +149,10 @@ ALL_SOURCES = \
##### TARGETS #####
-default: depend lib$(LIBNAME).a $(APPS) $(DRICORE_GLSL_LIBS)
+default: depend lib$(LIBNAME).a $(APPS) $(BUILD_DRICORE_GLSL_LIBS)
-$(TOP)/$(LIB_DIR)/libglsl.so: $(OBJECTS_DRICORE) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
- $(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
- -cplusplus -noprefix \
- -install $(TOP)/$(LIB_DIR) -id $(INSTALL_LIB_DIR)/$@.dylib \
- $(OBJECTS_DRICORE) builtin_function.o
+libglslcore.a: $(OBJECTS_DRICORE) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
+ $(MKLIB) -cplusplus -o glslcore -static $(OBJECTS_DRICORE) builtin_function.o
lib$(LIBNAME).a: $(OBJECTS) builtin_function.o Makefile $(TOP)/src/glsl/Makefile.template
$(MKLIB) -cplusplus -o $(LIBNAME) -static $(OBJECTS) builtin_function.o
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index 0e15d61..95f3506 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -111,7 +111,8 @@ $(TOP)/$(LIB_DIR)/libdricore.so: $(DRICORE_OBJECTS) $(DRICORE_GLSL_LIBS)
@$(MKLIB) -o $@ -linker '$(CXX)' -ldflags '$(LDFLAGS)' \
-cplusplus -noprefix \
-install $(TOP)/$(LIB_DIR) -id $(DRI_DRIVER_INSTALL_DIR)/$@.dylib \
- $(DRICORE_LIB_DEPS) $(DRICORE_OBJECTS)
+ -whole-archive $(DRICORE_GLSL_LIBS) -no-whole-archive \
+ $(DRICORE_OBJECTS)
# Make archive of subset of core mesa object files for gallium
libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS)
diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak
index 5e77e0f..b6252be 100644
--- a/src/mesa/sources.mak
+++ b/src/mesa/sources.mak
@@ -369,6 +369,8 @@ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o)
GLSL_LIBS = \
$(TOP)/src/glsl/libglsl.a
+DRICORE_GLSL_LIBS = \
+ $(TOP)/src/glsl/libglslcore.a
### Include directories
--
1.7.5.4
More information about the mesa-dev
mailing list