fi
if [[ -n "$OLD_PREFIX" ]]; then
- CONFIGURE_ARG=$OLD_PREFIX
+ PREFIX_ARG=$OLD_PREFIX
fi
if [[ -n "$OLD_MAKE" ]]; then
export -n CC CXX
}
-function push_PREFIX_ARG ()
-{
- if [[ -n "$OLD_PREFIX_ARG" ]]; then
- die "OLD_PREFIX_ARG was set on push, programmer error!"
- fi
-
- if [[ -n "$PREFIX_ARG" ]]; then
- OLD_PREFIX_ARG=$PREFIX_ARG
- PREFIX_ARG=
- fi
-
- if [[ -n "$1" ]]; then
- PREFIX_ARG="--prefix=$1"
- fi
-}
-
-function pop_PREFIX_ARG ()
-{
- if [[ -n "$OLD_PREFIX_ARG" ]]; then
- PREFIX_ARG=$OLD_PREFIX_ARG
- OLD_PREFIX_ARG=
- else
- PREFIX_ARG=
- fi
-}
-
-function push_TESTS_ENVIRONMENT ()
-{
- if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
- die "OLD_TESTS_ENVIRONMENT was set on push, programmer error!"
- fi
-
- if [[ -n "$TESTS_ENVIRONMENT" ]]; then
- OLD_TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT
- TESTS_ENVIRONMENT=
- fi
-}
-
-function pop_TESTS_ENVIRONMENT ()
-{
- TESTS_ENVIRONMENT=
- if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
- TESTS_ENVIRONMENT=$OLD_TESTS_ENVIRONMENT
- OLD_TESTS_ENVIRONMENT=
- fi
-}
-
function safe_pushd ()
{
pushd $1 &> /dev/null ;
return 1
fi
+ save_BUILD
+
# If we are required to run configure, do so now
run_configure_if_required
- push_TESTS_ENVIRONMENT
-
# If we don't have a configure, then most likely we will be missing libtool
assert_file 'configure'
if [[ -f 'libtool' ]]; then
make_target 'check' || return 1
- pop_TESTS_ENVIRONMENT
+ restore_BUILD
}
function make_install_system ()
{
local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX)
- push_PREFIX_ARG $INSTALL_LOCATION
+
+ save_BUILD
+ PREFIX_ARG="--prefix=$INSTALL_LOCATION"
if [ ! -d $INSTALL_LOCATION ] ; then
die "ASSERT temp directory not found '$INSTALL_LOCATION'"
run_configure #install_buid_dir
- push_TESTS_ENVIRONMENT
-
make_target 'install'
make_target 'installcheck'
make_target 'uninstall'
- pop_TESTS_ENVIRONMENT
- pop_PREFIX_ARG
-
rm -r -f $INSTALL_LOCATION
make 'distclean'
die "ASSERT Makefile should not exist"
fi
+ restore_BUILD
safe_popd
}
make_install_system
;;
- *-precise-*)
+ *-ubuntu-quantal-*)
run_configure
assert_exec_file 'configure'
function make_gdb ()
{
+ save_BUILD
+
if command_exists 'gdb'; then
run_configure_if_required
- push_TESTS_ENVIRONMENT
-
# Set ENV GDB_COMMAND
if [[ -z "$GDB_COMMAND" ]]; then
setup_gdb_command
rm 'gdb.txt'
fi
- pop_TESTS_ENVIRONMENT
-
if [ -f '.gdb_history' ]; then
rm '.gdb_history'
fi
echo 'gdb was not present'
return 1
fi
+
+ restore_BUILD
}
# $1 target to compile
# Set ENV PREFIX in order to set --prefix for ./configure
if [[ -n "$PREFIX" ]]; then
- push_PREFIX_ARG $PREFIX
+ PREFIX_ARG="--prefix=$PREFIX"
fi
# We should always have a target by this point
export AUTOM4TE
export AUTOMAKE
export AUTORECONF
+export CONFIGURE_ARG
export DEBUG
export GNU_BUILD_FLAGS
export LIBTOOLIZE
export LIBTOOLIZE_OPTIONS
export MAKE
+export PREFIX_ARG
export TESTS_ENVIRONMENT
export VERBOSE
export WARNINGS