Cygwin: Have mklib exit with error code if link fails
authorJon TURNEY <jon.turney@dronecode.org.uk>
Fri, 19 Feb 2010 22:38:57 +0000 (22:38 +0000)
committerBrian Paul <brianp@vmware.com>
Wed, 1 Sep 2010 14:48:00 +0000 (08:48 -0600)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Brian Paul <brianp@vmware.com>
bin/mklib

index c2760e5d892724b0c6a065695c1f3752605ab43f..e2b854f3509654561e03da57445c924039be69eb 100755 (executable)
--- a/bin/mklib
+++ b/bin/mklib
@@ -938,7 +938,7 @@ case $ARCH in
                 OPTS=${ALTOPTS}
             fi
            rm -f ${LIBNAME}
-           ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
+           ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS} || exit $?
            FINAL_LIBS=${LIBNAME}
         else
        CYGNAME="cyg${LIBNAME}"     # prefix with "cyg"
@@ -979,12 +979,7 @@ case $ARCH in
             rm -f ${LIBNAME}.a
 
             # make lib
-            ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS}
-            # make build fail if link failed
-            es=$?
-            if [ "$es" -ne "0" ]; then
-                exit $es
-            fi
+            ${LINK} ${OPTS} ${LDFLAGS} -o ${CYGNAME}-${MAJOR}.dll ${OBJECTS} ${DEPS} || exit $?
             # make usual symlinks
             ln -s ${LIBNAME}-${MAJOR}.dll.a ${LIBNAME}.dll.a
             # finish up