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
27
bin/mklib
27
bin/mklib
@@ -281,18 +281,21 @@ case $ARCH in
|
|||||||
# expand any .a objects into constituent .o files.
|
# expand any .a objects into constituent .o files.
|
||||||
NEWOBJECTS=""
|
NEWOBJECTS=""
|
||||||
DELETIA=""
|
DELETIA=""
|
||||||
for OBJ in ${OBJECTS} ; do
|
for OBJ in $OBJECTS ; do
|
||||||
if [ `expr match $OBJ '.*\.a'` -gt 0 ] ; then
|
case $OBJ in
|
||||||
# extract the .o files from this .a archive
|
*.a)
|
||||||
FILES=`ar t $OBJ`
|
# extract the .o files from this .a archive
|
||||||
ar x $OBJ
|
FILES=`ar t $OBJ`
|
||||||
NEWOBJECTS="$NEWOBJECTS $FILES"
|
ar x $OBJ
|
||||||
# keep track of temporary .o files and delete them below
|
NEWOBJECTS="$NEWOBJECTS $FILES"
|
||||||
DELETIA="$DELETIA $FILES"
|
# keep track of temporary .o files and delete them below
|
||||||
else
|
DELETIA="$DELETIA $FILES"
|
||||||
# ordinary .o file
|
;;
|
||||||
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
*)
|
||||||
fi
|
# ordinary .o file
|
||||||
|
NEWOBJECTS="$NEWOBJECTS $OBJ"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# make lib
|
# make lib
|
||||||
|
Reference in New Issue
Block a user