From 9cb3cdec76b679f15c591955084bd48e91a32142 Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Thu, 30 Apr 2009 16:52:56 -0600 Subject: mesa: Prepend "-Wl," to linking options Let mklib ignore -Wl options inside the object list when building static libraries --- bin/mklib | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'bin') diff --git a/bin/mklib b/bin/mklib index a3e826abac..db3bc8325f 100755 --- 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 # -- cgit v1.2.3 From eef79d50bf160a0278266cac56a915027538ac1e Mon Sep 17 00:00:00 2001 From: Tormod Volden Date: Thu, 30 Apr 2009 16:55:54 -0600 Subject: mklib: replace if/expr with case Saves forking an expr for every object. --- bin/mklib | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/mklib b/bin/mklib index db3bc8325f..2fd95ba775 100755 --- a/bin/mklib +++ b/bin/mklib @@ -281,18 +281,21 @@ case $ARCH in # expand any .a objects into constituent .o files. NEWOBJECTS="" DELETIA="" - for OBJ in ${OBJECTS} ; do - if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then - # extract the .o files from this .a archive - FILES=`ar t $OBJ` - ar x $OBJ - NEWOBJECTS="$NEWOBJECTS $FILES" - # keep track of temporary .o files and delete them below - DELETIA="$DELETIA $FILES" - else - # ordinary .o file - NEWOBJECTS="$NEWOBJECTS $OBJ" - fi + for OBJ in $OBJECTS ; do + case $OBJ in + *.a) + # extract the .o files from this .a archive + FILES=`ar t $OBJ` + ar x $OBJ + NEWOBJECTS="$NEWOBJECTS $FILES" + # keep track of temporary .o files and delete them below + DELETIA="$DELETIA $FILES" + ;; + *) + # ordinary .o file + NEWOBJECTS="$NEWOBJECTS $OBJ" + ;; + esac done # make lib -- cgit v1.2.3