Cygwin: Adjust mklib so -linker and -cplusplus options are processed more like they...
authorJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 27 Aug 2010 21:52:41 +0000 (22:52 +0100)
committerBrian Paul <brianp@vmware.com>
Wed, 1 Sep 2010 14:48:11 +0000 (08:48 -0600)
It looks like we were ignoring -linker when -noprefix wasn't present, and
when -noprefix was present, -linker was mandatory and -cplusplus ignored.

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

index bc554c15637dcb620abf0bd4f6c40ac72da81f43..2f9223ff3c1c94c6690baedc88e245b101acd03d 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -930,6 +930,16 @@ case $ARCH in
 
      CYGWIN*)
        # GCC-based environment
+
+       if [ "x$LINK" = "x" ] ; then
+           # -linker was not specified so set default link command now
+            if [ $CPLUSPLUS = 1 ] ; then
+                LINK=g++
+            else
+                LINK=gcc
+            fi
+       fi
+
        if [ $NOPREFIX = 1 ] ; then
            # No "lib" or ".so" part
            echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
@@ -966,12 +976,6 @@ case $ARCH in
             fi
             echo "mklib: Making CYGWIN shared library: " ${CYGNAME}-${MAJOR}.dll
 
-            if [ $CPLUSPLUS = 1 ] ; then
-                LINK="g++"
-            else
-                LINK="gcc"
-            fi
-
             # rm any old libs
             rm -f ${CYGNAME}-${MAJOR}.dll
             rm -f ${LIBNAME}-${MAJOR}.dll.a