Browse code

first version that build using mingw32-make

Nat! authored on 03-09-2016 16:05:16
Showing 19 changed files
... ...
@@ -16,6 +16,7 @@ libraries into an "addictions" folder
16 16
   MINGW bash (without brew)
17 17
 * certainly not a "lightweight" project with ca. 10000 lines of shell script
18 18
   code
19
+* reduced configurability of mulle-bootstrap, since I didn't use it so far much and it slows things down on MINGW
19 20
 
20 21
 
21 22
 ## Tell me more
... ...
@@ -20,6 +20,8 @@ better performance.
20 20
 symlinks available.  This meant that I had to redo the whole settings
21 21
 inheritance scheme.
22 22
 * -v is now more interesting to watch
23
+* renamed build setting OTHER_CPPFLAGS to OTHER_CXXFLAGS (!)
24
+
23 25
 
24 26
 1.1
25 27
 ===
... ...
@@ -5,25 +5,21 @@
5 5
 
6 6
 if [ "${MULLE_BOOTSTRAP_NO_COLOR}" != "YES" ]
7 7
 then
8
-   case `uname` in
9
-      Darwin|Linux|FreeBSD|MINGW*)
10
-         # Escape sequence and resets
11
-         C_RESET="\033[0m"
12
-
13
-         # Useable Foreground colours, for black/white white/black
14
-         C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
15
-         C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
16
-         C_CYAN="\033[0;36m"
17
-
18
-         C_BR_RED="\033[0;91m"
19
-         C_BOLD="\033[1m"
20
-
21
-         #
22
-         # restore colors if stuff gets wonky
23
-         #
24
-         trap 'printf "${C_RESET}"' TERM EXIT
25
-         ;;
26
-   esac
8
+   # Escape sequence and resets
9
+   C_RESET="\033[0m"
10
+
11
+   # Useable Foreground colours, for black/white white/black
12
+   C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
13
+   C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
14
+   C_CYAN="\033[0;36m"
15
+
16
+   C_BR_RED="\033[0;91m"
17
+   C_BOLD="\033[1m"
18
+
19
+   #
20
+   # restore colors if stuff gets wonky
21
+   #
22
+   trap 'printf "${C_RESET}"' TERM EXIT
27 23
 fi
28 24
 
29 25
 
... ...
@@ -43,6 +43,11 @@ export PATH
43 43
 MULLE_BOOTSTRAP_PID="$$"
44 44
 export MULLE_BOOTSTRAP_PID
45 45
 
46
+# now include this first to get
47
+# logging and UNAME
48
+
49
+[ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
50
+
46 51
 
47 52
 trap_fail()
48 53
 {
... ...
@@ -75,7 +80,7 @@ usage: mulle-bootstrap [-a|-y][-n][-v|-s|-t] [command] [--help]
75 80
    init      : initializes a bootstrap project
76 81
 EOF
77 82
 
78
-   if [ "`uname`" = 'Darwin' ]
83
+   if [ "${UNAME}" = 'Darwin' ]
79 84
    then
80 85
       cat <<EOF
81 86
    xcode     : sets up the xcodeproj settings
... ...
@@ -120,14 +125,13 @@ Well, do ya, punk?"
120 125
 }
121 126
 
122 127
 
123
-
124 128
 bootstrap_main()
125 129
 {
126 130
    local command
127 131
 
128
- #
129
-# simple option handling
130
-#
132
+   #
133
+   # simple option handling
134
+   #
131 135
    while :
132 136
    do
133 137
       if [ $# -eq 0 ]
... ...
@@ -217,6 +221,56 @@ bootstrap_main()
217 221
    [ $# -eq 0 ] || shift
218 222
 
219 223
 
224
+   case "${MULLE_BOOTSTRAP_TRACE}" in
225
+      VERBOSE)
226
+         MULLE_BOOTSTRAP_FLUFF="NO"
227
+         MULLE_BOOTSTRAP_TRACE="NO"
228
+         MULLE_BOOTSTRAP_VERBOSE="YES"
229
+         if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
230
+         then
231
+            MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
232
+         fi
233
+         ;;
234
+
235
+      FLUFF)
236
+         MULLE_BOOTSTRAP_FLUFF="YES"
237
+         MULLE_BOOTSTRAP_TRACE="NO"
238
+         MULLE_BOOTSTRAP_VERBOSE="YES"
239
+         if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
240
+         then
241
+            MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
242
+         fi
243
+         ;;
244
+
245
+      TRACE)
246
+         MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
247
+         MULLE_BOOTSTRAP_FLUFF="YES"
248
+         MULLE_BOOTSTRAP_VERBOSE="YES"
249
+         MULLE_BOOTSTRAP_TRACE="YES"
250
+         if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
251
+         then
252
+            MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
253
+         fi
254
+         log_trace "FULL trace started"
255
+         ;;
256
+
257
+      1848)
258
+         MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
259
+         MULLE_BOOTSTRAP_TRACE_SETTINGS="NO"
260
+         MULLE_BOOTSTRAP_FLUFF="NO"
261
+         MULLE_BOOTSTRAP_TRACE="NO"
262
+         MULLE_BOOTSTRAP_VERBOSE="NO"
263
+         MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
264
+         log_trace "1848 trace (set -x) started"
265
+         set -x
266
+         ;;
267
+   esac
268
+
269
+   if [ "${MULLE_BOOTSTRAP_DRY_RUN}" = "YES" ]
270
+   then
271
+      log_trace "Dry run is active."
272
+   fi
273
+
220 274
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
221 275
    [ -z "${MULLE_BOOTSTRAP_REFRESH_SH}" ] && . mulle-bootstrap-refresh.sh
222 276
 
... ...
@@ -247,7 +301,7 @@ bootstrap_main()
247 301
    if [ "${MULLE_BOOTSTRAP_SKIP_INITIAL_REFRESH}" != "YES" ]
248 302
    then
249 303
       case "${command}" in
250
-         bootstrap|nomagic|build|setup-xcode|xcode|tag)
304
+         bootstrap|nomagic|setup-xcode|xcode|tag)
251 305
             refresh_main || exit 1
252 306
          ;;
253 307
       esac
... ...
@@ -322,12 +376,14 @@ bootstrap_main()
322 376
 
323 377
          refresh_main clear || exit 1
324 378
          DONT_ASK_AFTER_WARNING=YES fetch_main "install" "$@" || exit 1
379
+         refresh_main || exit 1
325 380
       ;;
326 381
 
327 382
       update)
328 383
          . mulle-bootstrap-fetch.sh
329 384
 
330 385
          fetch_main "${command}" "$@" || exit 1
386
+         refresh_main || exit 1
331 387
       ;;
332 388
 
333 389
       init)
... ...
@@ -359,5 +415,4 @@ bootstrap_main()
359 415
    esac
360 416
 }
361 417
 
362
-
363 418
 bootstrap_main "$@"
... ...
@@ -68,7 +68,7 @@ bootstrap_auto_update()
68 68
    # contains own bootstrap ? and not a symlink
69 69
    if [ ! -d "${directory}/.bootstrap" ] # -a ! -L "${dst}" ]
70 70
    then
71
-      log_fluff "no .bootstrap folder in \"${directory}\" found"
71
+      log_fluff "No .bootstrap folder in \"${directory}\" found"
72 72
       return 1
73 73
    fi
74 74
 
... ...
@@ -61,7 +61,7 @@ fetch_brew_if_needed()
61 61
       return
62 62
    fi
63 63
 
64
-   case "`uname`" in
64
+   case "${UNAME}" in
65 65
       Darwin)
66 66
          log_info "Installing OS X brew"
67 67
          exekutor git clone https://github.com/Homebrew/brew.git "${ADDICTION_SUBDIR}"
... ...
@@ -73,7 +73,7 @@ fetch_brew_if_needed()
73 73
          ;;
74 74
 
75 75
       *)
76
-         log_fail "Missing brew support for `uname`"
76
+         log_fail "Missing brew support for ${UNAME}"
77 77
          ;;
78 78
    esac
79 79
 
80 80
new file mode 100644
... ...
@@ -0,0 +1,51 @@
1
+#! /bin/sh
2
+#
3
+#   Copyright (c) 2015 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
33
+
34
+
35
+CLONESBUILD_SUBDIR=`read_sane_config_path_setting "build_foldername" "${RELATIVE_ROOT}build/.repos"`
36
+BUILDLOG_SUBDIR=`read_sane_config_path_setting "build_log_foldername" "${CLONESBUILD_SUBDIR}/.logs"`
37
+
38
+[ -z "${CLONESBUILD_SUBDIR}" ]   && internal_fail "variable CLONESBUILD_SUBDIR is empty"
39
+[ -z "${BUILDLOG_SUBDIR}" ]      && internal_fail "variable BUILDLOG_SUBDIR is empty"
40
+
41
+#
42
+# Global Settings
43
+#
44
+HEADER_DIR_NAME="`read_config_setting "header_dir_name" "include"`"
45
+LIBRARY_DIR_NAME="`read_config_setting "library_dir_name" "lib"`"
46
+FRAMEWORK_DIR_NAME="`read_config_setting "framework_dir_name" "Frameworks"`"
47
+
48
+#
49
+# dont export stuff for scripts
50
+# if scripts want it, they should source this file
51
+#
... ...
@@ -29,7 +29,7 @@
29 29
 #   POSSIBILITY OF SUCH DAMAGE.
30 30
 MULLE_BOOTSTRAP_BUILD_SH="included"
31 31
 
32
-[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
32
+[ -z "${MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH}" ] && . mulle-bootstrap-build-environment.sh
33 33
 [ -z "${MULLE_BOOTSTRAP_GCC_SH}" ] && . mulle-bootstrap-gcc.sh
34 34
 [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
35 35
 [ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
... ...
@@ -456,62 +456,106 @@ build_log_name()
456 456
 }
457 457
 
458 458
 
459
-find_binary()
459
+assert_binary()
460 460
 {
461 461
    local toolname
462 462
    toolname="$1"
463 463
 
464
+   [ -z "${toolname}" ] && internal_fail "toolname is empty"
465
+
464 466
    local path
467
+
465 468
    path=`which_binary "${toolname}"`
466 469
    if [ -z "${path}" ]
467 470
    then
468
-      log_warning "${toolname} is an unknown build tool"
469
-      return 1
471
+      set -x
472
+      which_binary "${toolname}"
473
+      fail "${toolname} is an unknown build tool (PATH=$PATH)"
470 474
    fi
471
-   echo "$path"
475
+   # echo "$path"
472 476
 }
473 477
 
474 478
 
475 479
 find_cmake()
476 480
 {
481
+   local name
482
+
483
+   name="${1}"
484
+
477 485
    local toolname
478 486
 
479
-   toolname=`read_config_setting "cmake" "cmake"`
480
-   find_binary "${toolname}"
487
+   toolname=`read_build_setting "${name}" "cmake" "cmake"`
488
+   assert_binary "${toolname}"
489
+   echo "`basename -- "${toolname}"`"
481 490
 }
482 491
 
483 492
 
484 493
 find_xcodebuild()
485 494
 {
495
+   local name
496
+
497
+   name="${1}"
498
+
486 499
    local toolname
487 500
 
488
-   toolname=`read_config_setting "xcodebuild" "xcodebuild"`
489
-   find_binary "${toolname}"
501
+   toolname=`read_build_setting "${name}" "xcodebuild" "xcodebuild"`
502
+   assert_binary "${toolname}"
503
+   echo "`basename -- "${toolname}"`"
490 504
 }
491 505
 
492 506
 
493
-
494 507
 find_make()
495 508
 {
496
-   local default_toolname
509
+   local name
510
+
511
+   name="${1}"
512
+
497 513
    local toolname
514
+   local defaultname
515
+
516
+   defaultname="${2:-make}"
517
+   toolname=`read_build_setting "${name}" "make" "${defaultname}"`
518
+   assert_binary "${toolname}"
519
+   echo "`basename -- "${toolname}"`"
520
+}
521
+
522
+
523
+find_compiler()
524
+{
525
+   local compiler
526
+
527
+   compiler="`read_build_setting "${name}" "$1"`"
498 528
 
499 529
    case "${UNAME}" in
500 530
       MINGW*)
501
-         default_toolname="nmake"
531
+         case "${compiler}" in
532
+            mulle-clang*)
533
+               compiler="mulle-clang-cl"
534
+            ;;
535
+            clang*)
536
+               compiler="clang-cl"
537
+            ;;
538
+
539
+            *)
540
+               compiler="cl"
541
+               log_fluff "Using default compiler cl"
542
+            ;;
543
+         esac
502 544
       ;;
503 545
 
504 546
       *)
505
-         default_toolname="make"
547
+         if [ -z "${compiler}" ]
548
+         then
549
+            return 0
550
+         fi
506 551
       ;;
507 552
    esac
508 553
 
509
-   toolname=`read_config_setting "make" "${default_toolname}"`
510
-   find_binary "${toolname}"
554
+   assert_binary "${compiler}" 
555
+   echo "`basename -- "${compiler}"`"
511 556
 }
512 557
 
513 558
 
514
-
515 559
 #
516 560
 # remove old builddir, create a new one
517 561
 # depending on configuration cmake with flags
... ...
@@ -571,13 +615,21 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
571 615
    suffixsubdir="`determine_dependencies_subdir "${suffix}"`"
572 616
    fallbacksubdir="`determine_dependencies_subdir "${fallback}"`"
573 617
 
618
+   local c_compiler
619
+   local cxx_compiler
620
+   # local linker
621
+
622
+   # no problem if those are empty
623
+   c_compiler="`find_compiler CC`"
624
+   cxx_compiler="`find_compiler CXX`"
625
+   # linker="`read_build_setting "${name}" "LD"`"
626
+
574 627
    local other_cflags
575
-   local other_cppflags
628
+   local other_cxxflags
576 629
    local other_ldflags
577 630
 
578
-
579 631
    other_cflags="`gcc_cflags_value "${name}"`"
580
-   other_cppflags="`gcc_cppflags_value "${name}"`"
632
+   other_cxxflags="`gcc_cxxflags_value "${name}"`"
581 633
    other_ldflags="`gcc_ldflags_value "${name}"`"
582 634
 
583 635
    local logfile1
... ...
@@ -730,8 +782,17 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
730 782
          other_ldflags="`add_word "${other_ldflags}" "${frameworkprefix}${path}"`"
731 783
       done
732 784
 
785
+      if [ MULLE_BOOTSTRAP_VERBOSE_BUILD = "YES" ]
786
+      then
787
+         local_make_flags="${local_make_flags} VERBOSE=1"
788
+      fi
789
+
733 790
       IFS="${memo}"
734 791
 
792
+      local oldpath
793
+
794
+      oldpath="$PATH"
795
+      PATH="${BUILDPATH}" 
735 796
 
736 797
       logging_exekutor "${CMAKE}" -G "${CMAKE_GENERATOR}" "-DCMAKE_BUILD_TYPE=${mapped}" \
737 798
 "${sdkparameter}" \
... ...
@@ -740,8 +801,10 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
740 801
 "-DCMAKE_INCLUDE_PATH=${includelines}" \
741 802
 "-DCMAKE_LIBRARY_PATH=${librarylines}" \
742 803
 "-DCMAKE_FRAMEWORK_PATH=${frameworklines}" \
804
+"-DCMAKE_C_COMPILER=${c_compiler}" \
805
+"-DCMAKE_CXX_COMPILER=${cxx_compiler}" \
743 806
 "-DCMAKE_C_FLAGS=${other_cflags}" \
744
-"-DCMAKE_CXX_FLAGS=${other_cppflags}" \
807
+"-DCMAKE_CXX_FLAGS=${other_cxxflags}" \
745 808
 "-DCMAKE_EXE_LINKER_FLAGS=${other_ldflags}" \
746 809
 "-DCMAKE_SHARED_LINKER_FLAGS=${other_ldflags}" \
747 810
 "-DCMAKE_MODULE_PATH=${cmakemodulepath}" \
... ...
@@ -749,13 +812,10 @@ ${CMAKE_FLAGS} \
749 812
 ${localcmakeflags} \
750 813
 "${relative_srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
751 814
 
752
-      if [ MULLE_BOOTSTRAP_VERBOSE_BUILD = "YES" ]
753
-      then
754
-         local_make_flags="${local_make_flags} VERBOSE=1"
755
-      fi
756
-
757 815
       logging_exekutor "${MAKE}" ${MAKE_FLAGS} ${local_make_flags} install > "${logfile2}" || build_fail "${logfile2}" "make"
758 816
 
817
+      PATH="${oldpath}"
818
+
759 819
       set +f
760 820
 
761 821
    exekutor cd "${owd}"
... ...
@@ -826,12 +886,21 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
826 886
    suffixsubdir="`determine_dependencies_subdir "${suffix}"`"
827 887
    fallbacksubdir="`determine_dependencies_subdir "${fallback}"`"
828 888
 
889
+   local c_compiler
890
+   local cxx_compiler
891
+   #local linker
892
+
893
+   # no problem if those are empty
894
+   c_compiler="`find_compiler CC`"
895
+   cxx_compiler="`find_compiler CXX`"
896
+   #linker="`read_build_setting "${name}" "LD"`"
897
+
829 898
    local other_cflags
830
-   local other_cppflags
899
+   local other_cxxflags
831 900
    local other_ldflags
832 901
 
833 902
    other_cflags="`gcc_cflags_value "${name}"`"
834
-   other_cppflags="`gcc_cppflags_value "${name}"`"
903
+   other_cxxflags="`gcc_cxxflags_value "${name}"`"
835 904
    other_ldflags="`gcc_ldflags_value "${name}"`"
836 905
 
837 906
    local logfile1
... ...
@@ -906,7 +975,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
906 975
 
907 976
       local prefixbuild
908 977
       local dependenciesdir
909
-      local linker
978
+      #local linker
910 979
 
911 980
       pathrefixbuild="`add_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCY_SUBDIR}"`"
912 981
       dependenciesdir="`add_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}"`"
... ...
@@ -948,10 +1017,17 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
948 1017
 
949 1018
       IFS="${memo}"
950 1019
 
1020
+      local oldpath
1021
+
1022
+      oldpath="$PATH"
1023
+      PATH="${BUILDPATH}" 
1024
+
951 1025
       # use absolute paths for configure, safer (and easier to read IMO)
952 1026
       DEPENDENCIES_DIR="'${dependenciesdir}'" \
1027
+      CC="${c_compiler:-${CC}}" \
1028
+      CXX="${cxx_compiler:-${CXX}}" \
953 1029
       CFLAGS="${other_cflags}" \
954
-      CPPFLAGS="${other_cflags} ${other_cppflags}" \
1030
+      CXXFLAGS="${other_cflags} ${other_cxxflags}" \
955 1031
       LDFLAGS="${other_ldflags}" \
956 1032
       logging_exekutor "${owd}/${srcdir}/configure" ${configureflags} \
957 1033
           --prefix "${prefixbuild}" >> "${logfile1}" \
... ...
@@ -960,6 +1036,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
960 1036
       logging_exekutor "${MAKE}" ${MAKE_FLAGS} install > "${logfile2}" \
961 1037
       || build_fail "${logfile2}" "${MAKE}"
962 1038
 
1039
+      PATH="${oldpath}"
963 1040
       set +f
964 1041
 
965 1042
    exekutor cd "${owd}"
... ...
@@ -1276,20 +1353,20 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1276 1353
    fi
1277 1354
 
1278 1355
    local other_cflags
1279
-   local other_cppflags
1356
+   local other_cxxflags
1280 1357
    local other_ldflags
1281 1358
 
1282 1359
    other_cflags="`gcc_cflags_value "${name}"`"
1283
-   other_cppflags="`gcc_cppflags_value "${name}"`"
1360
+   other_cxxflags="`gcc_cxxflags_value "${name}"`"
1284 1361
    other_ldflags="`gcc_ldflags_value "${name}"`"
1285 1362
 
1286 1363
    if [ ! -z "${other_cflags}" ]
1287 1364
    then
1288 1365
       other_cflags="OTHER_CFLAGS=${other_cflags}"
1289 1366
    fi
1290
-   if [ ! -z "${other_cppflags}" ]
1367
+   if [ ! -z "${other_cxxflags}" ]
1291 1368
    then
1292
-      other_cppflags="OTHER_CPPFLAGS=${other_cppflags}"
1369
+      other_cxxflags="other_cxxflags=${other_cxxflags}"
1293 1370
    fi
1294 1371
    if [ ! -z "${other_ldflags}" ]
1295 1372
    then
... ...
@@ -1391,14 +1468,14 @@ ADDICTIONS_DIR='${owd}/${REFERENCE_ADDICTION_SUBDIR}' \
1391 1468
 ONLY_ACTIVE_ARCH=${ONLY_ACTIVE_ARCH:-NO} \
1392 1469
 ${skip_install} \
1393 1470
 ${other_cflags} \
1394
-${other_cppflags} \
1471
+${other_cxxflags} \
1395 1472
 ${other_ldflags} \
1396 1473
 ${XCODEBUILD_FLAGS} \
1397 1474
 HEADER_SEARCH_PATHS='${dependencies_header_search_path}' \
1398 1475
 LIBRARY_SEARCH_PATHS='${dependencies_lib_search_path}' \
1399 1476
 FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
1400 1477
 
1401
-      logging_eval_exekutor "${cmdline}" > "${logfile}" \
1478
+      PATH="${BUILDPATH}" logging_eval_exekutor "${cmdline}" > "${logfile}" \
1402 1479
       || build_fail "${logfile}" "${toolname}"
1403 1480
 
1404 1481
       set +f
... ...
@@ -1548,7 +1625,7 @@ ${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
1548 1625
 ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1549 1626
 \"${builddir}\" ..."
1550 1627
 
1551
-      run_log_build_script "${owd}/${script}" \
1628
+      PATH="${BUILDPATH}" run_log_build_script "${owd}/${script}" \
1552 1629
          "${configuration}" \
1553 1630
          "${owd}/${srcdir}" \
1554 1631
          "${owd}/${builddir}" \
... ...
@@ -1616,24 +1693,44 @@ configure"`"
1616 1693
    sdks=`read_build_root_setting "sdks" "Default"`
1617 1694
    [ ! -z "${sdks}" ] || fail "setting \"sdks\" must at least contain \"Default\" to build anything"
1618 1695
 
1619
-   MAKE="`find_make`"
1620
-   CMAKE="`find_cmake`"
1696
+
1697
+   local generator
1621 1698
 
1622 1699
    case "${UNAME}" in
1623 1700
       MINGW*)
1624
-         CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "NMake Makefiles"`"
1701
+         MAKE="`find_make "${name}" "mingw32-make"`"
1702
+         case "${MAKE}" in
1703
+            n*|N*)
1704
+               generator="NMake Makefiles"
1705
+            ;;
1706
+            mingw*|MINGW*)
1707
+               generator="MinGW Makefiles"
1708
+            ;;
1709
+            *)
1710
+               generator="MSYS Makefiles"
1711
+            ;;
1712
+         esac
1713
+
1714
+         CMAKE="`find_cmake "${name}"`"
1715
+         # default use mingw32-make
1716
+         # except if the settings specify otherwise
1625 1717
       ;;
1626 1718
 
1627 1719
       Darwin)
1628 1720
          XCODEBUILD="`find_xcodebuild`"
1629
-         CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "Unix Makefiles"`"
1721
+         generator="Unix Makefiles"
1722
+         MAKE="`find_make "${name}"`"
1723
+         CMAKE="`find_cmake "${name}"`"
1630 1724
       ;;
1631 1725
 
1632 1726
       *)
1633
-         CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "Unix Makefiles"`"
1727
+         generator="Unix Makefiles"
1728
+         MAKE="`find_make "${name}"`"
1729
+         CMAKE="`find_cmake "${name}"`"
1634 1730
       ;;
1635 1731
    esac
1636 1732
 
1733
+   CMAKE_GENERATOR="`read_build_setting "${name}" "cmake_generator" "${generator}"`"
1637 1734
 
1638 1735
    local builddir
1639 1736
    local hasbuilt
... ...
@@ -1720,7 +1817,7 @@ configure"`"
1720 1817
                fi
1721 1818
                if [ -x "${srcdir}/configure" ]
1722 1819
                then
1723
-                  if [ ! -x "${MAKE}" ]
1820
+                  if [ -z "${MAKE}" ]
1724 1821
                   then
1725 1822
                      log_warning "Found a configure, but make is not installed"
1726 1823
                   else
... ...
@@ -1735,7 +1832,7 @@ configure"`"
1735 1832
             then
1736 1833
                if [ -f "${srcdir}/CMakeLists.txt" ]
1737 1834
                then
1738
-                  if [ ! -x "${CMAKE}" ]
1835
+                  if [ -z "${CMAKE}" ]
1739 1836
                   then
1740 1837
                      log_warning "Found a CMakeLists.txt, but cmake is not installed"
1741 1838
                   else
... ...
@@ -30,7 +30,7 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 MULLE_BOOTSTRAP_CLEAN_SH="included"
32 32
 
33
-[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
33
+[ -z "${MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH}" ] && . mulle-bootstrap-build-environment.sh
34 34
 
35 35
 
36 36
 clean_usage()
... ...
@@ -42,6 +42,7 @@ MULLE_BOOTSTRAP_FETCH_SH="included"
42 42
 [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh
43 43
 [ -z "${MULLE_BOOTSTRAP_SCM_SH}" ] && . mulle-bootstrap-scm.sh
44 44
 [ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
45
+[ -z "${MULLE_BOOTSTRAP_WARTN_SCRIPTS_SH}" ] && . mulle-bootstrap-warn-scripts.sh
45 46
 [ -z "${MULLE_BOOTSTRAP_AUTO_UPDATE_SH}" ] && . mulle-bootstrap-auto-update.sh
46 47
 [ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
47 48
 
... ...
@@ -594,7 +595,7 @@ checkout()
594 595
 
595 596
       scmflags="`read_repo_setting "${name}" "checkout" "${scmflagsdefault}"`"
596 597
       "${operation}" "${src}" "${dstdir}" "${branch}" "${tag}" "${scmflags}"
597
-      mulle-bootstrap-warn-scripts.sh "${dstdir}/.bootstrap" "${dstdir}" || fail "Ok, aborted"  #sic
598
+      warn_scripts_main "${dstdir}/.bootstrap" "${dstdir}" || fail "Ok, aborted"  #sic
598 599
    fi
599 600
 }
600 601
 
... ...
@@ -1397,4 +1398,3 @@ fetch_main()
1397 1398
       fi
1398 1399
    fi
1399 1400
 }
1400
-
... ...
@@ -29,116 +29,10 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 
32
+[ ! -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && echo "double inclusion of functions" >&2 && exit 1
32 33
 MULLE_BOOTSTRAP_FUNCTIONS_SH="included"
33 34
 
34
-# Escape sequence and resets, should use tput here instead of ANSI
35
-
36
-if [ "${MULLE_BOOTSTRAP_NO_COLOR}" != "YES" ]
37
-then
38
-   case `uname` in
39
-      Darwin|Linux|FreeBSD|MINGW*)
40
-         C_RESET="\033[0m"
41
-
42
-         # Useable Foreground colours, for black/white white/black
43
-         C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
44
-         C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
45
-         C_CYAN="\033[0;36m"
46
-
47
-         C_BR_RED="\033[0;91m"
48
-         C_BOLD="\033[1m"
49
-         C_FAINT="\033[2m"
50
-
51
-         C_RESET_BOLD="${C_RESET}${C_BOLD}"
52
-         trap 'printf "${C_RESET}"' TERM EXIT
53
-         ;;
54
-   esac
55
-fi
56
-
57
-
58
-C_ERROR="${C_RED}${C_BOLD}"
59
-log_error()
60
-{
61
-   printf "${C_ERROR}%b${C_RESET}\n" "$*" >&2
62
-}
63
-
64
-
65
-C_WARNING="${C_MAGENTA}${C_BOLD}"
66
-log_warning()
67
-{
68
-   if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
69
-   then
70
-      printf "${C_WARNING}%b${C_RESET}\n" "$*" >&2
71
-   fi
72
-}
73
-
74
-
75
-C_INFO="${C_CYAN}${C_BOLD}"
76
-log_info()
77
-{
78
-   if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
79
-   then
80
-      printf "${C_INFO}%b${C_RESET}\n" "$*" >&2
81
-   fi
82
-}
83
-
84
-
85
-C_VERBOSE="${C_GREEN}${C_BOLD}"
86
-log_verbose()
87
-{
88
-   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES"  ]
89
-   then
90
-      printf "${C_VERBOSE}%b${C_RESET}\n" "$*" >&2
91
-   fi
92
-}
93
-
94
-
95
-C_FLUFF="${C_GREEN}${C_BOLD}"
96
-log_fluff()
97
-{
98
-   if [ "${MULLE_BOOTSTRAP_FLUFF}" = "YES"  ]
99
-   then
100
-      printf "${C_FLUFF}%b${C_RESET}\n" "$*" >&2
101
-   fi
102
-}
103
-
104
-
105
-C_TRACE="${C_FLUFF}${C_FAINT}"
106
-log_trace()
107
-{
108
-   printf "${C_TRACE}%b${C_RESET}\n" "$*" >&2
109
-}
110
-
111
-
112
-C_TRACE2="${C_RESET}${C_FAINT}"
113
-log_trace2()
114
-{
115
-   printf "${C_TRACE2}%b${C_RESET}\n" "$*" >&2
116
-}
117
-
118
-
119
-#
120
-# some common functions
121
-#
122
-fail()
123
-{
124
-   log_error "$@"
125
-   if [ ! -z "${MULLE_BOOTSTRAP_PID}" ]
126
-   then
127
-      kill -INT "${MULLE_BOOTSTRAP_PID}"  # kill myself (especially, if executing in subshell)
128
-      if [ $$ -ne ${MULLE_BOOTSTRAP_PID} ]
129
-      then
130
-         kill -INT $$  # actually useful
131
-      fi
132
-   fi
133
-   exit 1        # paranoia
134
-   # don't ask me why the fail message is printed twice
135
-}
136
-
137
-
138
-internal_fail()
139
-{
140
-   fail "${C_RED}*** internal error: ${C_BR_RED}$*"
141
-}
35
+[ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
142 36
 
143 37
 
144 38
 eval_exekutor()
... ...
@@ -187,6 +81,49 @@ logging_exekutor()
187 81
 }
188 82
 
189 83
 
84
+run_script()
85
+{
86
+   local script
87
+
88
+   script="$1"
89
+   shift
90
+
91
+   [ ! -z "$script" ] || internal_fail "script is empty"
92
+
93
+   if [ -x "${script}" ]
94
+   then
95
+      log_verbose "Executing script ${C_RESET_BOLD}${script}${C_VERBOSE} $1 ..."
96
+      if  [ "${MULLE_BOOTSTRAP_TRACE_SCRIPT_CALLS}" = "YES" ]
97
+      then
98
+         echo "ARGV=" "$@" >&2
99
+         echo "DIRECTORY=$PWD/$3" >&2
100
+         echo "ENVIRONMENT=" >&2
101
+         echo "{" >&2
102
+         env | sed 's/^\(.\)/   \1/' >&2
103
+         echo "}" >&2
104
+      fi
105
+      exekutor "${script}" "$@" || fail "script \"${script}\" did not run successfully"
106
+   else
107
+      if [ ! -e "${script}" ]
108
+      then
109
+         fail "script \"${script}\" not found ($PWD)"
110
+      else
111
+         fail "script \"${script}\" not executable"
112
+      fi
113
+   fi
114
+}
115
+
116
+
117
+run_log_script()
118
+{
119
+   echo "$@"
120
+   run_script "$@"
121
+}
122
+
123
+
124
+#
125
+#
126
+#
190 127
 is_yes()
191 128
 {
192 129
    local s
... ...
@@ -475,8 +412,8 @@ remove_file_if_present()
475 412
 
476 413
 modification_timestamp()
477 414
 {
478
-   case "`uname`" in
479
-      Linux )
415
+   case "${UNAME}" in
416
+      Linux|MINGW)
480 417
          stat --printf "%Y\n" "$1"
481 418
          ;;
482 419
       * )
... ...
@@ -881,45 +818,6 @@ lso()
881 818
 }
882 819
 
883 820
 
884
-run_script()
885
-{
886
-   local script
887
-
888
-   script="$1"
889
-   shift
890
-
891
-   [ ! -z "$script" ] || internal_fail "script is empty"
892
-
893
-   if [ -x "${script}" ]
894
-   then
895
-      log_verbose "Executing script ${C_RESET_BOLD}${script}${C_VERBOSE} $1 ..."
896
-      if  [ "${MULLE_BOOTSTRAP_TRACE_SCRIPT_CALLS}" = "YES" ]
897
-      then
898
-         echo "ARGV=" "$@" >&2
899
-         echo "DIRECTORY=$PWD/$3" >&2
900
-         echo "ENVIRONMENT=" >&2
901
-         echo "{" >&2
902
-         env | sed 's/^\(.\)/   \1/' >&2
903
-         echo "}" >&2
904
-      fi
905
-      exekutor "${script}" "$@" || fail "script \"${script}\" did not run successfully"
906
-   else
907
-      if [ ! -e "${script}" ]
908
-      then
909
-         fail "script \"${script}\" not found ($PWD)"
910
-      else
911
-         fail "script \"${script}\" not executable"
912
-      fi
913
-   fi
914
-}
915
-
916
-
917
-run_log_script()
918
-{
919
-   echo "$@"
920
-   run_script "$@"
921
-}
922
-
923 821
 
924 822
 has_usr_local_include()
925 823
 {
... ...
@@ -969,22 +867,6 @@ ensure_clones_directory()
969 867
 }
970 868
 
971 869
 
972
-get_core_count()
973
-{
974
-    count="`nproc 2> /dev/null`"
975
-    if [ -z "$count" ]
976
-    then
977
-       count="`sysctl -n hw.ncpu 2> /dev/null`"
978
-    fi
979
-
980
-    if [ -z "$count" ]
981
-    then
982
-       count=2
983
-    fi
984
-    echo $count
985
-}
986
-
987
-
988 870
 append_dir_to_gitignore_if_needed()
989 871
 {
990 872
    grep -s -x "$1/" .gitignore > /dev/null 2>&1
... ...
@@ -1001,8 +883,8 @@ which_binary()
1001 883
    local toolname
1002 884
 
1003 885
    toolname="$1"
1004
-   case "`uname`" in
1005
-      MINGW*)
886
+   case "${UNAME}" in
887
+      MINGW)
1006 888
          toolname="${toolname}.exe"
1007 889
          ;;
1008 890
    esac
... ...
@@ -1035,13 +917,12 @@ add_path()
1035 917
    local path
1036 918
 
1037 919
    [ -z "${PATH_SEPARATOR}" ] && fail "PATH_SEPARATOR is undefined"
1038
-   [ -z "${UNAME}" ] && fail "UNAME is undefined"
1039 920
 
1040 921
    line="${1}"
1041 922
    path="${2}"
1042 923
 
1043 924
    case "${UNAME}" in
1044
-      MINGW*)
925
+      MINGW)
1045 926
          path="`echo "${path}" | tr '/' '\\' 2> /dev/null`"
1046 927
       ;;
1047 928
    esac
... ...
@@ -37,7 +37,7 @@ gcc_sdk_parameter()
37 37
    sdk="$1"
38 38
 
39 39
    local sdkpath
40
-   if [ "`uname`" = "Darwin" ]
40
+   if [ "${UNAME}" = "Darwin" ]
41 41
    then
42 42
       if [ "${sdk}" = "Default" ]
43 43
       then
... ...
@@ -80,7 +80,7 @@ gcc_cflags_value()
80 80
 }
81 81
 
82 82
 
83
-gcc_cppflags_value()
83
+gcc_cxxflags_value()
84 84
 {
85 85
    local value
86 86
    local result
... ...
@@ -88,7 +88,7 @@ gcc_cppflags_value()
88 88
 
89 89
    name="${1}"
90 90
 
91
-   result="`read_build_setting "${name}" "OTHER_CPPFLAGS"`"
91
+   result="`read_build_setting "${name}" "OTHER_CXXFLAGS"`"
92 92
    value="`gcc_cflags_value "${name}"`"
93 93
    result="`concat "$result" "$value"`"
94 94
 
... ...
@@ -31,7 +31,7 @@
31 31
 
32 32
 MULLE_BOOTSTRAP_INSTALL_SH="included"
33 33
 
34
-[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
34
+[ -z "${MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH}" ] && . mulle-bootstrap-build-environment.sh
35 35
 
36 36
 
37 37
 install_usage()
... ...
@@ -299,7 +299,7 @@ install_main()
299 299
    PREFIX="${1:-${DEFAULT_PREFIX}}"
300 300
    [ $# -eq 0 ] || shift
301 301
 
302
-   case "`uname`" in
302
+   case "${UNAME}" in
303 303
       *)
304 304
          INSTALL_FRAMEWORKS="NO"
305 305
          ;;
... ...
@@ -28,6 +28,8 @@
28 28
 #   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31
+#
32
+
31 33
 MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH="included"
32 34
 
33 35
 MULLE_BOOTSTRAP_EXEC_VERSION=2.0  # paranoia
... ...
@@ -42,25 +44,43 @@ fi
42 44
 # read local environment
43 45
 # source this file
44 46
 #
45
-if [ -z "${BOOTSTRAP_SUBDIR}" ]
46
-then
47
-   BOOTSTRAP_SUBDIR=.bootstrap
48
-fi
47
+BOOTSTRAP_SUBDIR=.bootstrap
48
+# can't rename this because of embedded reposiories
49
+CLONES_SUBDIR=.repos
50
+# future: shared dependencies folder for many projects
51
+#RELATIVE_ROOT=""
52
+
53
+CLONESFETCH_SUBDIR="${CLONES_SUBDIR}"
54
+DEPENDENCY_SUBDIR="${RELATIVE_ROOT}dependencies"
55
+ADDICTION_SUBDIR="${RELATIVE_ROOT}addictions"
49 56
 
50 57
 [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
51
-[ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
52 58
 
53 59
 
54
-UNAME="`uname`"
55
-log_fluff "${UNAME} detected"
60
+#
61
+# simplify UNAME from MINGW64_NT-10.0 to MINGW
62
+# others should be ok
63
+#
64
+get_core_count()
65
+{
66
+    count="`nproc 2> /dev/null`"
67
+    if [ -z "$count" ]
68
+    then
69
+       count="`sysctl -n hw.ncpu 2> /dev/null`"
70
+    fi
71
+
72
+    if [ -z "$count" ]
73
+    then
74
+       count=2
75
+    fi
76
+    echo $count
77
+}
56 78
 
57
-# get number of cores, use 50% more for make -j
58
-case "${UNAME}" in
59
-   MINGW*)
60
-      setup_mingw_environment
61 79
 
62
-      PATH_SEPARATOR=';'
63
-      BUILD_PWD_OPTIONS="-PW"
80
+log_fluff "${UNAME} detected"
81
+case "${UNAME}" in
82
+   MINGW)
83
+      [ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
64 84
 
65 85
       # be verbose by default on MINGW because its so slow
66 86
       if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
... ...
@@ -72,106 +92,28 @@ case "${UNAME}" in
72 92
       then
73 93
          MULLE_BOOTSTRAP_SKIP_INITIAL_REFRESH="YES"
74 94
       fi      
95
+
96
+      setup_mingw_environment
97
+
98
+      BUILDPATH="`mingw_buildpath "$PATH"`"
99
+
100
+      PATH_SEPARATOR=';'
101
+      BUILD_PWD_OPTIONS="-PW"
102
+   ;;
103
+
104
+   "")
105
+      fail "UNAME not set"
75 106
    ;;
76 107
 
77 108
    *)
109
+      # get number of cores, use 50% more for make -j
78 110
       CORES="`get_core_count`"
79 111
       CORES="`expr $CORES + $CORES / 2`"
80 112
 
81 113
       PATH_SEPARATOR=':'
82 114
       BUILD_PWD_OPTIONS="-P"
83
-      ;;
84
-esac
85 115
 
86
-case "${MULLE_BOOTSTRAP_TRACE}" in
87
-   VERBOSE)
88
-      MULLE_BOOTSTRAP_FLUFF="NO"
89
-      MULLE_BOOTSTRAP_TRACE="NO"
90
-      MULLE_BOOTSTRAP_VERBOSE="YES"
91
-      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
92
-      then
93
-         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
94
-      fi
95
-      ;;
96
-
97
-   FLUFF)
98
-      MULLE_BOOTSTRAP_FLUFF="YES"
99
-      MULLE_BOOTSTRAP_TRACE="NO"
100
-      MULLE_BOOTSTRAP_VERBOSE="YES"
101
-      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
102
-      then
103
-         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
104
-      fi
105
-      ;;
106
-
107
-   TRACE)
108
-      MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
109
-      MULLE_BOOTSTRAP_FLUFF="YES"
110
-      MULLE_BOOTSTRAP_VERBOSE="YES"
111
-      MULLE_BOOTSTRAP_TRACE="YES"
112
-      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
113
-      then
114
-         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
115
-      fi
116
-      log_trace "FULL trace started"
117
-      ;;
118
-
119
-   1848)
120
-      MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
121
-      MULLE_BOOTSTRAP_TRACE_SETTINGS="NO"
122
-      MULLE_BOOTSTRAP_FLUFF="NO"
123
-      MULLE_BOOTSTRAP_TRACE="NO"
124
-      MULLE_BOOTSTRAP_VERBOSE="NO"
125
-      MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
126
-      log_trace "1848 trace (set -x) started"
127
-      set -x
128
-      ;;
116
+      BUILDPATH="$PATH"
117
+   ;;
129 118
 esac
130 119
 
131
-
132
-if [ "${MULLE_BOOTSTRAP_DRY_RUN}" = "YES" ]
133
-then
134
-   log_trace "Dry run is active."
135
-fi
136
-
137
-# can't rename this because of embedded reposiories
138
-CLONES_SUBDIR=.repos
139
-
140
-# future: shared dependencies folder for many projects
141
-
142
-RELATIVE_ROOT=""
143
-
144
-CLONESBUILD_SUBDIR=`read_sane_config_path_setting "build_foldername" "${RELATIVE_ROOT}build/.repos"`
145
-DEPENDENCY_SUBDIR=`read_sane_config_path_setting "output_foldername" "${RELATIVE_ROOT}dependencies"`
146
-ADDICTION_SUBDIR=`read_sane_config_path_setting "brew_foldername" "${RELATIVE_ROOT}addictions"`
147
-BUILDLOG_SUBDIR=`read_sane_config_path_setting "build_log_foldername" "${CLONESBUILD_SUBDIR}/.logs"`
148
-
149
-
150
-if [ "${CLONESFETCH_SUBDIR}" = "" ]
151
-then
152
-   CLONESFETCH_SUBDIR="${CLONES_SUBDIR}"
153
-fi
154
-
155
-
156
-#
157
-# some checks
158
-#
159
-[ -z "${BOOTSTRAP_SUBDIR}" ]     && internal_fail "variable BOOTSTRAP_SUBDIR is empty"
160
-[ -z "${CLONES_SUBDIR}" ]        && internal_fail "variable CLONES_SUBDIR is empty"
161
-[ -z "${CLONESBUILD_SUBDIR}" ]   && internal_fail "variable CLONESBUILD_SUBDIR is empty"
162
-[ -z "${BUILDLOG_SUBDIR}" ]      && internal_fail "variable BUILDLOG_SUBDIR is empty"
163
-[ -z "${DEPENDENCY_SUBDIR}" ]    && internal_fail "variable DEPENDENCY_SUBDIR is empty"
164
-[ -z "${ADDICTION_SUBDIR}" ]     && internal_fail "variable ADDICTION_SUBDIR is empty"
165
-
166
-#
167
-# Global Settings
168
-#
169
-HEADER_DIR_NAME="`read_config_setting "header_dir_name" "include"`"
170
-LIBRARY_DIR_NAME="`read_config_setting "library_dir_name" "lib"`"
171
-FRAMEWORK_DIR_NAME="`read_config_setting "framework_dir_name" "Frameworks"`"
172
-
173
-
174
-#
175
-# dont export stuff for scripts
176
-# if scripts want it, they should source this file
177
-#
178 120
new file mode 100644
... ...
@@ -0,0 +1,153 @@
1
+#! /bin/sh
2
+#
3
+#   Copyright (c) 2015 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+
32
+[ ! -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && echo "double inclusion of logging" >&2 && exit 1
33
+MULLE_BOOTSTRAP_LOGGING_SH="included"
34
+
35
+
36
+#
37
+# need this for scripts also
38
+#
39
+if [ -z "${UNAME}" ] 
40
+then
41
+   UNAME="`uname | cut -d_ -f1 | sed 's/64$//'`"
42
+fi
43
+
44
+
45
+# Escape sequence and resets, should use tput here instead of ANSI
46
+
47
+
48
+if [ "${MULLE_BOOTSTRAP_NO_COLOR}" != "YES" ]
49
+then
50
+   case "${UNAME}" in
51
+      *)
52
+         C_RESET="\033[0m"
53
+
54
+         # Useable Foreground colours, for black/white white/black
55
+         C_RED="\033[0;31m"     C_GREEN="\033[0;32m"
56
+         C_BLUE="\033[0;34m"    C_MAGENTA="\033[0;35m"
57
+         C_CYAN="\033[0;36m"
58
+
59
+         C_BR_RED="\033[0;91m"
60
+         C_BOLD="\033[1m"
61
+         C_FAINT="\033[2m"
62
+
63
+         C_RESET_BOLD="${C_RESET}${C_BOLD}"
64
+         trap 'printf "${C_RESET}"' TERM EXIT
65
+         ;;
66
+   esac
67
+fi
68
+
69
+
70
+C_ERROR="${C_RED}${C_BOLD}"
71
+log_error()
72
+{
73
+   printf "${C_ERROR}%b${C_RESET}\n" "$*" >&2
74
+}
75
+
76
+
77
+C_WARNING="${C_MAGENTA}${C_BOLD}"
78
+log_warning()
79
+{
80
+   if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
81
+   then
82
+      printf "${C_WARNING}%b${C_RESET}\n" "$*" >&2
83
+   fi
84
+}
85
+
86
+
87
+C_INFO="${C_CYAN}${C_BOLD}"
88
+log_info()
89
+{
90
+   if [ "${MULLE_BOOTSTRAP_TERSE}" != "YES" ]
91
+   then
92
+      printf "${C_INFO}%b${C_RESET}\n" "$*" >&2
93
+   fi
94
+}
95
+
96
+
97
+C_VERBOSE="${C_GREEN}${C_BOLD}"
98
+log_verbose()
99
+{
100
+   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES"  ]
101
+   then
102
+      printf "${C_VERBOSE}%b${C_RESET}\n" "$*" >&2
103
+   fi
104
+}
105
+
106
+
107
+C_FLUFF="${C_GREEN}${C_BOLD}"
108
+log_fluff()
109
+{
110
+   if [ "${MULLE_BOOTSTRAP_FLUFF}" = "YES"  ]
111
+   then
112
+      printf "${C_FLUFF}%b${C_RESET}\n" "$*" >&2
113
+   fi
114
+}
115
+
116
+
117
+C_TRACE="${C_FLUFF}${C_FAINT}"
118
+log_trace()
119
+{
120
+   printf "${C_TRACE}%b${C_RESET}\n" "$*" >&2
121
+}
122
+
123
+
124
+C_TRACE2="${C_RESET}${C_FAINT}"
125
+log_trace2()
126
+{
127
+   printf "${C_TRACE2}%b${C_RESET}\n" "$*" >&2
128
+}
129
+
130
+
131
+#
132
+# some common fail log functions
133
+#
134
+fail()
135
+{
136
+   log_error "$@"
137
+   if [ ! -z "${MULLE_BOOTSTRAP_PID}" ]
138
+   then
139
+      kill -INT "${MULLE_BOOTSTRAP_PID}"  # kill myself (especially, if executing in subshell)
140
+      if [ $$ -ne ${MULLE_BOOTSTRAP_PID} ]
141
+      then
142
+         kill -INT $$  # actually useful
143
+      fi
144
+   fi
145
+   exit 1        # paranoia
146
+   # don't ask me why the fail message is printed twice
147
+}
148
+
149
+
150
+internal_fail()
151
+{
152
+   fail "${C_RED}*** internal error: ${C_BR_RED}$*"
153
+}
... ...
@@ -106,3 +106,37 @@ setup_mingw_environment()
106 106
    fi
107 107
 }
108 108
 
109
+
110
+#
111
+# mingw32-make can't have sh.exe in its path
112
+#
113
+mingw_buildpath()
114
+{
115
+   local old
116
+   local i
117
+   local fetchpath
118
+   local match
119
+
120
+   old="${IFS}"
121
+
122
+   IFS=":" 
123
+   for i in $PATH
124
+   do
125
+      if [ -x "${i}/sh.exe" ]
126
+      then
127
+         log_fluff "Remove \"$i\" from build PATH because it contains sh"
128
+         continue
129
+      fi
130
+
131
+      if [ -z "${fetchpath}" ]
132
+      then
133
+         fetchpath="${i}"
134
+      else
135
+         fetchpath="${fetchpath}:${i}"
136
+      fi
137
+   done
138
+
139
+   IFS="${old}"
140
+
141
+   echo "${fetchpath}"
142
+}
... ...
@@ -463,7 +463,7 @@ read_fetch_setting()
463 463
    value="`_read_bootstrap_setting "${name}" ".auto" ".local"`"
464 464
    if [ $? -ne 0 ]
465 465
    then
466
-      os="${UNAME:-`uname`}"
466
+      os="${UNAME}"
467 467
       value="`_read_bootstrap_setting "${name}.${os}" ""`"
468 468
       if [ $? -ne 0 ]
469 469
       then
... ...
@@ -84,7 +84,7 @@ warn_scripts()
84 84
                log_warning "$phases" >&2
85 85
 
86 86
                log_info "To view them inline install \"ack\""
87
-               case "`uname`" in
87
+               case "${UNAME}" in
88 88
                   Darwin|Linux)
89 89
                      log_info "   brew install ack" >&2
90 90
                      ;;
... ...
@@ -33,7 +33,7 @@ MULLE_BOOTSTRAP_XCODE_SH="included"
33 33
 # lib files can be added in a sensible order
34 34
 #
35 35
 
36
-[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
36
+[ -z "${MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH}" ] && . mulle-bootstrap-build-environment.sh
37 37
 [ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh
38 38
 
39 39