#!/bin/bash
#
# Calls configure, make and make install on Ariba
# with the right options for cross-compiling
#
# Martin Florian <mflorian@lafka.net>
# Mar-2010
#

# this should point to your ariba-brcm-2.4 dir
ARIBA_BRCM_DIR=$PWD/ariba-brcm-2.4

# check where we are
test ! -e ./aclocal.m4 \
    && echo "Should be called from the root of an ariba build tree." \
    && exit

test ! -e $ARIBA_BRCM_DIR/variables \
    && echo "ARIBA_BRCM_DIR should point to the aiba-brcm-2.4 directory." \
    && exit

source $ARIBA_BRCM_DIR/variables    

# setup
export PREFIX=`cd ./build; pwd`

./configure --prefix=$PREFIX --with-boost=$PREFIX CPPFLAGS="$CXXFLAGS -I$TOOLCHAIN_DIR/include -I$PREFIX/include" LDFLAGS="$LDFLAGS -L$PREFIX/lib" $CONFIG_ARGS
make $MAKEOPTS
make install

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PREFIX/lib
