A few build automation changes/fixes.

This commit is contained in:
Gregory Burd 2013-10-02 14:41:06 -04:00
parent 17585a99b1
commit 9d2896016b
3 changed files with 15 additions and 23 deletions

View file

@ -52,19 +52,17 @@ endif
.PHONY: all compile doc clean test dialyzer typer shell distclean pdf \ .PHONY: all compile doc clean test dialyzer typer shell distclean pdf \
update-deps clean-common-test-data rebuild update-deps clean-common-test-data rebuild
all: deps compile test all: deps compile
# ============================================================================= # =============================================================================
# Rules to build the system # Rules to build the system
# ============================================================================= # =============================================================================
deps: deps:
c_src/build_deps.sh get-deps
$(REBAR) get-deps $(REBAR) get-deps
$(REBAR) compile $(REBAR) compile
update-deps: update-deps:
c_src/build_deps.sh update-deps
$(REBAR) update-deps $(REBAR) update-deps
$(REBAR) compile $(REBAR) compile

View file

@ -11,10 +11,10 @@ unset POSIX_SHELL # clear it so if we invoke other scripts, they run as ksh as w
set -e set -e
WT_REPO=http://github.com/wiredtiger/wiredtiger.git WT_REPO=http://github.com/wiredtiger/wiredtiger.git
#WT_BRANCH=develop WT_BRANCH=develop
#WT_DIR=wiredtiger-`basename $WT_BRANCH` WT_DIR=wiredtiger-`basename $WT_BRANCH`
WT_REF="tags/1.6.4" #WT_REF="tags/1.6.4"
WT_DIR=wiredtiger-`basename $WT_REF` #WT_DIR=wiredtiger-`basename $WT_REF`
SNAPPY_VSN="1.0.4" SNAPPY_VSN="1.0.4"
SNAPPY_DIR=snappy-$SNAPPY_VSN SNAPPY_DIR=snappy-$SNAPPY_VSN
@ -26,8 +26,7 @@ export BASEDIR="$PWD"
which gmake 1>/dev/null 2>/dev/null && MAKE=gmake which gmake 1>/dev/null 2>/dev/null && MAKE=gmake
MAKE=${MAKE:-make} MAKE=${MAKE:-make}
export CFLAGS="$CFLAGS -I $BASEDIR/system/include" export CPPFLAGS="$CPPLAGS -I $BASEDIR/system/include -O3 -mtune=native -march=native"
export CXXFLAGS="$CXXFLAGS -I $BASEDIR/system/include"
export LDFLAGS="$LDFLAGS -L$BASEDIR/system/lib" export LDFLAGS="$LDFLAGS -L$BASEDIR/system/lib"
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BASEDIR/system/lib:$LD_LIBRARY_PATH" export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$BASEDIR/system/lib:$LD_LIBRARY_PATH"
@ -58,7 +57,7 @@ get_wt ()
wt_configure () wt_configure ()
{ {
(cd $BASEDIR/$WT_DIR/build_posix (cd $BASEDIR/$WT_DIR/build_posix
CFLAGS+=-g ../configure --with-pic \ CFLAGS+=-g $BASEDIR/$WT_DIR/configure --with-pic \
--enable-snappy \ --enable-snappy \
--prefix=${BASEDIR}/system || exit 1) --prefix=${BASEDIR}/system || exit 1)
} }
@ -107,11 +106,6 @@ build_snappy ()
) )
} }
install_shared_lib ()
{
cp -p -P $1 ${BASEDIR}/../priv/`basename ${1%.*}.so`
}
case "$1" in case "$1" in
clean) clean)
[ -e $BASEDIR/$WT_DIR/build_posix/Makefile ] && \ [ -e $BASEDIR/$WT_DIR/build_posix/Makefile ] && \
@ -147,12 +141,12 @@ case "$1" in
# Build WiredTiger # Build WiredTiger
[ -d $WT_DIR ] || get_wt; [ -d $WT_DIR ] || get_wt;
[ -d $BASEDIR/$WT_DIR ] || (echo "Missing WiredTiger source directory" && exit 1) [ -d $BASEDIR/$WT_DIR ] || (echo "Missing WiredTiger source directory" && exit 1)
test -f $BASEDIR/system/lib/libwiredtiger-[0-9].[0-9].[0-9].$SUFFIXES -a \ test -f $BASEDIR/system/lib/libwiredtiger-[0-9].[0-9].[0-9].${SUFFIXES} -a \
-f $BASEDIR/system/lib/libwiredtiger_snappy.$SUFFIXES || build_wt; -f $BASEDIR/system/lib/libwiredtiger_snappy.${SUFFIXES} || build_wt;
[ -d $BASEDIR/../priv ] || mkdir ${BASEDIR}/../priv [ -d $BASEDIR/../priv ] || mkdir ${BASEDIR}/../priv
cp -p -P $BASEDIR/system/bin/wt ${BASEDIR}/../priv cp -p -P $BASEDIR/system/bin/wt ${BASEDIR}/../priv
install_shared_lib ${BASEDIR}/system/lib/libwiredtiger-[0-9].[0-9].[0-9].$SUFFIXES cp -p -P ${BASEDIR}/system/lib/libwiredtiger-[0-9].[0-9].[0-9].${SUFFIXES} ${BASEDIR}/../priv
install_shared_lib ${BASEDIR}/system/lib/libwiredtiger_snappy.$SUFFIXES* cp -p -P ${BASEDIR}/system/lib/libwiredtiger_snappy.${SUFFIXES} ${BASEDIR}/../priv
install_shared_lib ${BASEDIR}/system/lib/libsnappy.$SUFFIXES* cp -p -P ${BASEDIR}/system/lib/libsnappy.${SUFFIXES}* ${BASEDIR}/../priv
;; ;;
esac esac

View file

@ -38,8 +38,8 @@
{port_specs, [{"priv/wterl.so", ["c_src/*.c"]}]}. {port_specs, [{"priv/wterl.so", ["c_src/*.c"]}]}.
{port_env, [ {port_env, [
{"DRV_CFLAGS", "$DRV_CFLAGS -fPIC -Wall -Wextra -Werror -I c_src/system/include"}, {"DRV_CFLAGS", "$DRV_CFLAGS -fPIC -Wall -Wextra -Werror -O3 -march=native -mtune=native -I c_src/system/include"},
{"DRV_LDFLAGS", "$DRV_LDFLAGS -Wl,-rpath,lib/wterl/priv:priv -Lc_src/system/lib -lwiredtiger"} {"DRV_LDFLAGS", "$DRV_LDFLAGS -Wl,-rpath,lib/wterl/priv:lib/wterl-0.9.0/priv:priv -Lc_src/system/lib -lwiredtiger"}
]}. ]}.
{pre_hooks, [{compile, "c_src/build_deps.sh compile"}]}. {pre_hooks, [{compile, "c_src/build_deps.sh compile"}]}.