~drizzle-trunk/drizzle/7.2

« back to all changes in this revision

Viewing changes to bootstrap.sh

  • Committer: Continuous Integration
  • Date: 2013-04-27 20:03:58 UTC
  • mfrom: (2633.1.11 drizzle-7.2)
  • Revision ID: ci@drizzle.org-20130427200358-77r6140iqb0orc1o
Merge lp:~brianaker/drizzle/update-bootstrap-april-20113/ Build: jenkins-Drizzle-Builder-192

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/bash
2
2
3
 
# Copyright (C) 2012 Brian Aker
 
3
# Copyright (C) 2012-2013 Brian Aker
4
4
# All rights reserved.
5
5
6
6
# Redistribution and use in source and binary forms, with or without
45
45
 
46
46
command_not_found_handle ()
47
47
{
48
 
  echo "Command not found: '$@'"
49
 
  exit 127
 
48
  warn "$@: command not found"
 
49
 
 
50
  #if $DEBUG; then 
 
51
    echo ""
 
52
    echo "Stack trace:"
 
53
    local frame=0
 
54
    while caller $frame; do
 
55
      ((frame++));
 
56
    done
 
57
    echo ""
 
58
  #fi
 
59
 
 
60
  return 127
 
61
}
 
62
 
 
63
function error ()
 
64
 
65
  echo "$BASH_SOURCE:$BASH_LINENO: $@" >&2
50
66
}
51
67
 
52
68
function die ()
55
71
  exit 1; 
56
72
}
57
73
 
 
74
function warn ()
 
75
 
76
  echo "$BASH_SOURCE:$BASH_LINENO: $@"
 
77
  #echo "$BASH_SOURCE:$BASH_LINENO: $@" >&1
 
78
}
 
79
 
58
80
function nassert ()
59
81
{
60
82
  local param_name=\$"$1"
77
99
  fi
78
100
}
79
101
 
80
 
assert_file ()
 
102
function assert_file ()
81
103
{
82
104
  if [ ! -f "$1" ]; then
83
105
    echo "$BASH_SOURCE:$BASH_LINENO: assert($1) does not exist: $2" >&2
85
107
  fi
86
108
}
87
109
 
88
 
assert_no_file ()
 
110
function assert_no_file ()
89
111
{
90
112
  if [ -f "$1" ]; then
91
113
    echo "$BASH_SOURCE:$BASH_LINENO: assert($1) file exists: $2" >&2
93
115
  fi
94
116
}
95
117
 
96
 
assert_exec_file ()
 
118
function assert_no_directory ()
 
119
{
 
120
  if [ -d "$1" ]; then
 
121
    echo "$BASH_SOURCE:$BASH_LINENO: assert($1) directory exists: $2" >&2
 
122
    exit 1;
 
123
  fi
 
124
}
 
125
 
 
126
function assert_exec_file ()
97
127
{
98
128
  if [ ! -f "$1" ]; then
99
129
    echo "$BASH_SOURCE:$BASH_LINENO: assert($1) does not exist: $2" >&2
106
136
  fi
107
137
}
108
138
 
109
 
command_exists ()
 
139
function command_exists ()
110
140
{
111
141
  type "$1" &> /dev/null ;
112
142
}
113
143
 
114
 
rebuild_host_os ()
 
144
function rebuild_host_os ()
115
145
{
116
146
  HOST_OS="${UNAME_MACHINE_ARCH}-${VENDOR}-${VENDOR_DISTRIBUTION}-${VENDOR_RELEASE}-${UNAME_KERNEL}-${UNAME_KERNEL_RELEASE}"
117
147
  if [ -z "$1" ]; then
121
151
  fi
122
152
}
123
153
 
124
 
#  Valid values are: darwin,fedora,rhel,ubuntu
125
 
set_VENDOR_DISTRIBUTION ()
 
154
# Validate the distribution name, or toss an erro
 
155
#  values: darwin,fedora,rhel,ubuntu,debian,opensuse
 
156
function set_VENDOR_DISTRIBUTION ()
126
157
{
127
158
  local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`
128
159
  case "$dist" in
135
166
    rhel)
136
167
      VENDOR_DISTRIBUTION='rhel'
137
168
      ;;
 
169
    debian)
 
170
      VENDOR_DISTRIBUTION='debian'
 
171
      ;;
138
172
    ubuntu)
139
173
      VENDOR_DISTRIBUTION='ubuntu'
140
174
      ;;
 
175
    suse)
 
176
      VENDOR_DISTRIBUTION='opensuse'
 
177
      ;;
141
178
    opensuse)
142
179
      VENDOR_DISTRIBUTION='opensuse'
143
180
      ;;
147
184
  esac
148
185
}
149
186
 
150
 
set_VENDOR_RELEASE ()
 
187
# Validate a Vendor's release name/number 
 
188
function set_VENDOR_RELEASE ()
151
189
{
152
190
  local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
153
 
  case "$VENDOR_DISTRIBUTION" in
 
191
 
 
192
  if $DEBUG; then 
 
193
    echo "VENDOR_DISTRIBUTION:$VENDOR_DISTRIBUTION"
 
194
    echo "VENDOR_RELEASE:$release"
 
195
  fi
 
196
 
 
197
  case $VENDOR_DISTRIBUTION in
154
198
    darwin)
155
 
      VENDOR_RELEASE='mountain'
 
199
      case $release in
 
200
        10.6*)
 
201
          VENDOR_RELEASE='snow_leopard'
 
202
          ;;
 
203
        10.7*)
 
204
          VENDOR_RELEASE='mountain'
 
205
          ;;
 
206
        mountain)
 
207
          VENDOR_RELEASE='mountain'
 
208
          ;;
 
209
        10.8.*)
 
210
          echo "mountain_lion"
 
211
          VENDOR_RELEASE='mountain_lion'
 
212
          ;;
 
213
        *)
 
214
          echo $VENDOR_RELEASE
 
215
          VENDOR_RELEASE='unknown'
 
216
          ;;
 
217
      esac
156
218
      ;;
157
219
    fedora)
158
220
      VENDOR_RELEASE="$release"
 
221
      if [[ "x$VENDOR_RELEASE" == '18' ]]; then
 
222
        VENDOR_RELEASE='sphericalcow'
 
223
      fi
159
224
      ;;
160
225
    rhel)
161
226
      VENDOR_RELEASE="$release"
162
227
      ;;
 
228
    debian)
 
229
      VENDOR_RELEASE="$release"
 
230
      ;;
163
231
    ubuntu)
164
232
      VENDOR_RELEASE="$release"
 
233
      if [[ "x$VENDOR_RELEASE" == 'x12.04' ]]; then
 
234
        VENDOR_RELEASE="precise"
 
235
      elif [[ "x$VENDOR_RELEASE" == 'x12.10' ]]; then
 
236
        VENDOR_RELEASE="quantal"
 
237
      fi
165
238
      ;;
166
239
    opensuse)
167
240
      VENDOR_RELEASE="$release"
176
249
}
177
250
 
178
251
 
179
 
#  Valid values are: apple, redhat, centos, canonical
180
 
set_VENDOR ()
 
252
#  Valid values are: apple, redhat, centos, canonical, oracle, suse
 
253
function set_VENDOR ()
181
254
{
182
255
  local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`
183
256
 
188
261
    redhat)
189
262
      VENDOR='redhat'
190
263
      ;;
 
264
    fedora)
 
265
      VENDOR='redhat'
 
266
      ;;
 
267
    redhat-release-server-*)
 
268
      VENDOR='redhat'
 
269
      ;;
 
270
    enterprise-release-*)
 
271
      VENDOR='oracle'
 
272
      ;;
191
273
    centos)
192
274
      VENDOR='centos'
193
275
      ;;
194
276
    canonical)
195
277
      VENDOR='canonical'
196
278
      ;;
 
279
    ubuntu)
 
280
      VENDOR='canonical'
 
281
      ;;
 
282
    debian)
 
283
      VENDOR='debian'
 
284
      ;;
 
285
    opensuse)
 
286
      VENDOR='suse'
 
287
      ;;
197
288
    suse)
198
289
      VENDOR='suse'
199
290
      ;;
204
295
 
205
296
  set_VENDOR_DISTRIBUTION $2
206
297
  set_VENDOR_RELEASE $3
 
298
 
 
299
  # Set which vendor/versions we trust for autoreconf
 
300
  case $VENDOR_DISTRIBUTION in
 
301
    fedora)
 
302
      if [[ "x$VENDOR_RELEASE" == 'x18' ]]; then
 
303
        AUTORECONF_REBUILD_HOST=true
 
304
      elif [[ "x$VENDOR_RELEASE" == 'xsphericalcow' ]]; then
 
305
        AUTORECONF_REBUILD_HOST=true
 
306
      elif [[ "x$VENDOR_RELEASE" == 'x19' ]]; then
 
307
        AUTORECONF_REBUILD_HOST=true
 
308
      fi
 
309
      ;;
 
310
    canonical)
 
311
      if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
 
312
        AUTORECONF_REBUILD_HOST=true
 
313
      elif [[ "x$VENDOR_RELEASE" == 'xquantal' ]]; then
 
314
        AUTORECONF_REBUILD_HOST=true
 
315
      fi
 
316
      ;;
 
317
  esac
 
318
 
207
319
}
208
320
 
209
 
determine_target_platform ()
 
321
function determine_target_platform ()
210
322
{
211
323
  UNAME_MACHINE_ARCH=`(uname -m) 2>/dev/null` || UNAME_MACHINE_ARCH=unknown
212
324
  UNAME_KERNEL=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
213
325
  UNAME_KERNEL_RELEASE=`(uname -r) 2>/dev/null` || UNAME_KERNEL_RELEASE=unknown
214
326
 
215
 
  if [[ $(uname) == 'Darwin' ]]; then
 
327
  if [[ -x '/usr/bin/sw_vers' ]]; then 
 
328
    local _VERSION=`/usr/bin/sw_vers -productVersion`
 
329
    set_VENDOR 'apple' 'darwin' $_VERSION
 
330
  elif [[ $(uname) == 'Darwin' ]]; then
216
331
    set_VENDOR 'apple' 'darwin' 'mountain'
217
332
  elif [[ -f '/etc/fedora-release' ]]; then 
218
333
    local fedora_version=`cat /etc/fedora-release | awk ' { print $3 } '`
219
334
    set_VENDOR 'redhat' 'fedora' $fedora_version
220
 
    if [[ "x$VENDOR_RELEASE" == 'x17' ]]; then
221
 
      AUTORECONF_REBUILD_HOST=true
222
 
    fi
223
335
  elif [[ -f '/etc/centos-release' ]]; then
224
336
    local centos_version=`cat /etc/centos-release | awk ' { print $7 } '`
225
337
    set_VENDOR 'centos' 'rhel' $centos_version
229
341
    set_VENDOR 'suse' $suse_distribution $suse_version
230
342
  elif [[ -f '/etc/redhat-release' ]]; then
231
343
    local rhel_version=`cat /etc/redhat-release | awk ' { print $7 } '`
232
 
    set_VENDOR 'redhat' 'rhel' $rhel_version
 
344
    local _vendor=`rpm -qf /etc/redhat-release`
 
345
    set_VENDOR $_vendor 'rhel' $rhel_version
 
346
  elif [[ -f '/etc/os-release' ]]; then 
 
347
    source '/etc/os-release'
 
348
    set_VENDOR $ID $ID $VERSION_ID
 
349
  elif [[ -x '/usr/bin/lsb_release' ]]; then 
 
350
    local _ID=`/usr/bin/lsb_release -s -i`
 
351
    local _VERSION=`/usr/bin/lsb_release -s -r`
 
352
    set_VENDOR $_ID $_ID $_VERSION_ID
233
353
  elif [[ -f '/etc/lsb-release' ]]; then 
234
 
    local debian_DISTRIB_ID=`cat /etc/lsb-release | grep DISTRIB_ID | awk -F= ' { print $2 } '`
235
 
    local debian_version=`cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F= ' { print $2 } '`
236
 
    set_VENDOR 'canonical' $debian_DISTRIB_ID $debian_version
237
 
    if [[ "x$VENDOR_RELEASE" == 'xprecise' ]]; then
238
 
      AUTORECONF_REBUILD_HOST=true
239
 
    fi
 
354
    source '/etc/lsb-release'
 
355
    set_VENDOR 'canonical' $DISTRIB_ID $DISTRIB_CODENAME
240
356
  fi
241
357
 
242
358
  rebuild_host_os
243
359
}
244
360
 
245
 
run_configure ()
 
361
function run_configure ()
246
362
{
247
363
  # We will run autoreconf if we are required
248
364
  run_autoreconf_if_required
252
368
    die "Programmer error, we entered run_configure with a stacked directory"
253
369
  fi
254
370
 
 
371
  if ! command_exists "$CONFIGURE"; then
 
372
    die "$CONFIGURE does not exist"
 
373
  fi
 
374
 
255
375
  local BUILD_DIR="$1"
256
376
  if [[ -n "$BUILD_DIR" ]]; then
257
377
    rm -r -f $BUILD_DIR
260
380
  fi
261
381
 
262
382
  # Arguments for configure
263
 
  local CONFIGURE_ARG= 
264
 
 
265
 
  # Set ENV DEBUG in order to enable debugging
266
 
  if $DEBUG; then 
267
 
    CONFIGURE_ARG='--enable-debug'
268
 
  fi
269
 
 
270
 
  # Set ENV ASSERT in order to enable assert
271
 
  if [[ -n "$ASSERT" ]]; then 
272
 
    local ASSERT_ARG=
273
 
    ASSERT_ARG='--enable-assert'
274
 
    CONFIGURE_ARG="$ASSERT_ARG $CONFIGURE_ARG"
275
 
  fi
276
 
 
 
383
  local BUILD_CONFIGURE_ARG= 
 
384
 
 
385
  # If ENV DEBUG is set we enable both debug and asssert, otherwise we see if this is a VCS checkout and if so enable assert
 
386
  # Set ENV ASSERT in order to enable assert.
 
387
  # If we are doing a valgrind run, we always compile with assert disabled
 
388
  if $valgrind_run; then
 
389
    BUILD_CONFIGURE_ARG+= " CXXFLAGS=-DNDEBUG "
 
390
    BUILD_CONFIGURE_ARG+= " CFLAGS=-DNDEBUG "
 
391
  else
 
392
    if $DEBUG; then 
 
393
      BUILD_CONFIGURE_ARG+=' --enable-debug --enable-assert'
 
394
    elif [[ -n "$VCS_CHECKOUT" ]]; then
 
395
      BUILD_CONFIGURE_ARG+=' --enable-assert'
 
396
    fi
 
397
  fi
 
398
 
 
399
  if [[ -n "$CONFIGURE_ARG" ]]; then 
 
400
    BUILD_CONFIGURE_ARG+=" $CONFIGURE_ARG"
 
401
  fi
 
402
 
 
403
  if [[ -n "$PREFIX_ARG" ]]; then 
 
404
    BUILD_CONFIGURE_ARG+=" $PREFIX_ARG"
 
405
  fi
 
406
 
 
407
  ret=1;
277
408
  # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
278
409
  case $HOST_OS in
279
410
    *-darwin-*)
280
 
      CC=clang CXX=clang++ $top_srcdir/configure $CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ $top_srcdir/configure $CONFIGURE_ARG $PREFIX_ARG"
 
411
      CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG"
 
412
      ret=$?
281
413
      ;;
282
414
    rhel-5*)
283
 
      command_exists gcc44 || die "Could not locate gcc44"
284
 
      CC=gcc44 CXX=gcc44 $top_srcdir/configure $CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 $top_srcdir/configure $CONFIGURE_ARG $PREFIX_ARG"
 
415
      command_exists 'gcc44' || die "Could not locate gcc44"
 
416
      CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG"
 
417
      ret=$?
285
418
      ;;
286
419
    *)
287
 
      $top_srcdir/configure $CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute configure $CONFIGURE_ARG $PREFIX_ARG"
 
420
      $CONFIGURE $BUILD_CONFIGURE_ARG
 
421
      ret=$?
288
422
      ;;
289
423
  esac
290
424
 
 
425
  if [ $ret -ne 0 ]; then
 
426
    die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG"
 
427
  fi
 
428
 
291
429
  if [ ! -f 'Makefile' ]; then
292
 
    die "Programmer error, configure was run but no Makefile existed afterward"
 
430
    die "Programmer error, configure was run but no Makefile existed after $CONFIGURE was run"
293
431
  fi
294
432
}
295
433
 
296
 
setup_gdb_command () {
 
434
function setup_gdb_command () {
297
435
  GDB_TMPFILE=$(mktemp /tmp/gdb.XXXXXXXXXX)
298
436
  echo 'set logging overwrite on' > $GDB_TMPFILE
299
437
  echo 'set logging on' >> $GDB_TMPFILE
304
442
  GDB_COMMAND="gdb -f -batch -x $GDB_TMPFILE"
305
443
}
306
444
 
307
 
setup_valgrind_command () {
 
445
function setup_valgrind_command () {
308
446
  VALGRIND_PROGRAM=`type -p valgrind`
309
447
  if [[ -n "$VALGRIND_PROGRAM" ]]; then
310
 
    VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"
311
 
  fi
312
 
}
313
 
 
314
 
push_PREFIX_ARG ()
315
 
{
316
 
  if [[ -n "$PREFIX_ARG" ]]; then
317
 
    OLD_PREFIX_ARG=$PREFIX_ARG
318
 
    PREFIX_ARG=
319
 
  fi
320
 
 
321
 
  if [[ -n "$1" ]]; then
322
 
    PREFIX_ARG="--prefix=$1"
323
 
  fi
324
 
}
325
 
 
326
 
pop_PREFIX_ARG ()
327
 
{
328
 
  if [[ -n "$OLD_PREFIX_ARG" ]]; then
329
 
    PREFIX_ARG=$OLD_TESTS_ENVIRONMENT
330
 
    OLD_PREFIX_ARG=
331
 
  else
332
 
    PREFIX_ARG=
333
 
  fi
334
 
}
335
 
 
336
 
push_TESTS_ENVIRONMENT ()
337
 
{
 
448
    VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --malloc-fill=A5 --free-fill=DE --xml=yes --xml-file=\"valgrind-%p.xml\""
 
449
  fi
 
450
}
 
451
 
 
452
function save_BUILD ()
 
453
{
 
454
  if [[ -n "$OLD_CONFIGURE" ]]; then
 
455
    die "OLD_CONFIGURE($OLD_CONFIGURE) was set on push, programmer error!"
 
456
  fi
 
457
 
 
458
  if [[ -n "$OLD_CONFIGURE_ARG" ]]; then
 
459
    die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!"
 
460
  fi
 
461
 
 
462
  if [[ -n "$OLD_PREFIX" ]]; then
 
463
    die "OLD_PREFIX($OLD_PREFIX) was set on push, programmer error!"
 
464
  fi
 
465
 
 
466
  if [[ -n "$OLD_MAKE" ]]; then
 
467
    die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!"
 
468
  fi
 
469
 
338
470
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
339
 
    die "OLD_TESTS_ENVIRONMENT was set on push, programmer error!"
 
471
    die "OLD_TESTS_ENVIRONMENT($OLD_TESTS_ENVIRONMENT) was set on push, programmer error!"
 
472
  fi
 
473
 
 
474
  if [[ -n "$CONFIGURE" ]]; then
 
475
    OLD_CONFIGURE=$CONFIGURE
 
476
  fi
 
477
 
 
478
  if [[ -n "$CONFIGURE_ARG" ]]; then
 
479
    OLD_CONFIGURE_ARG=$CONFIGURE_ARG
 
480
  fi
 
481
 
 
482
  if [[ -n "$MAKE" ]]; then
 
483
    OLD_MAKE=$MAKE
340
484
  fi
341
485
 
342
486
  if [[ -n "$TESTS_ENVIRONMENT" ]]; then
343
487
    OLD_TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT
344
 
    TESTS_ENVIRONMENT=
345
488
  fi
346
489
}
347
490
 
348
 
pop_TESTS_ENVIRONMENT ()
 
491
function restore_BUILD ()
349
492
{
350
 
  TESTS_ENVIRONMENT=
 
493
  if [[ -n "$OLD_CONFIGURE" ]]; then
 
494
    CONFIGURE=$OLD_CONFIGURE
 
495
  fi
 
496
 
 
497
  if [[ -n "$OLD_CONFIGURE_ARG" ]]; then
 
498
    CONFIGURE_ARG=$OLD_CONFIGURE_ARG
 
499
  fi
 
500
 
 
501
  if [[ -n "$OLD_PREFIX" ]]; then
 
502
    PREFIX_ARG=$OLD_PREFIX
 
503
  fi
 
504
 
 
505
  if [[ -n "$OLD_MAKE" ]]; then
 
506
    MAKE=$OLD_MAKE
 
507
  fi
 
508
 
351
509
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
352
510
    TESTS_ENVIRONMENT=$OLD_TESTS_ENVIRONMENT
353
 
    OLD_TESTS_ENVIRONMENT=
354
511
  fi
 
512
 
 
513
  OLD_CONFIGURE=
 
514
  OLD_CONFIGURE_ARG=
 
515
  OLD_PREFIX=
 
516
  OLD_MAKE=
 
517
  OLD_TESTS_ENVIRONMENT=
 
518
 
 
519
  export -n CC CXX
355
520
}
356
521
 
357
522
function safe_pushd ()
380
545
 
381
546
function make_valgrind ()
382
547
{
383
 
  if [[ "$VENDOR_DISTRIBUTION" == 'darwin' ]]; then
384
 
    make_darwin_malloc
385
 
    return
386
 
  fi
387
 
 
388
548
  # If the env VALGRIND_COMMAND is set then we assume it is valid
389
549
  local valgrind_was_set=false
390
550
  if [[ -z "$VALGRIND_COMMAND" ]]; then
402
562
    return 1
403
563
  fi
404
564
 
 
565
  save_BUILD
 
566
 
 
567
  valgrind_run=true
 
568
 
405
569
  # If we are required to run configure, do so now
406
 
  run_configure_if_required
407
 
 
408
 
  push_TESTS_ENVIRONMENT
 
570
  run_configure
409
571
 
410
572
  # If we don't have a configure, then most likely we will be missing libtool
411
573
  assert_file 'configure'
415
577
    TESTS_ENVIRONMENT="$VALGRIND_COMMAND"
416
578
  fi
417
579
 
418
 
  make_target 'check' || return 1
419
 
 
420
 
  pop_TESTS_ENVIRONMENT
 
580
  make_target 'check'
 
581
  ret=$?
 
582
 
 
583
  # If we aren't going to error, we will clean up our environment
 
584
  if [ "$ret" -eq 0 ]; then
 
585
     make 'distclean'
 
586
  fi
 
587
 
 
588
  valgrind_run=false
 
589
 
 
590
  restore_BUILD
 
591
 
 
592
  if [ "$ret" -ne 0 ]; then
 
593
    return 1
 
594
  fi
421
595
}
422
596
 
423
597
function make_install_system ()
424
598
{
425
599
  local INSTALL_LOCATION=$(mktemp -d /tmp/XXXXXXXXXX)
426
 
  push_PREFIX_ARG $INSTALL_LOCATION
 
600
 
 
601
  save_BUILD
 
602
  PREFIX_ARG="--prefix=$INSTALL_LOCATION"
427
603
 
428
604
  if [ ! -d $INSTALL_LOCATION ] ; then
429
605
    die "ASSERT temp directory not found '$INSTALL_LOCATION'"
431
607
 
432
608
  run_configure #install_buid_dir
433
609
 
434
 
  push_TESTS_ENVIRONMENT
435
 
 
436
610
  make_target 'install'
437
611
 
438
612
  make_target 'installcheck'
439
613
 
440
614
  make_target 'uninstall'
441
615
 
442
 
  pop_TESTS_ENVIRONMENT
443
 
  pop_PREFIX_ARG
444
 
 
445
616
  rm -r -f $INSTALL_LOCATION
446
617
  make 'distclean'
447
618
 
449
620
    die "ASSERT Makefile should not exist"
450
621
  fi
451
622
 
 
623
  restore_BUILD
452
624
  safe_popd
453
625
}
454
626
 
498
670
  snapshot_check
499
671
}
500
672
 
501
 
function make_for_mingw32 ()
502
 
{
503
 
  # Make sure it is clean
504
 
  if [ -f Makefile -o -f configure ]; then
505
 
    make_maintainer_clean
506
 
  fi
507
 
  assert_no_file 'Makefile'
508
 
 
509
 
  if command_exists mingw32-configure; then
510
 
    run_autoreconf
511
 
 
512
 
    mingw32-configure || die 'mingw32-configure failed'
 
673
function check_mingw ()
 
674
{
 
675
  command_exists 'mingw64-configure'
 
676
  ret=$?
 
677
  if [ "$ret" -ne 0 ]; then
 
678
    return 1
 
679
  fi
 
680
 
 
681
  command_exists 'mingw64-make'
 
682
  ret=$?
 
683
  if [ "$ret" -ne 0 ]; then
 
684
    return 1
 
685
  fi
 
686
 
 
687
  return 0
 
688
}
 
689
 
 
690
function check_clang ()
 
691
{
 
692
  command_exists 'clang'
 
693
  ret=$?
 
694
  if [ "$ret" -ne 0 ]; then
 
695
    return 1
 
696
  fi
 
697
 
 
698
  return 0
 
699
}
 
700
 
 
701
function check_clang_analyzer ()
 
702
{
 
703
  command_exists 'scan-build'
 
704
  ret=$?
 
705
  if [ "$ret" -ne 0 ]; then
 
706
    return 1
 
707
  fi
 
708
 
 
709
  return 0
 
710
}
 
711
 
 
712
function make_skeleton ()
 
713
{
 
714
  run_configure
 
715
  ret=$?
 
716
 
 
717
  if [ $ret -eq 0 ]; then
513
718
    assert_file 'Makefile'
514
719
 
515
 
    if command_exists mingw32-make; then
516
 
      mingw32-make || die 'mingw32-make failed'
517
 
    fi
518
 
  fi
 
720
    make_target 'all' 'warn'
 
721
    ret=$?
 
722
    if [ $ret -ne 0 ]; then
 
723
      warn "$MAKE failed"
 
724
    else
 
725
      if [[ -n "$DISPLAY" ]]; then
 
726
        if command_exists 'wine'; then
 
727
          TESTS_ENVIRONMENT='wine'
 
728
        fi
 
729
      fi
 
730
 
 
731
      if [[ -n "$TESTS_ENVIRONMENT" ]]; then
 
732
        make_target 'check' 'warn' || warn "$MAKE check failed"
 
733
        ret=$?
 
734
      fi
 
735
    fi
 
736
 
 
737
    if $jenkins_build_environment; then
 
738
      make_target 'clean' 'warn'
 
739
    fi
 
740
  fi
 
741
 
 
742
  return $ret
 
743
}
 
744
 
 
745
function make_for_mingw ()
 
746
{
 
747
  if ! check_mingw; then
 
748
    return 1
 
749
  fi
 
750
 
 
751
  # Make sure it is clean
 
752
  if [ -f Makefile -o -f configure ]; then
 
753
    make_maintainer_clean
 
754
  fi
 
755
 
 
756
  run_autoreconf
 
757
 
 
758
  save_BUILD
 
759
 
 
760
  CONFIGURE='mingw64-configure'
 
761
  MAKE='mingw64-make'
 
762
  CONFIGURE_ARGS='--enable-static --disable-shared'
 
763
 
 
764
  make_skeleton
 
765
  ret=$?
 
766
 
 
767
  restore_BUILD
 
768
 
 
769
  return $ret
 
770
}
 
771
 
 
772
function make_for_clang ()
 
773
{
 
774
  if ! check_clang; then
 
775
    return 1
 
776
  fi
 
777
 
 
778
  # Make sure it is clean
 
779
  if [ -f Makefile -o -f configure ]; then
 
780
    make_maintainer_clean
 
781
  fi
 
782
 
 
783
  run_autoreconf
 
784
 
 
785
  save_BUILD
 
786
 
 
787
  CC=clang CXX=clang++
 
788
  export CC CXX
 
789
 
 
790
  make_skeleton
 
791
  ret=$?
 
792
 
 
793
  make_target 'check'
 
794
 
 
795
  restore_BUILD
 
796
 
 
797
  return $ret
 
798
}
 
799
 
 
800
function make_for_clang_analyzer ()
 
801
{
 
802
  if ! check_clang; then
 
803
    return 1
 
804
  fi
 
805
 
 
806
  if ! check_clang_analyzer; then
 
807
    die 'clang-analyzer was not found'
 
808
  fi
 
809
 
 
810
  # Make sure it is clean
 
811
  if [ -f Makefile -o -f configure ]; then
 
812
    make_maintainer_clean
 
813
  fi
 
814
 
 
815
  run_autoreconf
 
816
 
 
817
  save_BUILD
 
818
 
 
819
  CC=clang CXX=clang++
 
820
  export CC CXX
 
821
  CONFIGURE_ARGS='--enable-debug'
 
822
 
 
823
  make_skeleton
 
824
  ret=$?
 
825
 
 
826
  make_target 'clean' 'warn'
 
827
 
 
828
  scan-build -o clang-html make -j4 -k
 
829
 
 
830
  restore_BUILD
 
831
 
 
832
  return $ret
519
833
}
520
834
 
521
835
# If we are locally testing, we should make sure the environment is setup correctly
540
854
  make_valgrind
541
855
  make_gdb
542
856
  make_rpm
543
 
  make_for_mingw32
 
857
  make_for_clang
 
858
  make_for_clang_analyzer
 
859
 
 
860
  if [ check_mingw -eq 0 ]; then
 
861
    make_for_mingw
 
862
  fi
 
863
 
544
864
  make_distcheck
545
865
  make_install_system
546
866
}
631
951
  eval "./bootstrap.sh maintainer-clean" || die "failed 'maintainer-clean'"
632
952
}
633
953
 
 
954
function make_install_html ()
 
955
{
 
956
  run_configure_if_required
 
957
  assert_file 'configure'
 
958
 
 
959
  make_target 'install-html'
 
960
}
 
961
 
634
962
function make_gdb ()
635
963
{
636
 
  run_configure_if_required
637
 
 
638
 
  if command_exists gdb; then
639
 
 
640
 
    push_TESTS_ENVIRONMENT
 
964
  save_BUILD
 
965
 
 
966
  if command_exists 'gdb'; then
 
967
    run_configure_if_required
641
968
 
642
969
    # Set ENV GDB_COMMAND
643
970
    if [[ -z "$GDB_COMMAND" ]]; then
652
979
      TESTS_ENVIRONMENT="$GDB_COMMAND"
653
980
    fi
654
981
 
655
 
    make_target check
 
982
    make_target 'check'
656
983
 
657
984
    if [ -f 'gdb.txt' ]; then
658
985
      rm 'gdb.txt'
659
986
    fi
660
987
 
661
 
    pop_TESTS_ENVIRONMENT
662
 
 
663
988
    if [ -f '.gdb_history' ]; then
664
989
      rm '.gdb_history'
665
990
    fi
 
991
 
 
992
    if $jenkins_build_environment; then
 
993
      make_target 'clean'
 
994
    fi
666
995
  else
667
996
    echo 'gdb was not present'
668
997
    return 1
669
998
  fi
 
999
 
 
1000
  restore_BUILD
670
1001
}
671
1002
 
672
1003
# $1 target to compile
692
1023
    die "MAKE was not set"
693
1024
  fi
694
1025
 
695
 
  if [ -n "$2" ]; then
696
 
    run $MAKE $1 || return 1
697
 
  else
698
 
    run $MAKE $1 || die "Cannot execute $MAKE $1"
 
1026
  # $2 represents error or warn
 
1027
  run $MAKE $1
 
1028
  ret=$?
 
1029
 
 
1030
  if [ $ret -ne 0 ]; then
 
1031
    if [ -n "$2" ]; then
 
1032
      warn "Failed to execute $MAKE $1: $ret"
 
1033
    else
 
1034
      die "Failed to execute $MAKE $1: $ret"
 
1035
    fi
699
1036
  fi
 
1037
 
 
1038
  return $ret
700
1039
}
701
1040
 
702
1041
function make_distcheck ()
706
1045
 
707
1046
function make_rpm ()
708
1047
{
709
 
  if [ -f 'rpm.am' -o -d 'rpm' ]; then
710
 
    run_configure_if_required
711
 
    make_target 'rpm'
 
1048
  if command_exists 'rpmbuild'; then
 
1049
    if [ -f 'rpm.am' -o -d 'rpm' ]; then
 
1050
      run_configure_if_required
 
1051
      make_target 'rpm'
 
1052
 
 
1053
      if $jenkins_build_environment; then
 
1054
        make_target 'clean'
 
1055
      fi
 
1056
 
 
1057
    fi
712
1058
  fi
713
1059
}
714
1060
 
716
1062
{
717
1063
  run_configure_if_required
718
1064
  make_target 'maintainer-clean' 'no_error'
 
1065
 
 
1066
  # Lets make sure we really cleaned up the environment
 
1067
  assert_no_file 'Makefile'
 
1068
  assert_no_file 'configure'
 
1069
  assert_no_directory 'autom4te.cache'
719
1070
}
720
1071
 
721
1072
function make_check ()
746
1097
  assert_file 'Makefile' 'configure did not produce a Makefile'
747
1098
}
748
1099
 
 
1100
function run_make_maintainer_clean_if_possible () 
 
1101
{
 
1102
  if [ -f 'Makefile' ]; then
 
1103
    make_maintainer_clean
 
1104
  fi
 
1105
}
 
1106
 
749
1107
function run_autoreconf_if_required () 
750
1108
{
751
1109
  if [ ! -x 'configure' ]; then
753
1111
  fi
754
1112
 
755
1113
  assert_exec_file 'configure'
 
1114
  bash -n configure
756
1115
}
757
1116
 
758
1117
function run_autoreconf () 
766
1125
    run $BOOTSTRAP_LIBTOOLIZE '--copy' '--install' '--force' || die "Cannot execute $BOOTSTRAP_LIBTOOLIZE"
767
1126
  fi
768
1127
 
769
 
  run $AUTORECONF || die "Cannot execute $AUTORECONF"
 
1128
  run $AUTORECONF $AUTORECONF_ARGS || die "Cannot execute $AUTORECONF"
770
1129
 
771
1130
  eval 'bash -n configure' || die "autoreconf generated a malformed configure"
772
1131
}
777
1136
    echo "\`$@' $ARGS"
778
1137
  fi
779
1138
 
 
1139
  if [ -z "$1" ]; then
 
1140
    return 127;
 
1141
  fi
 
1142
 
780
1143
  eval $@ $ARGS
781
1144
782
1145
 
783
 
parse_command_line_options ()
 
1146
function parse_command_line_options ()
784
1147
{
785
1148
  local SHORTOPTS=':apcmt:dvh'
786
1149
 
814
1177
        ;;
815
1178
      h) # help
816
1179
        echo "bootstrap.sh [options] optional_target ..."
 
1180
        echo "  -a # Just run autoreconf";
 
1181
        echo "  -p # Print ENV";
 
1182
        echo "  -c # Just run configure";
 
1183
        echo "  -m # Just run maintainer-clean";
 
1184
        echo "  -t # Make target";
 
1185
        echo "  -d # Enable debug";
 
1186
        echo "  -h # Show help";
 
1187
        echo "  -v # Be more verbose in output";
817
1188
        exit
818
1189
        ;;
819
1190
      v) # verbose
838
1209
  fi
839
1210
}
840
1211
 
841
 
determine_vcs ()
 
1212
function determine_vcs ()
842
1213
{
843
1214
  if [[ -d '.git' ]]; then
844
1215
    VCS_CHECKOUT=git
848
1219
    VCS_CHECKOUT=svn
849
1220
  elif [[ -d '.hg' ]]; then
850
1221
    VCS_CHECKOUT=hg
 
1222
  else
 
1223
    VCS_CHECKOUT=
851
1224
  fi
852
1225
 
853
1226
  if [[ -n "$VCS_CHECKOUT" ]]; then
868
1241
{
869
1242
  # Set ENV MAKE in order to override "make"
870
1243
  if [[ -z "$MAKE" ]]; then 
871
 
    if command_exists gmake; then
 
1244
    if command_exists 'gmake'; then
872
1245
      MAKE=`type -p gmake`
873
1246
    else
874
 
      if command_exists make; then
 
1247
      if command_exists 'make'; then
875
1248
        MAKE=`type -p make`
876
1249
      fi
877
1250
    fi
913
1286
 
914
1287
      if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
915
1288
        echo "Couldn't find user supplied libtoolize, it is required"
 
1289
        return 1
916
1290
      fi
917
1291
    else
918
1292
      # If we are using OSX, we first check to see glibtoolize is available
921
1295
 
922
1296
        if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
923
1297
          echo "Couldn't find glibtoolize, it is required on OSX"
 
1298
          return 1
924
1299
        fi
925
1300
      else
926
1301
        BOOTSTRAP_LIBTOOLIZE=`type -p libtoolize`
927
1302
 
928
1303
        if [[ -z "$BOOTSTRAP_LIBTOOLIZE" ]]; then
929
1304
          echo "Couldn't find libtoolize, it is required"
 
1305
          return 1
930
1306
        fi
931
1307
      fi
932
1308
    fi
 
1309
 
933
1310
    if $VERBOSE; then
934
1311
      LIBTOOLIZE_OPTIONS="--verbose $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
935
1312
    fi
 
1313
 
936
1314
    if $DEBUG; then
937
1315
      LIBTOOLIZE_OPTIONS="--debug $BOOTSTRAP_LIBTOOLIZE_OPTIONS"
938
1316
    fi
 
1317
 
 
1318
    # Here we set LIBTOOLIZE to true since we are going to invoke it via BOOTSTRAP_LIBTOOLIZE
939
1319
    LIBTOOLIZE=true
940
1320
  fi
941
1321
 
973
1353
    fi
974
1354
 
975
1355
    if [[ -n "$GNU_BUILD_FLAGS" ]]; then
976
 
      AUTORECONF="$AUTORECONF $GNU_BUILD_FLAGS"
 
1356
      AUTORECONF_ARGS="$GNU_BUILD_FLAGS"
977
1357
    fi
978
1358
  fi
979
1359
 
980
1360
  run $AUTORECONF '--help'  &> /dev/null    || die "Failed to run AUTORECONF:$AUTORECONF"
981
1361
}
982
1362
 
983
 
print_setup ()
 
1363
function print_setup ()
984
1364
{
985
1365
  saved_debug_status=$DEBUG
986
1366
  if $DEBUG; then
991
1371
  echo 'BOOTSTRAP ENV' 
992
1372
  echo "AUTORECONF=$AUTORECONF"
993
1373
  echo "HOST_OS=$HOST_OS"
 
1374
  echo "VENDOR=$VENDOR"
 
1375
  echo "VENDOR_DISTRIBUTION=$VENDOR_DISTRIBUTION"
 
1376
  echo "VENDOR_RELEASE=$VENDOR_RELEASE"
994
1377
 
995
1378
  echo "getopt()"
996
1379
  if $AUTORECONF_OPTION; then
1059
1442
  fi
1060
1443
}
1061
1444
 
1062
 
make_clean_option ()
 
1445
function make_clean_option ()
1063
1446
{
1064
1447
  run_configure_if_required
1065
1448
 
1072
1455
  fi
1073
1456
}
1074
1457
 
1075
 
make_for_autoreconf ()
 
1458
function make_for_autoreconf ()
1076
1459
{
1077
1460
  if [ -f 'Makefile' ]; then
1078
1461
    make_maintainer_clean
1083
1466
  assert_no_file 'Makefile'
1084
1467
}
1085
1468
 
1086
 
check_make_target()
 
1469
function check_make_target()
1087
1470
{
1088
1471
  case $1 in
1089
1472
    'self')
1124
1507
      ;;
1125
1508
    'make_default')
1126
1509
      ;;
1127
 
    'test-*')
1128
 
      ;;
1129
 
    'valgrind-*')
1130
 
      ;;
1131
 
    'gdb-*')
 
1510
    'clang')
 
1511
      ;;
 
1512
    'clang-analyzer')
 
1513
      ;;
 
1514
    test-*)
 
1515
      ;;
 
1516
    valgrind-*)
 
1517
      ;;
 
1518
    gdb-*)
1132
1519
      ;;
1133
1520
    'dist')
1134
1521
      ;;
1135
1522
    *)
1136
 
      die "Unknown MAKE_TARGET option: $1"
 
1523
      echo "Matched default"
 
1524
      return 1
1137
1525
      ;;
1138
1526
  esac
 
1527
 
 
1528
  return 0
1139
1529
}
1140
1530
 
1141
1531
function bootstrap ()
1146
1536
 
1147
1537
  # Set up whatever we need to do to use autoreconf later
1148
1538
  require_libtoolise
1149
 
  autoreconf_setup
 
1539
  if ! autoreconf_setup; then
 
1540
    return 1
 
1541
  fi
1150
1542
 
1151
1543
  if [ -z "$MAKE_TARGET" ]; then
1152
1544
    MAKE_TARGET="make_default"
1168
1560
 
1169
1561
  # Set ENV PREFIX in order to set --prefix for ./configure
1170
1562
  if [[ -n "$PREFIX" ]]; then 
1171
 
    push_PREFIX_ARG $PREFIX
 
1563
    PREFIX_ARG="--prefix=$PREFIX"
1172
1564
  fi
1173
1565
 
1174
1566
  # We should always have a target by this point
1181
1573
    # If we are running inside of Jenkins, we want to only run some of the possible tests
1182
1574
    if $jenkins_build_environment; then
1183
1575
      check_make_target $target
 
1576
      ret=$?
 
1577
      if [ $ret -ne 0 ]; then
 
1578
        die "Unknown MAKE_TARGET option: $target"
 
1579
      fi
1184
1580
    fi
1185
1581
 
 
1582
    local snapshot_run=false
 
1583
    local valgrind_run=false
 
1584
 
1186
1585
    case $target in
1187
1586
      'self')
1188
1587
        self_test
1190
1589
      'gdb')
1191
1590
        make_gdb
1192
1591
        ;;
 
1592
      'install-html')
 
1593
        make_install_html
 
1594
        ;;
1193
1595
      'clean_op')
1194
1596
        make_clean_option
1195
1597
        ;;
1205
1607
      'make_default')
1206
1608
        make_default
1207
1609
        ;;
 
1610
      'clang')
 
1611
        if ! check_clang; then
 
1612
          die "clang was not found"
 
1613
        fi
 
1614
 
 
1615
        if ! make_for_clang; then
 
1616
          die "Failed to build clang: $?"
 
1617
        fi
 
1618
        ;;
 
1619
      'clang-analyzer')
 
1620
        if ! check_clang_analyzer; then
 
1621
          die "clang-analyzer was not found"
 
1622
        fi
 
1623
        if ! check_clang; then
 
1624
          die "clang was not found"
 
1625
        fi
 
1626
 
 
1627
        if ! make_for_clang_analyzer; then
 
1628
          die "Failed to build clang-analyzer: $?"
 
1629
        fi
 
1630
        ;;
1208
1631
      'mingw')
1209
 
        make_for_mingw32
 
1632
        if ! check_mingw; then
 
1633
          die "mingw was not found"
 
1634
        fi
 
1635
 
 
1636
        if ! make_for_mingw; then
 
1637
          die "Failed to build mingw: $?"
 
1638
        fi
1210
1639
        ;;
1211
1640
      'snapshot')
1212
1641
        make_for_snapshot
 
1642
        snapshot_run=true
1213
1643
        ;;
1214
1644
      'rpm')
1215
1645
        make_rpm
1216
1646
        ;;
 
1647
      'darwin_malloc')
 
1648
        make_darwin_malloc
 
1649
        ;;
1217
1650
      'valgrind')
 
1651
        make_maintainer_clean 
1218
1652
        make_valgrind
1219
1653
        ;;
1220
1654
      'universe')
1228
1662
        make_target "$target"
1229
1663
        ;;
1230
1664
    esac
 
1665
 
 
1666
    if $jenkins_build_environment; then
 
1667
      if ! $snapshot_run; then
 
1668
        run_make_maintainer_clean_if_possible
 
1669
      fi
 
1670
    fi
 
1671
 
1231
1672
  done
1232
1673
}
1233
1674
 
1234
 
main ()
 
1675
function main ()
1235
1676
{
1236
1677
  # Variables we export
1237
1678
  declare -x VCS_CHECKOUT=
1238
1679
 
1239
1680
  # Variables we control globally
1240
1681
  local MAKE_TARGET=
 
1682
  local CONFIGURE=
1241
1683
 
1242
1684
  # Options for getopt
1243
1685
  local AUTORECONF_OPTION=false
1249
1691
  local TARGET_OPTION_ARG=
1250
1692
  local VERBOSE_OPTION=false
1251
1693
 
 
1694
  local OLD_CONFIGURE=
 
1695
  local OLD_CONFIGURE_ARG=
 
1696
  local OLD_PREFIX=
 
1697
  local OLD_MAKE=
 
1698
  local OLD_TESTS_ENVIRONMENT=
 
1699
 
1252
1700
  # If we call autoreconf on the platform or not
1253
1701
  local AUTORECONF_REBUILD_HOST=false
1254
1702
  local AUTORECONF_REBUILD=false
1255
1703
 
1256
1704
  local -r top_srcdir=`pwd`
1257
1705
 
1258
 
  if [ -z "$top_srcdir" ]; then
1259
 
    top_srcdir='.';
 
1706
  # Default configure
 
1707
  if [ -z "$CONFIGURE" ]; then
 
1708
    CONFIGURE="$top_srcdir/configure"
1260
1709
  fi
1261
1710
 
 
1711
 
1262
1712
  # Variables for determine_target_platform () and rebuild_host_os ()
1263
1713
  #   UNAME_MACHINE_ARCH= uname -m
1264
1714
  #   VENDOR= apple, redhat, centos, canonical
1287
1737
  # We don't want Jenkins overriding other variables, so we NULL them.
1288
1738
  if [ -z "$MAKE_TARGET" ]; then
1289
1739
    if $jenkins_build_environment; then
1290
 
      MAKE_TARGET='jenkins'
 
1740
      if [[ -n "$label" ]]; then
 
1741
        check_make_target $label
 
1742
        if [ $? -eq 0 ]; then
 
1743
          MAKE_TARGET="$label"
 
1744
        fi
 
1745
      fi
 
1746
 
 
1747
      if [ -z "$MAKE_TARGET" ]; then
 
1748
        MAKE_TARGET='check'
 
1749
      fi
1291
1750
    fi
1292
1751
  fi
1293
1752
 
1341
1800
  fi
1342
1801
}
1343
1802
 
1344
 
enable_debug ()
 
1803
function enable_debug ()
1345
1804
{
1346
1805
  if ! $DEBUG; then
1347
1806
    local caller_loc=`caller`
1367
1826
EOF
1368
1827
}
1369
1828
 
1370
 
disable_debug ()
 
1829
function disable_debug ()
1371
1830
{
1372
1831
  set +x
1373
1832
  DEBUG=true
1390
1849
export AUTOM4TE
1391
1850
export AUTOMAKE
1392
1851
export AUTORECONF
 
1852
export CONFIGURE_ARG
1393
1853
export DEBUG
1394
1854
export GNU_BUILD_FLAGS
1395
1855
export LIBTOOLIZE
1396
1856
export LIBTOOLIZE_OPTIONS
1397
1857
export MAKE
 
1858
export PREFIX_ARG
1398
1859
export TESTS_ENVIRONMENT
1399
1860
export VERBOSE
1400
1861
export WARNINGS