From 942e51b7537663bccb525b73854d659390d9bf84 Mon Sep 17 00:00:00 2001 From: Gregory Burd Date: Fri, 6 Sep 2013 09:54:55 -0400 Subject: [PATCH] OS/X uses ".dylib" rather than ".so" for shared libraries (because it's special) so I've worked around that. Also tightened up some tests so that we're not rebuilding the libraries when not necessary. --- c_src/build_deps.sh | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/c_src/build_deps.sh b/c_src/build_deps.sh index bbaddb4..a435913 100755 --- a/c_src/build_deps.sh +++ b/c_src/build_deps.sh @@ -107,6 +107,11 @@ build_snappy () ) } +install_shared_lib () +{ + cp -p -P $1 ${BASEDIR}/../priv/`basename ${1%.*}.so` +} + case "$1" in clean) [ -e $BASEDIR/$WT_DIR/build_posix/Makefile ] && \ @@ -131,21 +136,23 @@ case "$1" in ;; *) + shopt -s extglob + SUFFIXES='@(so|dylib)' + # Build Snappy [ -d $SNAPPY_DIR ] || get_snappy; [ -d $BASEDIR/$SNAPPY_DIR ] || (echo "Missing Snappy source directory" && exit 1) - test -f $BASEDIR/system/lib/libsnappy.so.[0-9].[0-9].[0-9] || build_snappy; + test -f $BASEDIR/system/lib/libsnappy.so.[0-9].[0-9].[0-9].* || build_snappy; # Build WiredTiger [ -d $WT_DIR ] || get_wt; [ -d $BASEDIR/$WT_DIR ] || (echo "Missing WiredTiger source directory" && exit 1) - test -f $BASEDIR/system/lib/libwiredtiger-[0-9].[0-9].[0-9].so \ - -a -f $BASEDIR/system/lib/libwiredtiger_snappy.so || build_wt; - + test -f $BASEDIR/system/lib/libwiredtiger-[0-9].[0-9].[0-9].$SUFFIXES -a \ + -f $BASEDIR/system/lib/libwiredtiger_snappy.$SUFFIXES || build_wt; [ -d $BASEDIR/../priv ] || mkdir ${BASEDIR}/../priv cp -p -P $BASEDIR/system/bin/wt ${BASEDIR}/../priv - cp -p -P $BASEDIR/system/lib/libwiredtiger-[0-9].[0-9].[0-9].so ${BASEDIR}/../priv - cp -p -P $BASEDIR/system/lib/libwiredtiger_snappy.so* ${BASEDIR}/../priv - cp -p -P $BASEDIR/system/lib/libsnappy.so* ${BASEDIR}/../priv + install_shared_lib ${BASEDIR}/system/lib/libwiredtiger-[0-9].[0-9].[0-9].$SUFFIXES + install_shared_lib ${BASEDIR}/system/lib/libwiredtiger_snappy.$SUFFIXES* + install_shared_lib ${BASEDIR}/system/lib/libsnappy.$SUFFIXES* ;; esac