mesa: fix static library construction

If the .a is made of other .a files, extract the objects from the later.
This commit is contained in:
Brian Paul
2008-10-06 10:58:16 -06:00
parent b0ca50bd38
commit 145d49838f

View File

@@ -260,9 +260,31 @@ case $ARCH in
OPTS=${ALTOPTS} OPTS=${ALTOPTS}
fi fi
rm -f ${LIBNAME} rm -f ${LIBNAME}
# 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
done
# make lib # make lib
${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} ${LINK} ${OPTS} ${LIBNAME} ${NEWOBJECTS}
ranlib ${LIBNAME} ranlib ${LIBNAME}
# remove temporary extracted .o files
rm -f ${DELETIA}
# finish up # finish up
FINAL_LIBS=${LIBNAME} FINAL_LIBS=${LIBNAME}
else else