+ # Use OLD_TESTS_ENVIRONMENT for tracking the state of the variable
+ local OLD_TESTS_ENVIRONMENT=
+
+ # Set ENV PREFIX in order to set --prefix for ./configure
+ if [[ -n "$PREFIX" ]]; then
+ push_PREFIX_ARG $PREFIX
+ fi
+
+ # We should always have a target by this point
+ assert MAKE_TARGET
+
+ local MAKE_TARGET_ARRAY=($MAKE_TARGET)
+
+ for target in "${MAKE_TARGET_ARRAY[@]}"
+ do
+ # If we are running inside of Jenkins, we want to only run some of the possible tests
+ if $jenkins_build_environment; then
+ check_make_target $target
+ fi
+
+ case $target in
+ 'self')
+ self_test
+ ;;
+ 'gdb')
+ make_gdb
+ ;;
+ 'clean_op')
+ make_clean_option
+ ;;
+ 'autoreconf')
+ make_for_autoreconf
+ ;;
+ 'install-system')
+ make_install_system
+ ;;
+ 'configure')
+ run_configure
+ ;;
+ 'make_default')
+ make_default
+ ;;
+ 'mingw')
+ make_for_mingw32
+ ;;
+ 'snapshot')
+ make_for_snapshot
+ ;;
+ 'rpm')
+ make_rpm
+ ;;
+ 'valgrind')
+ make_valgrind
+ ;;
+ 'universe')
+ make_universe
+ ;;
+ 'jenkins')
+ make_for_continuus_integration
+ ;;
+ *)
+ run_configure_if_required
+ make_target "$target"
+ ;;
+ esac
+ done
+}
+
+main ()
+{
+ # Variables we export
+ declare -x VCS_CHECKOUT=
+
+ # Variables we control globally
+ local MAKE_TARGET=
+
+ # Options for getopt
+ local AUTORECONF_OPTION=false
+ local CLEAN_OPTION=false
+ local CONFIGURE_OPTION=false
+ local DEBUG_OPTION=false
+ local PRINT_SETUP_OPTION=false
+ local TARGET_OPTION=false
+ local TARGET_OPTION_ARG=
+ local VERBOSE_OPTION=false
+
+ # If we call autoreconf on the platform or not
+ local AUTORECONF_REBUILD_HOST=false
+ local AUTORECONF_REBUILD=false
+
+ local -r top_srcdir=`pwd`
+
+ # Variables for determine_target_platform () and rebuild_host_os ()
+ # UNAME_MACHINE_ARCH= uname -m
+ # VENDOR= apple, redhat, centos, canonical
+ # VENDOR_RELEASE=
+ # RHEL{rhel,Tikanga,Santiago}
+ # Ubuntu{ubuntu,Lucid,Maverick,Natty,Oneiric,Precise,Quantal}
+ # Fedora{fedora,Verne,Beefy}
+ # OSX{osx,lion,snow,mountain}
+ # VENDOR_DISTRIBUTION= darwin,fedora,rhel,ubuntu
+ # UNAME_KERNEL= Linux, Darwin,...
+ # UNAME_KERNEL_RELEASE= Linux, Darwin,...
+ local UNAME_MACHINE_ARCH=unknown
+ local VENDOR=unknown
+ local VENDOR_RELEASE=unknown
+ local VENDOR_DISTRIBUTION=unknown
+ local UNAME_KERNEL=unknown
+ local UNAME_KERNEL_RELEASE=unknown
+ local HOST_OS=
+
+ rebuild_host_os no_output
+
+ parse_command_line_options $@
+