3 # Copyright (C) 2012 Brian Aker
6 # Redistribution and use in source and binary forms, with or without
7 # modification, are permitted provided that the following conditions are
10 # * Redistributions of source code must retain the above copyright
11 # notice, this list of conditions and the following disclaimer.
13 # * Redistributions in binary form must reproduce the above
14 # copyright notice, this list of conditions and the following disclaimer
15 # in the documentation and/or other materials provided with the
18 # * The names of its contributors may not be used to endorse or
19 # promote products derived from this software without specific prior
22 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
28 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 # Environment Variables that will influence the build:
46 command_not_found_handle
()
48 echo "Command not found: '$@'"
54 echo "$BASH_SOURCE:$BASH_LINENO: $@" >&2
60 local param_name
=\$
"$1"
61 local param_value
=`eval "expr \"$param_name\" "`
63 if [ -z "$param_value" ]; then
64 echo "$BASH_SOURCE:$BASH_LINENO: assert($param_name)" >&2
71 if [ ! -f "$1" ]; then
72 echo "$BASH_SOURCE:$BASH_LINENO: assert($1) does not exist: $2" >&2
80 echo "$BASH_SOURCE:$BASH_LINENO: assert($1) file exists: $2" >&2
87 if [ ! -f "$1" ]; then
88 echo "$BASH_SOURCE:$BASH_LINENO: assert($1) does not exist: $2" >&2
92 if [ ! -x "$1" ]; then
93 echo "$BASH_SOURCE:$BASH_LINENO: assert($1) exists but is not executable: $2" >&2
100 type "$1" &> /dev
/null
;
105 HOST_OS
="${UNAME_MACHINE_ARCH}-${VENDOR}-${VENDOR_DISTRIBUTION}-${VENDOR_RELEASE}-${UNAME_KERNEL}-${UNAME_KERNEL_RELEASE}"
108 echo "HOST_OS=$HOST_OS"
113 # Valid values are: darwin,fedora,rhel,ubuntu
114 set_VENDOR_DISTRIBUTION
()
116 local dist
=`echo "$1" | tr '[A-Z]' '[a-z]'`
119 VENDOR_DISTRIBUTION
='darwin'
122 VENDOR_DISTRIBUTION
='fedora'
125 VENDOR_DISTRIBUTION
='rhel'
128 VENDOR_DISTRIBUTION
='ubuntu'
131 VENDOR_DISTRIBUTION
='opensuse'
134 die
"attempt to set an invalid VENDOR_DISTRIBUTION=$dist"
139 set_VENDOR_RELEASE
()
141 local release
=`echo "$1" | tr '[A-Z]' '[a-z]'`
142 case "$VENDOR_DISTRIBUTION" in
144 VENDOR_RELEASE
='mountain'
147 VENDOR_RELEASE
="$release"
150 VENDOR_RELEASE
="$release"
153 VENDOR_RELEASE
="$release"
156 VENDOR_RELEASE
="$release"
159 die
"attempt to set VENDOR_RELEASE without setting VENDOR_DISTRIBUTION"
162 die
"attempt to set with an invalid VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION"
168 # Valid values are: apple, redhat, centos, canonical
171 local vendor
=`echo "$1" | tr '[A-Z]' '[a-z]'`
190 die
"An attempt was made to set an invalid VENDOR=$_vendor"
194 set_VENDOR_DISTRIBUTION
$2
195 set_VENDOR_RELEASE
$3
198 determine_target_platform
()
200 UNAME_MACHINE_ARCH
=`(uname -m) 2>/dev/null` || UNAME_MACHINE_ARCH
=unknown
201 UNAME_KERNEL
=`(uname -s) 2>/dev/null` || UNAME_SYSTEM
=unknown
202 UNAME_KERNEL_RELEASE
=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE
=unknown
204 if [[ $
(uname
) == 'Darwin' ]]; then
205 set_VENDOR
'apple' 'darwin' 'mountain'
206 elif [[ -f '/etc/fedora-release' ]]; then
207 local fedora_version
=`cat /etc/fedora-release | awk ' { print $3 } '`
208 set_VENDOR
'redhat' 'fedora' $fedora_version
209 if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then
210 AUTORECONF_REBUILD_HOST
=true
212 elif [[ -f '/etc/centos-release' ]]; then
213 local centos_version
=`cat /etc/centos-release | awk ' { print $7 } '`
214 set_VENDOR
'centos' 'rhel' $centos_version
215 elif [[ -f '/etc/SuSE-release' ]]; then
216 local suse_distribution
=`head -1 /etc/SuSE-release | awk ' { print $1 } '`
217 local suse_version
=`head -1 /etc/SuSE-release | awk ' { print $2 } '`
218 set_VENDOR
'suse' $suse_distribution $suse_version
219 elif [[ -f '/etc/redhat-release' ]]; then
220 local rhel_version
=`cat /etc/redhat-release | awk ' { print $7 } '`
221 set_VENDOR
'redhat' 'rhel' $rhel_version
222 elif [[ -f '/etc/lsb-release' ]]; then
223 local debian_DISTRIB_ID
=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '`
224 local debian_version
=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '`
225 set_VENDOR
'canonical' $debian_DISTRIB_ID $debian_version
226 if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
227 AUTORECONF_REBUILD_HOST
=true
236 # We will run autoreconf if we are required
237 run_autoreconf_if_required
239 # We always begin at the root of our build
241 die
"Programmer error, we entered run_configure with a stacked directory"
245 if [[ -n "$BUILD_DIR" ]]; then
248 safe_pushd
$BUILD_DIR
251 # Arguments for configure
254 # Set ENV DEBUG in order to enable debugging
256 CONFIGURE_ARG
='--enable-debug'
259 # Set ENV ASSERT in order to enable assert
260 if [[ -n "$ASSERT" ]]; then
262 ASSERT_ARG
='--enable-assert'
263 CONFIGURE_ARG
="$ASSERT_ARG $CONFIGURE_ARG"
266 # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
269 CC
=clang CXX
=clang
++ $top_srcdir/configure
$CONFIGURE_ARG || die
"Cannot execute CC=clang CXX=clang++ configure $CONFIGURE_ARG $PREFIX_ARG"
272 command_exists gcc44 || die
"Could not locate gcc44"
273 CC
=gcc44 CXX
=gcc44
$top_srcdir/configure
$CONFIGURE_ARG $PREFIX_ARG || die
"Cannot execute CC=gcc44 CXX=gcc44 configure $CONFIGURE_ARG $PREFIX_ARG"
276 $top_srcdir/configure
$CONFIGURE_ARG $PREFIX_ARG || die
"Cannot execute configure $CONFIGURE_ARG $PREFIX_ARG"
280 if [ ! -f 'Makefile' ]; then
281 die
"Programmer error, configure was run but no Makefile existed afterward"
285 setup_gdb_command
() {
286 GDB_TMPFILE
=$
(mktemp
/tmp
/gdb.XXXXXXXXXX
)
287 echo 'set logging overwrite on' > $GDB_TMPFILE
288 echo 'set logging on' >> $GDB_TMPFILE
289 echo 'set environment LIBTEST_IN_GDB=1' >> $GDB_TMPFILE
290 echo 'run' >> $GDB_TMPFILE
291 echo 'thread apply all bt' >> $GDB_TMPFILE
292 echo 'quit' >> $GDB_TMPFILE
293 GDB_COMMAND
="gdb -f -batch -x $GDB_TMPFILE"
296 setup_valgrind_command
() {
297 VALGRIND_PROGRAM
=`type -p valgrind`
298 if [[ -n "$VALGRIND_PROGRAM" ]]; then
299 VALGRIND_COMMAND
="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"
305 if [[ -n "$PREFIX_ARG" ]]; then
306 OLD_PREFIX_ARG
=$PREFIX_ARG
310 if [[ -n "$1" ]]; then
311 PREFIX_ARG
="--prefix=$1"
317 if [[ -n "$OLD_PREFIX_ARG" ]]; then
318 PREFIX_ARG
=$OLD_TESTS_ENVIRONMENT
325 push_TESTS_ENVIRONMENT
()
327 if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
328 die
"OLD_TESTS_ENVIRONMENT was set on push, programmer error!"
331 if [[ -n "$TESTS_ENVIRONMENT" ]]; then
332 OLD_TESTS_ENVIRONMENT
=$TESTS_ENVIRONMENT
337 pop_TESTS_ENVIRONMENT
()
340 if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
341 TESTS_ENVIRONMENT
=$OLD_TESTS_ENVIRONMENT
342 OLD_TESTS_ENVIRONMENT
=
348 pushd $1 &> /dev
/null
;
350 if $VERBOSE -a test -n "$BUILD_DIR"; then
351 echo "BUILD_DIR=$BUILD_DIR"
357 local directory_to_delete
=`pwd`
359 if [ $?
-eq 0 ]; then
360 if [[ "$top_srcdir" == "$directory_to_delete" ]]; then
361 die
"We almost deleted top_srcdir($top_srcdir), programmer error"
364 rm -r -f "$directory_to_delete"
370 if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then
375 # If the env VALGRIND_COMMAND is set then we assume it is valid
376 local valgrind_was_set
=false
377 if [[ -z "$VALGRIND_COMMAND" ]]; then
378 setup_valgrind_command
379 if [[ -n "$VALGRIND_COMMAND" ]]; then
380 valgrind_was_set
=true
383 valgrind_was_set
=true
386 # If valgrind_was_set is set to no we bail
387 if ! $valgrind_was_set; then
388 echo 'valgrind was not present'
392 # If we are required to run configure, do so now
393 run_configure_if_required
395 push_TESTS_ENVIRONMENT
397 if [[ -f 'libtool' ]]; then
398 TESTS_ENVIRONMENT
="$LIBTOOL_COMMAND $VALGRIND_COMMAND"
400 TESTS_ENVIRONMENT
="$VALGRIND_COMMAND"
403 make_target
'check' ||
return 1
405 pop_TESTS_ENVIRONMENT
408 make_install_system
()
410 local INSTALL_LOCATION
=$
(mktemp
-d /tmp
/XXXXXXXXXX
)
411 push_PREFIX_ARG
$INSTALL_LOCATION
413 if [ ! -d $INSTALL_LOCATION ] ; then
414 die
"ASSERT temp directory not found '$INSTALL_LOCATION'"
417 run_configure
#install_buid_dir
419 push_TESTS_ENVIRONMENT
421 make_target
'install'
423 make_target
'installcheck'
425 make_target
'uninstall'
427 pop_TESTS_ENVIRONMENT
430 rm -r -f $INSTALL_LOCATION
433 if [ -f 'Makefile' ]; then
434 die
"ASSERT Makefile should not exist"
440 make_darwin_malloc
()
442 run_configure_if_required
444 old_MallocGuardEdges
=$MallocGuardEdges
446 old_MallocErrorAbort
=$MallocErrorAbort
448 old_MallocScribble
=$MallocScribble
453 MallocGuardEdges
=$old_MallocGuardEdges
454 MallocErrorAbort
=$old_MallocErrorAbort
455 MallocScribble
=$old_MallocScribble
460 if [ -n "$BOOTSTRAP_SNAPSHOT_CHECK" ]; then
461 assert_file
"$BOOTSTRAP_SNAPSHOT_CHECK" 'snapshot check failed'
465 # This will reset our environment, and make sure built files are available.
468 # Make sure it is clean
469 make_maintainer_clean
473 make_target
'distclean'
475 # We should have a configure, but no Makefile at the end of this exercise
476 assert_no_file
'Makefile'
477 assert_exec_file
'configure'
482 # If we are locally testing, we should make sure the environment is setup correctly
485 if ! $jenkins_build_environment; then
486 echo "Not inside of jenkins"
488 if [ -f 'configure' ]; then
489 make_maintainer_clean
492 if $BOOTSTRAP_SNAPSHOT; then
498 make_for_continuus_integration
()
500 # Setup the environment if we are local
503 # No matter then evironment, we should not have a Makefile at this point
504 assert_no_file
'Makefile'
506 # Platforms which require bootstrap should have some setup done before we hit this stage.
507 # If we are building locally, skip this step, unless we are just testing locally.
508 if $BOOTSTRAP_SNAPSHOT; then
511 # If we didn't require a snapshot, then we should not have a configure
512 assert_no_file
'configure'
517 assert_no_file
'Makefile' 'Programmer error, Makefile existed where build state should have been clean'
523 assert_exec_file
'configure'
524 assert_file
'Makefile'
526 # make rpm includes "make distcheck"
527 if [[ -f rpm.am
]]; then
529 elif [[ -d rpm
]]; then
535 assert_exec_file
'configure'
536 assert_file
'Makefile'
543 assert_exec_file
'configure'
544 assert_file
'Makefile'
548 assert_exec_file
'configure'
549 assert_file
'Makefile'
553 assert_exec_file
'configure'
554 assert_file
'Makefile'
564 make_maintainer_clean
571 run_configure_if_required
573 if command_exists gdb
; then
575 push_TESTS_ENVIRONMENT
577 # Set ENV GDB_COMMAND
578 if [[ -z "$GDB_COMMAND" ]]; then
582 if [ -f 'libtool' ]; then
583 TESTS_ENVIRONMENT
="$LIBTOOL_COMMAND $GDB_COMMAND"
585 TESTS_ENVIRONMENT
="$GDB_COMMAND"
590 if [ -f 'gdb.txt' ]; then
594 pop_TESTS_ENVIRONMENT
596 if [ -f '.gdb_history' ]; then
600 echo 'gdb was not present'
605 # $1 target to compile
606 # $2 to die, or not to die, based on contents
609 if [[ -z "$1" ]]; then
610 die
"Programmer error, no target provided for make"
613 if [ ! -f 'Makefile' ]; then
614 die
"Programmer error, make was called before configure"
618 if test -n "$TESTS_ENVIRONMENT" -a $VERBOSE; then
619 echo "TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT"
622 if [[ -z "$MAKE" ]]; then
623 die
"MAKE was not set"
626 if [[ -n "$2" ]]; then
627 run
$MAKE $1 ||
return 1
629 run
$MAKE $1 || die
"Cannot execute $MAKE $1"
635 make_target
'distcheck'
643 make_maintainer_clean
()
645 run_configure_if_required
646 make_target
'maintainer-clean' 'no_error'
659 run_configure_if_required
()
661 run_autoreconf_if_required
663 if [ ! -f 'Makefile' ]; then
667 assert_file
'Makefile' 'configure did not produce a Makefile'
670 run_autoreconf_if_required
()
672 if [ ! -x 'configure' ]; then
676 assert_exec_file
'configure'
681 if [[ -z "$AUTORECONF" ]]; then
682 die
"Programmer error, tried to call run_autoreconf () but AUTORECONF was not set"
685 run
$AUTORECONF || die
"Cannot execute $AUTORECONF"
687 eval 'bash -n configure' || die
"autoreconf generated a malformed configure"
699 parse_command_line_options
()
703 local SHORTOPTS
='p,c,a,v'
704 local LONGOPTS
='target:,debug,clean,print-env,configure,autoreconf'
706 if ! options
=$
(getopt
--shell bash
--longoptions $LONGOPTS --options $SHORTOPTS -n 'bootstrap' -- "$@"); then
707 die
'Bad option given'
710 eval set -- "$options"
712 while [[ $# -gt 0 ]]; do
715 AUTORECONF_OPTION
=true
716 MAKE_TARGET
='autoreconf'
720 PRINT_SETUP_OPTION
=true
724 CONFIGURE_OPTION
=true
725 MAKE_TARGET
='configure'
730 MAKE_TARGET
='clean_op'
736 TARGET_OPTION_ARG
="$1"
755 echo "$0: error - unrecognized option $1" 1>&2
771 if [[ -d '.git' ]]; then
773 elif [[ -d '.bzr' ]]; then
775 elif [[ -d '.svn' ]]; then
777 elif [[ -d '.hg' ]]; then
781 if [[ -n "$VCS_CHECKOUT" ]]; then
788 # Set ENV MAKE in order to override "make"
789 if [[ -z "$MAKE" ]]; then
790 if command_exists gmake
; then
794 if command_exists
make; then
799 if [[ -z "$GNU_BUILD_FLAGS" ]]; then
800 GNU_BUILD_FLAGS
="--install --force"
804 GNU_BUILD_FLAGS
="$GNU_BUILD_FLAGS --verbose"
807 if [[ -z "$WARNINGS" ]]; then
808 if [[ -n "$VCS_CHECKOUT" ]]; then
815 if [[ -z "$LIBTOOLIZE" ]]; then
816 # If we are using OSX, we first check to see glibtoolize is available
817 if [[ "$VENDOR_DISTRIBUTION" == "darwin" ]]; then
818 LIBTOOLIZE
=`type -p glibtoolize`
820 if [[ -z "$LIBTOOLIZE" ]]; then
821 echo "Couldn't find glibtoolize, it is required on OSX"
826 # Test the ENV AUTOMAKE if it exists
827 if [[ -n "$AUTOMAKE" ]]; then
828 run
$AUTOMAKE '--help' &> /dev
/null || die
"Failed to run AUTOMAKE:$AUTOMAKE"
831 # Test the ENV AUTOCONF if it exists
832 if [[ -n "$AUTOCONF" ]]; then
833 run
$AUTOCONF '--help' &> /dev
/null || die
"Failed to run AUTOCONF:$AUTOCONF"
836 # Test the ENV AUTOHEADER if it exists
837 if [[ -n "$AUTOHEADER" ]]; then
838 run
$AUTOHEADER '--help' &> /dev
/null || die
"Failed to run AUTOHEADER:$AUTOHEADER"
841 # Test the ENV AUTOM4TE if it exists
842 if [[ -n "$AUTOM4TE" ]]; then
843 run
$AUTOM4TE '--help' &> /dev
/null || die
"Failed to run AUTOM4TE:$AUTOM4TE"
846 if [[ -z "$AUTORECONF" ]]; then
847 AUTORECONF
=`type -p autoreconf`
849 if [[ -z "$AUTORECONF" ]]; then
850 die
"Couldn't find autoreconf"
853 if [[ -n "$GNU_BUILD_FLAGS" ]]; then
854 AUTORECONF
="$AUTORECONF $GNU_BUILD_FLAGS"
858 run
$AUTORECONF '--help' &> /dev
/null || die
"Failed to run AUTORECONF:$AUTORECONF"
863 saved_debug_status
=$DEBUG
868 echo '----------------------------------------------'
870 echo "AUTORECONF=$AUTORECONF"
871 echo "HOST_OS=$HOST_OS"
874 if $AUTORECONF_OPTION; then
878 if $CLEAN_OPTION; then
882 if $CONFIGURE_OPTION; then
886 if $DEBUG_OPTION; then
890 if $PRINT_SETUP_OPTION; then
894 if $TARGET_OPTION; then
895 echo "--target=$TARGET_OPTION_ARG"
898 if $VERBOSE_OPTION; then
902 if [[ -n "$MAKE" ]]; then
906 if [[ -n "$MAKE_TARGET" ]]; then
907 echo "MAKE_TARGET=$MAKE_TARGET"
910 if [[ -n "$PREFIX" ]]; then
911 echo "PREFIX=$PREFIX"
914 if [[ -n "$TESTS_ENVIRONMENT" ]]; then
915 echo "TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT"
918 if [[ -n "$VCS_CHECKOUT" ]]; then
919 echo "VCS_CHECKOUT=$VCS_CHECKOUT"
930 if [[ -n "$WARNINGS" ]]; then
931 echo "WARNINGS=$WARNINGS"
933 echo '----------------------------------------------'
935 if $saved_debug_status; then
942 run_configure_if_required
944 make_maintainer_clean
946 if [[ "$VCS_CHECKOUT" == 'git' ]]; then
947 run
"$VCS_CHECKOUT" status
--ignored
948 elif [[ -n "$VCS_CHECKOUT" ]]; then
949 run
"$VCS_CHECKOUT" status
953 make_for_autoreconf
()
955 if [ -f 'Makefile' ]; then
956 make_maintainer_clean
961 assert_no_file
'Makefile'
994 die
"Unknown MAKE_TARGET option: $1"
1001 determine_target_platform
1005 # Set up whatever we need to do to use autoreconf later
1008 if $PRINT_SETUP_OPTION -o $DEBUG; then
1013 # Exit if all we were looking for were the currently used options
1014 if $PRINT_SETUP_OPTION; then
1019 # Setup LIBTOOL_COMMAND if we need it
1020 if [ -f 'libtool' ]; then
1021 LIBTOOL_COMMAND
='./libtool --mode=execute'
1024 # Use OLD_TESTS_ENVIRONMENT for tracking the state of the variable
1025 local OLD_TESTS_ENVIRONMENT
=
1027 # Set ENV PREFIX in order to set --prefix for ./configure
1028 if [[ -n "$PREFIX" ]]; then
1029 push_PREFIX_ARG
$PREFIX
1032 # Either we run a known target (or error), or we default to "all"
1033 if [[ -n "$MAKE_TARGET" ]]; then
1035 # If we are running inside of Jenkins, we want to only run some of the possible tests
1036 if $jenkins_build_environment; then
1037 check_make_target
$MAKE_TARGET
1040 case $MAKE_TARGET in
1063 make_for_continuus_integration
1066 run_configure_if_required
1067 make_target
$MAKE_TARGET
1071 run_configure_if_required
1078 # Variables we export
1079 declare -x VCS_CHECKOUT
=
1081 # Variables we control globally
1084 # Options for getopt
1085 local AUTORECONF_OPTION
=false
1086 local CLEAN_OPTION
=false
1087 local CONFIGURE_OPTION
=false
1088 local DEBUG_OPTION
=false
1089 local PRINT_SETUP_OPTION
=false
1090 local TARGET_OPTION
=false
1091 local TARGET_OPTION_ARG
=
1092 local VERBOSE_OPTION
=false
1094 # If we call autoreconf on the platform or not
1095 local AUTORECONF_REBUILD_HOST
=false
1096 local AUTORECONF_REBUILD
=false
1098 local -r top_srcdir
=`pwd`
1100 # Variables for determine_target_platform () and rebuild_host_os ()
1101 # UNAME_MACHINE_ARCH= uname -m
1102 # VENDOR= apple, redhat, centos, canonical
1104 # RHEL{rhel,Tikanga,Santiago}
1105 # Ubuntu{ubuntu,Lucid,Maverick,Natty,Oneiric,Precise,Quantal}
1106 # Fedora{fedora,Verne,Beefy}
1107 # OSX{osx,lion,snow,mountain}
1108 # VENDOR_DISTRIBUTION= darwin,fedora,rhel,ubuntu
1109 # UNAME_KERNEL= Linux, Darwin,...
1110 # UNAME_KERNEL_RELEASE= Linux, Darwin,...
1111 local UNAME_MACHINE_ARCH
=unknown
1112 local VENDOR
=unknown
1113 local VENDOR_RELEASE
=unknown
1114 local VENDOR_DISTRIBUTION
=unknown
1115 local UNAME_KERNEL
=unknown
1116 local UNAME_KERNEL_RELEASE
=unknown
1119 rebuild_host_os no_output
1121 # If we are running under Jenkins we predetermine what tests we will run against
1122 # This MAKE_TARGET can be overridden by parse_command_line_options based MAKE_TARGET changes.
1123 # We don't want Jenkins overriding other variables, so we NULL them.
1124 if $jenkins_build_environment; then
1125 MAKE_TARGET
='jenkins'
1128 parse_command_line_options $@
1141 local caller_loc
=`caller`
1143 echo "$caller_loc Enabling debug: $1"
1145 echo "$caller_loc Enabling debug"
1158 # Script begins here
1160 env_debug_enabled
=false
1161 if [[ -n "$JENKINS_HOME" ]]; then
1162 declare -r jenkins_build_environment
=true
1164 declare -r jenkins_build_environment
=false
1173 export GNU_BUILD_FLAGS
1175 export TESTS_ENVIRONMENT
1181 export MallocGuardEdges
1182 export MallocErrorAbort
1183 export MallocScribble
1187 # We check for DEBUG twice, once before we source the config file, and once afterward
1188 env_debug_enabled
=false
1189 if [[ -n "$DEBUG" ]]; then
1190 env_debug_enabled
=true
1195 # Variables which only can be set by .bootstrap
1196 BOOTSTRAP_SNAPSHOT
=false
1197 BOOTSTRAP_SNAPSHOT_CHECK
=
1199 if [ -f '.bootstrap' ]; then
1203 if $env_debug_enabled; then
1206 if [[ -n "$DEBUG" ]]; then
1207 enable_debug
"Enabling DEBUG from '.bootstrap'"
1212 # We do this in order to protect the case where DEBUG
1213 if ! $env_debug_enabled; then