summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-06-12 12:09:34 -0400
committerAlex Deucher <alexdeucher@gmail.com>2009-06-12 12:09:34 -0400
commit1036ef2bf468611d37b5df06fc4424f2002e3837 (patch)
treef0859a6d903c2570a0a00c918da88139f8f7d065 /bin
parent917f8bc1a85e61311cef6478127b387df70fba14 (diff)
parent1cd0afffc9edbcac690f8ab436aecfced26b0aba (diff)
Merge master and fix conflicts
Diffstat (limited to 'bin')
-rwxr-xr-xbin/minstall7
-rwxr-xr-xbin/mklib63
2 files changed, 53 insertions, 17 deletions
diff --git a/bin/minstall b/bin/minstall
index 8ee96089fa..130025829b 100755
--- a/bin/minstall
+++ b/bin/minstall
@@ -66,8 +66,11 @@ if [ $# -ge 2 ] ; then
elif [ -f "$FILE" ] ; then
#echo "$FILE" is a regular file
- $RM "$DEST/`basename $FILE`"
- cp "$FILE" "$DEST"
+ # Only copy if the files differ
+ if ! cmp -s $FILE $DEST/`basename $FILE`; then
+ $RM "$DEST/`basename $FILE`"
+ cp "$FILE" "$DEST"
+ fi
if [ $MODE ] ; then
FILE=`basename "$FILE"`
chmod $MODE "$DEST/$FILE"
diff --git a/bin/mklib b/bin/mklib
index a3e826abac..2444945006 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -176,6 +176,23 @@ if [ ${ARCH} = "auto" ] ; then
fi
+if [ $STATIC = 1 ]; then
+ # filter out linker options inside object list
+ NEWOBJECTS=""
+ for OBJ in $OBJECTS ; do
+ case $OBJ in
+ -Wl,*)
+ echo "mklib: warning: ignoring $OBJ for static library"
+ ;;
+ *)
+ NEWOBJECTS="$NEWOBJECTS $OBJ"
+ ;;
+ esac
+ done
+ OBJECTS=$NEWOBJECTS
+fi
+
+
#
# Error checking
#
@@ -264,18 +281,21 @@ case $ARCH in
# 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
+ for OBJ in $OBJECTS ; do
+ case $OBJ in
+ *.a)
+ # 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"
+ ;;
+ *)
+ # ordinary .o file
+ NEWOBJECTS="$NEWOBJECTS $OBJ"
+ ;;
+ esac
done
# make lib
@@ -865,6 +885,17 @@ case $ARCH in
CYGWIN*)
# GCC-based environment
+ if [ $NOPREFIX = 1 ] ; then
+ # No "lib" or ".so" part
+ echo "mklib: Making CYGWIN shared library: " ${LIBNAME}
+ OPTS="-shared -Wl,--enable-auto-image-base"
+ if [ "${ALTOPTS}" ] ; then
+ OPTS=${ALTOPTS}
+ fi
+ rm -f ${LIBNAME}
+ ${LINK} ${OPTS} ${LDFLAGS} -o ${LIBNAME} ${OBJECTS} ${DEPS}
+ FINAL_LIBS=${LIBNAME}
+ else
CYGNAME="cyg${LIBNAME}" # prefix with "cyg"
LIBNAME="lib${LIBNAME}" # prefix with "lib"
@@ -881,11 +912,11 @@ case $ARCH in
# finish up
FINAL_LIBS=${LIBNAME}.a
else
- OPTS="-shared -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
+ OPTS="-shared -Wl,--enable-auto-image-base -Wl,-export-all -Wl,--out-implib=${LIBNAME}-${MAJOR}.dll.a"
if [ "${ALTOPTS}" ] ; then
OPTS=${ALTOPTS}
fi
- echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}-${MAJOR}.dll
+ echo "mklib: Making" $ARCH "shared library: " ${CYGNAME}-${MAJOR}.dll
if [ $CPLUSPLUS = 1 ] ; then
LINK="g++"
@@ -894,7 +925,8 @@ case $ARCH in
fi
# rm any old libs
- rm -f ${LIBNAME}-${MAJOR}.dll
+ rm -f ${CYGNAME}-${MAJOR}.dll
+ rm -f ${LIBNAME}-${MAJOR}.dll.a
rm -f ${LIBNAME}.dll.a
rm -f ${LIBNAME}.a
@@ -907,6 +939,7 @@ case $ARCH in
# special case for installing in bin
FINAL_BINS="${CYGNAME}-${MAJOR}.dll"
fi
+ fi
;;
'example')