mesa: Prepend "-Wl," to linking options
authorTormod Volden <debian.tormod@gmail.com>
Thu, 30 Apr 2009 22:52:56 +0000 (16:52 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 30 Apr 2009 22:52:56 +0000 (16:52 -0600)
Let mklib ignore -Wl options inside the object list when building
static libraries

bin/mklib
src/gallium/winsys/egl_xlib/Makefile
src/gallium/winsys/xlib/Makefile

index a3e826abac9b357319d02cfb9ff8c70c51ac80f5..db3bc8325f72956cbbe7947a56e2b97c753b507a 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -176,6 +176,23 @@ if [ ${ARCH} = "auto" ] ; then
 fi
 
 
+if [ $STATIC = 1 ]; then
+    # filter out linker options inside object list
+    NEWOBJECTS=""
+    for OBJ in $OBJECTS ; do
+       case $OBJ in
+           -Wl,*)
+               echo "mklib: warning: ignoring $OBJ for static library"
+               ;;
+           *)
+               NEWOBJECTS="$NEWOBJECTS $OBJ"
+               ;;
+       esac
+    done
+    OBJECTS=$NEWOBJECTS
+fi
+
+
 #
 # Error checking
 #
index 02ac47caa4e03cad50b87ac80f245cd311b625fa..8646ee3b527c3b873c7074f7ed4639b104b94ef2 100644 (file)
@@ -60,7 +60,7 @@ $(TOP)/$(LIB_DIR)/$(DRIVER_NAME): $(WINSYS_OBJECTS) $(LIBS)
                -noprefix \
                -install $(TOP)/$(LIB_DIR) \
                $(MKLIB_OPTIONS) $(WINSYS_OBJECTS) \
-               --whole-archive $(LIBS) --no-whole-archive
+               -Wl,--whole-archive $(LIBS) -Wl,--no-whole-archive
 
 
 depend: $(ALL_SOURCES)
index bb187cc14a5788ad9d86a3020784d51d991585c4..04309e67eea5e75366a3f0e0a5e0a80d62ca6ee2 100644 (file)
@@ -74,7 +74,7 @@ $(TOP)/$(LIB_DIR)/gallium/$(GL_LIB_NAME): $(XLIB_WINSYS_OBJECTS) $(LIBS) Makefil
                -major $(GL_MAJOR) -minor $(GL_MINOR) -patch $(GL_TINY) \
                -install $(TOP)/$(LIB_DIR)/gallium \
                $(MKLIB_OPTIONS) $(XLIB_WINSYS_OBJECTS) \
-               --start-group $(LIBS) --end-group $(GL_LIB_DEPS)
+               -Wl,--start-group $(LIBS) -Wl,--end-group $(GL_LIB_DEPS)
 
 
 depend: $(XLIB_WINSYS_SOURCES)