Browse code

* mulle-bootstrap gains the uninit command, to completely remove .bootstrap stuff from project some bugfixes

Nat! authored on 21-08-2017 18:18:59
Showing 11 changed files
... ...
@@ -144,7 +144,7 @@ EOF
144 144
 
145 145
 _bootstrap_main()
146 146
 {
147
-   local command
147
+   local cmd
148 148
 
149 149
    log_debug "::: bootstrap begin :::"
150 150
 
... ...
@@ -311,11 +311,12 @@ bootstrap_init()
311 311
    set -o pipefail
312 312
 }
313 313
 
314
-
314
+#
315
+# global variables used (sick)
316
+#  orgpwd
317
+#  cmd
315 318
 bootstrap_cd_projectpath()
316 319
 {
317
-   local  orgpwd
318
-
319 320
    orgpwd="$PWD"
320 321
 
321 322
    while ! is_bootstrap_project
... ...
@@ -327,7 +328,7 @@ bootstrap_cd_projectpath()
327 328
 
328 329
       if [ "$PWD" = "${old}" ]
329 330
       then
330
-         if [ "${command}" = "seting" ]
331
+         if [ "${cmd}" = "setting" ]
331 332
          then
332 333
             cd "${orgpwd}"
333 334
          else
... ...
@@ -340,9 +341,6 @@ bootstrap_cd_projectpath()
340 341
 
341 342
 bootstrap_main()
342 343
 {
343
-   local command
344
-   local ps4string
345
-
346 344
    local MULLE_FLAG_ANSWER="ASK"
347 345
    local MULLE_FLAG_MAGNUM_FORCE="NONE"
348 346
    local MULLE_FLAG_IGNORE_GRAVEYARD="NO"
... ...
@@ -445,9 +443,12 @@ bootstrap_main()
445 443
    # hierarchy until we find a .bootstrap or .bootstrap.local folder
446 444
    # this is useful for `mulle-bootstrap paths` (with absolute paths)
447 445
    #
448
-   command="${1:-bootstrap}"
446
+   local cmd
447
+   local orgpwd
448
+
449
+   cmd="${1:-bootstrap}"
449 450
 
450
-   case "${command}" in
451
+   case "${cmd}" in
451 452
       help|init|uname)
452 453
       ;;
453 454
 
... ...
@@ -483,7 +484,7 @@ bootstrap_main()
483 484
       ;;
484 485
 
485 486
       "NONE")
486
-         case "${command}" in
487
+         case "${cmd}" in
487 488
             bootstrap|build|systeminstall|tag|update|upgrade)
488 489
                bootstrap_ensure_consistency
489 490
             ;;
... ...
@@ -491,12 +492,12 @@ bootstrap_main()
491 492
       ;;
492 493
    esac
493 494
 
494
-   MULLE_EXECUTABLE_FAIL_PREFIX="${MULLE_EXECUTABLE} ${command}"
495
+   MULLE_EXECUTABLE_FAIL_PREFIX="${MULLE_EXECUTABLE} ${cmd}"
495 496
    [ $# -eq 0 ] || shift
496 497
 
497 498
    MULLE_EXECUTABLE_OPTIONS="$@"
498 499
 
499
-   case "${command}" in
500
+   case "${cmd}" in
500 501
       bootstrap)
501 502
          _bootstrap_main "$@"
502 503
       ;;
... ...
@@ -641,6 +642,13 @@ bootstrap_main()
641 642
          exit 0
642 643
       ;;
643 644
 
645
+      uninit)
646
+         . mulle-bootstrap-clean.sh
647
+
648
+         uninit_main "$@" || exit 1
649
+      ;;
650
+
651
+
644 652
       update)
645 653
          . mulle-bootstrap-fetch.sh
646 654
 
... ...
@@ -666,7 +674,7 @@ bootstrap_main()
666 674
       ;;
667 675
 
668 676
       *)
669
-         log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown command \"${command}\""
677
+         log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown command \"${cmd}\""
670 678
          mulle_bootstrap_usage
671 679
       ;;
672 680
    esac
... ...
@@ -45,7 +45,7 @@ find_cmake()
45 45
 tools_environment_cmake()
46 46
 {
47 47
    local name="$1"
48
-   local srcdir="$2"
48
+#   local projectdir="$2"
49 49
 
50 50
    tools_environment_make "$@"
51 51
 
... ...
@@ -92,29 +92,16 @@ build_cmake()
92 92
 {
93 93
    log_entry "build_cmake" "$@"
94 94
 
95
-   local cmakefile="$1"
96
-   shift
95
+   local projectfile="$1"
96
+   local configuration="$2"
97
+   local srcdir="$3"
98
+   local builddir="$4"
99
+   local name="$5"
100
+   local sdk="$6"
97 101
 
98
-   local configuration="$1"
99
-   local srcdir="$2"
100
-   local builddir="$3"
101
-   local name="$4"
102
-   local sdk="$5"
102
+   local projectdir
103 103
 
104
-   if [ -z "${CMAKE}" ]
105
-   then
106
-      fail "No cmake available"
107
-   fi
108
-
109
-   if [ -z "${MAKE}" ]
110
-   then
111
-      fail "No make available"
112
-   fi
113
-
114
-   log_info "Let ${C_RESET_BOLD}cmake${C_INFO} do a \
115
-${C_MAGENTA}${C_BOLD}${configuration}${C_INFO} build of \
116
-${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
117
-${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
104
+   projectdir="`dirname -- "${projectfile}"`"
118 105
 
119 106
    local sdkparameter
120 107
    local local_cmake_flags
... ...
@@ -161,7 +148,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
161 148
    mapped="`read_build_setting "${name}" "cmake-${configuration}.map" "${configuration}"`"  || exit 1
162 149
 
163 150
    flaglines="`build_cmake_flags "${configuration}" \
164
-                                 "${srcdir}" \
151
+                                 "${projectdir}" \
165 152
                                  "${builddir}" \
166 153
                                  "${name}" \
167 154
                                  "${sdk}" \
... ...
@@ -310,12 +297,12 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
310 297
          cmake_dirs="`concat "${cmake_dirs}" "-DCMAKE_FRAMEWORK_PATH='${frameworklines}'"`"
311 298
       fi
312 299
 
313
-      local relative_srcdir
300
+      local relative_projectdir
314 301
 
315
-      relative_srcdir="`relative_path_between "${owd}/${srcdir}" "${PWD}"`"
302
+      relative_projectdir="`relative_path_between "${owd}/${projectdir}" "${PWD}"`"
316 303
       case "${UNAME}" in
317 304
          mingw)
318
-            relative_srcdir="`echo "${relative_srcdir}" | tr '/' '\\'  2> /dev/null`"
305
+            relative_projectdir="`echo "${relative_projectdir}" | tr '/' '\\'  2> /dev/null`"
319 306
       esac
320 307
 
321 308
       logging_redirect_eval_exekutor "${logfile1}" "'${CMAKE}'" \
... ...
@@ -330,7 +317,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
330 317
 "${cxx_compiler_line}" \
331 318
 "${local_cmake_flags}" \
332 319
 "${CMAKEFLAGS}" \
333
-"'${relative_srcdir}'"
320
+"'${relative_projectdir}'"
334 321
       rval=$?
335 322
 
336 323
       if [ $rval -ne 0 ]
... ...
@@ -360,13 +347,19 @@ test_cmake()
360 347
    local builddir="$3"
361 348
    local name="$4"
362 349
 
363
-   if [ ! -f "${srcdir}/CMakeLists.txt" ]
350
+   local projectfile
351
+   local projectdir
352
+
353
+   projectfile="`find_nearest_matching_pattern "${srcdir}" "CMakeLists.txt"`"
354
+   if [ ! -f "${projectfile}" ]
364 355
    then
365 356
       log_fluff "There is no CMakeLists.txt file in \"${srcdir}\""
366 357
       return 1
367 358
    fi
359
+   projectfile="${srcdir}/${projectfile}"
360
+   projectdir="`dirname -- "${projectfile}"`"
368 361
 
369
-   tools_environment_cmake "${name}" "${srcdir}"
362
+   tools_environment_cmake "${name}" "${projectdir}"
370 363
 
371 364
    if [ -z "${CMAKE}" ]
372 365
    then
... ...
@@ -374,5 +367,12 @@ test_cmake()
374 367
       return 1
375 368
    fi
376 369
 
370
+   if [ -z "${MAKE}" ]
371
+   then
372
+      fail "No make available"
373
+   fi
374
+
375
+   PROJECTFILE="${projectfile}"
376
+
377 377
    return 0
378 378
 }
... ...
@@ -39,26 +39,18 @@ MULLE_BOOTSTRAP_BUILD_PLUGIN_CONFIGURE_SH="included"
39 39
 #
40 40
 build_configure()
41 41
 {
42
-   log_debug "build_configure" "$*"
42
+   log_entry "build_configure" "$@"
43 43
 
44
-   local script="$1"
45
-   shift
44
+   local projectfile="$1"
45
+   local configuration="$2"
46
+   local srcdir="$3"
47
+   local builddir="$4"
48
+   local name="$5"
49
+   local sdk="$6"
46 50
 
47
-   local configuration="$1"
48
-   local srcdir="$2"
49
-   local builddir="$3"
50
-   local name="$4"
51
-   local sdk="$5"
51
+   local projectdir
52 52
 
53
-   if [ -z "${MAKE}" ]
54
-   then
55
-      fail "No make available"
56
-   fi
57
-
58
-   log_info "Let ${C_RESET_BOLD}configure${C_INFO} do a \
59
-${C_MAGENTA}${C_BOLD}${configuration}${C_INFO} build of \
60
-${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
61
-${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
53
+   projectdir="`dirname -- "${projectfile}"`"
62 54
 
63 55
    local configure_flags
64 56
 
... ...
@@ -205,7 +197,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
205 197
          "${c_compiler_line}" \
206 198
          "${cxx_compiler_line}" \
207 199
          "${env_flags}" \
208
-         "'${owd}/${script}'" \
200
+         "'${owd}/${projectdir}/configure'" \
209 201
          "${configure_flags}" \
210 202
          --prefix "'${prefixbuild}'"
211 203
       rval=$?
... ...
@@ -237,19 +229,25 @@ test_configure()
237 229
    local builddir="$3"
238 230
    local name="$4"
239 231
 
240
-   if [ ! -f "${srcdir}/configure" ]
232
+   local projectfile
233
+   local projectdir
234
+
235
+   projectfile="`find_nearest_matching_pattern "${srcdir}" "configure"`"
236
+   if [ -z "${projectfile}" ]
241 237
    then
242
-      log_fluff "No configure script found in \"${srcdir}\""
238
+      log_fluff "There is no configure project in \"${srcdir}\""
243 239
       return 1
244 240
    fi
241
+   projectfile="${srcdir}/${projectfile}"
242
+   projectdir="`dirname -- "${projectfile}"`"
245 243
 
246
-   if ! [ -x "${srcdir}/configure" ]
244
+   if ! [ -x "${projectdir}/configure" ]
247 245
    then
248
-      log_fluff "Configure script in \"${srcdir}\" is not executable"
246
+      log_fluff "Configure script in \"${projectdir}\" is not executable"
249 247
       return 1
250 248
    fi
251 249
 
252
-   tools_environment_make "${name}" "${srcdir}"
250
+   tools_environment_make "${name}" "${projectdir}"
253 251
 
254 252
    if [ -z "${MAKE}" ]
255 253
    then
... ...
@@ -257,6 +255,6 @@ test_configure()
257 255
       return 1
258 256
    fi
259 257
 
260
-   PARAMETER="${srcdir}/configure"
258
+   PROJECTFILE="${projectfile}"
261 259
    return 0
262 260
 }
... ...
@@ -43,11 +43,7 @@ build_script()
43 43
 {
44 44
    log_entry "build_script" "$@"
45 45
 
46
-   local script
47
-
48
-   script="$1"
49
-   shift
50
-
46
+   local script="$1"
51 47
    local configuration="$1"
52 48
    local srcdir="$2"
53 49
    local builddir="$3"
... ...
@@ -138,6 +134,6 @@ test_script()
138 134
       return 1
139 135
    fi
140 136
 
141
-   PARAMETER="${script}"
137
+   PROJECTFILE="${script}"
142 138
    return 0
143 139
 }
... ...
@@ -42,11 +42,10 @@ find_xcodebuild()
42 42
 }
43 43
 
44 44
 
45
-
46 45
 tools_environment_xcodebuild()
47 46
 {
48 47
    local name="$1"
49
-   local srcdir="$2"
48
+#   local projectdir="$2"
50 49
 
51 50
    tools_environment_common "$@"
52 51
 
... ...
@@ -70,11 +69,37 @@ xcode_get_setting()
70 69
 }
71 70
 
72 71
 
72
+xcode_fixup_header_path()
73
+{
74
+   local key="$1" ; shift
75
+   local setting_key="$1" ; shift
76
+   local name="$1"; shift
77
+   local default="$1" ; shift
78
+
79
+   headers="`read_build_setting "${name}" "${setting_key}"`"
80
+
81
+   # headers setting overrides
82
+   if [ -z "${headers}" ]
83
+   then
84
+      if ! read_yes_no_build_setting "${name}" "xcode_mangle_header_paths"
85
+      then
86
+         return
87
+      fi
88
+
89
+      headers="`create_mangled_header_path "${key}" "${name}" "${default}"`"
90
+   fi
91
+
92
+   log_fluff "${key} set to \"${headers}\""
93
+
94
+   echo "${headers}"
95
+}
96
+
97
+
73 98
 _build_xcodebuild()
74 99
 {
75 100
    log_entry "_build_xcodebuild" "$@"
76 101
 
77
-   local project="$1"
102
+   local projectfile="$1"
78 103
    local configuration="$2"
79 104
    local srcdir="$3"
80 105
    local builddir="$4"
... ...
@@ -88,36 +113,11 @@ _build_xcodebuild()
88 113
    [ ! -z "${builddir}" ]      || internal_fail "builddir is empty"
89 114
    [ ! -z "${name}" ]          || internal_fail "name is empty"
90 115
    [ ! -z "${sdk}" ]           || internal_fail "sdk is empty"
91
-   [ ! -z "${project}" ]       || internal_fail "project is empty"
116
+   [ ! -z "${projectfile}" ]   || internal_fail "project is empty"
92 117
 
118
+   local projectdir
93 119
 
94
-   local toolname
95
-
96
-   toolname="`read_config_setting "xcodebuild" "xcodebuild"`"
97
-
98
-   local info
99
-
100
-   info=""
101
-   if [ ! -z "${targetname}" ]
102
-   then
103
-      info=" Target ${C_MAGENTA}${C_BOLD}${targetname}${C_INFO}"
104
-   fi
105
-
106
-   if [ ! -z "${schemename}" ]
107
-   then
108
-      info=" Scheme ${C_MAGENTA}${C_BOLD}${schemename}${C_INFO}"
109
-   fi
110
-
111
-   log_info "Let ${C_RESET_BOLD}${toolname}${C_INFO} do a \
112
-${C_MAGENTA}${C_BOLD}${configuration}${C_INFO} build of \
113
-${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
114
-${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
115
-\"${builddir}\" ..."
116
-
117
-   local projectname
118
-
119
-    # always pass project directly
120
-   projectname=`read_build_setting "${name}" "xcode_project" "${project}"`
120
+   projectdir="`dirname -- "${projectfile}"`"
121 121
 
122 122
    local mapped
123 123
    local fallback
... ...
@@ -168,16 +168,18 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
168 168
    # xcodebuild can just use a target
169 169
    # xctool is by and large useless fluff IMO
170 170
    #
171
-   if [ "${toolname}" = "xctool"  -a "${schemename}" = ""  ]
171
+   if [ "${TOOLNAME}" = "xctool"  -a "${schemename}" = ""  ]
172 172
    then
173 173
       if [ ! -z "$targetname" ]
174 174
       then
175 175
          schemename="${targetname}"
176 176
          targetname=
177 177
       else
178
-         echo "Please specify a scheme to compile in ${BOOTSTRAP_DIR}/${name}/SCHEME for xctool" >& 2
179
-         echo "and be sure that this scheme exists and is shared." >& 2
180
-         echo "Or just delete ${HOME}/.mulle-bootstrap/xcodebuild and use xcodebuild (preferred)" >& 2
178
+         cat <<EOF >&2
179
+Please specify a scheme to compile in ${BOOTSTRAP_DIR}/${name}/SCHEME for
180
+xctool and be sure that this scheme exists and is shared. Or delete
181
+${HOME}/.mulle-bootstrap/xcodebuild and use xcodebuild (preferred).
182
+EOF
181 183
          exit 1
182 184
       fi
183 185
    fi
... ...
@@ -216,15 +218,15 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
216 218
    local default
217 219
 
218 220
    default="/include/${name}"
219
-   public_headers="`fixup_header_path "PUBLIC_HEADERS_FOLDER_PATH" "xcode_public_headers" "${name}" "${default}" ${arguments}`"
221
+   public_headers="`xcode_fixup_header_path "PUBLIC_HEADERS_FOLDER_PATH" "xcode_public_headers" "${name}" "${default}" ${arguments}`"
220 222
    default="/include/${name}/private"
221
-   private_headers="`fixup_header_path "PRIVATE_HEADERS_FOLDER_PATH" "xcode_private_headers" "${name}" "${default}" ${arguments}`"
223
+   private_headers="`xcode_fixup_header_path "PRIVATE_HEADERS_FOLDER_PATH" "xcode_private_headers" "${name}" "${default}" ${arguments}`"
222 224
 
223 225
    local logfile
224 226
 
225 227
    mkdir_if_missing "${BUILDLOGS_DIR}"
226 228
 
227
-   logfile="`build_log_name "${toolname}" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`"
229
+   logfile="`build_log_name "${TOOLNAME}" "${name}" "${configuration}" "${targetname}" "${schemename}" "${sdk}"`" || exit 1
228 230
 
229 231
    set -f
230 232
 
... ...
@@ -281,7 +283,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
281 283
    fi
282 284
 
283 285
    owd=`pwd`
284
-   exekutor cd "${srcdir}" || exit 1
286
+   exekutor cd "${projectdir}" || exit 1
285 287
 
286 288
       # DONT READ CONFIG SETTING IN THIS INDENT
287 289
       if [ "${MULLE_FLAG_VERBOSE_BUILD}" = "YES" ]
... ...
@@ -399,7 +401,7 @@ FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
399 401
       rval=$?
400 402
 
401 403
       PATH="${oldpath}"
402
-      [ $rval -ne 0 ] && build_fail "${logfile}" "${toolname}"
404
+      [ $rval -ne 0 ] && build_fail "${logfile}" "${TOOLNAME}"
403 405
       set +f
404 406
 
405 407
    exekutor cd "${owd}"
... ...
@@ -456,19 +458,38 @@ test_xcodebuild()
456 458
 {
457 459
    log_entry "test_xcodebuild" "$@"
458 460
 
461
+   [ -z "${MULLE_BOOTSTRAP_XCODE_SH}" ] && . mulle-bootstrap-xcode.sh
462
+
459 463
    local configuration="$1"
460 464
    local srcdir="$2"
461 465
    local builddir="$3"
462 466
    local name="$4"
463 467
 
464
-   project="`(cd "${srcdir}" ; find_xcodeproj "${name}")`"
465
-   if [ -z "${project}" ]
468
+   local projectfile
469
+   local projectdir
470
+
471
+   local projectname
472
+
473
+    # always pass project directly
474
+   projectfile=`read_build_setting "${name}" "xcode_project"`
475
+   if [ ! -z "${projectfile}" ]
466 476
    then
467
-      log_fluff "There is no Xcode project in \"${srcdir}\""
468
-      return 1
477
+      projectfile="${srcdir}/${projectfile}"
469 478
    fi
470 479
 
471
-   tools_environment_xcodebuild "${name}" "${srcdir}"
480
+   if [ ! -d "${projectfile}" ]
481
+   then
482
+      projectfile="`find_nearest_matching_pattern "${srcdir}" "*.xcodeproj" "${name}.xcodeproj"`"
483
+      if [ -z "${projectfile}" ]
484
+      then
485
+         log_fluff "There is no Xcode project in \"${srcdir}\""
486
+         return 1
487
+      fi
488
+      projectfile="${srcdir}/${projectfile}"
489
+   fi
490
+   projectdir="`dirname -- "${projectfile}"`"
491
+
492
+   tools_environment_xcodebuild "${name}" "${projectdir}"
472 493
 
473 494
    if [ -z "${XCODEBUILD}" ]
474 495
    then
... ...
@@ -476,7 +497,18 @@ test_xcodebuild()
476 497
       return 1
477 498
    fi
478 499
 
479
-   PARAMETER="${project}"
500
+   if [ ! -z "${targetname}" ]
501
+   then
502
+      AUXINFO=" Target ${C_MAGENTA}${C_BOLD}${targetname}${C_INFO}"
503
+   fi
504
+
505
+   if [ ! -z "${schemename}" ]
506
+   then
507
+      AUXINFO=" Scheme ${C_MAGENTA}${C_BOLD}${schemename}${C_INFO}"
508
+   fi
509
+
510
+   TOOLNAME="`read_config_setting "xcodebuild" "xcodebuild"`"
511
+   PROJECTFILE="${projectfile}"
480 512
    WASXCODE="YES"
481 513
 
482 514
    return 0
... ...
@@ -570,41 +570,6 @@ create_mangled_header_path()
570 570
 }
571 571
 
572 572
 
573
-fixup_header_path()
574
-{
575
-   local key
576
-   local setting_key
577
-   local default
578
-   local name
579
-
580
-   key="$1"
581
-   shift
582
-   setting_key="$1"
583
-   shift
584
-   name="$1"
585
-   shift
586
-   default="$1"
587
-   shift
588
-
589
-   headers="`read_build_setting "${name}" "${setting_key}"`"
590
-   if [ "$headers" = "" ]
591
-   then
592
-      read_yes_no_build_setting "${name}" "xcode_mangle_header_paths"
593
-      if [ $? -ne 0 ]
594
-      then
595
-         return 1
596
-      fi
597
-
598
-      headers="`create_mangled_header_path "${key}" "${name}" "${default}"`"
599
-   fi
600
-
601
-   log_fluff "${key} set to \"${headers}\""
602
-
603
-   echo "${headers}"
604
-}
605
-
606
-
607
-
608 573
 build_with_configuration_sdk_preferences()
609 574
 {
610 575
    log_entry "build_with_configuration_sdk_preferences" "$@"
... ...
@@ -636,17 +601,30 @@ build_with_configuration_sdk_preferences()
636 601
    local project
637 602
    local rval
638 603
    local WASXCODE
639
-   local PARAMETER
604
+   local PROJECTFILE
605
+   local TOOLNAME
606
+   local AUX_INFO
640 607
 
641 608
    rval=1
642 609
    for preference in ${preferences}
643 610
    do
644 611
       WASXCODE="NO"
645
-      PARAMETER=
612
+      PROJECTFILE=
613
+      TOOLNAME="${preference}"
614
+      AUX_INFO=
615
+
646 616
       test_${preference} "${configuration}" "${srcdir}" "${builddir}" "${name}"
647 617
       if [ $? -eq 0 ]
648 618
       then
649
-         build_${preference} "${PARAMETER}" "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}"
619
+         [ -z "${PROJECTFILE}" ] && internal_fail "test_${preference} did not set PROJECTFILE"
620
+            #statements
621
+
622
+         log_info "Let ${C_RESET_BOLD}${TOOLNAME}${C_INFO} do a \
623
+${C_MAGENTA}${C_BOLD}${configuration}${C_INFO} build of \
624
+${C_MAGENTA}${C_BOLD}${name}${C_INFO} for SDK \
625
+${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${AUX_INFO} in \"${builddir}\" ..."
626
+
627
+         build_${preference} "${PROJECTFILE}" "${configuration}" "${srcdir}" "${builddir}" "${name}" "${sdk}"
650 628
          if [ $? -ne 0 ]
651 629
          then
652 630
             internal_fail "$build_${preference} should exit on failure and not return"
... ...
@@ -751,6 +729,7 @@ build()
751 729
             preferences="`read_config_setting "build_preferences" "script
752 730
 cmake
753 731
 configure
732
+autoconf
754 733
 xcodebuild"`"
755 734
          ;;
756 735
 
... ...
@@ -758,7 +737,8 @@ xcodebuild"`"
758 737
          *)
759 738
             preferences="`read_config_setting "build_preferences" "script
760 739
 cmake
761
-configure"`"
740
+configure
741
+autoconf"`"
762 742
          ;;
763 743
       esac
764 744
    fi
... ...
@@ -486,8 +486,6 @@ clean_main()
486 486
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
487 487
    [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ]    && . mulle-bootstrap-repositories.sh
488 488
 
489
-   [ -z "${DEFAULT_IFS}" ] && internal_fail "IFS fail"
490
-
491 489
    while [ $# -ne 0 ]
492 490
    do
493 491
       case "$1" in
... ...
@@ -551,3 +549,55 @@ clean_main()
551 549
       ;;
552 550
    esac
553 551
 }
552
+
553
+
554
+clean_usage()
555
+{
556
+   cat <<EOF >&2
557
+Usage:
558
+   ${MULLE_EXECUTABLE} uninit
559
+
560
+   Completely remove all mulle-bootstrap files from project.
561
+EOF
562
+   exit 1
563
+}
564
+
565
+
566
+uninit_main()
567
+{
568
+   log_debug "::: uninit :::"
569
+
570
+   local ROOT_DIR="`pwd -P`"
571
+
572
+   local OPTION_MINION_NAMES=
573
+
574
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
575
+   [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
576
+   [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ]    && . mulle-bootstrap-repositories.sh
577
+
578
+   while [ $# -ne 0 ]
579
+   do
580
+      case "$1" in
581
+         -h|-help|--help)
582
+            unit_usage
583
+         ;;
584
+
585
+         -*)
586
+            log_error "${MULLE_EXECUTABLE_FAIL_PREFIX}: Unknown uninit option $1"
587
+            clean_usage
588
+         ;;
589
+
590
+         *)
591
+            break
592
+         ;;
593
+      esac
594
+
595
+      shift
596
+   done
597
+
598
+   clean_execute "dist"
599
+   clean_directories "${BOOTSTRAP_DIR}"
600
+   clean_directories "${BOOTSTRAP_DIR}.local"
601
+}
602
+
603
+
... ...
@@ -141,54 +141,6 @@ platform_cmake_generator()
141 141
 }
142 142
 
143 143
 
144
-#
145
-# first find a project with matching name, otherwise find
146
-# first nearest project
147
-#
148
-find_xcodeproj()
149
-{
150
-   local found
151
-   local expect
152
-   local depth
153
-
154
-   found=""
155
-   expect="$1"
156
-   depth=1000
157
-   #     IFS='\0'
158
-
159
-   local match
160
-   local new_depth
161
-
162
-   #
163
-   # don't go too deep in search
164
-   #
165
-   for i in `find . -maxdepth 2 -name "*.xcodeproj" -print`
166
-   do
167
-      match=`basename -- "${i}" .xcodeproj`
168
-      if [ "$match" = "$expect" ]
169
-      then
170
-         echo "$i"
171
-         return 0
172
-      fi
173
-
174
-      new_depth=`path_depth "$i"`
175
-      if [ "$new_depth" -lt "$depth" ]
176
-      then
177
-         found="${i}"
178
-         depth="$new_depth"
179
-      fi
180
-   done
181
-
182
-   if [ ! -z "$found" ]
183
-   then
184
-      echo "${found}"
185
-      return 0
186
-   fi
187
-
188
-   return 1
189
-}
190
-
191
-
192 144
 which_binary()
193 145
 {
194 146
    local toolname
... ...
@@ -1174,6 +1174,90 @@ remove_file_if_present()
1174 1174
    fi
1175 1175
 }
1176 1176
 
1177
+
1178
+#
1179
+# first find a project with matching name, otherwise find
1180
+# first nearest project
1181
+#
1182
+_find_nearest_matching_pattern()
1183
+{
1184
+   local pattern="$1"
1185
+   local expectation="$2"
1186
+
1187
+   local found
1188
+   local depth
1189
+
1190
+   found=""
1191
+   depth=1000
1192
+
1193
+   #     IFS='\0'
1194
+
1195
+   local match
1196
+   local new_depth
1197
+
1198
+   #
1199
+   # don't go too deep in search
1200
+   #
1201
+   IFS="
1202
+"
1203
+   for i in `find . -maxdepth 2 -name "${pattern}" -print`
1204
+   do
1205
+      IFS="${DEFAULT_IFS}"
1206
+
1207
+      match=`basename -- "$i"`
1208
+      if [ "${match}" = "${expectation}" ]
1209
+      then
1210
+         echo "$i"
1211
+         return 0
1212
+      fi
1213
+
1214
+      new_depth="`path_depth "$i"`"
1215
+      if [ "${new_depth}" -lt "${depth}" ]
1216
+      then
1217
+         found="$i"
1218
+         depth="${new_depth}"
1219
+      fi
1220
+   done
1221
+
1222
+   if [ ! -z "${found}" ]
1223
+   then
1224
+      found="`sed 's|^\./||g' <<< "${found}"`"
1225
+      echo "${found}"
1226
+      return 0
1227
+   fi
1228
+
1229
+   return 1
1230
+}
1231
+
1232
+
1233
+find_nearest_matching_pattern()
1234
+{
1235
+   log_entry "find_nearest_matching_pattern" "$@"
1236
+
1237
+   local directory="$1" ; shift
1238
+
1239
+   if [ ! -d "${directory}" ]
1240
+   then
1241
+      log_warning "\"${directory}\" not found"
1242
+      return 1
1243
+   fi
1244
+
1245
+   local rval
1246
+   local oldwd
1247
+
1248
+   oldwd="${PWD}"
1249
+   cd "${directory}"
1250
+
1251
+      _find_nearest_matching_pattern "$@"
1252
+      rval="$?"
1253
+      IFS="${DEFAULT_IFS}"
1254
+
1255
+   cd "${oldwd}"
1256
+
1257
+   return $rval
1258
+}
1259
+
1260
+
1177 1261
 # ####################################################################
1178 1262
 #                        Symbolic Links
1179 1263
 # ####################################################################
... ...
@@ -160,12 +160,20 @@ EOF
160 160
          log_info "${BOOTSTRAP_DIR} has been created. Use
161 161
    ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE} setting -g -r -a repositories <url>${C_INFO}
162 162
 to specify dependencies and then install them with
163
-   ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE}${C_INFO}"
163
+   ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE}${C_INFO}
164
+E.g.:${C_RESET}${C_FAINT}
165
+${MULLE_EXECUTABLE} setting -g -r -a repositories 'https://github.com/madler/zlib.git'
166
+${MULLE_EXECUTABLE}${C_INFO}
167
+"
164 168
       else
165 169
          log_info "${BOOTSTRAP_DIR} has been created. Use
166 170
    ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE} setting -g -r -a brews <name>${C_INFO}
167 171
 to specify brew formula to fetch and then install them with
168
-   ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE}${C_INFO}"
172
+   ${C_RESET}${C_BOLD}${MULLE_EXECUTABLE}${C_INFO}
173
+E.g.:${C_RESET}${C_FAINT}
174
+${MULLE_EXECUTABLE} setting --g -r -a brews 'ack'
175
+${MULLE_EXECUTABLE}${C_INFO}
176
+"
169 177
       fi
170 178
       return
171 179
    fi
... ...
@@ -49,6 +49,17 @@ EOF
49 49
 }
50 50
 
51 51
 
52
+
53
+#
54
+# first find a project with matching name, otherwise find
55
+# first nearest project
56
+#
57
+find_xcodeproj()
58
+{
59
+   find_nearest_matching_pattern "${PWD}" "*.xcodeproj" "$1.xcodeproj"
60
+}
61
+
62
+
52 63
 list_configurations()
53 64
 {
54 65
    local project
... ...
@@ -384,6 +395,7 @@ xcode_main()
384 395
 
385 396
    [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]        && . mulle-bootstrap-settings.sh
386 397
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
398
+   [ -z "${MULLE_BOOTSTRAP_COMMON_XCODE_SH}" ]    && . mulle-bootstrap-common-xcode.sh
387 399
 
388 400
    if [ "${UNAME}" != 'darwin' ]
389 401
    then