Browse code

Include libexec files instead of execing them.

Nat! authored on 01-09-2016 15:54:56
Showing 23 changed files
... ...
@@ -12,6 +12,10 @@ gems, mulle-bootstrap can now claim to do only project relative installs.
12 12
 * You can now specify ALL (always YES) or NONE (always NO) at the y/n prompt.
13 13
 * Support for MINGW (Windows) for cmake (experimental)
14 14
 * Finally added a proper dependency resolver
15
+* -f option now recognized by build and fetch
16
+* rewrote mulle-bootstrap so that the files in libexec are included and not
17
+executed, which is nicer for less environment pollution and ever so slightly 
18
+better performance.
15 19
 
16 20
 
17 21
 1.1
... ...
@@ -29,8 +29,8 @@
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
-VERSION=2.0
33
-export VERSION
32
+MULLE_BOOTSTRAP_VERSION=2.0
33
+export MULLE_BOOTSTRAP_VERSION
34 34
 
35 35
 #
36 36
 # This is the main user interface to mulle-bootstrap
... ...
@@ -38,7 +38,7 @@ export VERSION
38 38
 #
39 39
 BOOTSTRAP_SUBDIR=.bootstrap
40 40
 
41
-PATH="/usr/local/libexec/mulle-bootstrap:`pwd -P`/addictions/bin:$PATH"
41
+PATH="/usr/local/libexec/mulle-bootstrap:`pwd -P`/dependencies/bin:`pwd -P`/addictions/bin:$PATH"
42 42
 export PATH
43 43
 
44 44
 MULLE_BOOTSTRAP_PID="$$"
... ...
@@ -111,38 +111,35 @@ do
111 111
    case "$1" in
112 112
       -a)
113 113
          MULLE_BOOTSTRAP_ANSWER="NO"
114
-         export MULLE_BOOTSTRAP_ANSWER
115
-      ;;
114
+         export MULLE_BOOTSTRAP_ANSWER  # override settings with environment
115
+       ;;
116 116
 
117 117
       -y)
118 118
          MULLE_BOOTSTRAP_ANSWER="YES"
119
-         export MULLE_BOOTSTRAP_ANSWER
119
+         export MULLE_BOOTSTRAP_ANSWER  # override settings with environment
120 120
       ;;
121 121
 
122
+      -f) 
123
+         MULLE_BOOTSTRAP_DIRTY_HARRY="NO"
124
+      ;;
122 125
 
123 126
       -n)
124 127
          MULLE_BOOTSTRAP_DRY_RUN="YES"
125
-         export MULLE_BOOTSTRAP_DRY_RUN
126 128
       ;;
127 129
 
128 130
       -tm)
129 131
          MULLE_BOOTSTRAP_TRACE_MERGE="YES"
130
-         export MULLE_BOOTSTRAP_TRACE_MERGE
131 132
       ;;
132 133
 
133 134
       -t)
134 135
          MULLE_BOOTSTRAP_TRACE="1848"
135
-         export MULLE_BOOTSTRAP_TRACE
136
-
136
+         export MULLE_BOOTSTRAP_TRACE  # override settings with environment
137 137
          COPYMOVEFLAGS="-v"
138
-         export COPYMOVEFLAGS
139 138
          GITFLAGS="-v"
140
-         export GITFLAGS
141 139
       ;;
142 140
 
143 141
       -V)
144 142
          MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
145
-         export MULLE_BOOTSTRAP_VERBOSE_BUILD
146 143
       ;;
147 144
 
148 145
 
... ...
@@ -150,51 +147,45 @@ do
150 147
          if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
151 148
          then
152 149
             MULLE_BOOTSTRAP_TRACE="VERBOSE"
153
-            export MULLE_BOOTSTRAP_TRACE
150
+            export MULLE_BOOTSTRAP_TRACE  # override settings with environment
154 151
          fi
155 152
 
156 153
          COPYMOVEFLAGS="-v"
157
-         export COPYMOVEFLAGS
158 154
          GITFLAGS="-v"
159
-         export GITFLAGS
160 155
       ;;
161 156
 
162 157
       -vv)
163 158
          if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
164 159
          then
165 160
             MULLE_BOOTSTRAP_TRACE="FLUFF"
166
-            export MULLE_BOOTSTRAP_TRACE
161
+            export MULLE_BOOTSTRAP_TRACE  # override settings with environment
167 162
          fi
168 163
 
169 164
          COPYMOVEFLAGS="-v"
170
-         export COPYMOVEFLAGS
171 165
          GITFLAGS="-v"
172
-         export GITFLAGS
173 166
       ;;
174 167
 
175 168
       -vvv)
176 169
          if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
177 170
          then
178 171
             MULLE_BOOTSTRAP_TRACE="TRACE"
179
-            export MULLE_BOOTSTRAP_TRACE
172
+            export MULLE_BOOTSTRAP_TRACE  # override settings with environment
180 173
          fi
181 174
 
182 175
          COPYMOVEFLAGS="-v"
183
-         export COPYMOVEFLAGS
184 176
          GITFLAGS="-v"
185
-         export GITFLAGS
186 177
       ;;
187 178
 
188 179
       -s)
189 180
          MULLE_BOOTSTRAP_TRACE=
181
+         export MULLE_BOOTSTRAP_TRACE  # override settings with environment
190 182
          MULLE_BOOTSTRAP_TERSE="YES"
191
-         export MULLE_BOOTSTRAP_TERSE
192
-
183
+         export MULLE_BOOTSTRAP_TERSE  # override settings with environment
193 184
          GITFLAGS="-q"
194
-         export GITFLAGS
195 185
       ;;
196 186
 
197 187
       -*)
188
+         log_error "unknown option \"$1\""
198 189
          usage
199 190
       ;;
200 191
 
... ...
@@ -228,26 +219,31 @@ EOF
228 219
       . install.sh "$@"
229 220
       exit 0
230 221
    else
231
-      mulle-bootstrap-warn-scripts.sh "${BOOTSTRAP_SUBDIR}" || exit 1
222
+      . mulle-bootstrap-warn-scripts.sh 
223
+
224
+      warn_scripts_main "${BOOTSTRAP_SUBDIR}" || exit 1
232 225
    fi
233 226
 
234
-   COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
227
+   . mulle-bootstrap-refresh.sh 
228
+   . mulle-bootstrap-fetch.sh  
229
+   . mulle-bootstrap-build.sh 
230
+
231
+   COMMAND="refresh" refresh_main || exit 1
235 232
 
236 233
    if [ "${DONT_RECURSE}" = "" ]
237 234
    then
238
-      mulle-bootstrap-fetch.sh || exit 1
235
+      COMMAND="install" fetch_main "$@" || exit 1
239 236
    else
240
-      mulle-bootstrap-fetch.sh nonrecursive  || exit 1
237
+      COMMAND="install" fetch_main nonrecursive "$@" || exit 1
241 238
    fi
242 239
 
243 240
    # do it again now!
244 241
 
245
-   COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
246
-   mulle-bootstrap-build.sh  || exit 1
242
+   COMMAND="refresh" refresh_main || exit 1
243
+   COMMAND="build "build_main "$@" || exit 1
247 244
 }
248 245
 
249 246
 
250
-
251 247
 main()
252 248
 {
253 249
    local command
... ...
@@ -283,61 +279,88 @@ main()
283 279
 
284 280
       # experimental stuff
285 281
       project)
286
-         mulle-bootstrap-project.sh "$@" || exit 1
282
+         . mulle-bootstrap-project.sh 
283
+
284
+         COMMAND="${command}" project_main"$@" || exit 1
287 285
       ;;
288 286
 
289 287
       install)
290
-         mulle-bootstrap-install.sh "$@" || exit 1
288
+         . mulle-bootstrap-install.sh 
289
+
290
+         COMMAND="${command}" install_main"$@" || exit 1
291 291
       ;;
292 292
 
293 293
       build)
294
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
295
-         COMMAND="${command}" mulle-bootstrap-build.sh "$@" || exit 1
294
+         . mulle-bootstrap-refresh.sh 
295
+         . mulle-bootstrap-build.sh 
296
+
297
+         COMMAND="refresh" refresh_main || exit 1
298
+         COMMAND="${command}" build_main "$@" || exit 1
296 299
       ;;
297 300
 
298 301
       refresh)
299
-         COMMAND="${command}" mulle-bootstrap-refresh.sh || exit 1
302
+         . mulle-bootstrap-refresh.sh 
303
+
304
+         COMMAND="refresh" refresh_main || exit 1
300 305
       ;;
301 306
 
302 307
       clean)
303
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
304
-         mulle-bootstrap-clean.sh "$@" || exit 1
308
+         . mulle-bootstrap-refresh.sh 
309
+         . mulle-bootstrap-clean.sh 
310
+
311
+         COMMAND="refresh" refresh_main || exit 1
312
+         COMMAND="${command}" clean_main "$@" || exit 1
305 313
       ;;
306 314
 
307 315
       dist-clean)
308
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
309
-         mulle-bootstrap-clean.sh "dist"  || exit 1
316
+         . mulle-bootstrap-refresh.sh 
317
+         . mulle-bootstrap-clean.sh 
318
+
319
+         COMMAND="refresh" refresh_main || exit 1
320
+         COMMAND="clean" clean_main "dist" || exit 1
310 321
       ;;
311 322
 
312 323
       fetch)
313
-         COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
314
-         DONT_ASK_AFTER_WARNING=YES mulle-bootstrap-fetch.sh "$@" || exit 1
324
+         . mulle-bootstrap-refresh.sh 
325
+         . mulle-bootstrap-fetch.sh 
326
+
327
+         COMMAND="refresh" refresh_main || exit 1
328
+         COMMAND="install" DONT_ASK_AFTER_WARNING=YES fetch_main "$@" || exit 1
315 329
       ;;
316 330
 
317 331
       update)
318
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
319
-         COMMAND="${command}" mulle-bootstrap-fetch.sh "$@" || exit 1
332
+         . mulle-bootstrap-fetch.sh 
333
+
334
+         COMMAND="${command}" fetch_main "$@" || exit 1
320 335
       ;;
321 336
 
322 337
       init)
323
-         mulle-bootstrap-init.sh "$@" || exit 1
338
+         . mulle-bootstrap-init.sh
339
+         COMMAND="${command}" init_main "$@" || exit 1
324 340
       ;;
325 341
 
326 342
       setup-xcode|xcode)
327
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
328
-         mulle-bootstrap-xcode.sh "$@"|| exit 1
343
+         . mulle-bootstrap-refresh.sh 
344
+         . mulle-bootstrap-xcode.sh 
345
+
346
+         COMMAND="refresh" refresh_main || exit 1
347
+         COMMAND="xcode" xcode_main "$@" || exit 1
329 348
       ;;
330 349
 
331 350
       tag)
332
-         COMMAND="refresh" mulle-bootstrap-refresh.sh || exit 1
333
-         mulle-bootstrap-tag.sh "$@" || exit 1
351
+         . mulle-bootstrap-refresh.sh 
352
+         . mulle-bootstrap-tag.sh 
353
+
354
+         COMMAND="refresh" refresh_main || exit 1
355
+         COMMAND="${command}" tag_main  "$@" || exit 1
334 356
       ;;
335 357
 
336 358
       version)
337
-         echo "${VERSION}" || exit 1
359
+         echo "${MULLE_BOOTSTRAP_VERSION}" || exit 1
338 360
       ;;
339 361
 
340 362
       *)
363
+         log_error "Unknown command \"${command}\""
341 364
          usage
342 365
       ;;
343 366
       esac
... ...
@@ -29,6 +29,7 @@
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
+MULLE_BOOTSTRAP_ARRAY_SH="included"
32 33
 
33 34
 # declare "fail" outside
34 35
 # array contents can contain any characters except newline
... ...
@@ -28,6 +28,7 @@
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
+MULLE_BOOTSTRAP_AUTO_UPDATE_SH="included"
31 32
 
32 33
 #
33 34
 # this script installs the proper git clones into "clones"
... ...
@@ -71,7 +72,7 @@ bootstrap_auto_update()
71 72
       return 1
72 73
    fi
73 74
 
74
-   log_fluff "Acquiring ${directory} .bootstrap settings ..."
75
+   log_verbose "Acquiring ${directory} .bootstrap settings ..."
75 76
 
76 77
    local old
77 78
 
... ...
@@ -83,7 +84,7 @@ bootstrap_auto_update()
83 84
    #
84 85
    if [ ! -d "${BOOTSTRAP_SUBDIR}.auto" ]
85 86
    then
86
-      log_fluff "Found a .bootstrap folder for \"${name}\" will set up ${BOOTSTRAP_SUBDIR}.auto"
87
+      log_verbose "Found a .bootstrap folder for \"${name}\" will set up ${BOOTSTRAP_SUBDIR}.auto"
87 88
 
88 89
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}.tmp/settings"
89 90
 
... ...
@@ -137,7 +138,7 @@ bootstrap_auto_update()
137 138
 
138 139
       if [ -f "${srcfile}" ]
139 140
       then
140
-         log_fluff "Inheriting \"${settingname}\" from \"${srcfile}\""
141
+         log_verbose "Inheriting \"${settingname}\" from \"${srcfile}\""
141 142
 
142 143
          mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/`dirname -- "${i}"`"
143 144
          if [ -f "${BOOTSTRAP_SUBDIR}.auto/${i}" ]
... ...
@@ -172,7 +173,7 @@ bootstrap_auto_update()
172 173
    then
173 174
       local relative
174 175
 
175
-      log_fluff "Link up build settings of \"${name}\" to \"${BOOTSTRAP_SUBDIR}.auto/settings/${name}\""
176
+      log_verbose "Link up build settings of \"${name}\" to \"${BOOTSTRAP_SUBDIR}.auto/settings/${name}\""
176 177
 
177 178
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}.auto/settings"
178 179
       exekutor find "${directory}/.bootstrap/settings" -xdev -mindepth 1 -maxdepth 1 -type f -print0 | \
... ...
@@ -28,6 +28,7 @@
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
+MULLE_BOOTSTRAP_BREW_SH="included"
31 32
 
32 33
 
33 34
 #
... ...
@@ -102,7 +103,7 @@ brew_update_if_needed()
102 103
       stale="`find "${last_update}" -mtime +1 -type f -exec echo '{}' \;`"
103 104
       if [ -f "${last_update}" -a "$stale" = "" ]
104 105
       then
105
-         log_fluff "brew seems to be up to date"
106
+         log_verbose "brew seems to be up to date"
106 107
          return 0
107 108
       fi
108 109
    fi
... ...
@@ -27,43 +27,15 @@
27 27
 #   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 28
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 29
 #   POSSIBILITY OF SUCH DAMAGE.
30
+MULLE_BOOTSTRAP_BUILD_SH="included"
30 31
 
31
-. mulle-bootstrap-local-environment.sh
32
-. mulle-bootstrap-gcc.sh
33
-. mulle-bootstrap-scripts.sh
32
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
33
+[ -z "${MULLE_BOOTSTRAP_GCC_SH}" ] && . mulle-bootstrap-gcc.sh
34
+[ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
35
+[ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
34 36
 
35 37
 
36
-
37
-CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build"`
38
-CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
39
-N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
40
-
41
-UNAME="`uname`"
42
-# get number of cores, use 50% more for make -j
43
-case "${UNAME}" in
44
-   MINGW*)
45
-      if [ -z "${LIBPATH}" -o  -z "${INCLUDE}" ] && [ -z "${DONT_USE_VS}" ]
46
-      then
47
-         fail "environment variables INCLUDE and LIBPATH not set, start MINGW inside IDE environment"
48
-      fi
49
-
50
-      BUILD_PWD_OPTIONS="-PW"
51
-      PATH_SEPARATOR=';'
52
-      export PATH_SEPARATOR
53
-      :
54
-   ;;
55
-
56
-   *)
57
-      BUILD_PWD_OPTIONS="-P"
58
-      CORES="`get_core_count`"
59
-      CORES="`expr $CORES + $CORES / 2`"
60
-      PATH_SEPARATOR=':'
61
-      export PATH_SEPARATOR
62
-      ;;
63
-esac
64
-
65
-
66
-usage()
38
+build_usage()
67 39
 {
68 40
    local defk
69 41
    local defc
... ...
@@ -83,6 +55,7 @@ usage()
83 55
 usage:
84 56
    mulle-bootstrap build [-ck] [repos]*
85 57
 
58
+   -f         :  override dirty harry check
86 59
    -k         :  don't clean before building $defk
87 60
    -K         :  always clean before building $defkk
88 61
    -c <name>  :  configurations to build ($defc)
... ...
@@ -108,51 +81,6 @@ EOF
108 81
 }
109 82
 
110 83
 
111
-while :
112
-do
113
-   case "$1" in
114
-      -K)
115
-         CLEAN_BEFORE_BUILD="YES"
116
-      ;;
117
-
118
-      -k)
119
-         CLEAN_BEFORE_BUILD=
120
-      ;;
121
-
122
-
123
-      -j)
124
-         case "${UNAME}" in
125
-            MINGW*)
126
-               usage
127
-            ;;
128
-         esac
129
-
130
-         shift
131
-         [ $# -ne 0 ] || fail "core count missing"
132
-
133
-         CORES="$1"
134
-         ;;
135
-
136
-      -c)
137
-         shift
138
-         [ $# -ne 0 ] || fail "core count missing"
139
-
140
-         CONFIGURATIONS="`printf "%s" "$1" | tr ',' '\012'`"
141
-         ;;
142
-
143
-      -*)
144
-         usage
145
-      ;;
146
-
147
-      ""|*)
148
-         break
149
-      ;;
150
-   esac
151
-
152
-   shift
153
-   continue
154
-done
155
-
156 84
 
157 85
 #
158 86
 # move stuff produced my cmake and configure to places
... ...
@@ -228,7 +156,7 @@ dispense_binaries()
228 156
       then
229 157
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${depend_subdir}${subpath}"
230 158
 
231
-         log_fluff "Copying \"${src}\" to \"${dst}\""
159
+         log_verbose "Copying \"${src}\" to \"${dst}\""
232 160
          mkdir_if_missing "${dst}"
233 161
          exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 \( -type "${findtype}" -o -type "${findtype2}" \) -print0 | \
234 162
             exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} "${copyflag}" % "${dst}"
... ...
@@ -264,7 +192,7 @@ collect_and_dispense_product()
264 192
       return 0
265 193
    fi
266 194
 
267
-   log_fluff "Collecting and dispensing \"${name}\" \"`basename -- "${build_subdir}"`\" products "
195
+   log_verbose "Collecting and dispensing \"${name}\" \"`basename -- "${build_subdir}"`\" products "
268 196
 
269 197
    #
270 198
    # probably should use install_name_tool to hack all dylib paths that contain .ref
... ...
@@ -351,7 +279,7 @@ collect_and_dispense_product()
351 279
       then
352 280
          dst="${REFERENCE_DEPENDENCY_SUBDIR}${usrlocal}"
353 281
 
354
-         log_fluff "Copying everything from \"${src}\" to \"${dst}\""
282
+         log_verbose "Copying everything from \"${src}\" to \"${dst}\""
355 283
          exekutor find "${src}" -xdev -mindepth 1 -maxdepth 1 -print0 | \
356 284
                exekutor xargs -0 -I % mv ${COPYMOVEFLAGS} -f % "${dst}"
357 285
          [ $? -eq 0 ]  || fail "moving files from ${src} to ${dst} failed"
... ...
@@ -660,7 +588,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
660 588
    logfile1="`build_log_name "cmake" "${name}" "${configuration}" "${sdk}"`"
661 589
    logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
662 590
 
663
-   log_fluff "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
591
+   log_verbose "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
664 592
 
665 593
    local local_make_flags
666 594
 
... ...
@@ -914,7 +842,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
914 842
    logfile1="`build_log_name "configure" "${name}" "${configuration}" "${sdk}"`"
915 843
    logfile2="`build_log_name "make" "${name}" "${configuration}" "${sdk}"`"
916 844
 
917
-   log_fluff "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
845
+   log_verbose "Build logs will be in \"${logfile1}\" and \"${logfile2}\""
918 846
 
919 847
    local owd
920 848
    local nativewd
... ...
@@ -978,8 +906,9 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
978 906
 
979 907
       local prefixbuild
980 908
       local dependenciesdir
909
+      local linker
981 910
 
982
-      prefixbuild="`add_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCY_SUBDIR}"`"
911
+      pathrefixbuild="`add_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCY_SUBDIR}"`"
983 912
       dependenciesdir="`add_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCY_SUBDIR}"`"
984 913
 
985 914
       case "${UNAME}" in
... ...
@@ -1311,7 +1240,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1311 1240
    mkdir_if_missing "${BUILDLOG_SUBDIR}"
1312 1241
 
1313 1242
    logfile="`build_log_name "${toolname}" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
1314
-   log_fluff "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
1243
+   log_verbose "Build log will be in: ${C_RESET_BOLD}${logfile}${C_INFO}"
1315 1244
 
1316 1245
    set -f
1317 1246
 
... ...
@@ -1652,7 +1581,7 @@ build()
1652 1581
 
1653 1582
    [ "${name}" != "${CLONES_SUBDIR}" ] || internal_fail "missing repo argument (${srcdir})"
1654 1583
 
1655
-   log_fluff "Building ${name} ..."
1584
+   log_verbose "Building ${name} ..."
1656 1585
    
1657 1586
    local preferences
1658 1587
 
... ...
@@ -1858,9 +1787,6 @@ build_wrapper()
1858 1787
       rmdir_safer "${BUILD_DEPENDENCY_SUBDIR}"
1859 1788
    fi
1860 1789
 
1861
-   export BUILD_DEPENDENCY_SUBDIR
1862
-   export REFERENCE_DEPENDENCY_SUBDIR
1863
-   export REFERENCE_ADDICTION_SUBDIR
1864 1790
 
1865 1791
    #
1866 1792
    # move dependencies we have so far away into safety,
... ...
@@ -1962,7 +1888,6 @@ build_clones()
1962 1888
    # and maybe later hgs
1963 1889
    #
1964 1890
    BUILT=
1965
-   export BUILT
1966 1891
 
1967 1892
    if [ "$#" -eq 0 ]
1968 1893
    then
... ...
@@ -2086,11 +2011,66 @@ install_tars()
2086 2011
 }
2087 2012
 
2088 2013
 
2089
-main()
2014
+build_main()
2090 2015
 {
2091 2016
    local  clean
2092 2017
 
2093
-   log_verbose "::: build :::"
2018
+   log_fluff "::: build :::"
2019
+
2020
+   CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build"`
2021
+   CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
2022
+   N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
2023
+
2024
+
2025
+   while :
2026
+   do
2027
+      case "$1" in
2028
+         -K)
2029
+            CLEAN_BEFORE_BUILD="YES"
2030
+         ;;
2031
+
2032
+         -k)
2033
+            CLEAN_BEFORE_BUILD=
2034
+         ;;
2035
+
2036
+         -f) 
2037
+            MULLE_BOOTSTRAP_DIRTY_HARRY="NO"
2038
+         ;;
2039
+
2040
+         -j)
2041
+            case "${UNAME}" in
2042
+               MINGW*)
2043
+                  build_usage
2044
+               ;;
2045
+            esac
2046
+
2047
+            shift
2048
+            [ $# -ne 0 ] || fail "core count missing"
2049
+
2050
+            CORES="$1"
2051
+            ;;
2052
+
2053
+         -c)
2054
+            shift
2055
+            [ $# -ne 0 ] || fail "core count missing"
2056
+
2057
+            CONFIGURATIONS="`printf "%s" "$1" | tr ',' '\012'`"
2058
+            ;;
2059
+
2060
+         -*)
2061
+            log_error "unknown option $1"
2062
+            build_usage
2063
+         ;;
2064
+
2065
+         ""|*)
2066
+            break
2067
+         ;;
2068
+      esac
2069
+
2070
+      shift
2071
+      continue
2072
+   done
2073
+
2094 2074
 
2095 2075
    #
2096 2076
    # START
... ...
@@ -2101,7 +2081,7 @@ main()
2101 2081
       return 0
2102 2082
    fi
2103 2083
 
2104
-   ensure_consistency
2084
+   [ "${MULLE_BOOTSTRAP_DIRTY_HARRY}" != "NO" ] && ensure_consistency
2105 2085
 
2106 2086
    if [ $# -eq 0 ]
2107 2087
    then
... ...
@@ -2137,4 +2117,4 @@ main()
2137 2117
    fi
2138 2118
 }
2139 2119
 
2140
-main "$@"
2120
+
... ...
@@ -28,63 +28,12 @@
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
+MULLE_BOOTSTRAP_CLEAN_SH="included"
31 32
 
32
-. mulle-bootstrap-local-environment.sh
33
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
33 34
 
34
-CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
35 35
 
36
-
37
-BUILD_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "clean_folders" "${CLONESBUILD_SUBDIR}
38
-${DEPENDENCY_SUBDIR}/tmp"`"
39
-OUTPUT_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "output_clean_folders" "${DEPENDENCY_SUBDIR}"`"
40
-DIST_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "dist_clean_folders" "${CLONES_SUBDIR}
41
-${ADDICTION_SUBDIR}
42
-.bootstrap.auto"`"
43
-INSTALL_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "install_clean_folders" "${BUILD_CLEANABLE_SUBDIRS}
44
-${CLONES_SUBDIR}
45
-.bootstrap.auto"`"
46
-
47
-
48
-embedded_repositories()
49
-{
50
-   local clones
51
-   local clone
52
-   local dir
53
-   local name
54
-
55
-   clones="`read_fetch_setting "embedded_repositories"`"
56
-   if [ "${clones}" != "" ]
57
-   then
58
-      local old
59
-
60
-      old="${IFS:-" "}"
61
-      IFS="
62
-"
63
-      for clone in ${clones}
64
-      do
65
-         IFS="${old}"
66
-
67
-         clone="`expanded_setting "${clone}"`"
68
-
69
-         name="`canonical_name_from_clone "${clone}"`"
70
-         dir="${name}"
71
-         echo "${dir}"
72
-      done
73
-      IFS="${old}"
74
-   fi
75
-}
76
-
77
-
78
-EMBEDDED="`embedded_repositories`"
79
-
80
-if [ ! -z "$EMBEDDED" ]
81
-then
82
-   DIST_CLEANABLE_SUBDIRS="${DIST_CLEANABLE_SUBDIRS}
83
-${EMBEDDED}"
84
-fi
85
-
86
-
87
-usage()
36
+clean_usage()
88 37
 {
89 38
    cat <<EOF >&2
90 39
 usage:
... ...
@@ -113,32 +62,38 @@ ${DIST_CLEANABLE_SUBDIRS}
113 62
 ${INSTALL_CLEANABLE_SUBDIRS}
114 63
 ---
115 64
 EOF
65
+   exit 1
116 66
 }
117 67
 
118 68
 
119
-check_and_usage_and_help()
69
+embedded_repositories()
120 70
 {
121
-   case "$COMMAND" in
122
-      output)
123
-      ;;
124
-      dist)
125
-      ;;
126
-      build)
127
-      ;;
128
-      install)
129
-      ;;
130
-      *)
131
-      usage >&2
132
-      exit 1
133
-      ;;
134
-   esac
135
-}
71
+   local clones
72
+   local clone
73
+   local dir
74
+   local name
136 75
 
76
+   clones="`read_fetch_setting "embedded_repositories"`"
77
+   if [ "${clones}" != "" ]
78
+   then
79
+      local old
80
+
81
+      old="${IFS:-" "}"
82
+      IFS="
83
+"
84
+      for clone in ${clones}
85
+      do
86
+         IFS="${old}"
137 87
 
138
-COMMAND=${1:-"output"}
139
-[ $# -eq 0 ] || shift
88
+         clone="`expanded_setting "${clone}"`"
140 89
 
141
-check_and_usage_and_help
90
+         name="`canonical_name_from_clone "${clone}"`"
91
+         dir="${name}"
92
+         echo "${dir}"
93
+      done
94
+      IFS="${old}"
95
+   fi
96
+}
142 97
 
143 98
 
144 99
 clean_asserted_folder()
... ...
@@ -187,13 +142,12 @@ clean_parent_folders_if_empty()
187 142
 }
188 143
 
189 144
 
190
-
191 145
 #
192 146
 # cleanability is checked, because in some cases its convenient
193 147
 # to have other tools provide stuff besides /include and /lib
194 148
 # and sometimes  projects install other stuff into /share
195 149
 #
196
-clean()
150
+clean_execute()
197 151
 {
198 152
    local flag
199 153
    local old
... ...
@@ -266,7 +220,7 @@ clean()
266 220
 }
267 221
 
268 222
 
269
-main()
223
+clean_main()
270 224
 {
271 225
    #
272 226
    # don't rename these settings anymore, the consequences can be catastrophic
... ...
@@ -275,7 +229,43 @@ main()
275 229
    #
276 230
    log_fluff "::: clean :::"
277 231
 
278
-   clean "$@"
232
+   CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
233
+
234
+   BUILD_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "clean_folders" "${CLONESBUILD_SUBDIR}
235
+${DEPENDENCY_SUBDIR}/tmp"`"
236
+   OUTPUT_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "output_clean_folders" "${DEPENDENCY_SUBDIR}"`"
237
+   DIST_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "dist_clean_folders" "${CLONES_SUBDIR}
238
+${ADDICTION_SUBDIR}
239
+.bootstrap.auto"`"
240
+   INSTALL_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "install_clean_folders" "${BUILD_CLEANABLE_SUBDIRS}
241
+${CLONES_SUBDIR}
242
+.bootstrap.auto"`"
243
+
244
+   EMBEDDED="`embedded_repositories`"
245
+   if [ ! -z "$EMBEDDED" ]
246
+   then
247
+      DIST_CLEANABLE_SUBDIRS="${DIST_CLEANABLE_SUBDIRS}
248
+${EMBEDDED}"
249
+   fi
250
+
251
+   COMMAND=${1:-"output"}
252
+   [ $# -eq 0 ] || shift
253
+
254
+   case "$COMMAND" in
255
+      output)
256
+      ;;
257
+      dist)
258
+      ;;
259
+      build)
260
+      ;;
261
+      install)
262
+      ;;
263
+      *)
264
+         log_error "Unknown command \${COMMAND}\""
265
+         clean_usage 
266
+      ;;
267
+   esac
268
+
269
+   clean_execute "$@"
279 270
 }
280 271
 
281
-main "$@"
... ...
@@ -30,8 +30,9 @@
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 #
32 32
 #
33
+MULLE_BOOTSTRAP_DEPENDENY_RESOLVE_SH="included"
33 34
 
34
-. mulle-bootstrap-array.sh
35
+[ -z "${MULLE_BOOTSTRAP_ARRAY_SH}" ] && . mulle-bootstrap-array.sh
35 36
 
36 37
 
37 38
 _dependency_resolve()
... ...
@@ -29,87 +29,43 @@
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
+MULLE_BOOTSTRAP_FETCH_SH="included"
33
+
32 34
 #
33 35
 # this script installs the proper git clones into "clones"
34 36
 # it does not to git subprojects.
35 37
 # You can also specify a list of "brew" dependencies. That
36 38
 # will be third party libraries, you don't tag or debug
37 39
 #
38
-. mulle-bootstrap-local-environment.sh
39
-. mulle-bootstrap-brew.sh
40
-. mulle-bootstrap-scm.sh
41
-. mulle-bootstrap-scripts.sh
42
-. mulle-bootstrap-auto-update.sh
40
+
41
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
42
+[ -z "${MULLE_BOOTSTRAP_BREW_SH}" ] && . mulle-bootstrap-brew.sh
43
+[ -z "${MULLE_BOOTSTRAP_SCM_SH}" ] && . mulle-bootstrap-scm.sh
44
+[ -z "${MULLE_BOOTSTRAP_SCRIPTS_SH}" ] && . mulle-bootstrap-scripts.sh
45
+[ -z "${MULLE_BOOTSTRAP_AUTO_UPDATE_SH}" ] && . mulle-bootstrap-auto-update.sh
46
+[ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
43 47
 
44 48
 
45
-usage()
49
+
50
+fetch_usage()
46 51
 {
47 52
    cat <<EOF >&2
48 53
 usage:
49 54
    mulle-bootstrap fetch [-f] <install|nonrecursive|update>
50
-   -f           : override dirty harry check
55
+   -f           :  override dirty harry check
51 56
 
52
-   install      : clone or symlink non-exisiting repositories and other resources
53
-   nonrecursive : like above, but ignore .bootstrap folders of repositories
54
-   update       : execute `git pull` in fetched repositories
57
+   install      :  clone or symlink non-exisiting repositories and other resources
58
+   nonrecursive :  like above, but ignore .bootstrap folders of repositories
59
+   update       :  execute `git pull` in fetched repositories
55 60
 
56 61
    You can specify the names of the repositories to update.
57 62
    Currently available names are:
58 63
 EOF
59 64
    (cd "${CLONESFETCH_SUBDIR}" ; ls -1 ) 2> /dev/null
65
+   exit 1
60 66
 }
61 67
 
62 68
 
63
-
64
-while :
65
-do
66
-   if [ "$1" = "-h" -o "$1" = "--help" ]
67
-   then
68
-      usage >&2
69
-      exit 1
70
-   fi
71
-
72
-   if [ "$1" = "-f" ]
73
-   then
74
-      FORCE="YES"
75
-      [ $# -eq 0 ] || shift
76
-      continue
77
-   fi
78
-
79
-   break
80
-done
81
-
82
-
83
-
84
-if [ -z "${COMMAND}" ]
85
-then
86
-   COMMAND=${1:-"install"}
87
-   [ $# -eq 0 ] || shift
88
-fi
89
-
90
-if [ "${MULLE_BOOTSTRAP}" = "mulle-bootstrap" ]
91
-then
92
-   COMMAND="install"
93
-fi
94
-
95
-
96
-case "$COMMAND" in
97
-   install)
98
-      ;;
99
-   nonrecursive)
100
-     COMMAND=install
101
-     DONT_RECURSE="YES"
102
-      ;;
103
-   update)
104
-      ;;
105
-   *)
106
-      usage >&2
107
-      exit 1
108
-      ;;
109
-esac
110
-
111
-
112
-
113 69
 #
114 70
 # Use brews for stuff we don't tag
115 71
 #
... ...
@@ -761,7 +717,7 @@ clone_repository()
761 717
    local flag
762 718
    local doit
763 719
 
764
-   log_fluff "Cloning ${name} ..."
720
+   log_verbose "Clone ${name} if needed ..."
765 721
 
766 722
    tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
767 723
    dstdir="${CLONESFETCH_SUBDIR}/${name}"
... ...
@@ -960,7 +916,6 @@ clone_embedded_repositories()
960 916
    old="${IFS:-" "}"
961 917
 
962 918
    MULLE_BOOTSTRAP_SETTINGS_NO_AUTO="YES"
963
-   export MULLE_BOOTSTRAP_SETTINGS_NO_AUTO
964 919
 
965 920
    clones="`read_fetch_setting "embedded_repositories"`"
966 921
    if [ "${clones}" != "" ]
... ...
@@ -1266,7 +1221,6 @@ update_embedded_repositories()
1266 1221
    local scm
1267 1222
 
1268 1223
    MULLE_BOOTSTRAP_SETTINGS_NO_AUTO="YES"
1269
-   export MULLE_BOOTSTRAP_SETTINGS_NO_AUTO
1270 1224
 
1271 1225
    old="${IFS:-" "}"
1272 1226
 
... ...
@@ -1324,31 +1278,83 @@ update_embedded_repositories()
1324 1278
 }
1325 1279
 
1326 1280
 
1327
-main()
1281
+fetch_main()
1328 1282
 {
1329
-   log_verbose "::: fetch :::"
1283
+   log_fluff "::: fetch :::"
1284
+
1285
+   while :
1286
+   do
1287
+      case "$1" in
1288
+         -h|-help|--help)
1289
+            fetch_usage 
1290
+         ;;
1291
+
1292
+         -f)
1293
+            MULLE_BOOTSTRAP_DIRTY_HARRY="NO"
1294
+         ;;
1295
+
1296
+
1297
+         -*)
1298
+            log_error "unknown option $1"
1299
+            fetch_usage
1300
+         ;;
1301
+
1302
+         ""|*)
1303
+            break
1304
+         ;;
1305
+      esac
1306
+
1307
+      shift
1308
+      continue
1309
+   done
1310
+
1311
+
1312
+   if [ -z "${COMMAND}" ]
1313
+   then
1314
+      COMMAND=${1:-"install"}
1315
+      [ $# -eq 0 ] || shift
1316
+   fi
1317
+
1318
+   if [ "${MULLE_BOOTSTRAP}" = "mulle-bootstrap" ]
1319
+   then
1320
+      COMMAND="install"
1321
+   fi
1322
+
1323
+
1324
+   case "$COMMAND" in
1325
+      install)
1326
+         ;;
1327
+      nonrecursive)
1328
+        COMMAND=install
1329
+        DONT_RECURSE="YES"
1330
+         ;;
1331
+      update)
1332
+         ;;
1333
+      *)
1334
+         log_error "unknown command \"$COMMAND\""
1335
+         usage 
1336
+         ;;
1337
+   esac
1338
+
1330 1339
 
1331 1340
    SYMLINK_FORBIDDEN="`read_config_setting "symlink_forbidden"`"
1332
-   export SYMLINK_FORBIDDEN
1333 1341
 
1334 1342
    #
1335 1343
    # should we check for '/usr/local/include/<name>' and don't fetch if
1336 1344
    # present (somewhat dangerous, because we do not check versions)
1337 1345
    #
1338 1346
    DO_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1339
-   export DO_CHECK_USR_LOCAL_INCLUDE
1340 1347
 
1341 1348
    if [ "${COMMAND}" = "install" ]
1342 1349
    then
1343 1350
       if [ $# -ne 0 ]
1344 1351
       then
1345 1352
          log_error  "Additional parameters not allowed for install"
1346
-         usage >&2
1347
-         exit 1
1353
+         fetch_usage 
1348 1354
       fi
1349 1355
    fi
1350 1356
 
1351
-   [ -z "${FORCE}" ] && ensure_consistency
1357
+   [ "${MULLE_BOOTSTRAP_DIRTY_HARRY}" != "NO" ] && ensure_consistency
1352 1358
 
1353 1359
    #
1354 1360
    # Run prepare scripts if present
... ...
@@ -1396,4 +1402,3 @@ main()
1396 1402
    fi
1397 1403
 }
1398 1404
 
1399
-main "$@"
... ...
@@ -29,6 +29,8 @@
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
+MULLE_BOOTSTRAP_FUNCTIONS_SH="included"
33
+
32 34
 # Escape sequence and resets, should use tput here instead of ANSI
33 35
 
34 36
 if [ "${MULLE_BOOTSTRAP_NO_COLOR}" != "YES" ]
... ...
@@ -889,6 +891,11 @@ run_script()
889 891
    if [ -x "${script}" ]
890 892
    then
891 893
       log_verbose "Executing script ${C_RESET_BOLD}${script}${C_VERBOSE} $1 ..."
894
+      if [ "${MULLE_BOOTSTRAP_TRACE}" = "YES" ]
895
+      then
896
+         log_trace "Environment:"
897
+         env >&2
898
+      fi
892 899
       exekutor "${script}" "$@" || fail "script \"${script}\" did not run successfully"
893 900
    else
894 901
       if [ ! -e "${script}" ]
... ...
@@ -973,7 +980,7 @@ Or do you feel lucky ?
973 980
    ${C_RESET_BOLD}rm $owd/${CLONESFETCH_SUBDIR}/.fetch_update_started${C_ERROR}
974 981
 and try again. But you've gotta ask yourself one question: Do I feel lucky ?
975 982
 Well, do ya, punk?
976
-(Same difference: if you are in \"${owd}\", ${C_RESET_BOLD}mulle-bootstrap fetch -f{C_ERROR})"
983
+(Same difference: if you are in \"${owd}\", ${C_RESET_BOLD}mulle-bootstrap fetch -f${C_ERROR})"
977 984
       exit 1
978 985
    fi
979 986
 }
... ...
@@ -1082,6 +1089,3 @@ add_line()
1082 1089
 ${line}"
1083 1090
    fi
1084 1091
 }
1085
-
1086
-
1087
-## 962: getting close to 1000 here
1088 1092
\ No newline at end of file
... ...
@@ -28,6 +28,7 @@
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
 #
31
+MULLE_BOOTSTRAP_GCC_SH="included"
31 32
 
32 33
 gcc_sdk_parameter()
33 34
 {
... ...
@@ -28,36 +28,38 @@
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
+MULLE_BOOTSTRAP_INIT_SH="included"
32
+
33
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
31 34
 
32
-. mulle-bootstrap-local-environment.sh
33 35
 
34 36
 #
35 37
 # this script creates a .bootstrap folder with some
36 38
 # demo files.
37 39
 #
38
-if [ "$1" = "-h" -o "$1" = "--help" ]
39
-then
40
-   echo "usage:
41
-  mulle_bootstrap init" >&2
42
-   exit 1
43
-fi
44 40
 
45
-BOOTSTRAP_SUBDIR=.bootstrap
46 41
 
42
+main_init()
43
+{
44
+  if [ "$1" = "-h" -o "$1" = "--help" ]
45
+  then
46
+     echo "usage:
47
+mulle_bootstrap init" >&2
48
+     exit 1
49
+  fi
47 50
 
48
-CREATE_DEFAULT_FILES="`read_config_setting "create_default_files" "YES"`"
49
-CREATE_EXAMPLE_FILES="`read_config_setting "create_example_files" "NO"`"
51
+  BOOTSTRAP_SUBDIR=.bootstrap
50 52
 
53
+  CREATE_DEFAULT_FILES="`read_config_setting "create_default_files" "YES"`"
54
+  CREATE_EXAMPLE_FILES="`read_config_setting "create_example_files" "NO"`"
51 55
 
52
-if [ -d "${BOOTSTRAP_SUBDIR}" ]
53
-then
54
-   log_warning "\"${BOOTSTRAP_SUBDIR}\" already exists"
55
-   exit 1
56
-fi
57 56
 
57
+  if [ -d "${BOOTSTRAP_SUBDIR}" ]
58
+  then
59
+     log_warning "\"${BOOTSTRAP_SUBDIR}\" already exists"
60
+     exit 1
61
+  fi
58 62
 
59
-main()
60
-{
61 63
    project=""
62 64
    for i in *.xcodeproj/project.pbxproj
63 65
    do
... ...
@@ -146,7 +148,7 @@ EOF
146 148
 
147 149
    if [ "${CREATE_EXAMPLE_FILES}" = "YES" ]
148 150
    then
149
-      log_fluff "Create example repository settings"
151
+      log_verbose "Create example repository settings"
150 152
 
151 153
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}/settings/MulleScion.example/bin"
152 154
 
... ...
@@ -219,5 +221,3 @@ EOF
219 221
      exekutor $editor "${BOOTSTRAP_SUBDIR}/repositories"
220 222
   fi
221 223
 }
222
-
223
-main "$@"
224 224
\ No newline at end of file
... ...
@@ -29,17 +29,12 @@
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
-. mulle-bootstrap-local-environment.sh
32
+MULLE_BOOTSTRAP_INSTALL_SH="included"
33 33
 
34
+[ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
34 35
 
35
-DEFAULT_PREFIX="/usr/local"
36
-DEFAULT_FRAMEWORK_PREFIX="/Library"
37 36
 
38
-CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
39
-N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
40
-
41
-
42
-check_and_usage_and_help()
37
+install_usage()
43 38
 {
44 39
    cat <<EOF >&2
45 40
 usage:
... ...
@@ -49,38 +44,10 @@ usage:
49 44
    The default libraryprefix is ${DEFAULT_PREFIX}
50 45
    The default frameworkprefix is ${DEFAULT_FRAMEWORK_PREFIX}
51 46
 EOF
47
+   exit 1
52 48
 }
53 49
 
54 50
 
55
-while :
56
-do
57
-   if [ "$1" = "-h" -o "$1" = "--help" ]
58
-   then
59
-      check_and_usage_and_help >&2
60
-      exit 1
61
-   fi
62
-
63
-   break
64
-done
65
-
66
-
67
-PREFIX="${1:-${DEFAULT_PREFIX}}"
68
-[ $# -eq 0 ] || shift
69
-
70
-
71
-case "`uname`" in
72
-   *)
73
-      INSTALL_FRAMEWORKS="NO"
74
-      ;;
75
-
76
-   Darwin)
77
-      FRAMEWORK_PREFIX="${1:-${DEFAULT_FRAMEWORK_PREFIX}}"
78
-      [ $# -eq 0 ] || shift
79
-      INSTALL_FRAMEWORKS="YES"
80
-      ;;
81
-esac
82
-
83
-
84 51
 install_libraries_with_action()
85 52
 {
86 53
    local action
... ...
@@ -308,10 +275,41 @@ install_frameworks_by_symlinking()
308 275
 # Currently only install the default configuration, which
309 276
 # is usually "Release"
310 277
 #
311
-main()
278
+install_main()
312 279
 {
280
+   log_fluff "::: install :::"
313 281
 
314
-   log_verbose "::: install :::"
282
+   DEFAULT_PREFIX="/usr/local"
283
+   DEFAULT_FRAMEWORK_PREFIX="/Library"
284
+
285
+   CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
286
+   N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
287
+
288
+   while :
289
+   do
290
+      if [ "$1" = "-h" -o "$1" = "--help" ]
291
+      then
292
+         install_usage
293
+      fi
294
+
295
+      break
296
+   done
297
+
298
+
299
+   PREFIX="${1:-${DEFAULT_PREFIX}}"
300
+   [ $# -eq 0 ] || shift
301
+
302
+   case "`uname`" in
303
+      *)
304
+         INSTALL_FRAMEWORKS="NO"
305
+         ;;
306
+
307
+      Darwin)
308
+         FRAMEWORK_PREFIX="${1:-${DEFAULT_FRAMEWORK_PREFIX}}"
309
+         [ $# -eq 0 ] || shift
310
+         INSTALL_FRAMEWORKS="YES"
311
+         ;;
312
+   esac
315 313
 
316 314
    if [ ! -d "${DEPENDENCY_SUBDIR}" ]
317 315
    then
... ...
@@ -342,5 +340,3 @@ Suggested fix:
342 340
    fi
343 341
 }
344 342
 
345
-
346
-main "$@"
... ...
@@ -28,12 +28,13 @@
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
+MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH="included"
31 32
 
32
-EXEC_VERSION=2.0  # paranoia
33
+MULLE_BOOTSTRAP_EXEC_VERSION=2.0  # paranoia
33 34
 
34
-if [ "${EXEC_VERSION}" != "${VERSION}" ]
35
+if [ "${MULLE_BOOTSTRAP_EXEC_VERSION}" != "${MULLE_BOOTSTRAP_VERSION}" ]
35 36
 then
36
-   echo "mulle-bootstrap is misinstalled (${EXEC_VERSION} vs ${VERSION})" >&2
37
+   echo "mulle-bootstrap is misinstalled (${MULLE_BOOTSTRAP_EXEC_VERSION} vs ${MULLE_BOOTSTRAP_VERSION})" >&2
37 38
    exit 1
38 39
 fi
39 40
 
... ...
@@ -46,7 +47,8 @@ then
46 47
    BOOTSTRAP_SUBDIR=.bootstrap
47 48
 fi
48 49
 
49
-. mulle-bootstrap-settings.sh
50
+[ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
51
+[ -z "${MULLE_BOOTSTRAP_MINGW_SH}" ] && . mulle-bootstrap-mingw.sh
50 52
 
51 53
 
52 54
 MULLE_BOOTSTRAP_TRACE="`read_config_setting "trace"`"
... ...
@@ -151,3 +153,23 @@ export ADDICTION_SUBDIR
151 153
 export HEADER_DIR_NAME
152 154
 export LIBRARY_DIR_NAME
153 155
 export FRAMEWORK_DIR_NAME
156
+
157
+
158
+UNAME="`uname`"
159
+log_fluff "${UNAME} detected"
160
+
161
+# get number of cores, use 50% more for make -j
162
+case "${UNAME}" in
163
+   MINGW*)
164
+      setup_mingw_environment
165
+
166
+      PATH_SEPARATOR=';'
167
+   ;;
168
+
169
+   *)
170
+      CORES="`get_core_count`"
171
+      CORES="`expr $CORES + $CORES / 2`"
172
+
173
+      PATH_SEPARATOR=':'
174
+      ;;
175
+esac
154 176
new file mode 100644
... ...
@@ -0,0 +1,91 @@
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
+MULLE_BOOTSTRAP_MINGW_SH="included"
32
+
33
+
34
+find_msvc_linker()
35
+{
36
+   local exe
37
+
38
+   exe="${1:-link.exe}"
39
+
40
+   local path
41
+   local old
42
+   local linker
43
+
44
+   old="${IFS}"
45
+   IFS=":"
46
+
47
+   for path in $PATH
48
+   do
49
+      case "${path}" in
50
+         /usr/*|/bin)
51
+            continue;
52
+         ;;
53
+
54
+         *)
55
+            linker="${path}/${exe}"
56
+            if [ -x "${linker}" ]
57
+            then
58
+               log_verbose "MSVC linker found as ${C_RESET}${linker}"
59
+               echo "${linker}"
60
+               break
61
+            fi
62
+         ;;
63
+      esac
64
+   done
65
+
66
+   IFS="${old}"
67
+}
68
+
69
+
70
+#
71
+# fix path fckup
72
+#
73
+setup_mingw_environment()
74
+{
75
+	local linker
76
+
77
+   if [ -z "${LIBPATH}" -o  -z "${INCLUDE}" ] && [ -z "${DONT_USE_VS}" ]
78
+   then
79
+      fail "environment variables INCLUDE and LIBPATH not set, start MINGW inside IDE environment"