summaryrefslogtreecommitdiff
path: root/bin/mklib
diff options
context:
space:
mode:
authorTormod Volden <debian.tormod@gmail.com>2009-04-30 16:55:54 -0600
committerBrian Paul <brianp@vmware.com>2009-04-30 16:55:54 -0600
commiteef79d50bf160a0278266cac56a915027538ac1e (patch)
tree91c1d5c7d09f2f2a99e9c5f2d9f52841469db86e /bin/mklib
parent9cb3cdec76b679f15c591955084bd48e91a32142 (diff)
mklib: replace if/expr with case
Saves forking an expr for every object.
Diffstat (limited to 'bin/mklib')
-rwxr-xr-xbin/mklib27
1 files changed, 15 insertions, 12 deletions
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