Skip to content

Commit

Permalink
Replicate build changes
Browse files Browse the repository at this point in the history
Compatible with MAC OSX as well as always taking the leveldb_ee version
  • Loading branch information
martinsumner committed Mar 14, 2019
1 parent c565e46 commit b7071c2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
30 changes: 17 additions & 13 deletions c_src/build_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if [ `uname -s` = 'SunOS' -a "${POSIX_SHELL}" != "true" ]; then
fi
unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as well

LEVELDB_VSN="2.0.34"
LEVELDB_VSN="2.0.35"

SNAPPY_VSN="1.0.4"

Expand Down Expand Up @@ -56,17 +56,24 @@ case "$1" in

get-deps)
if [ ! -d leveldb ]; then
git clone git://github.com/basho/leveldb
git clone https://github.com/basho/leveldb
(cd leveldb && git checkout $LEVELDB_VSN)
if [ "$BASHO_EE" = "1" ]; then
(cd leveldb && git submodule update --init)
fi
(cd leveldb && git submodule update --init)
fi
;;

*)
export MACOSX_DEPLOYMENT_TARGET=10.8
TARGET_OS=`uname -s`

export CFLAGS="$CFLAGS -I $BASEDIR/system/include"
export CXXFLAGS="$CXXFLAGS -I $BASEDIR/system/include"
# On GCC, we pick libc's memcmp over GCC's memcmp via -fno-builtin-memcmp
if [ "$TARGET_OS" = "Darwin" ]; then
export MACOSX_DEPLOYMENT_TARGET=10.8
export CFLAGS="$CFLAGS -stdlib=libc++"
export CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi

if [ ! -d snappy-$SNAPPY_VSN ]; then
tar -xzf snappy-$SNAPPY_VSN.tar.gz
(cd snappy-$SNAPPY_VSN && ./configure --disable-shared --prefix=$BASEDIR/system --libdir=$BASEDIR/system/lib --with-pic)
Expand All @@ -76,18 +83,15 @@ case "$1" in
(cd snappy-$SNAPPY_VSN && $MAKE && $MAKE install)
fi

export CFLAGS="$CFLAGS -I $BASEDIR/system/include"
export CXXFLAGS="$CXXFLAGS -I $BASEDIR/system/include"

export LDFLAGS="$LDFLAGS -L$BASEDIR/system/lib"
export LD_LIBRARY_PATH="$BASEDIR/system/lib:$LD_LIBRARY_PATH"
export LEVELDB_VSN="$LEVELDB_VSN"

if [ ! -d leveldb ]; then
git clone git://github.com/basho/leveldb
git clone https://github.com/basho/leveldb
(cd leveldb && git checkout $LEVELDB_VSN)
if [ $BASHO_EE = "1" ]; then
(cd leveldb && git submodule update --init)
fi
(cd leveldb && git submodule update --init)
fi

# hack issue where high level make is running -j 4
Expand All @@ -99,4 +103,4 @@ case "$1" in
(cp leveldb/perf_dump leveldb/sst_rewrite leveldb/sst_scan leveldb/leveldb_repair ../priv)

;;
esac
esac
2 changes: 1 addition & 1 deletion rebar.config.script
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
%% actually running.
case os:type() of
{unix,darwin} ->
Opt = " -mmacosx-version-min=10.8",
Opt = " -mmacosx-version-min=10.8 -stdlib=libc++",
[Mjr|_] = string:tokens(os:cmd("/usr/bin/uname -r"), "."),
Major = list_to_integer(Mjr),
if
Expand Down

0 comments on commit b7071c2

Please sign in to comment.