mklib: replace if/expr with case
Saves forking an expr for every object.
This commit is contained in:

committed by
Brian Paul

parent
9cb3cdec76
commit
eef79d50bf
11
bin/mklib
11
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
|
||||
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"
|
||||
else
|
||||
;;
|
||||
*)
|
||||
# ordinary .o file
|
||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# make lib
|
||||
|
Reference in New Issue
Block a user