Browse code

Some logging changes. Run brews only on Linux and Darwin. -V flag has "make VERBOSE=1" meaning so to speak now.

Nat! authored on 27-06-2016 13:41:24
Showing 13 changed files
... ...
@@ -16,7 +16,10 @@ eliminated.
16 16
 * new clean target "install"
17 17
 * removed convert-pre-0.10 and ibuild commands
18 18
 * ConsoleMovies are gone, I am too lazy to maintain them.
19
-
19
+* Improve generation of -F and -L flags in cmake and configure
20
+* cmake and configure always add `/usr/local/include` and link with `/usr/local/lib`
21
+(mostly due to brew installing dependencies there).
22
+* redid the verbosity logging with -v, -vv , -vvv, -t
20 23
 
21 24
 0.26
22 25
 ===
... ...
@@ -157,7 +157,8 @@ Setting Name                      |  Description
157 157
 `absolute_symlinks`               | Use absolute symlinks instead of relatives    | NO
158 158
 `symlink_forbidden`               | mulle-bootstrap will not attempt to symlink   | NO
159 159
 `update_gitignore`                | add cleanable directories to .gitignore       | YES
160
-
160
+`check_usr_local_include`         | do not install, if a system header of same    |
161
+                                  | is present in `/usr/local/include`            | NO
161 162
 
162 163
 Build Config Settings
163 164
 
... ...
@@ -84,6 +84,15 @@ do
84 84
       continue
85 85
    fi
86 86
 
87
+   if [ "$1" = "-V" ]
88
+   then
89
+      MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
90
+      export MULLE_BOOTSTRAP_VERBOSE_BUILD
91
+
92
+      [ $# -eq 0 ] || shift
93
+      continue
94
+   fi
95
+
87 96
    if [ "$1" = "-v" ]
88 97
    then
89 98
       if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
... ...
@@ -100,11 +109,27 @@ do
100 109
       continue
101 110
    fi
102 111
 
103
-   if [ "$1" = "-V" ]
112
+   if [ "$1" = "-vv" ]
113
+   then
114
+      if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
115
+      then
116
+         MULLE_BOOTSTRAP_TRACE="FLUFF"
117
+         export MULLE_BOOTSTRAP_TRACE
118
+      fi
119
+
120
+      COPYMOVEFLAGS="-v"
121
+      export COPYMOVEFLAGS
122
+      GITFLAGS="-v"
123
+      export GITFLAGS
124
+      [ $# -eq 0 ] || shift
125
+      continue
126
+   fi
127
+
128
+   if [ "$1" = "-vvv" ]
104 129
    then
105 130
       if [ -z "${MULLE_BOOTSTRAP_TRACE}" ]
106 131
       then
107
-         MULLE_BOOTSTRAP_TRACE="ALL"
132
+         MULLE_BOOTSTRAP_TRACE="TRACE"
108 133
          export MULLE_BOOTSTRAP_TRACE
109 134
       fi
110 135
 
... ...
@@ -140,8 +165,10 @@ usage: mulle-bootstrap [-a|-y][-n][-v|-s|-t] [command] [--help]
140 165
    -a -y     : default answer to questions (scripts wont be checked)
141 166
                -a (clone preferred) -y (symlink preferred)
142 167
    -n        : do nothing creative or destructive
143
-   -v -s -t  : -v be more verbose (-V even more verbose), -s be more terse
168
+   -v -s -t  : -v to be more verbose (-vv or -vvv for more verbosity)
169
+               -s to be more terse
144 170
                -t turns on shell tracing for development
171
+   -V        : show build commands
145 172
 
146 173
  Common user commands:
147 174
    clone     : git clone a remote repository and try to bootstrap and build it
... ...
@@ -43,8 +43,9 @@ fetch_brew_if_needed()
43 43
 Install brew now (Linux or OS X should work) ? "
44 44
       if [ $? -ne 0 ]
45 45
       then
46
-         return 1
46
+         return 2
47 47
       fi
48
+
48 49
       if [ "`uname`" = 'Darwin' ]
49 50
       then
50 51
          log_info "Installing OS X brew"
... ...
@@ -591,7 +591,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
591 591
       logfile1="${owd}/${logfile1}"
592 592
       logfile2="${owd}/${logfile2}"
593 593
 
594
-      if [ "$MULLE_BOOTSTRAP_VERBOSE" != "" ]
594
+      if [ "$MULLE_BOOTSTRAP_VERBOSE_BUILD" = "YES" ]
595 595
       then
596 596
          logfile1="`tty`"
597 597
          logfile2="$logfile1"
... ...
@@ -602,6 +602,30 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
602 602
          logfile2="/dev/null"
603 603
       fi
604 604
 
605
+      local frameworklines
606
+      local librarylines
607
+
608
+      frameworklines=
609
+      librarylines=
610
+
611
+      if [ ! -z "${suffixsubdir}" ]
612
+      then
613
+         frameworklines="-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"
614
+         librarylines="-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"
615
+      fi
616
+
617
+      if [ ! -z "${mappedsubdir}" -a "${mappedsubdir}" != "${suffixsubdir}" ]
618
+      then
619
+         frameworklines="${frameworklines} -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"
620
+         librarylines="${librarylines} -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"
621
+      fi
622
+
623
+      if [ ! -z "${fallbacksubdir}" -a "${fallbacksubdir}" != "${suffixsubdir}" -a "${fallbacksubdir}" != "${mappedsubdir}" ]
624
+      then
625
+         frameworklines="${frameworklines} -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"
626
+         librarylines="${librarylines} -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"
627
+      fi
628
+
605 629
       local relative_srcdir
606 630
 
607 631
       relative_srcdir="`relative_path_between "${owd}/${srcdir}" "${PWD}"`"
... ...
@@ -612,36 +636,37 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
612 636
 "-DCMAKE_INSTALL_PREFIX:PATH=${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local"  \
613 637
 "-DCMAKE_C_FLAGS=\
614 638
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
615
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
616
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
617
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
639
+-I/usr/local/include \
640
+${frameworklines} \
618 641
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
619 642
 ${other_cflags}" \
620 643
 "-DCMAKE_CXX_FLAGS=\
621 644
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
622
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
623
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
624
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
645
+-I/usr/local/include \
646
+${frameworklines} \
625 647
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
626 648
 ${other_cppflags}" \
627 649
 "-DCMAKE_EXE_LINKER_FLAGS=\
628
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
629
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
630
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
650
+${librarylines} \
631 651
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
652
+-L/usr/local/lib \
632 653
 ${other_ldflags}" \
633 654
 "-DCMAKE_SHARED_LINKER_FLAGS=\
634
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
635
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
636
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
655
+${librarylines} \
637 656
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
657
+-L/usr/local/lib \
638 658
 ${other_ldflags}" \
639 659
 "-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH};\${CMAKE_MODULE_PATH}" \
640 660
 ${CMAKE_FLAGS} \
641 661
 ${localcmakeflags} \
642 662
 "${relative_srcdir}" > "${logfile1}" || build_fail "${logfile1}" "cmake"
643 663
 
644
-      logging_exekutor make ${local_make_flags} VERBOSE=1 install > "${logfile2}" || build_fail "${logfile2}" "make"
664
+      if [ MULLE_BOOTSTRAP_VERBOSE_BUILD = "YES" ]
665
+      then
666
+         local_make_flags="${local_make_flags} VERBOSE=1"
667
+      fi
668
+
669
+      logging_exekutor make ${local_make_flags} install > "${logfile2}" || build_fail "${logfile2}" "make"
645 670
 
646 671
       set +f
647 672
 
... ...
@@ -736,7 +761,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
736 761
       logfile1="${owd}/${logfile1}"
737 762
       logfile2="${owd}/${logfile2}"
738 763
 
739
-      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
764
+      if [ "$MULLE_BOOTSTRAP_VERBOSE_BUILD" = "YES" ]
740 765
       then
741 766
          logfile1="`tty`"
742 767
          logfile2="$logfile1"
... ...
@@ -747,33 +772,52 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
747 772
          logfile2="/dev/null"
748 773
       fi
749 774
 
775
+      local frameworklines
776
+      local librarylines
777
+
778
+      frameworklines=
779
+      librarylines=
780
+
781
+      if [ ! -z "${suffixsubdir}" ]
782
+      then
783
+         frameworklines="-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"
784
+         librarylines="-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"
785
+      fi
786
+
787
+      if [ ! -z "${mappedsubdir}" -a "${mappedsubdir}" != "${suffixsubdir}" ]
788
+      then
789
+         frameworklines="${frameworklines} -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"
790
+         librarylines="${librarylines} -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"
791
+      fi
792
+
793
+      if [ ! -z "${fallbacksubdir}" -a "${fallbacksubdir}" != "${suffixsubdir}" -a "${fallbacksubdir}" != "${mappedsubdir}" ]
794
+      then
795
+         frameworklines="${frameworklines} -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"
796
+         librarylines="${librarylines} -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"
797
+      fi
798
+
750 799
       # use absolute paths for configure, safer (and easier to read IMO)
751 800
        DEPENDENCIES_DIR="'${owd}/${REFERENCE_DEPENDENCY_SUBDIR}'" \
752 801
        CFLAGS="\
753 802
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
754
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
755
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
756
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
803
+-I/usr/local/include \
804
+${frameworklines}
757 805
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
758 806
 ${other_cflags} \
759 807
 -isysroot ${sdkpath}" \
760 808
       CPPFLAGS="\
761 809
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
762
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
763
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
764
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
810
+-I/usr/local/include \
811
+${frameworklines}
765 812
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
766 813
 ${other_cppflags} \
767 814
 -isysroot ${sdkpath}" \
768 815
       LDFLAGS="\
769
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
770
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
771
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
816
+${frameworklines}
772 817
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
773
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
774
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
775
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
818
+${librarylines}
776 819
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
820
+-L/usr/local/lib \
777 821
 ${other_ldflags} \
778 822
 -isysroot ${sdkpath}" \
779 823
        logging_exekutor "${owd}/${srcdir}/configure" ${configureflags} \
... ...
@@ -813,7 +857,7 @@ xcode_get_setting()
813 857
 
814 858
 #
815 859
 # Code I didn't want to throw away really
816
-# In general just uss "public_headers" or
860
+# In general just use "public_headers" or
817 861
 # "private_headers" and set them to a /usr/local/include/whatever
818 862
 #
819 863
 create_mangled_header_path()
... ...
@@ -1133,7 +1177,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1133 1177
 
1134 1178
       logfile="${owd}/${logfile}"
1135 1179
 
1136
-      if [ "${MULLE_BOOTSTRAP_TRACE}" != "" ]
1180
+      if [ "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" = "YES" ]
1137 1181
       then
1138 1182
          logfile="`tty`"
1139 1183
       fi
... ...
@@ -1360,7 +1404,7 @@ build_script()
1360 1404
 
1361 1405
       logfile="${owd}/${logfile}"
1362 1406
 
1363
-      if [ "$MULLE_BOOTSTRAP_TRACE" != "" ]
1407
+      if [ "$MULLE_BOOTSTRAP_VERBOSE_BUILD" = "YES" ]
1364 1408
       then
1365 1409
          logfile="`tty`"
1366 1410
       fi
... ...
@@ -1699,7 +1743,12 @@ build_clones()
1699 1743
          then
1700 1744
             build_if_alive  "${name}" "${srcdir}" || exit 1
1701 1745
          else
1702
-            fail "build_order contains unknown repo \"${clone}\" (\"${srcdir}\")"
1746
+            if has_usr_local_include "${name}"
1747
+            then
1748
+               :
1749
+            else
1750
+               fail "build_order contains unknown repo \"${clone}\" (\"${srcdir}\")"
1751
+            fi
1703 1752
          fi
1704 1753
       done
1705 1754
       IFS="$old"
... ...
@@ -1723,7 +1772,12 @@ build_clones()
1723 1772
             then
1724 1773
                build_if_alive "${name}" "${srcdir}" || exit  1
1725 1774
             else
1726
-               fail "build failed for repository\"${clone}\": not found in (\"${srcdir}\") ($PWD)"
1775
+               if has_usr_local_include "${name}"
1776
+               then
1777
+                  :
1778
+               else
1779
+                  fail "build failed for repository \"${clone}\": not found in (\"${srcdir}\") ($PWD)"
1780
+               fi
1727 1781
             fi
1728 1782
          done
1729 1783
       fi
... ...
@@ -1736,7 +1790,12 @@ build_clones()
1736 1790
          then
1737 1791
             build_if_alive "${name}" "${srcdir}"|| exit 1
1738 1792
          else
1739
-            fail "unknown repo ${name}"
1793
+            if has_usr_local_include "${name}"
1794
+            then
1795
+               :
1796
+            else
1797
+               fail "unknown repo ${name}"
1798
+            fi
1740 1799
          fi
1741 1800
       done
1742 1801
    fi
... ...
@@ -1788,7 +1847,7 @@ main()
1788 1847
 {
1789 1848
    local  clean
1790 1849
 
1791
-   log_fluff "::: build :::"
1850
+   log_verbose "::: build :::"
1792 1851
 
1793 1852
    #
1794 1853
    # START
... ...
@@ -162,9 +162,11 @@ install_brews()
162 162
          if [ "`which "${brew}"`" = "" ]
163 163
          then
164 164
             brew_update_if_needed "${brew}"
165
-
166
-            log_fluff "brew ${COMMAND} \"${brew}\""
167
-            exekutor brew "${COMMAND}" "${brew}" || exit 1
165
+            if [ $? -ne 2 ]
166
+            then
167
+               log_fluff "brew ${COMMAND} \"${brew}\""
168
+               exekutor brew "${COMMAND}" "${brew}" || exit 1
169
+            fi
168 170
          else
169 171
             log_info "\"${brew}\" is already installed."
170 172
          fi
... ...
@@ -358,10 +360,20 @@ ask_symlink_it()
358 360
       flag=1  # mens clone it
359 361
       if [ "${SYMLINK_FORBIDDEN}" != "YES" ]
360 362
       then
361
-         user_say_yes "Should ${clone} be symlinked instead of cloned ?
362
-   You usually say NO to this, even more so, if tag is set (tag=${tag})"
363
+         local prompt
364
+
365
+         prompt="Should ${clone} be symlinked instead of cloned ?
366
+You usually say NO to this."
367
+
368
+         if [ ! -z "${tag}" ]
369
+         then
370
+            prompt="${prompt} (Even more so, since tag is set as ${tag})"
371
+         fi
372
+
373
+         user_say_yes "$prompt"
363 374
          flag=$?
364 375
       fi
376
+
365 377
       [ $flag -eq 0 ]
366 378
       return $?
367 379
    fi
... ...
@@ -533,9 +545,8 @@ checkout()
533 545
 
534 546
             if [ ! -z "${found}" ]
535 547
             then
536
-               user_say_yes "There is a ${found} folder in the parent
537
-directory of this project.
538
-Use it ?"
548
+               user_say_yes "There is a \"${found}\" folder in the parent directory of this project.
549
+(\"${PWD}\"). Use it ?"
539 550
                if [ $? -eq 0 ]
540 551
                then
541 552
                   src="${found}"
... ...
@@ -685,20 +696,35 @@ clone_repository()
685 696
    local tag
686 697
    local dstdir
687 698
    local flag
699
+   local doit
688 700
 
689 701
    tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
690 702
    dstdir="${CLONESFETCH_SUBDIR}/${name}"
691
-   log_fetch_action "${name}" "${dstdir}"
692 703
 
693
-   # mark the checkout progress, so that we don't do incomplete fetches and
694
-   # later on happily build
704
+   doit=1
705
+   if [ "${DO_CHECK_USR_LOCAL_INCLUDE}" = "YES" ]
706
+   then
707
+      has_usr_local_include "${name}"
708
+      doit=$?
709
+   fi
695 710
 
696
-   create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
711
+   flag=0
712
+   if [ $doit -ne 0 ]
713
+   then
714
+      log_fetch_action "${name}" "${dstdir}"
697 715
 
698
-   checkout_repository "${name}" "${url}" "${dstdir}" "${branch}" "${tag}" "${scm}"
699
-   flag=$?
716
+      # mark the checkout progress, so that we don't do incomplete fetches and
717
+      # later on happily build
700 718
 
701
-   remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
719
+      create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
720
+
721
+      checkout_repository "${name}" "${url}" "${dstdir}" "${branch}" "${tag}" "${scm}"
722
+      flag=$?
723
+
724
+      remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
725
+   else
726
+      log_info "${C_MAGENTA}${C_BOLD}${name}${C_INFO} is a system library, so not fetching it"
727
+   fi
702 728
 
703 729
    return $flag
704 730
 }
... ...
@@ -1182,18 +1208,33 @@ update_embedded_repositories()
1182 1208
 
1183 1209
          tag="`read_repo_setting "${name}" "tag"`" #repo (sic)
1184 1210
          dstdir="${dstprefix}${name}"
1185
-         log_fetch_action "${name}" "${dstdir}"
1186 1211
 
1187
-         create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1212
+         local doit
1188 1213
 
1189
-         if [ -e "${dstdir}" ]
1214
+         doit=1
1215
+         if [ "${DO_CHECK_USR_LOCAL_INCLUDE}" = "YES" ]
1190 1216
          then
1191
-            update "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
1192
-         else
1193
-            clone_embedded_repository "${dstprefix}" "${clone}"
1217
+            has_usr_local_include "${name}"
1218
+            doit=$?
1194 1219
          fi
1195 1220
 
1196
-         remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1221
+         if [ $doit -ne 0 ]
1222
+         then
1223
+            log_fetch_action "${name}" "${dstdir}"
1224
+
1225
+            create_file_if_missing "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1226
+
1227
+            if [ -e "${dstdir}" ]
1228
+            then
1229
+               update "${name}" "${url}" "${dstdir}" "${branch}" "${tag}"
1230
+            else
1231
+               clone_embedded_repository "${dstprefix}" "${clone}"
1232
+            fi
1233
+
1234
+            remove_file_if_present "${CLONESFETCH_SUBDIR}/.fetch_update_started"
1235
+         else
1236
+            log_info "${C_MAGENTA}${C_BOLD}${name}${C_INFO} is a system library, so not updating"
1237
+         fi
1197 1238
       done
1198 1239
    fi
1199 1240
 
... ...
@@ -1215,11 +1256,18 @@ append_dir_to_gitignore_if_needed()
1215 1256
 
1216 1257
 main()
1217 1258
 {
1218
-   log_fluff "::: fetch :::"
1259
+   log_verbose "::: fetch :::"
1219 1260
 
1220 1261
    SYMLINK_FORBIDDEN="`read_config_setting "symlink_forbidden"`"
1221 1262
    export SYMLINK_FORBIDDEN
1222 1263
 
1264
+   #
1265
+   # should we check for '/usr/local/include/<name>' and don't fetch if
1266
+   # present (somewhat dangerous, because we do not check versions)
1267
+   #
1268
+   DO_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1269
+   export DO_CHECK_USR_LOCAL_INCLUDE
1270
+
1223 1271
    if [ "${COMMAND}" = "install" ]
1224 1272
    then
1225 1273
       if [ $# -ne 0 ]
... ...
@@ -1237,7 +1285,11 @@ main()
1237 1285
    #
1238 1286
    if [ "${COMMAND}" = "install" ]
1239 1287
    then
1240
-      install_brews
1288
+      case "`uname`" in
1289
+         Darwin|Linux)
1290
+            install_brews
1291
+            ;;
1292
+      esac
1241 1293
       install_gems
1242 1294
       install_pips
1243 1295
 
... ...
@@ -80,10 +80,20 @@ log_info()
80 80
 }
81 81
 
82 82
 
83
+C_VERBOSE="${C_GREEN}${C_BOLD}"
84
+log_verbose()
85
+{
86
+   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES"  ]
87
+   then
88
+      printf "${C_VERBOSE}%b${C_RESET}\n" "$*" >&2
89
+   fi
90
+}
91
+
92
+
83 93
 C_FLUFF="${C_GREEN}${C_BOLD}"
84 94
 log_fluff()
85 95
 {
86
-   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES"  ]
96
+   if [ "${MULLE_BOOTSTRAP_FLUFF}" = "YES"  ]
87 97
    then
88 98
       printf "${C_FLUFF}%b${C_RESET}\n" "$*" >&2
89 99
    fi
... ...
@@ -800,7 +810,7 @@ run_script()
800 810
 
801 811
    if [ -x "${script}" ]
802 812
    then
803
-      log_fluff "Executing script \"${script}\" $1"
813
+      log_verbose "Executing script ${C_RESET_BOLD}${script}${C_VERBOSE} $1 ..."
804 814
       exekutor "${script}" "$@" || fail "script \"${script}\" did not run successfully"
805 815
    else
806 816
       if [ ! -e "${script}" ]
... ...
@@ -820,6 +830,23 @@ run_log_script()
820 830
 }
821 831
 
822 832
 
833
+has_usr_local_include()
834
+{
835
+   local name
836
+
837
+   name="${1}"
838
+   if [ -d "/usr/local/include/${name}" ]
839
+   then
840
+      return 0
841
+   fi
842
+
843
+   local include_name
844
+
845
+   include_name="`echo "${name}" | tr '-' '_'`"
846
+   [ -d "/usr/local/include/${include_name}" ]
847
+}
848
+
849
+
823 850
 ensure_clones_directory()
824 851
 {
825 852
    if [ ! -d "${CLONESFETCH_SUBDIR}" ]
... ...
@@ -310,7 +310,7 @@ install_frameworks_by_symlinking()
310 310
 main()
311 311
 {
312 312
 
313
-   log_fluff "::: install :::"
313
+   log_verbose "::: install :::"
314 314
 
315 315
    if [ ! -d "${DEPENDENCY_SUBDIR}" ]
316 316
    then
... ...
@@ -53,21 +53,44 @@ MULLE_BOOTSTRAP_TRACE="`read_config_setting "trace"`"
53 53
 
54 54
 case "${MULLE_BOOTSTRAP_TRACE}" in
55 55
    VERBOSE)
56
+      MULLE_BOOTSTRAP_FLUFF="NO"
57
+      MULLE_BOOTSTRAP_TRACE="NO"
56 58
       MULLE_BOOTSTRAP_VERBOSE="YES"
57
-      MULLE_BOOTSTRAP_TRACE="YES"
58
-      log_trace "VERBOSE trace started"
59
+      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
60
+      then
61
+         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
62
+      fi
63
+      ;;
64
+
65
+   FLUFF)
66
+      MULLE_BOOTSTRAP_FLUFF="YES"
67
+      MULLE_BOOTSTRAP_TRACE="NO"
68
+      MULLE_BOOTSTRAP_VERBOSE="YES"
69
+      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
70
+      then
71
+         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
72
+      fi
59 73
       ;;
60
-   FULL|ALL)
74
+
75
+   TRACE)
61 76
       MULLE_BOOTSTRAP_TRACE_SETTINGS="YES"
77
+      MULLE_BOOTSTRAP_FLUFF="YES"
62 78
       MULLE_BOOTSTRAP_VERBOSE="YES"
63 79
       MULLE_BOOTSTRAP_TRACE="YES"
80
+      if [ -z "${MULLE_BOOTSTRAP_VERBOSE_BUILD}" ]
81
+      then
82
+         MULLE_BOOTSTRAP_VERBOSE_BUILD="NO"
83
+      fi
64 84
       log_trace "FULL trace started"
65 85
       ;;
86
+
66 87
    1848)
67 88
       MULLE_BOOTSTRAP_SETTINGS_FLIP_X="YES"
68 89
       MULLE_BOOTSTRAP_TRACE_SETTINGS="NO"
69
-      MULLE_BOOTSTRAP_VERBOSE="YES"
70
-      MULLE_BOOTSTRAP_TRACE="YES"
90
+      MULLE_BOOTSTRAP_FLUFF="NO"
91
+      MULLE_BOOTSTRAP_TRACE="NO"
92
+      MULLE_BOOTSTRAP_VERBOSE="NO"
93
+      MULLE_BOOTSTRAP_VERBOSE_BUILD="YES"
71 94
       log_trace "1848 trace (set -x) started"
72 95
       set -x
73 96
       ;;
... ...
@@ -190,7 +190,13 @@ run_build_settings_script()
190 190
    scriptname="$1"
191 191
    shift
192 192
 
193
-   exekutor [ -e "$srcdir" ]  || internal_fail "srcdir \"${srcdir}\" is wrong ($PWD)"
193
+   # can happen, if system libs override
194
+   if [ ! -e "$srcdir" ]
195
+   then
196
+      log_verbose "script \${script}\" not executed, because ${srcdir} does not exist"
197
+      return 0
198
+   fi
199
+
194 200
    [ ! -z "$name" ]           || internal_fail "name is empty"
195 201
    [ ! -z "$url" ]            || internal_fail "url is empty"
196 202
    [ ! -z "$scriptname" ]     || internal_fail "scriptname is empty"
... ...
@@ -64,7 +64,9 @@ warn_environment_setting()
64 64
    if [ "$MULLE_BOOTSTRAP_NO_WARN_ENVIRONMENT_SETTINGS" != "YES" ]
65 65
    then
66 66
       # don't trace some boring ones
67
-      if [ "${name}" != "MULLE_BOOTSTRAP_ANSWER" -a "${name}" != "MULLE_BOOTSTRAP_VERBOSE" ]
67
+      if [ "${name}" != "MULLE_BOOTSTRAP_ANSWER" -a \
68
+           "${name}" != "MULLE_BOOTSTRAP_VERBOSE" -a \
69
+           "${name}" != "MULLE_BOOTSTRAP_TRACE" ]
68 70
       then
69 71
          log_warning "Using environment variable \"${name}\""
70 72
       fi
... ...
@@ -108,19 +110,32 @@ _read_setting()
108 110
    if [ "${READ_SETTING_RETURNS_PATH}" = "YES" ]
109 111
    then
110 112
       value="${file}"
113
+
111 114
       if [ "$MULLE_BOOTSTRAP_VERBOSE" = "YES"  ]
112 115
       then
113 116
          local os
117
+         local name
118
+
114 119
          os="`uname`"
120
+         name="`basename -- "${file}" ".${os}"`"
115 121
          log_fluff "${C_MAGENTA}${C_BOLD}`basename -- "${file}" ".${os}"`${C_FLUFF} found as \"${file}\""
116 122
       fi
117 123
    else
118 124
       value=`egrep -v '^#|^[ ]*$' "${file}"`
125
+
119 126
       if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES"  ]
120 127
       then
121 128
          local os
129
+         local name
130
+
122 131
          os="`uname`"
123
-         log_fluff "Setting ${C_MAGENTA}${C_BOLD}`basename -- "${file}" ".${os}"`${C_FLUFF} found in \"${file}\" as ${C_MAGENTA}${C_BOLD}${value}${C_FLUFF}"
132
+         name="`basename -- "${file}" ".${os}"`"
133
+         if [ "${name}" = "repositories" -o "${name}" = "repositories.tmp" -o  "${name}" = "embedded_repositories" ]
134
+         then
135
+            log_fluff "Setting ${C_MAGENTA}${C_BOLD}${name}${C_FLUFF} found in \"${file}\" as ${C_MAGENTA}${C_BOLD}${value}${C_FLUFF}"
136
+         else
137
+            log_verbose "Setting ${C_MAGENTA}${C_BOLD}${name}${C_FLUFF} found in \"${file}\" as ${C_MAGENTA}${C_BOLD}${value}${C_FLUFF}"
138
+         fi
124 139
       fi
125 140
    fi
126 141
 
... ...
@@ -163,7 +178,7 @@ _read_environment_setting()
163 178
       return 2
164 179
    fi
165 180
 
166
-   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES" ]
181
+   if [ "${MULLE_BOOTSTRAP_TRACE_SETTINGS}" = "YES" ]
167 182
    then
168 183
       log_trace "Setting ${C_MAGENTA}${C_BOLD}${name}${C_TRACE} found in environment variable \"${envname}\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
169 184
    fi
... ...
@@ -187,7 +202,7 @@ _read_local_setting()
187 202
 
188 203
    [ "$name" = "" ] && internal_fail "missing parameters in _read_local_setting"
189 204
 
190
-   if [ "$MULLE_BOOTSTRAP_TRACE_SETTINGS" = "YES" ]
205
+   if [ "${MULLE_BOOTSTRAP_TRACE_SETTINGS}" = "YES" ]
191 206
    then
192 207
       log_trace2 "Looking for setting \"${name}\" in \"~/.mulle-bootstrap\""
193 208
    fi
... ...
@@ -198,7 +213,7 @@ _read_local_setting()
198 213
       return 2
199 214
    fi
200 215
 
201
-   if [ "${MULLE_BOOTSTRAP_VERBOSE}" = "YES" ]
216
+   if [ "${MULLE_BOOTSTRAP_TRACE_SETTINGS}" = "YES" ]
202 217
    then
203 218
       log_trace "Setting ${C_MAGENTA}${C_BOLD}${name}${C_TRACE} found in \"~/.mulle-bootstrap\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
204 219
    fi
... ...
@@ -225,7 +225,7 @@ tag()
225 225
 
226 226
 main()
227 227
 {
228
-   log_fluff "::: tag :::"
228
+   log_verbose "::: tag :::"
229 229
 
230 230
    ensure_consistency
231 231
    if [ -z "${GIT_FLAGS}" ]
... ...
@@ -47,8 +47,8 @@ warn_scripts()
47 47
       scripts="`find "$1" -name "*.sh" \( -perm +u+x -o -perm +g+x -o -perm +o+x \) -type f -print`"
48 48
       if [ ! -z "${scripts}" ]
49 49
       then
50
-         log_warning "this .bootstrap contains shell scripts:" 
51
-         old="${IFS:-" "}"         
50
+         log_warning "this .bootstrap contains shell scripts:"
51
+         old="${IFS:-" "}"
52 52
          IFS="
53 53
 "
54 54
          echo "${C_BOLD}--------------------------------------------------------${C_RESET}" >&2
... ...
@@ -73,7 +73,7 @@ warn_scripts()
73 73
          phases="`(find "$2"/* -name "project.pbxproj" -exec grep -q 'PBXShellScriptBuildPhase' '{}'  \; -print)`"
74 74
          if [ ! -z "${phases}" ]
75 75
          then
76
-            log_warning "this repository contains xcode projects with shellscript phases" 
76
+            log_warning "This repository contains xcode projects with shellscript phases"
77 77
 
78 78
             ack=`which ack`
79 79
             if [ -z "${ack}" ]