From: Brian Paul Date: Mon, 6 Oct 2008 16:58:16 +0000 (-0600) Subject: mesa: fix static library construction X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=145d49838fe268c8524a369d59cb9f771657ad59;p=mesa.git mesa: fix static library construction If the .a is made of other .a files, extract the objects from the later. --- diff --git a/bin/mklib b/bin/mklib index a25d5bfaeb2..d7b740f8e34 100755 --- a/bin/mklib +++ b/bin/mklib @@ -260,9 +260,31 @@ case $ARCH in OPTS=${ALTOPTS} fi 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 - ${LINK} ${OPTS} ${LIBNAME} ${OBJECTS} + ${LINK} ${OPTS} ${LIBNAME} ${NEWOBJECTS} ranlib ${LIBNAME} + + # remove temporary extracted .o files + rm -f ${DELETIA} + # finish up FINAL_LIBS=${LIBNAME} else