Cygwin build fix: Fix linkage
authorJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 19 Feb 2010 22:38:00 +0000 (22:38 +0000)
committerBrian Paul <brianp@vmware.com>
Sat, 20 Feb 2010 16:24:15 +0000 (09:24 -0700)
Fix the way we make static convenience libraries, such as libmesa.a,
to be the same as linux etc.

Putting archives inside archives doesn't make the objects inside
the archive linkable, so use expand_archives() to get all the objects
inside an archive out again before linking.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
bin/mklib

index c4b3478c7987b12e012dbd7ff1df31e9de72edb2..06e8029cb6d1d2a71a854b93e4e70a70a6e32e91 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -936,7 +936,14 @@ case $ARCH in
             if [ "${ALTOPTS}" ] ; then
                 OPTS=${ALTOPTS}
             fi
-            FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${OBJECTS}`
+
+            # expand .a into .o files
+            NEW_OBJECTS=`expand_archives ${LIBNAME}.obj $OBJECTS`
+
+            FINAL_LIBS=`make_ar_static_lib ${OPTS} 1 ${LIBNAME} ${NEW_OBJECTS}`
+
+            # remove temporary extracted .o files
+            rm -rf ${LIBNAME}.obj
         else
            OPTS="-shared -Wl,--enable-auto-image-base -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
             if [ "${ALTOPTS}" ] ; then