summaryrefslogtreecommitdiff
path: root/bin/mklib
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mklib')
-rwxr-xr-xbin/mklib34
1 files changed, 19 insertions, 15 deletions
diff --git a/bin/mklib b/bin/mklib
index c2760e5d89..2f9223ff3c 100755
--- 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}
@@ -938,7 +948,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"
@@ -946,7 +956,7 @@ case $ARCH in
if [ $STATIC = 1 ] ; then
LIBNAME=${LIBNAME}.a
- echo "mklib: Making" $ARCH "static library: " ${LIBNAME}
+ echo "mklib: Making CYGWIN static library: " ${LIBNAME}
OPTS="-ru"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
@@ -964,13 +974,7 @@ case $ARCH in
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
- echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
-
- if [ $CPLUSPLUS = 1 ] ; then
- LINK="g++"
- else
- LINK="gcc"
- fi
+ echo "mklib: Making CYGWIN shared library: " ${CYGNAME}-${MAJOR}.dll
# rm any old libs
rm -f ${CYGNAME}-${MAJOR}.dll
@@ -979,12 +983,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
@@ -1024,4 +1023,9 @@ if [ ${INSTALLDIR} != "." ] ; then
echo "mklib: Installing" ${FINAL_LIBS} "in" ${INSTALLDIR}
test -d ${INSTALLDIR} || mkdir -p ${INSTALLDIR}
mv ${FINAL_LIBS} ${INSTALLDIR}/
+
+ if [ "x${FINAL_BINS}" != "x" ] ; then
+ echo "mklib: Installing" ${FINAL_BINS} "in" ${INSTALLDIR}
+ mv ${FINAL_BINS} ${INSTALLDIR}/
+ fi
fi