mklib: replace if/expr with case

Saves forking an expr for every object.
This commit is contained in:
Tormod Volden
2009-04-30 16:55:54 -06:00
committed by Brian Paul
parent 9cb3cdec76
commit eef79d50bf

View File

@@ -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