~brianaker/libmemcached/merge-1.0-april-2013

« back to all changes in this revision

Viewing changes to bootstrap.sh

  • Committer: Continuous Integration
  • Date: 2013-01-14 21:10:11 UTC
  • mfrom: (1094.1.2 libmemcached-1.2)
  • Revision ID: ci@tangent.org-20130114211011-qql124fta45s730w
Merge lp:~tangent-org/libmemcached/1.2-build/ Build: jenkins-Libmemcached-199

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
122
152
}
123
153
 
124
154
#  Valid values are: darwin,fedora,rhel,ubuntu
125
 
set_VENDOR_DISTRIBUTION ()
 
155
function set_VENDOR_DISTRIBUTION ()
126
156
{
127
157
  local dist=`echo "$1" | tr '[A-Z]' '[a-z]'`
128
158
  case "$dist" in
147
177
  esac
148
178
}
149
179
 
150
 
set_VENDOR_RELEASE ()
 
180
function set_VENDOR_RELEASE ()
151
181
{
152
182
  local release=`echo "$1" | tr '[A-Z]' '[a-z]'`
153
183
  case "$VENDOR_DISTRIBUTION" in
177
207
 
178
208
 
179
209
#  Valid values are: apple, redhat, centos, canonical
180
 
set_VENDOR ()
 
210
function set_VENDOR ()
181
211
{
182
212
  local vendor=`echo "$1" | tr '[A-Z]' '[a-z]'`
183
213
 
206
236
  set_VENDOR_RELEASE $3
207
237
}
208
238
 
209
 
determine_target_platform ()
 
239
function determine_target_platform ()
210
240
{
211
241
  UNAME_MACHINE_ARCH=`(uname -m) 2>/dev/null` || UNAME_MACHINE_ARCH=unknown
212
242
  UNAME_KERNEL=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
242
272
  rebuild_host_os
243
273
}
244
274
 
245
 
run_configure ()
 
275
function run_configure ()
246
276
{
247
277
  # We will run autoreconf if we are required
248
278
  run_autoreconf_if_required
252
282
    die "Programmer error, we entered run_configure with a stacked directory"
253
283
  fi
254
284
 
 
285
  if ! command_exists "$CONFIGURE"; then
 
286
    die "$CONFIGURE does not exist"
 
287
  fi
 
288
 
255
289
  local BUILD_DIR="$1"
256
290
  if [[ -n "$BUILD_DIR" ]]; then
257
291
    rm -r -f $BUILD_DIR
260
294
  fi
261
295
 
262
296
  # Arguments for configure
263
 
  local CONFIGURE_ARG= 
 
297
  local BUILD_CONFIGURE_ARG= 
264
298
 
265
299
  # Set ENV DEBUG in order to enable debugging
266
300
  if $DEBUG; then 
267
 
    CONFIGURE_ARG='--enable-debug'
 
301
    BUILD_CONFIGURE_ARG='--enable-debug'
268
302
  fi
269
303
 
270
304
  # Set ENV ASSERT in order to enable assert
271
305
  if [[ -n "$ASSERT" ]]; then 
272
306
    local ASSERT_ARG=
273
307
    ASSERT_ARG='--enable-assert'
274
 
    CONFIGURE_ARG="$ASSERT_ARG $CONFIGURE_ARG"
275
 
  fi
276
 
 
 
308
    BUILD_CONFIGURE_ARG="$ASSERT_ARG $BUILD_CONFIGURE_ARG"
 
309
  fi
 
310
 
 
311
  if [[ -n "$CONFIGURE_ARG" ]]; then 
 
312
    BUILD_CONFIGURE_ARG= "$BUILD_CONFIGURE_ARG $CONFIGURE_ARG"
 
313
  fi
 
314
 
 
315
  ret=1;
277
316
  # If we are executing on OSX use CLANG, otherwise only use it if we find it in the ENV
278
317
  case $HOST_OS in
279
318
    *-darwin-*)
280
 
      CC=clang CXX=clang++ $top_srcdir/configure $CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $CONFIGURE_ARG $PREFIX_ARG"
 
319
      CC=clang CXX=clang++ $top_srcdir/configure $BUILD_CONFIGURE_ARG || die "Cannot execute CC=clang CXX=clang++ configure $BUILD_CONFIGURE_ARG $PREFIX_ARG"
 
320
      ret=$?
281
321
      ;;
282
322
    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 configure $CONFIGURE_ARG $PREFIX_ARG"
 
323
      command_exists 'gcc44' || die "Could not locate gcc44"
 
324
      CC=gcc44 CXX=gcc44 $top_srcdir/configure $BUILD_CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute CC=gcc44 CXX=gcc44 configure $BUILD_CONFIGURE_ARG $PREFIX_ARG"
 
325
      ret=$?
285
326
      ;;
286
327
    *)
287
 
      $top_srcdir/configure $CONFIGURE_ARG $PREFIX_ARG || die "Cannot execute configure $CONFIGURE_ARG $PREFIX_ARG"
 
328
      $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG
 
329
      ret=$?
288
330
      ;;
289
331
  esac
290
332
 
 
333
  if [ $ret -ne 0 ]; then
 
334
    die "Could not execute $CONFIGURE $BUILD_CONFIGURE_ARG $PREFIX_ARG"
 
335
  fi
 
336
 
291
337
  if [ ! -f 'Makefile' ]; then
292
 
    die "Programmer error, configure was run but no Makefile existed afterward"
 
338
    die "Programmer error, configure was run but no Makefile existed after $CONFIGURE was run"
293
339
  fi
294
340
}
295
341
 
296
 
setup_gdb_command () {
 
342
function setup_gdb_command () {
297
343
  GDB_TMPFILE=$(mktemp /tmp/gdb.XXXXXXXXXX)
298
344
  echo 'set logging overwrite on' > $GDB_TMPFILE
299
345
  echo 'set logging on' >> $GDB_TMPFILE
304
350
  GDB_COMMAND="gdb -f -batch -x $GDB_TMPFILE"
305
351
}
306
352
 
307
 
setup_valgrind_command () {
 
353
function setup_valgrind_command () {
308
354
  VALGRIND_PROGRAM=`type -p valgrind`
309
355
  if [[ -n "$VALGRIND_PROGRAM" ]]; then
310
356
    VALGRIND_COMMAND="$VALGRIND_PROGRAM --error-exitcode=1 --leak-check=yes --show-reachable=yes --track-fds=yes --malloc-fill=A5 --free-fill=DE"
311
357
  fi
312
358
}
313
359
 
314
 
push_PREFIX_ARG ()
315
 
{
 
360
function save_BUILD ()
 
361
{
 
362
  if [[ -n "$OLD_CONFIGURE" ]]; then
 
363
    die "OLD_CONFIGURE($OLD_CONFIGURE) was set on push, programmer error!"
 
364
  fi
 
365
 
 
366
  if [[ -n "$OLD_CONFIGURE_ARG" ]]; then
 
367
    die "OLD_CONFIGURE_ARG($OLD_CONFIGURE_ARG) was set on push, programmer error!"
 
368
  fi
 
369
 
 
370
  if [[ -n "$OLD_MAKE" ]]; then
 
371
    die "OLD_MAKE($OLD_MAKE) was set on push, programmer error!"
 
372
  fi
 
373
 
 
374
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
 
375
    die "OLD_TESTS_ENVIRONMENT($OLD_TESTS_ENVIRONMENT) was set on push, programmer error!"
 
376
  fi
 
377
 
 
378
  if [[ -n "$CONFIGURE" ]]; then
 
379
    OLD_CONFIGURE=$CONFIGURE
 
380
  fi
 
381
 
 
382
  if [[ -n "$CONFIGURE_ARG" ]]; then
 
383
    OLD_CONFIGURE_ARG=$CONFIGURE_ARG
 
384
  fi
 
385
 
 
386
  if [[ -n "$MAKE" ]]; then
 
387
    OLD_MAKE=$MAKE
 
388
  fi
 
389
 
 
390
  if [[ -n "$TESTS_ENVIRONMENT" ]]; then
 
391
    OLD_TESTS_ENVIRONMENT=$TESTS_ENVIRONMENT
 
392
  fi
 
393
}
 
394
 
 
395
function restore_BUILD ()
 
396
{
 
397
  if [[ -n "$OLD_CONFIGURE" ]]; then
 
398
    CONFIGURE=$OLD_CONFIGURE
 
399
  fi
 
400
 
 
401
  if [[ -n "$OLD_CONFIGURE_ARG" ]]; then
 
402
    CONFIGURE_ARG=$OLD_CONFIGURE_ARG
 
403
  fi
 
404
 
 
405
  if [[ -n "$OLD_MAKE" ]]; then
 
406
    MAKE=$OLD_MAKE
 
407
  fi
 
408
 
 
409
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
 
410
    TESTS_ENVIRONMENT=$OLD_TESTS_ENVIRONMENT
 
411
  fi
 
412
 
 
413
  OLD_CONFIGURE=
 
414
  OLD_CONFIGURE_ARG=
 
415
  OLD_MAKE=
 
416
  OLD_TESTS_ENVIRONMENT=
 
417
  echo "reset happened"
 
418
}
 
419
 
 
420
function push_PREFIX_ARG ()
 
421
{
 
422
  if [[ -n "$OLD_PREFIX_ARG" ]]; then
 
423
    die "OLD_PREFIX_ARG was set on push, programmer error!"
 
424
  fi
 
425
 
316
426
  if [[ -n "$PREFIX_ARG" ]]; then
317
427
    OLD_PREFIX_ARG=$PREFIX_ARG
318
428
    PREFIX_ARG=
323
433
  fi
324
434
}
325
435
 
326
 
pop_PREFIX_ARG ()
 
436
function pop_PREFIX_ARG ()
327
437
{
328
438
  if [[ -n "$OLD_PREFIX_ARG" ]]; then
329
 
    PREFIX_ARG=$OLD_TESTS_ENVIRONMENT
 
439
    PREFIX_ARG=$OLD_PREFIX_ARG
330
440
    OLD_PREFIX_ARG=
331
441
  else
332
442
    PREFIX_ARG=
333
443
  fi
334
444
}
335
445
 
336
 
push_TESTS_ENVIRONMENT ()
 
446
function push_TESTS_ENVIRONMENT ()
337
447
{
338
448
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
339
449
    die "OLD_TESTS_ENVIRONMENT was set on push, programmer error!"
345
455
  fi
346
456
}
347
457
 
348
 
pop_TESTS_ENVIRONMENT ()
 
458
function pop_TESTS_ENVIRONMENT ()
349
459
{
350
460
  TESTS_ENVIRONMENT=
351
461
  if [[ -n "$OLD_TESTS_ENVIRONMENT" ]]; then
498
608
  snapshot_check
499
609
}
500
610
 
501
 
function make_for_mingw32 ()
502
 
{
 
611
function check_mingw ()
 
612
{
 
613
  command_exists 'mingw64-configure'
 
614
  ret=$?
 
615
  if [ "$ret" -ne 0 ]; then
 
616
    return 1
 
617
  fi
 
618
 
 
619
  command_exists 'mingw64-make'
 
620
  ret=$?
 
621
  if [ "$ret" -ne 0 ]; then
 
622
    return 1
 
623
  fi
 
624
 
 
625
  return 0
 
626
}
 
627
 
 
628
function make_skeleton_mingw ()
 
629
{
 
630
  run_configure
 
631
  ret=$?
 
632
 
 
633
  if [ $ret -eq 0 ]; then
 
634
    assert_file 'Makefile'
 
635
 
 
636
    make_target 'all' 'warn'
 
637
    ret=$?
 
638
    if [ $ret -ne 0 ]; then
 
639
      warn "$MAKE failed"
 
640
    else
 
641
      if [[ -n "$DISPLAY" ]]; then
 
642
        if command_exists 'wine'; then
 
643
          TESTS_ENVIRONMENT='wine'
 
644
        fi
 
645
      elif command_exists 'wineconsole'; then
 
646
        TESTS_ENVIRONMENT='wineconsole --backend=curses'
 
647
      fi
 
648
 
 
649
      if [[ -n "$TESTS_ENVIRONMENT" ]]; then
 
650
        make_target 'check' 'warn' || warn "$MAKE check failed"
 
651
        ret=$?
 
652
      fi
 
653
    fi
 
654
 
 
655
    if $jenkins_build_environment; then
 
656
      make_target 'clean' 'warn'
 
657
    fi
 
658
  fi
 
659
 
 
660
  return $ret
 
661
}
 
662
 
 
663
function make_for_mingw ()
 
664
{
 
665
  check_mingw
 
666
  if ! check_mingw; then
 
667
    die 'mingw64 tools were not found'
 
668
  fi
 
669
 
503
670
  # Make sure it is clean
504
671
  if [ -f Makefile -o -f configure ]; then
505
672
    make_maintainer_clean
506
673
  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'
513
 
    assert_file 'Makefile'
514
 
 
515
 
    if command_exists mingw32-make; then
516
 
      mingw32-make || die 'mingw32-make failed'
517
 
    fi
518
 
  fi
 
674
 
 
675
  run_autoreconf
 
676
 
 
677
  save_BUILD
 
678
 
 
679
  CONFIGURE='mingw64-configure'
 
680
  MAKE='mingw64-make'
 
681
  CONFIGURE_ARGS='--enable-static'
 
682
 
 
683
  make_skeleton_mingw
 
684
  ret=$?
 
685
 
 
686
  restore_BUILD
 
687
 
 
688
  return $ret
519
689
}
520
690
 
521
691
# If we are locally testing, we should make sure the environment is setup correctly
540
710
  make_valgrind
541
711
  make_gdb
542
712
  make_rpm
543
 
  make_for_mingw32
 
713
 
 
714
  if [ check_mingw -eq 0 ]; then
 
715
    make_for_mingw
 
716
  fi
 
717
 
544
718
  make_distcheck
545
719
  make_install_system
546
720
}
631
805
  eval "./bootstrap.sh maintainer-clean" || die "failed 'maintainer-clean'"
632
806
}
633
807
 
 
808
function make_install_html ()
 
809
{
 
810
  run_configure_if_required
 
811
  assert_file 'configure'
 
812
 
 
813
  make_target 'install-html'
 
814
}
 
815
 
634
816
function make_gdb ()
635
817
{
636
 
  run_configure_if_required
637
 
 
638
 
  if command_exists gdb; then
 
818
  if command_exists 'gdb'; then
 
819
    run_configure_if_required
639
820
 
640
821
    push_TESTS_ENVIRONMENT
641
822
 
652
833
      TESTS_ENVIRONMENT="$GDB_COMMAND"
653
834
    fi
654
835
 
655
 
    make_target check
 
836
    make_target 'check'
656
837
 
657
838
    if [ -f 'gdb.txt' ]; then
658
839
      rm 'gdb.txt'
663
844
    if [ -f '.gdb_history' ]; then
664
845
      rm '.gdb_history'
665
846
    fi
 
847
 
 
848
    if $jenkins_build_environment; then
 
849
      make_target 'clean'
 
850
    fi
666
851
  else
667
852
    echo 'gdb was not present'
668
853
    return 1
692
877
    die "MAKE was not set"
693
878
  fi
694
879
 
695
 
  if [ -n "$2" ]; then
696
 
    run $MAKE $1 || return 1
697
 
  else
698
 
    run $MAKE $1 || die "Cannot execute $MAKE $1"
 
880
  # $2 represents error or warn
 
881
  run $MAKE $1
 
882
  ret=$?
 
883
 
 
884
  if [ $ret -ne 0 ]; then
 
885
    if [ -n "$2" ]; then
 
886
      warn "Cannot execute $MAKE $1: $ret"
 
887
    else
 
888
      die "Cannot execute $MAKE $1: $ret"
 
889
    fi
699
890
  fi
 
891
 
 
892
  return $ret
700
893
}
701
894
 
702
895
function make_distcheck ()
706
899
 
707
900
function make_rpm ()
708
901
{
709
 
  if [ -f 'rpm.am' -o -d 'rpm' ]; then
710
 
    run_configure_if_required
711
 
    make_target 'rpm'
 
902
  if command_exists 'rpmbuild'; then
 
903
    if [ -f 'rpm.am' -o -d 'rpm' ]; then
 
904
      run_configure_if_required
 
905
      make_target 'rpm'
 
906
 
 
907
      if $jenkins_build_environment; then
 
908
        make_target 'clean'
 
909
      fi
 
910
 
 
911
    fi
712
912
  fi
713
913
}
714
914
 
716
916
{
717
917
  run_configure_if_required
718
918
  make_target 'maintainer-clean' 'no_error'
 
919
 
 
920
  # Lets make sure we really cleaned up the environment
 
921
  assert_no_file 'Makefile'
 
922
  assert_no_file 'configure'
 
923
  assert_no_directory 'autom4te.cache'
719
924
}
720
925
 
721
926
function make_check ()
777
982
    echo "\`$@' $ARGS"
778
983
  fi
779
984
 
 
985
  if [ -z "$1" ]; then
 
986
    return 127;
 
987
  fi
 
988
 
780
989
  eval $@ $ARGS
781
990
782
991
 
783
 
parse_command_line_options ()
 
992
function parse_command_line_options ()
784
993
{
785
994
  local SHORTOPTS=':apcmt:dvh'
786
995
 
838
1047
  fi
839
1048
}
840
1049
 
841
 
determine_vcs ()
 
1050
function determine_vcs ()
842
1051
{
843
1052
  if [[ -d '.git' ]]; then
844
1053
    VCS_CHECKOUT=git
868
1077
{
869
1078
  # Set ENV MAKE in order to override "make"
870
1079
  if [[ -z "$MAKE" ]]; then 
871
 
    if command_exists gmake; then
 
1080
    if command_exists 'gmake'; then
872
1081
      MAKE=`type -p gmake`
873
1082
    else
874
 
      if command_exists make; then
 
1083
      if command_exists 'make'; then
875
1084
        MAKE=`type -p make`
876
1085
      fi
877
1086
    fi
980
1189
  run $AUTORECONF '--help'  &> /dev/null    || die "Failed to run AUTORECONF:$AUTORECONF"
981
1190
}
982
1191
 
983
 
print_setup ()
 
1192
function print_setup ()
984
1193
{
985
1194
  saved_debug_status=$DEBUG
986
1195
  if $DEBUG; then
1059
1268
  fi
1060
1269
}
1061
1270
 
1062
 
make_clean_option ()
 
1271
function make_clean_option ()
1063
1272
{
1064
1273
  run_configure_if_required
1065
1274
 
1072
1281
  fi
1073
1282
}
1074
1283
 
1075
 
make_for_autoreconf ()
 
1284
function make_for_autoreconf ()
1076
1285
{
1077
1286
  if [ -f 'Makefile' ]; then
1078
1287
    make_maintainer_clean
1083
1292
  assert_no_file 'Makefile'
1084
1293
}
1085
1294
 
1086
 
check_make_target()
 
1295
function check_make_target()
1087
1296
{
1088
1297
  case $1 in
1089
1298
    'self')
1190
1399
      'gdb')
1191
1400
        make_gdb
1192
1401
        ;;
 
1402
      'install-html')
 
1403
        make_install_html
 
1404
        ;;
1193
1405
      'clean_op')
1194
1406
        make_clean_option
1195
1407
        ;;
1206
1418
        make_default
1207
1419
        ;;
1208
1420
      'mingw')
1209
 
        make_for_mingw32
 
1421
        check_mingw
 
1422
        if ! check_mingw; then
 
1423
          die "mingw was not found"
 
1424
        fi
 
1425
 
 
1426
        make_for_mingw
 
1427
        check_ret=$?
 
1428
 
 
1429
        if ! make_for_mingw; then
 
1430
          die "Failed to build mingw: $?"
 
1431
        fi
1210
1432
        ;;
1211
1433
      'snapshot')
1212
1434
        make_for_snapshot
1231
1453
  done
1232
1454
}
1233
1455
 
1234
 
main ()
 
1456
function main ()
1235
1457
{
1236
1458
  # Variables we export
1237
1459
  declare -x VCS_CHECKOUT=
1238
1460
 
1239
1461
  # Variables we control globally
1240
1462
  local MAKE_TARGET=
 
1463
  local CONFIGURE=
1241
1464
 
1242
1465
  # Options for getopt
1243
1466
  local AUTORECONF_OPTION=false
1249
1472
  local TARGET_OPTION_ARG=
1250
1473
  local VERBOSE_OPTION=false
1251
1474
 
 
1475
  local OLD_CONFIGURE=
 
1476
  local OLD_CONFIGURE_ARG=
 
1477
  local OLD_MAKE=
 
1478
  local OLD_TESTS_ENVIRONMENT=
 
1479
 
1252
1480
  # If we call autoreconf on the platform or not
1253
1481
  local AUTORECONF_REBUILD_HOST=false
1254
1482
  local AUTORECONF_REBUILD=false
1255
1483
 
1256
1484
  local -r top_srcdir=`pwd`
1257
1485
 
 
1486
  # Default configure
 
1487
  if [ -z "$CONFIGURE" ]; then
 
1488
    CONFIGURE="$top_srcdir/configure"
 
1489
  fi
 
1490
 
 
1491
 
1258
1492
  # Variables for determine_target_platform () and rebuild_host_os ()
1259
1493
  #   UNAME_MACHINE_ARCH= uname -m
1260
1494
  #   VENDOR= apple, redhat, centos, canonical
1337
1571
  fi
1338
1572
}
1339
1573
 
1340
 
enable_debug ()
 
1574
function enable_debug ()
1341
1575
{
1342
1576
  if ! $DEBUG; then
1343
1577
    local caller_loc=`caller`
1363
1597
EOF
1364
1598
}
1365
1599
 
1366
 
disable_debug ()
 
1600
function disable_debug ()
1367
1601
{
1368
1602
  set +x
1369
1603
  DEBUG=true