Browse code

pretty much a rewrite of the settings game

Nat! authored on 04-09-2016 16:35:58
Showing 28 changed files
... ...
@@ -1,6 +1,9 @@
1 1
 2.0
2 2
 ===
3 3
 
4
+YOUR OLD STUFF MAY NOT RUN ANYMORE!
5
+Do a `mulle-bootstrap dist clean`. 
6
+
4 7
 * Add pre-build.sh script phase (for libcurl really)
5 8
 * Brew formulas are now installed locally into "addictions". A folder which
6 9
 lies besides "dependencies". This is a pretty huge change. By removing pips and
... ...
@@ -21,6 +24,8 @@ symlinks available.  This meant that I had to redo the whole settings
21 24
 inheritance scheme.
22 25
 * -v is now more interesting to watch
23 26
 * renamed build setting OTHER_CPPFLAGS to OTHER_CXXFLAGS (!)
27
+* UNAME is now simplified and lowercased(!)
28
+* redid the settings merge and inheritance logic. It's now a bit more scrutable.
24 29
 
25 30
 
26 31
 1.1
... ...
@@ -4,46 +4,56 @@
4 4
 > <font color="green">**Important: Setting values are delimited by LF.**</font>
5 5
 
6 6
 
7
-Build Settings (Global only)
7
+# Golden Rules
8
+
9
+* any **file** in `.bootstrap/` is mergable except `embedded_repositories`
10
+* a directory `.bootstrap.local/config` is used, but `.bootstrap/config` will be ignored
11
+* anything else is inheritable, but will not be merged
12
+
13
+
14
+Mergable Settings 
8 15
 ===================
9 16
 
10
-#### Search Paths
17
+1. `.bootstrap.local` (Merge)
18
+2. `.bootstrap`       (Merge)
11 19
 
12
-1. `.bootstrap.auto/settings`
13
-2. `.bootstrap.local/settings`
14
-3. `.bootstrap/settings`
15 20
 
16
-#### Settings
21
+##### Fetch Settings
17 22
 
23
+Setting Name            |  Description
24
+------------------------|----------------------------------------
25
+`brews`                 | Homebrew formulae to install
26
+`repositories`          | Repositories to clone, specify the URLs
27
+`embedded_repositories` | Repositories to embed, specify the URLs
28
+`taps`                  | Homebrew taps to install
29
+`tarballs`              | Tarballs to install (currently filesystem only)
30
+                        |
31
+
32
+##### Build Settings
33
+
34
+All build settings are searched OS specific first and then globally.
35
+Example: on OS X, "build_ignore.darwin" will be searched first followed
36
+by a search for "build_ignore".
37
+
38
+Setting Name            |  Description
39
+------------------------|----------------------------------------
40
+`build_ignore`          | repositories not to build            
18 41
 
19
-Setting Name              | Description                           |  Default
20
-`build_ignore`            | repositories not to build             |
21
-`build_order`             | repositories to build in that order.  |
22
-                          | You only need to specify those, that  |
23
-                          | need ordering. Otherwise              |
24
-                          | mulle-bootstrap builds in default `ls`|
25
-                          | sort order by name.                   |
26
-`configurations`          | configurations to build               | Debug\nRelease
27
-`sdks`                    | SDKs to build                         | Default
28 42
 
29 43
 
30 44
 Build Settings
31 45
 ===================
32 46
 
33
-These settings are usually repository specific, but can be set globally also. If they are
34
-specified globally, they won't be inheritable by other projects bootstrapping this project
35
-as a repository.
47
+These settings are usually repository specific, but can be set globally also. 
36 48
 
37 49
 #### Search Paths
38 50
 
39
-1. `.bootstrap.local/${reponame}/settings`
40
-2. `.bootstrap/${reponame}/settings`
41
-3. `.bootstrap.auto/${reponame}/settings`
51
+1. `.bootstrap.local/${reponame}/settings`  (Inherit)
52
+2. `.bootstrap/${reponame}/settings`        (Inherit)
53
+
54
+4. `.bootstrap.local/settings`              (Inherit)
55
+5. `.bootstrap/settings`                    (Inherit)
42 56
 
43
-4. `.bootstrap.auto/settings`
44
-5. `.bootstrap.local/settings`
45
-6. `.bootstrap/settings`
46 57
 
47 58
 #### Settings
48 59
 
... ...
@@ -51,7 +61,8 @@ Setting Name                     |  Description                               |
51 61
 ---------------------------------|--------------------------------------------|---------------
52 62
 `build_preferences`              | list order of preferred build tools. Will  |
53 63
                                  | be used in deciding if to use cmake or     |
54
-                                 | xcodebuild, if both are available          |  config setting
64
+                                 | xcodebuild, if both are available          | config setting
65
+`configurations`                 | configurations to build                    | config setting
55 66
 `${configuration}.map`           | rename configuration for xcodebuild        |
56 67
 `cmake-${configuration}.map`     | rename configuration for cmake             |
57 68
 `configure-${configuration}.map` | rename configuration for configure         |
... ...
@@ -63,6 +74,7 @@ Setting Name                     |  Description                               |
63 74
                                  | (excluding libraries, frameworks and headers),|
64 75
                                  | relative to dependencies                   | `/usr/local`
65 76
 `dispense_other_product`         | if the build should dispense other files   | NO
77
+`sdks`                           | SDKs to build                              | config setting
66 78
 `xcode_proper_skip_install`      | assume SKIP_INSTALL is set correctly in    |
67 79
                                  | Xcode project                              | NO
68 80
 `xcode_public_headers`           | Substitute for PUBLIC_HEADERS_FOLDER_PATH  |
... ...
@@ -77,44 +89,43 @@ Setting Name                     |  Description                               |
77 89
 
78 90
 
79 91
 
80
-Settings Repository Specific
92
+Repository Specific Settings
81 93
 ===================
82 94
 
83
-
84 95
 #### Search Paths
85 96
 
86
-1. `.bootstrap.local/${reponame}/settings`
87
-2. `.bootstrap/${reponame}/settings`
88
-3. `.bootstrap.auto/${reponame}/settings`
97
+1. `.bootstrap.local/${reponame}/settings`    (Inherit)
98
+2. `.bootstrap/${reponame}/settings`          (Inherit)
89 99
 
90 100
 
91 101
 #### Settings
92 102
 
93 103
 Setting Name     | Used by       | Description
94 104
 -----------------|---------------|---------------------------
95
-`tag`            | fetch         | What to checkout after cloning/symlinking a repository.
96
-`project`        | build,xcode   | The Xcode project file to use
97
-`schemes`        | build         | The Xcode schemes to build
98
-`targets`        | build         | The Xcode targets to build
105
+`tag`            | fetch         | What to checkout after fetching a repository.
106
+`xcode_project`  | build,xcode   | The Xcode project file to use
107
+`xcode_schemes`  | build         | The Xcode schemes to build
108
+`xcode_targets`  | build         | The Xcode targets to build
99 109
 
100 110
 
101
-Fetch Settings
102
-===================
111
+Scripts 
112
+==========================
103 113
 
104
-1. `.bootstrap.auto/settings`
105
-2. `.bootstrap.local/settings`
106
-3. `.bootstrap/settings`
114
+Scripts are run at various times during the fetch, build and tag process.
115
+Root scripts must be aware, that they will be called for every repository.
107 116
 
117
+1. `.bootstrap.local/${reponame}/settings/bin`    (Inherit)
118
+2. `.bootstrap/${reponame}/settings/bin`          (Inherit)
108 119
 
109
-Setting Name            |  Description
110
-`brews`                 | Homebrew formulae to install
111
-`gems`                  | Ruby packages to install with gem
112
-`repositories`          | Repositories to clone, specify the URLs
113
-`embedded_repositories` | Repositories to embed, specify the URLs
114
-`pips`                  | Python packages to install with pip
115
-`taps`                  | Homebrew taps to install
116
-`tarballs`              | Tarballs to install (currently filesystem only)
120
+1. `.bootstrap.local/settings/bin`                (Inherit)
121
+2. `.bootstrap/settings/bin`                      (Inherit)
122
+
123
+`pre-install.sh`
124
+`post-install.sh`
125
+`pre-upgrade.sh`
126
+`post-upgrade.sh`
127
+`pre-tag.sh`
128
+`post-tag.sh`
117 129
 
118 130
 
119 131
 
... ...
@@ -122,16 +133,15 @@ Config Settings
122 133
 ===================
123 134
 
124 135
 Environment variables use the setting name, transformed to upper case and
125
-prepended with "MULLE_BOOTSTRAP_". So preferences is MULLE_BOOTSTRAP_PREFERENCES
126
-in the environment.
136
+prepended with "MULLE_BOOTSTRAP_". So "preferences" is `MULLE_BOOTSTRAP_PREFERENCES`
137
+in the environment. These can only be specified locally. They are not inherited.
127 138
 
128 139
 #### Search Paths
129 140
 
130 141
 1. ENVIRONMENT
131
-2. `.bootstrap.local/config`
132
-3. `.bootstrap/config`
133
-4. `.bootstrap.auto/config`
134
-5. `~/.mulle-bootstrap`
142
+2. `.bootstrap.local/config`    (Private)
143
+3. `~/.mulle-bootstrap`         (Private)
144
+
135 145
 
136 146
 ##### General Settings
137 147
 
... ...
@@ -139,9 +149,6 @@ Setting Name                      |  Description
139 149
 ----------------------------------|-----------------------------------------------|--------------
140 150
 `repos_foldername`                | Where to place cloned repositories            | `.repos`
141 151
 `output_foldername`               | DSTROOT, --prefix of headers and libraries    | `dependencies`
142
-`trace`                           | see `MULLE_BOOTSTRAP_TRACE` for more info     | NO
143
-`terse`                           | set output to less verbose                    | NO
144
-`verbose`                         | set output to more verbose                    | NO
145 152
 `no_warn_environment_setting`     | don't warn when a setting is defined by       |
146 153
                                   | environment                                   | NO
147 154
 `no_warn_local_setting`           | don't warn when a setting is defined by       |
... ...
@@ -155,7 +162,7 @@ Setting Name                      |  Description
155 162
 Setting Name                      |  Description                                  | Default
156 163
 ----------------------------------|-----------------------------------------------|--------------
157 164
 `absolute_symlinks`               | Use absolute symlinks instead of relatives    | NO
158
-`symlink_forbidden`               | mulle-bootstrap will not attempt to symlink   | NO
165
+`symlink_forbidden`               | mulle-bootstrap will not attempt to symlink   | NO (ignored on MINGW)
159 166
 `update_gitignore`                | add cleanable directories to .gitignore       | YES
160 167
 `check_usr_local_include`         | do not install, if a system header of same    |
161 168
                                   | is present in `/usr/local/include`            | NO
... ...
@@ -174,11 +181,13 @@ Setting Name                      |  Description
174 181
 `clean_dependencies_before_build` | usually before a build, mulle-bootstrap       |
175 182
                                   | cleans dependencies to avoid surprising       |
176 183
                                   | worked the second time" builds due to a wrong |
184
+`configurations`                  | configurations to build                       | Release
177 185
 `framework_dir_name`              | name of the Frameworks folder                 | `Frameworks`
178 186
 `header_dir_name`                 | name of the headers folder in dependencies.   |
179 187
                                   | e.g. You dislike "include" and favor          |
180 188
                                   | "headers".                                    | `include`
181 189
 `library_dir_name`                | as above, but for libraries                   | `lib`
190
+`sdks`                            | SDKs to build                                 | Default
182 191
 `skip_collect_and_dispense`       | don't collect and dispense products           | NO
183 192
 `xcodebuild`                      | tool to use instead of xcodebuild (xctool ?)  | `xcodebuild`
184 193
 
... ...
@@ -208,34 +217,3 @@ Setting Name                      |  Description
208 217
                                   | dist                                          | `.repos\n/.bootstrap.auto`
209 218
 `output_clean_folders`            | folders to delete for mulle-bootstrap clean   |
210 219
                                   | output                                        | `dependencies`
211
-
212
-
213
-Fetch Script Settings
214
-==========================
215
-
216
-1. `.bootstrap.auto/settings/bin`
217
-2. `.bootstrap.local/settings/bin`
218
-3. `.bootstrap/settings/bin`
219
-
220
-`pre-install.sh`
221
-`post-install.sh`
222
-`pre-upgrade.sh`
223
-`post-upgrade.sh`
224
-`pre-tag.sh`
225
-`post-tag.sh`
226
-
227
-
228
-Build Script Settings
229
-==========================
230
-
231
-1. `.bootstrap.local/${reponame}/settings/bin`
232
-2. `.bootstrap/${reponame}/settings/bin`
233
-3. `.bootstrap.auto/${reponame}/settings/bin`
234
-
235
-`pre-build.sh`
236
-`pre-install.sh
237
-`post-install.sh`
238
-`pre-upgrade.sh`
239
-`post-upgrade.sh`
240
-`pre-tag.sh`
241
-`post-tag.sh`
... ...
@@ -112,7 +112,7 @@ libexec=${1:-"${prefix}/libexec/mulle-bootstrap"}
112 112
 
113 113
 if [ "$prefix" = "" ] || [ "$bin" = "" ] || [ "$libexec" = "" ] || [ "$mode" = "" ]
114 114
 then
115
-   echo "usage: install.sh [prefix] [mode] [binpath] [libexecpath]"
115
+   echo "usage: install.sh [prefix] [mode] [binpath] [libexecpath]" >&2
116 116
    exit 1
117 117
 fi
118 118
 
... ...
@@ -144,7 +144,6 @@ case `uname` in
144 144
    ;;
145 145
 esac
146 146
 
147
-
148 147
 for i in src/mulle*.sh
149 148
 do
150 149
    mkdir -p "${libexec}" 2> /dev/null
... ...
@@ -35,18 +35,6 @@ MULLE_BOOTSTRAP_VERSION=2.0
35 35
 # This is the main user interface to mulle-bootstrap
36 36
 # sorta like git
37 37
 #
38
-BOOTSTRAP_SUBDIR=.bootstrap
39
-
40
-PATH="/usr/local/libexec/mulle-bootstrap:`pwd -P`/dependencies/bin:`pwd -P`/addictions/bin:$PATH"
41
-export PATH
42
-
43
-MULLE_BOOTSTRAP_PID="$$"
44
-export MULLE_BOOTSTRAP_PID
45
-
46
-# now include this first to get
47
-# logging and UNAME
48
-
49
-[ -z "${MULLE_BOOTSTRAP_LOGGING_SH}" ] && . mulle-bootstrap-logging.sh
50 38
 
51 39
 
52 40
 trap_fail()
... ...
@@ -54,36 +42,31 @@ trap_fail()
54 42
    exit 1
55 43
 }
56 44
 
57
-trap trap_fail INT
58 45
 
59 46
 
60 47
 usage()
61 48
 {
62 49
    cat <<EOF
63
-usage: mulle-bootstrap [-a|-y][-n][-v|-s|-t] [command] [--help]
64
- Flags
50
+usage: mulle-bootstrap [options] [command] [--help]
51
+ Common Options: 
65 52
    -a -y     : default answer to questions (scripts wont be checked)
66
-               -a (clone preferred) -y (symlink preferred)
53
+               -a (clone preferred) -y (local copy/symlink preferred)
67 54
    -n        : do nothing creative or destructive
68
-   -v -s -t  : -v to be more verbose (-vv or -vvv for more verbosity)
69
-               -s to be more terse
70
-               -t turns on shell tracing for development
55
+   -v        : -v to be more verbose (-vv or -vvv for more verbosity)
71 56
    -V        : show build commands
72 57
 
73 58
  Common user commands:
74
-   clone     : git clone a remote repository and try to bootstrap and build it
75 59
    bootstrap : does fetch and build recursively [default]
76
-   nomagic   : does fetch and build, but not recursively
77 60
    clean     : cleans mulle-bootstrap produced files.
78 61
 
79 62
  Common maintainer commands:
80 63
    init      : initializes a bootstrap project
81 64
 EOF
82 65
 
83
-   if [ "${UNAME}" = 'Darwin' ]
66
+   if [ "${UNAME}" = 'darwin' ]
84 67
    then
85 68
       cat <<EOF
86
-   xcode     : sets up the xcodeproj settings
69
+   xcode     : sets up xcodeproj settings
87 70
 EOF
88 71
    fi
89 72
 
... ...
@@ -96,8 +79,6 @@ cat <<EOF
96 79
                the repositories and embedded_repositories files.
97 80
    update    : updates repositories (pull).
98 81
    install   : install dependencies as system headers
99
-
100
- Specify the -h or --help option after each command to get more help.
101 82
 EOF
102 83
    exit 1
103 84
 }
... ...
@@ -129,6 +110,21 @@ bootstrap_main()
129 110
 {
130 111
    local command
131 112
 
113
+   BOOTSTRAP_SUBDIR=.bootstrap
114
+
115
+   PATH="/usr/local/libexec/mulle-bootstrap:`pwd -P`/dependencies/bin:`pwd -P`/addictions/bin:$PATH"
116
+   export PATH
117
+
118
+   MULLE_BOOTSTRAP_PID="$$"
119
+   export MULLE_BOOTSTRAP_PID
120
+
121
+   # now include this first to get
122
+   # logging and UNAME
123
+
124
+   . mulle-bootstrap-logging.sh && logging_initialize
125
+
126
+   trap trap_fail INT
127
+
132 128
    #
133 129
    # simple option handling
134 130
    #
... ...
@@ -140,69 +136,84 @@ bootstrap_main()
140 136
       fi
141 137
 
142 138
       case "$1" in
143
-         -a)
139
+         -a|--prefer-origin)
144 140
             MULLE_BOOTSTRAP_ANSWER="NO"
145 141
           ;;
146 142
 
147
-         -y)
143
+         -y|--prefer-local)
148 144
             MULLE_BOOTSTRAP_ANSWER="YES"
149 145
          ;;
150 146
 
151
-         -f)
147
+         -f|--force-fetch)
152 148
             MULLE_BOOTSTRAP_DIRTY_HARRY="NO"
153 149
          ;;
154 150
 
155
-         -n)
151
+         -n|--dry-run)
156 152
             MULLE_BOOTSTRAP_DRY_RUN="YES"
157 153
          ;;
158 154
 
159
-         -tm)
155
+         -ig|--ignore-graveyard)
156
+            MULLE_BOOTSTRAP_IGNORE_GRAVEYARD="YES"
157
+         ;;
158
+
159
+         -te|--trace-execution)
160
+            MULLE_BOOTSTRAP_TRACE_EXECUTION="YES"
161
+         ;;
162
+
163
+         -tm|--trace-settings-merge)
160 164
             MULLE_BOOTSTRAP_TRACE_MERGE="YES"
161 165
          ;;
162 166
 
163
-         -ts)
167
+         -ts|--trace-scripts)
164 168
             MULLE_BOOTSTRAP_TRACE_SCRIPT_CALLS="YES"
165 169
          ;;
166 170
 
167
-         -t)
171
+         -tt|--trace-ignores-settings)
172
+            MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
173
+         ;;
174
+
175
+         -t|--trace)
168 176
             MULLE_BOOTSTRAP_TRACE="1848"
169 177
             COPYMOVEFLAGS="-v"
170 178
             GITFLAGS="-v"
171 179
          ;;
172 180
 
173
-         -V)
181
+         -V|--verbose-build)
174 182
             MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
175 183
          ;;
176 184
 
177
-
178
-         -v)
185
+         -v|--verbose)
179 186
             MULLE_BOOTSTRAP_TRACE="VERBOSE"
180 187
             COPYMOVEFLAGS="-v"
181 188
             GITFLAGS="-v"
182 189
          ;;
183 190
 
184
-         -vv)
191
+         -vv|--very-verbose)
185 192
             MULLE_BOOTSTRAP_TRACE="FLUFF"
186 193
             COPYMOVEFLAGS="-v"
187 194
             GITFLAGS="-v"
188 195
          ;;
189 196
 
190
-         -vvv)
197
+         -vvv|--very-verbose-with-settings)
191 198
             MULLE_BOOTSTRAP_TRACE="TRACE"
192 199
             COPYMOVEFLAGS="-v"
193 200
             GITFLAGS="-v"
194 201
          ;;
195 202
 
196
-         -r)
203
+         -r|--refresh)
197 204
             MULLE_BOOTSTRAP_SKIP_INITIAL_REFRESH="YES"
198 205
          ;;
199 206
 
200
-         -s)
207
+         -s|--silent)
201 208
             MULLE_BOOTSTRAP_TRACE=
202 209
             MULLE_BOOTSTRAP_TERSE="YES"
203 210
             GITFLAGS="-q"
204 211
          ;;
205 212
 
213
+         -h|--help)
214
+            usage
215
+         ;;
216
+
206 217
          -*)
207 218
             log_error "unknown option \"$1\""
208 219
             usage
... ...
@@ -224,7 +235,6 @@ bootstrap_main()
224 235
    case "${MULLE_BOOTSTRAP_TRACE}" in
225 236
       VERBOSE)
226 237
          MULLE_BOOTSTRAP_FLUFF="NO"
227
-         MULLE_BOOTSTRAP_TRACE="NO"
228 238
          MULLE_BOOTSTRAP_VERBOSE="YES"
229 239
          if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
230 240
          then
... ...
@@ -234,7 +244,6 @@ bootstrap_main()
234 244
 
235 245
       FLUFF)
236 246
          MULLE_BOOTSTRAP_FLUFF="YES"
237
-         MULLE_BOOTSTRAP_TRACE="NO"
238 247
          MULLE_BOOTSTRAP_VERBOSE="YES"
239 248
          if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
240 249
          then
... ...
@@ -244,9 +253,9 @@ bootstrap_main()
244 253
 
245 254
       TRACE)
246 255
          MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
256
+         MULLE_BOOTSTRAP_TRACE_EXECUTION="YES"
247 257
          MULLE_BOOTSTRAP_FLUFF="YES"
248 258
          MULLE_BOOTSTRAP_VERBOSE="YES"
249
-         MULLE_BOOTSTRAP_TRACE="YES"
250 259
          if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
251 260
          then
252 261
             MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
... ...
@@ -255,12 +264,14 @@ bootstrap_main()
255 264
          ;;
256 265
 
257 266
       1848)
258
-         MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
259 267
          MULLE_BOOTSTRAP_TRACE_SETTINGS="NO"
268
+         MULLE_BOOTSTRAP_TRACE_EXECUTION="NO"
260 269
          MULLE_BOOTSTRAP_FLUFF="NO"
261
-         MULLE_BOOTSTRAP_TRACE="NO"
262 270
          MULLE_BOOTSTRAP_VERBOSE="NO"
263
-         MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
271
+         if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
272
+         then
273
+            MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
274
+         fi
264 275
          log_trace "1848 trace (set -x) started"
265 276
          set -x
266 277
          ;;
... ...
@@ -271,9 +282,6 @@ bootstrap_main()
271 282
       log_trace "Dry run is active."
272 283
    fi
273 284
 
274
-   [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
275
-   [ -z "${MULLE_BOOTSTRAP_REFRESH_SH}" ] && . mulle-bootstrap-refresh.sh
276
-
277 285
    #
278 286
    # some commands only run when we have a .bootstrap folder
279 287
    #
... ...
@@ -288,7 +296,7 @@ bootstrap_main()
288 296
    if [ "${MULLE_BOOTSTRAP_DIRTY_HARRY}" != "NO" ]
289 297
    then
290 298
       case "${command}" in
291
-         clean|dist-clean)
299
+         clean|dist-clean|init)
292 300
             :
293 301
          ;;
294 302
          *)
... ...
@@ -302,8 +310,19 @@ bootstrap_main()
302 310
    then
303 311
       case "${command}" in
304 312
          bootstrap|nomagic|setup-xcode|xcode|tag)
313
+           . mulle-bootstrap-refresh.sh  
305 314
             refresh_main || exit 1
306 315
          ;;
316
+
317
+         clean|dist-clean|fetch)
318
+           . mulle-bootstrap-refresh.sh  
319
+
320
+            refresh_main clear || exit 1
321
+         ;;
322
+
323
+         update)
324
+           . mulle-bootstrap-refresh.sh 
325
+         ;;
307 326
       esac
308 327
    fi
309 328
 
... ...
@@ -314,11 +333,10 @@ bootstrap_main()
314 333
             DONT_RECURSE=YES
315 334
          fi
316 335
 
317
-         . mulle-bootstrap-fetch.sh
318
-         . mulle-bootstrap-build.sh
319
-         . mulle-bootstrap-warn-scripts.sh
336
+         . mulle-bootstrap-fetch.sh 
337
+         . mulle-bootstrap-build.sh 
338
+         . mulle-bootstrap-warn-scripts.sh 
320 339
 
321
-         refresh_main clear              || exit 1
322 340
          if [ "${DONT_RECURSE}" = "" ]
323 341
          then
324 342
             fetch_main install "$@"      || exit 1
... ...
@@ -360,21 +378,18 @@ bootstrap_main()
360 378
       clean)
361 379
          . mulle-bootstrap-clean.sh
362 380
 
363
-         refresh_main clear || exit 1
364 381
          clean_main "$@"    || exit 1
365 382
       ;;
366 383
 
367 384
       dist-clean)
368 385
          . mulle-bootstrap-clean.sh
369 386
 
370
-         refresh_main clear || exit 1
371 387
          clean_main "dist"  || exit 1
372 388
       ;;
373 389
 
374 390
       fetch)
375 391
          . mulle-bootstrap-fetch.sh
376 392
 
377
-         refresh_main clear || exit 1
378 393
          DONT_ASK_AFTER_WARNING=YES fetch_main "install" "$@" || exit 1
379 394
          refresh_main || exit 1
380 395
       ;;
... ...
@@ -298,6 +298,16 @@ assoc_array_get_last()
298 298
 }
299 299
 
300 300
 
301
+assoc_array_all_keys()
302
+{
303
+   local array
304
+
305
+   array="$1"
306
+
307
+   echo "${array}" | sed -n 's/^\([^=]*\)=.*$/\1/p'
308
+}
309
+
310
+
301 311
 assoc_array_set()
302 312
 {
303 313
    local array
... ...
@@ -306,8 +316,8 @@ assoc_array_set()
306 316
    local old_value
307 317
 
308 318
    array="$1"
309
-   key="${2}"
310
-   value="${3}"
319
+   key="$2"
320
+   value="$3"
311 321
 
312 322
    if [ -z "${value}" ]
313 323
    then
... ...
@@ -360,6 +370,8 @@ assoc_array_add_array()
360 370
 }
361 371
 
362 372
 
363
-
364
-
365
-
373
+# initialize code of this file
374
+array_initialize()
375
+{
376
+   :
377
+}
... ...
@@ -31,15 +31,178 @@
31 31
 MULLE_BOOTSTRAP_AUTO_UPDATE_SH="included"
32 32
 
33 33
 #
34
-# this script installs the proper git clones into "clones"
35
-# it does not to git subprojects.
36
-# You can also specify a list of "brew" dependencies. That
37
-# will be third party libraries, you don't tag or debug
34
+# MERGE some settings
38 35
 #
39
-INHERIT_SETTINGS='brews
40
-repositories
41
-settings/build_order
42
-settings/build_ignore'
36
+# prepend new contents to old contents
37
+# of a few select and known files, these are merged with whats there
38
+#
39
+bootstrap_auto_update_merge()
40
+{
41
+   local directory
42
+
43
+   directory="$1"
44
+
45
+   local srcfile
46
+   local dstfile
47
+   local localfile
48
+   local tmpfile
49
+   local settingname
50
+   local match
51
+   local old
52
+   local i
53
+
54
+   old="${IFS:-' '}"
55
+   IFS="
56
+"
57
+   for i in `ls -1 "${directory}/.bootstrap"`
58
+   do
59
+      IFS="${old}"
60
+
61
+      settingname="`basename -- "${i}"`"
62
+      srcfile="${directory}/.bootstrap/${settingname}"
63
+      dstfile="${BOOTSTRAP_SUBDIR}.auto/${settingname}"
64
+      localfile="${BOOTSTRAP_SUBDIR}.local/${settingname}"
65
+
66
+      if [ -e "${localfile}" ]
67
+      then
68
+         log_verbose "Setting \"${settingname}\" is locally specified, so not merged"
69
+         continue
70
+      fi
71
+
72
+      if [ -d "${srcfile}" ]
73
+      then
74
+         continue
75
+      fi
76
+
77
+      match="`echo "$NON_MERGABLE_SETTINGS" | grep "${settingname}"`"
78
+      if [ ! -z "${match}" ]
79
+      then
80
+         continue
81
+      fi
82
+
83
+      log_verbose "Inheriting \"${settingname}\" from \"${srcfile}\""
84
+
85
+      if [ -f "${dstfile}" ]
86
+      then
87
+         tmpfile="${BOOTSTRAP_SUBDIR}.auto/${settingname}.tmp"
88
+
89
+         exekutor mv "${dstfile}" "${tmpfile}" || exit 1
90
+         exekutor merge_settings_in_front "${srcfile}" "${tmpfile}" > "${dstfile}"  || exit 1
91
+         exekutor rm "${tmpfile}" || exit 1
92
+      else
93
+         exekutor cp "${srcfile}" "${dstfile}" || exit 1
94
+      fi
95
+   done
96
+   IFS="${old}"
97
+}
98
+
99
+
100
+bootstrap_auto_copy_files()
101
+{
102
+   local srcdir
103
+   local dstdir
104
+
105
+   srcdir="$1"
106
+   dstdir="$2"
107
+
108
+   local path
109
+   local filename
110
+
111
+    # copy settings
112
+   for path in `find "${srcdir}" -mindepth 1 -maxdepth 1 -type f -print 2> /dev/null`
113
+   do
114
+      filename="`basename -- "${path}"`"
115
+
116
+      if [ -f "${dstdir}/${filename}" ]
117
+      then
118
+         log_verbose "\"${filename}\" is already present, so not inherited"
119
+         continue
120
+      fi
121
+
122
+      exekutor cp -a "${path}" "${dstdir}/"
123
+   done
124
+}
125
+
126
+
127
+#
128
+# copy up other non-mergable settings, if there aren't already settings there
129
+#
130
+bootstrap_auto_update_settings()
131
+{
132
+   local name
133
+   local directory
134
+
135
+   directory="$1"
136
+   name="$2"
137
+
138
+   local srcdir
139
+   local settingname
140
+   local script
141
+   local dstdir
142
+   local i
143
+   local is_merge
144
+
145
+   srcdir="${directory}/.bootstrap/settings"
146
+   dstdir="${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
147
+
148
+   mkdir_if_missing "${dstdir}" 
149
+
150
+   bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
151
+
152
+   # copy scripts
153
+
154
+   srcdir="${srcdir}/bin"
155
+   dstdir="${dstdir}/bin"
156
+
157
+   mkdir_if_missing "${dstdir}" 
158
+   bootstrap_auto_copy_files  "${srcdir}" "${dstdir}"
159
+
160
+   rmdir_if_empty "${dstdir}/bin"
161
+
162
+   rmdir_if_empty "${dstdir}" 
163
+}
164
+
165
+
166
+bootstrap_auto_update_repo_settings()
167
+{
168
+   local directory
169
+
170
+   directory="$1"
171
+
172
+   local srcdir
173
+   local dstdir
174
+   local reponame
175
+
176
+   srcdir="${directory}/.bootstrap"
177
+   dstdir="${BOOTSTRAP_SUBDIR}.auto"
178
+
179
+   mkdir_if_missing "${dstdir}" 
180
+
181
+   #
182
+   # copy repo settings flat if not present already
183
+   #
184
+   for i in `find "${srcdir}" -mindepth 1 -maxdepth 1 -type d -print 2> /dev/null`
185
+   do
186
+      reponame="`basename -- "${i}"`"
187
+
188
+      case "${reponame}" in
189
+         bin|config|settings)
190
+            continue
191
+         ;;
192
+      esac
193
+
194
+      if [ -d "${dstdir}/${reponame}" ]
195
+      then
196
+         log_verbose "Settings for \"${reponame}\" are already present, so skipped"
197
+         continue
198
+      fi
199
+
200
+      log_fluff  "Copy \"${i}\" to \"${dstdir}\""
201
+      exekutor cp -Ra "${i}" ${dstdir}/${reponame}""
202
+   done
203
+
204
+   rmdir_if_empty "${dstdir}" 
205
+}
43 206
 
44 207
 
45 208
 bootstrap_auto_update()
... ...
@@ -48,17 +211,12 @@ bootstrap_auto_update()
48 211
    local url
49 212
    local directory
50 213
 
51
-
52 214
    name="$1"
53 215
    url="$2"
54 216
    directory="$3"
55 217
 
56
-   local settings
57
-
58
-   settings="$INHERIT_SETTINGS"
59
-
60
-   [ ! -z "${directory}" ]        || internal_fail "src was empty"
61
-   [ "${PWD}" != "${directory}" ] || internal_fail "configuration error"
218
+   [ -z "${directory}" ]         && internal_fail "src was empty"
219
+   [ "${PWD}" = "${directory}" ] && internal_fail "configuration error"
62 220
 
63 221
    if [ "$MULLE_BOOTSTRAP_TRACE_MERGE" = "YES" ]
64 222
    then
... ...
@@ -72,119 +230,68 @@ bootstrap_auto_update()
72 230
       return 1
73 231
    fi
74 232
 
75
-   log_verbose "Acquiring ${directory} .bootstrap settings ..."
233
+   log_verbose "Updating .bootstrap.auto with ${directory}"
76 234
 
77
-   local old
235
+   log_fluff "Acquiring \"${name}\" merge settings"
236
+   bootstrap_auto_update_merge "${directory}"
78 237
 
79
-   old="${IFS:-" "}"
238
+   log_fluff "Acquiring \"${name}\" build settings"
239
+   bootstrap_auto_update_settings "${directory}" "${name}"
80 240
 
81
-   #
82
-   # prepare auto folder if it doesn't exist yet
83
-   # means copy our own files to .auto first,
84
-   #
85
-   if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
86
-   then
87
-      log_verbose "Found a .bootstrap folder for \"${name}\" will set up ${BOOTSTRAP_SUBDIR}.auto"
241
+   log_fluff "Acquiring \"${name}\" repo settings"
242
+   bootstrap_auto_update_repo_settings "${directory}"
88 243
 
89
-      mkdir_if_missing "${BOOTSTRAP_SUBDIR}.tmp/settings"
244
+   return 0
245
+}
90 246
 
91
-      IFS="
92
-"
93
-      for i in $settings
94
-      do
95
-         IFS="${old}"
96
-
97
-         if [ -f "${BOOTSTRAP_SUBDIR}.local/${i}" ]
98
-         then
99
-            exekutor cp "${BOOTSTRAP_SUBDIR}.local/${i}" "${BOOTSTRAP_SUBDIR}.tmp/${i}" || exit 1
100
-         else
101
-            if [ -f "${BOOTSTRAP_SUBDIR}/${i}" ]
102
-            then
103
-               exekutor cp "${BOOTSTRAP_SUBDIR}/${i}" "${BOOTSTRAP_SUBDIR}.tmp/${i}" || exit 1
104
-            else
105
-               local  settingname
106
-
107
-               settingname="`basename -- "${i}"`"
108
-               log_fluff "Setting \"${settingname}\" is not specified, so not inherited"
109
-            fi
110
-         fi
111
-      done
112
-      IFS="${old}"
247
+#
248
+# copy contents of .bootstrap.local to .bootstrap.auto
249
+# them add contents of .bootstrap to .bootstrap.auto, if not present
250
+# 
251
+bootstrap_auto_create()
252
+{
253
+   log_verbose "Creating .bootstrap.auto from .bootstrap and .bootstrap.local"
254
+
255
+   mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto"
113 256
 
114
-      # now move it
115
-      exekutor mv "${BOOTSTRAP_SUBDIR}.tmp" "${BOOTSTRAP_SUBDIR}.auto" || exit 1
257
+   if dir_has_files "${BOOTSTRAP_SUBDIR}.local"
258
+   then
259
+      exekutor cp -Ra "${BOOTSTRAP_SUBDIR}.local/"* "${BOOTSTRAP_SUBDIR}.auto/"
116 260
    fi
117 261
 
118 262
    #
119
-   # prepend new contents to old contents
120
-   # of a few select and known files
263
+   # add stuff from bootstrap folder
264
+   # don't copy config/ if exists (it could be malicious)
121 265
    #
122
-   local srcfile
123
-   local dstfile
124
-   local i
125
-   local settingname
266
+   local old
267
+   local file
126 268
 
269
+   old="${IFS}"
127 270
    IFS="
128 271
 "
129
-   for i in $settings
272
+   for file in `ls -1 "${BOOTSTRAP_SUBDIR}"`
130 273
    do
131
-      IFS="${old}"
132
-
133
-      srcfile="${directory}/.bootstrap/${i}"
134
-      dstfile="${BOOTSTRAP_SUBDIR}.auto/${i}"
135
-      settingname="`basename -- "${i}"`"
136
-
137
-      if [ -f "${srcfile}" ]
138
-      then
139
-         log_verbose "Inheriting \"${settingname}\" from \"${srcfile}\""
140
-
141
-         mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/`dirname -- "${i}"`"
142
-         if [ -f "${BOOTSTRAP_SUBDIR}.auto/${i}" ]
143
-         then
144
-            local tmpfile
145
-
146
-            tmpfile="${BOOTSTRAP_SUBDIR}.auto/${i}.tmp"
147
-
148
-            exekutor mv "${dstfile}" "${tmpfile}" || exit 1
149
-            exekutor merge_settings_in_front "${srcfile}" "${tmpfile}" > "${dstfile}"  || exit 1
150
-            exekutor rm "${tmpfile}" || exit 1
151
-         else
152
-            exekutor cp "${srcfile}" "${dstfile}" || exit 1
153
-         fi
154
-      else
155
-         log_fluff "Setting \"${settingname}\" is not specified, so not inherited"
156
-      fi
274
+      name="`basename -- "${file}"`"
275
+      case "$name" in
276
+         config)
277
+            continue
278
+         ;;
279
+
280
+         *)
281
+            exekutor cp -Ran "${BOOTSTRAP_SUBDIR}/${name}" "${BOOTSTRAP_SUBDIR}.auto/${name}"
282
+         ;;
283
+      esac
157 284
    done
158
-   IFS="${old}"
159
-
160
-   #
161
-   # copy up other non-inheriting settings, if there aren't already settings there
162
-   #
163
-   local srcsettingsdir
164
-
165
-   srcsettingsdir="${directory}/.bootstrap/settings"
166
-
167
-   if dir_has_files "${srcsettingsdir}"
168
-   then
169
-      local dstdir
170
-      local dstsettingsdir
171 285
 
172
-      dstsettingsdir="${BOOTSTRAP_SUBDIR}.auto/settings"
173
-      dstdir="${BOOTSTRAP_SUBDIR}.auto/settings/${name}"
174
-
175
-      log_verbose "Copy build settings of \"${name}\" to \"${dstdir}\""
176
-
177
-      mkdir_if_missing "${dstdir}"
178
-
179
-      local entry
286
+   IFS="${old}"
287
+}
180 288
 
181
-      for entry in "${srcsettingsdir}"/*
182
-      do
183
-         exekutor cp -Ran "${entry}" "${dstdir}/"
184
-      done
185
-   fi
186 289
 
187
-   log_fluff "Acquisition of ${directory} .bootstrap settings finished"
290
+auto_update_initialize()
291
+{
292
+    log_fluff ":auto_update_initialize:"
188 293
 
189
-   return 0
294
+  NON_MERGABLE_SETTINGS='embedded_repositories
295
+'   
296
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh && functions_initialize
190 297
 }
... ...
@@ -62,12 +62,12 @@ fetch_brew_if_needed()
62 62
    fi
63 63
 
64 64
    case "${UNAME}" in
65
-      Darwin)
65
+      darwin)
66 66
          log_info "Installing OS X brew"
67 67
          exekutor git clone https://github.com/Homebrew/brew.git "${ADDICTION_SUBDIR}"
68 68
          ;;
69 69
 
70
-      Linux)
70
+      linux)
71 71
          log_info "Installing Linux brew"
72 72
          exekutor git clone https://github.com/Linuxbrew/brew.git "${ADDICTION_SUBDIR}"
73 73
          ;;
... ...
@@ -118,3 +118,11 @@ brew_update_if_needed()
118 118
       touch_last_update
119 119
    fi
120 120
 }
121
+
122
+
123
+brew_initialize()
124
+{
125
+   log_fluff ":brew_initialize:"
126
+
127
+   [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh && functions_main
128
+}
121 129
\ No newline at end of file
... ...
@@ -29,23 +29,69 @@
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_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
32
+MULLE_BOOTSTRAP_BUILD_ENVIRONMENT_SH="included"
33 33
 
34
+# only needed for true builds
34 35
 
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"`
36
+build_complete_environment()
37
+{
38
+   if [ ! -z "${CLEAN_BEFORE_BUILD}" ]
39
+   then
40
+      return
41
+   fi
37 42
 
38
-[ -z "${CLONESBUILD_SUBDIR}" ]   && internal_fail "variable CLONESBUILD_SUBDIR is empty"
39
-[ -z "${BUILDLOG_SUBDIR}" ]      && internal_fail "variable BUILDLOG_SUBDIR is empty"
43
+   CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build"`
44
+   CONFIGURATIONS="`read_config_setting "configurations" "Release"`"
45
+   N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
40 46
 
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
+   # dont export stuff for scripts
49
+   # if scripts want it, they should source this file
50
+   #
51
+   case "${UNAME}" in
52
+      mingw)
53
+         [ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
54
+
55
+         setup_mingw_buildenvironment
56
+
57
+         BUILDPATH="`mingw_buildpath "$PATH"`"
58
+         BUILD_PWD_OPTIONS="-PW"
59
+      ;;
60
+
61
+      "")
62
+         fail "UNAME not set"
63
+      ;;
64
+
65
+      *)
66
+         # get number of cores, use 50% more for make -j
67
+         CORES="`get_core_count`"
68
+         CORES="`expr $CORES + $CORES / 2`"
69
+
70
+         BUILD_PWD_OPTIONS="-P"
71
+         BUILDPATH="$PATH"
72
+      ;;
73
+   esac
74
+}
75
+
76
+
77
+build_environment_initialize()
78
+{
79
+   log_fluff ":build_environment_initialize:"
80
+
81
+   [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh && local_environment_initialize
82
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh && settings_initialize
83
+
84
+   CLONESBUILD_SUBDIR=`read_sane_config_path_setting "build_foldername" "${RELATIVE_ROOT}build/.repos"`
85
+   BUILDLOG_SUBDIR=`read_sane_config_path_setting "build_log_foldername" "${CLONESBUILD_SUBDIR}/.logs"`
86
+
87
+   [ -z "${CLONESBUILD_SUBDIR}" ]   && internal_fail "variable CLONESBUILD_SUBDIR is empty"
88
+   [ -z "${BUILDLOG_SUBDIR}" ]      && internal_fail "variable BUILDLOG_SUBDIR is empty"
89
+
90
+   #
91
+   # Global Settings
92
+   #
93
+   HEADER_DIR_NAME="`read_config_setting "header_dir_name" "include"`"
94
+   LIBRARY_DIR_NAME="`read_config_setting "library_dir_name" "lib"`"
95
+   FRAMEWORK_DIR_NAME="`read_config_setting "framework_dir_name" "Frameworks"`"
96
+}
47 97
 
48
-#
49
-# dont export stuff for scripts
50
-# if scripts want it, they should source this file
51
-#
... ...
@@ -62,7 +62,7 @@ usage:
62 62
 EOF
63 63
 
64 64
    case "${UNAME}" in
65
-      MINGW*)
65
+      mingw*)
66 66
          :
67 67
       ;;
68 68
 
... ...
@@ -178,10 +178,10 @@ collect_and_dispense_product()
178 178
    local  depend_subdir
179 179
    local  name
180 180
 
181
-   name="${1}"
182
-   build_subdir="${2}"
183
-   depend_subdir="${3}"
184
-   wasxcode="${4}"
181
+   name="$1"
182
+   build_subdir="$2"
183
+   depend_subdir="$3"
184
+   wasxcode="$4"
185 185
 
186 186
    local  dst
187 187
    local  src
... ...
@@ -415,16 +415,16 @@ create_dummy_dirs_against_warnings()
415 415
 
416 416
 build_fail()
417 417
 {
418
-   if [ -f "${1}" ]
418
+   if [ -f "$1" ]
419 419
    then
420 420
       printf "${C_RED}"
421
-      egrep -B1 -A5 -w "[Ee]rror" "${1}" >&2
421
+      egrep -B1 -A5 -w "[Ee]rror" "$1" >&2
422 422
       printf "${C_RESET}"
423 423
    fi
424 424
 
425
-   if [ -z "$MULLE_BOOTSTRAP_TRACE" ]
425
+   if [ "$MULLE_BOOTSTRAP_TRACE" != "1848" ]
426 426
    then
427
-      log_info "Check the build log: ${C_RESET_BOLD}${1}${C_INFO}"
427
+      log_info "Check the build log: ${C_RESET_BOLD}$1${C_INFO}"
428 428
    fi
429 429
    fail "$2 failed"
430 430
 }
... ...
@@ -445,9 +445,9 @@ build_log_name()
445 445
 
446 446
    while [ $# -gt 0 ]
447 447
    do
448
-      if [ ! -z "${1}" ]
448
+      if [ ! -z "$1" ]
449 449
       then
450
-         logfile="${logfile}-${1}"
450
+         logfile="${logfile}-$1"
451 451
       fi
452 452
       [ $# -eq 0 ] || shift
453 453
    done
... ...
@@ -480,7 +480,7 @@ find_cmake()
480 480
 {
481 481
    local name
482 482
 
483
-   name="${1}"
483
+   name="$1"
484 484
 
485 485
    local toolname
486 486
 
... ...
@@ -494,7 +494,7 @@ find_xcodebuild()
494 494
 {
495 495
    local name
496 496
 
497
-   name="${1}"
497
+   name="$1"
498 498
 
499 499
    local toolname
500 500
 
... ...
@@ -508,7 +508,7 @@ find_make()
508 508
 {
509 509
    local name
510 510
 
511
-   name="${1}"
511
+   name="$1"
512 512
 
513 513
    local toolname
514 514
    local defaultname
... ...
@@ -527,7 +527,7 @@ find_compiler()
527 527
    compiler="`read_build_setting "${name}" "$1"`"
528 528
 
529 529
    case "${UNAME}" in
530
-      MINGW*)
530
+      mingw)
531 531
          case "${compiler}" in
532 532
             mulle-clang*)
533 533
                compiler="mulle-clang-cl"
... ...
@@ -560,6 +560,7 @@ find_compiler()
560 560
 # remove old builddir, create a new one
561 561
 # depending on configuration cmake with flags
562 562
 # build stuff into dependencies
563
+# TODO: cache commandline in a file $ and emit instead of rebuilding it every time
563 564
 #
564 565
 build_cmake()
565 566
 {
... ...
@@ -743,11 +744,11 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
743 744
       includeprefix="-I"
744 745
 
745 746
       case "${UNAME}" in
746
-         Darwin)
747
+         darwin)
747 748
             frameworkprefix="-F"
748 749
          ;;
749 750
 
750
-         MINGW*)
751
+         mingw)
751 752
             relative_srcdir="`echo "${relative_srcdir}" | tr '/' '\\'  2> /dev/null`"
752 753
             libraryprefix="/LIBPATH:"
753 754
             includeprefix="/I"
... ...
@@ -768,18 +769,18 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
768 769
       IFS="${PATH_SEPARATOR}"
769 770
       for path in ${includelines}
770 771
       do
771
-         other_cflags="`add_word "${other_cflags}" "${includeprefix}${path}"`"
772
+         other_cflags="`concat "${other_cflags}" "${includeprefix}${path}"`"
772 773
       done
773 774
 
774 775
       for path in ${librarylines}
775 776
       do
776
-         other_ldflags="`add_word "${other_ldflags}" "${libraryprefix}${path}"`"
777
+         other_ldflags="`concat "${other_ldflags}" "${libraryprefix}${path}"`"
777 778
       done
778 779
 
779 780
       for path in ${frameworklines}
780 781
       do
781
-         other_cflags="`add_word "${other_cflags}" "${frameworkprefix}${path}"`"
782
-         other_ldflags="`add_word "${other_ldflags}" "${frameworkprefix}${path}"`"
782
+         other_cflags="`concat "${other_cflags}" "${frameworkprefix}${path}"`"
783
+         other_ldflags="`concat "${other_ldflags}" "${frameworkprefix}${path}"`"
783 784
       done
784 785
 
785 786
       if [ MULLE_BOOTSTRAP_VERBOSE_BUILD = "YES" ]
... ...
@@ -790,7 +791,10 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
790 791
       IFS="${memo}"
791 792
 
792 793
       local oldpath
794
+      local rval
793 795
 
796
+      [ -z "${BUILDPATH}"] && internal_fail "BUILDPATH not set"
797
+   
794 798
       oldpath="$PATH"
795 799
       PATH="${BUILDPATH}" 
796 800
 
... ...
@@ -810,12 +814,21 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
810 814
 "-DCMAKE_MODULE_PATH=${cmakemodulepath}" \
811 815
 ${CMAKE_FLAGS} \
812 816
 ${localcmakeflags} \
813
-"${relative_srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
817
+"${relative_srcdir}" > "${logfile1}" 
818
+      rval=$?
819
+
820
+      if [ $rval -ne 0 ]
821
+      then
822
+         PATH="${oldpath}" 
823
+         build_fail "${logfile1}" "cmake"
824
+      fi
814 825
 
815
-      logging_exekutor "${MAKE}" ${MAKE_FLAGS} ${local_make_flags} install > "${logfile2}" || build_fail "${logfile2}" "make"
826
+      logging_exekutor "${MAKE}" ${MAKE_FLAGS} ${local_make_flags} install > "${logfile2}" 
827
+      rval=$?
816 828
 
817 829
       PATH="${oldpath}"
818
-
830
+      [ $rval -ne 0 ] && build_fail "${logfile2}" "make"
831
+   
819 832
       set +f
820 833
 
821 834
    exekutor cd "${owd}"
... ...
@@ -981,9 +994,9 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
981 994
       dependenciesdir="`add_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}"`"
982 995
 
983 996
       case "${UNAME}" in
984
-         Darwin)
985
-            other_cflags="`add_word "${other_cflags}" "-isysroot ${sdkpath}"`"
986
-            other_ldflags="`add_word "${other_ldflags}" "-isysroot ${sdkpath}"`"
997
+         darwin)
998
+            other_cflags="`concat "${other_cflags}" "-isysroot ${sdkpath}"`"
999
+            other_ldflags="`concat "${other_ldflags}" "-isysroot ${sdkpath}"`"
987 1000
          ;;
988 1001
 
989 1002
          *)
... ...
@@ -1001,23 +1014,24 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1001 1014
       IFS="${PATH_SEPARATOR}"
1002 1015
       for path in ${includelines}
1003 1016
       do
1004
-         other_cflags="`add_word "${other_cflags}" "${includeprefix}${path}"`"
1017
+         other_cflags="`concat "${other_cflags}" "${includeprefix}${path}"`"
1005 1018
       done
1006 1019
 
1007 1020
       for path in ${librarylines}
1008 1021
       do
1009
-         other_ldflags="`add_word "${other_ldflags}" "${libraryprefix}${path}"`"
1022
+         other_ldflags="`concat "${other_ldflags}" "${libraryprefix}${path}"`"
1010 1023
       done
1011 1024
 
1012 1025
       for path in ${frameworklines}
1013 1026
       do
1014
-         other_cflags="`add_word "${other_cflags}" "${frameworkprefix}${path}"`"
1015
-         other_ldflags="`add_word "${other_ldflags}" "${frameworkprefix}${path}"`"
1027
+         other_cflags="`concat "${other_cflags}" "${frameworkprefix}${path}"`"
1028
+         other_ldflags="`concat "${other_ldflags}" "${frameworkprefix}${path}"`"
1016 1029
       done
1017 1030
 
1018 1031
       IFS="${memo}"
1019 1032
 
1020 1033
       local oldpath
1034
+      local rval
1021 1035
 
1022 1036
       oldpath="$PATH"
1023 1037
       PATH="${BUILDPATH}" 
... ...
@@ -1031,10 +1045,19 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1031 1045
       LDFLAGS="${other_ldflags}" \
1032 1046
       logging_exekutor "${owd}/${srcdir}/configure" ${configureflags} \
1033 1047
           --prefix "${prefixbuild}" >> "${logfile1}" \
1034
-      || build_fail "${logfile1}" "configure"
1048
+      rval=$?
1049
+
1050
+      if [ $rval -ne 0 ]
1051
+      then
1052
+         PATH="${oldpath}" 
1053
+         build_fail "${logfile1}" "configure"
1054
+      fi
1035 1055
 
1036
-      logging_exekutor "${MAKE}" ${MAKE_FLAGS} install > "${logfile2}" \
1037
-      || build_fail "${logfile2}" "${MAKE}"
1056
+      logging_exekutor "${MAKE}" ${MAKE_FLAGS} install > "${logfile2}" 
1057
+      rval=$?
1058
+
1059
+      PATH="${oldpath}"
1060
+      [ $rval -ne 0 ] && build_fail "${logfile2}" "make"
1038 1061
 
1039 1062
       PATH="${oldpath}"
1040 1063
       set +f
... ...
@@ -1207,7 +1230,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1207 1230
    local projectname
1208 1231
 
1209 1232
     # always pass project directly
1210
-   projectname=`read_repo_setting "${name}" "project" "${project}"`
1233
+   projectname=`read_repo_setting "${name}" "xcode_project" "${project}"`
1211 1234
 
1212 1235
    local mapped
1213 1236
    local fallback
... ...
@@ -1457,6 +1480,11 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1457 1480
          arguments="${arguments} PRIVATE_HEADERS_FOLDER_PATH='${private_headers}'"
1458 1481
       fi
1459 1482
 
1483
+      local oldpath
1484
+      local rval
1485
+      
1486
+      oldpath="${PATH}"
1487
+      PATH="${BUILDPATH}" 
1460 1488
       # if it doesn't install, probably SKIP_INSTALL is set
1461 1489
       cmdline="\"${XCODEBUILD}\" \"${command}\" ${arguments} \
1462 1490
 ARCHS='${ARCHS:-\${ARCHS_STANDARD_32_64_BIT\}}' \
... ...
@@ -1475,9 +1503,11 @@ HEADER_SEARCH_PATHS='${dependencies_header_search_path}' \
1475 1503
 LIBRARY_SEARCH_PATHS='${dependencies_lib_search_path}' \
1476 1504
 FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
1477 1505
 
1478
-      PATH="${BUILDPATH}" logging_eval_exekutor "${cmdline}" > "${logfile}" \
1479
-      || build_fail "${logfile}" "${toolname}"
1506
+      logging_eval_exekutor "${cmdline}" > "${logfile}" 
1507
+      rval=$?
1480 1508
 
1509
+      PATH="${oldpath}"
1510
+      [ $rval -ne 0 ] && build_fail "${logfile}" "${toolname}"
1481 1511
       set +f
1482 1512
 
1483 1513
    exekutor cd "${owd}"
... ...
@@ -1502,7 +1532,7 @@ build_xcodebuild_schemes_or_target()
1502 1532
    local scheme
1503 1533
    local schemes
1504 1534
 
1505
-   schemes=`read_repo_setting "${name}" "schemes"`
1535
+   schemes=`read_repo_setting "${name}" "xcode_schemes"`
1506 1536
 
1507 1537
    local old
1508 1538
 
... ...
@@ -1520,7 +1550,7 @@ build_xcodebuild_schemes_or_target()
1520 1550
    local target
1521 1551
    local targets
1522 1552
 
1523
-   targets=`read_repo_setting "${name}" "targets"`
1553
+   targets=`read_repo_setting "${name}" "xcode_targets"`
1524 1554
 
1525 1555
    old="$IFS"
1526 1556
    IFS="
... ...
@@ -1625,14 +1655,23 @@ ${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
1625 1655
 ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1626 1656
 \"${builddir}\" ..."