Browse code

Fix script calling. Make things go faster by being less flexible. Improve flags and show output.

Nat! authored on 19-02-2017 21:29:32
Showing 16 changed files
... ...
@@ -423,10 +423,10 @@ bootstrap_technical_flags()
423 423
          [ "${MULLE_TRACE}" = "1848" ] || fail "option \"$1\" must be specified after -t"
424 424
          case "${UNAME}" in
425 425
             linux)
426
-               ps4string='$(date "\+ +%s.%N (${BASH_SOURCE[1]##*/}:${LINENO})")'
426
+               ps4string='$(date "+%s.%N (${BASH_SOURCE[1]##*/}:${LINENO})")'
427 427
             ;;
428 428
             *)
429
-               ps4string='$(date "\+ +%s (${BASH_SOURCE[1]##*/}:${LINENO})")'
429
+               ps4string='$(date "+%s (${BASH_SOURCE[1]##*/}:${LINENO})")'
430 430
             ;;
431 431
          esac
432 432
       ;;
... ...
@@ -516,7 +516,7 @@ bootstrap_should_defer_to_master()
516 516
    masterpath="`get_master_of_minion_bootstrap_project`"
517 517
 
518 518
    case "${command}" in
519
-      git|setup-xcode|xcode|tag|version|defer|emancipate)
519
+      git|setup-xcode|xcode|tag|version|defer|emancipate|uname|library-path)
520 520
          log_verbose "Minion executes locally"
521 521
       ;;
522 522
 
... ...
@@ -526,7 +526,7 @@ ${MULLE_BOOTSTRAP_EXECUTABLE} ${command}t is not possible."
526 526
       ;;
527 527
 
528 528
       *)
529
-         log_info "Minion defers to master \"$masterpath\" for execution"
529
+         log_verbose "Minion defers to master \"$masterpath\" for execution"
530 530
 
531 531
          cd "${masterpath}" || fail "master is missing"
532 532
          return 0  # this leads to  main deferring later on (but cd is set!)
... ...
@@ -625,9 +625,9 @@ bootstrap_main()
625 625
    #
626 626
    # some commands only run when we have a .bootstrap folder
627 627
    #
628
-   command=${1:-"bootstrap"}
628
+   command="${1:-bootstrap}"
629 629
 
630
-   if [ "${MULLE_FLAG_DIRTY_HARRY}" = "YES" ]
630
+   if [ "${MULLE_FLAG_DIRTY_HARRY}" = "NO" ]
631 631
    then
632 632
       set_fetch_needed
633 633
       set_build_needed
... ...
@@ -881,7 +881,7 @@ brew_main()
881 881
    #
882 882
    # some commands only run when we have a .bootstrap folder
883 883
    #
884
-   command=${1:-"install"}
884
+   command="${1:-install}"
885 885
    [ $# -eq 0 ] || shift
886 886
 
887 887
    if [ ! -d "${BOOTSTRAP_DIR}" ]
... ...
@@ -1031,23 +1031,29 @@ export MULLE_EXECUTABLE_PID
1031 1031
 
1032 1032
 bootstrap_init
1033 1033
 
1034
-case "${MULLE_BOOTSTRAP_EXECUTABLE}" in
1035
-   "mulle-brew")
1036
-      if ! brew_main "$@"
1037
-      then
1038
-         "${MULLE_BOOTSTRAP_EXECUTABLE}" "$@" # is array
1039
-         exit $?
1040
-      fi
1041
-   ;;
1034
+main()
1035
+{
1036
+   case "${MULLE_BOOTSTRAP_EXECUTABLE}" in
1037
+      "mulle-brew")
1038
+         if ! brew_main "$@"
1039
+         then
1040
+            # just do it again, but cd has been set differently
1041
+            main "$@" # is array
1042
+            exit $?
1043
+         fi
1044
+      ;;
1042 1045
 
1043
-   "mulle-bootstrap")
1044
-      if ! bootstrap_main "$@"
1045
-      then
1046
-         "${MULLE_BOOTSTRAP_EXECUTABLE}" "$@" # is array
1047
-         exit $?
1048
-      fi
1049
-   ;;
1050
-esac
1046
+      "mulle-bootstrap")
1047
+         if ! bootstrap_main "$@"
1048
+         then
1049
+            # just do it again, but cd has been set differently
1050
+            main "$@"
1051
+            exit $?
1052
+         fi
1053
+      ;;
1054
+   esac
1055
+}
1051 1056
 
1052
-trap - TERM EXIT
1057
+main "$@"
1053 1058
 
1059
+trap - TERM EXIT
... ...
@@ -64,6 +64,11 @@ fetch_brew_if_needed()
64 64
       return
65 65
    fi
66 66
 
67
+   if [ -d "${ADDICTIONS_DIR}" ]
68
+   then
69
+      fail "There is already a \"${ADDICTIONS_DIR}\" directory, move it away"
70
+   fi
71
+
67 72
    case "${UNAME}" in
68 73
       darwin)
69 74
          log_info "Installing OS X brew"
... ...
@@ -385,38 +385,6 @@ cmake_sdk_parameter()
385 385
 }
386 386
 
387 387
 
388
-create_dummy_dirs_against_warnings()
389
-{
390
-   local mapped
391
-   local suffix
392
-
393
-   mapped="$1"
394
-   suffix="$2"
395
-
396
-   local mappedsubdir
397
-   local suffixsubdir
398
-
399
-   mappedsubdir="`determine_dependencies_subdir "${mapped}"`"
400
-   suffixsubdir="`determine_dependencies_subdir "${suffix}"`"
401
-
402
-   local owd
403
-
404
-   owd="${PWD}"
405
-
406
-   # to avoid warnings, make sure directories are all there
407
-   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}"
408
-
409
-   mkdir_if_missing "${owd}/${REFERENCE_ADDICTIONS_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"
410
-   mkdir_if_missing "${owd}/${REFERENCE_ADDICTIONS_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"
411
-
412
-   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"
413
-   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"
414
-
415
-   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"
416
-   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"
417
-}
418
-
419
-
420 388
 build_fail()
421 389
 {
422 390
    if [ -f "$1" ]
... ...
@@ -714,8 +682,6 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
714 682
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
715 683
    sdkparameter="`cmake_sdk_parameter "${sdk}"`"
716 684
 
717
-   create_dummy_dirs_against_warnings "${mapped}" "${suffix}"
718
-
719 685
    local mappedsubdir
720 686
    local fallbacksubdir
721 687
    local suffixsubdir
... ...
@@ -804,35 +770,35 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
804 770
 
805 771
       if [ ! -z "${suffixsubdir}" ]
806 772
       then
807
-         frameworklines="`add_cmake_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"`"
808
-         librarylines="`add_cmake_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"`"
773
+         frameworklines="`add_cmake_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"`"
774
+         librarylines="`add_cmake_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"`"
809 775
       fi
810 776
 
811 777
       if [ ! -z "${mappedsubdir}" -a "${mappedsubdir}" != "${suffixsubdir}" ]
812 778
       then
813
-         frameworklines="`add_cmake_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"`"
814
-         librarylines="`add_cmake_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"`"
779
+         frameworklines="`add_cmake_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"`"
780
+         librarylines="`add_cmake_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"`"
815 781
       fi
816 782
 
817 783
       if [ ! -z "${fallbacksubdir}" -a "${fallbacksubdir}" != "${suffixsubdir}" -a "${fallbacksubdir}" != "${mappedsubdir}" ]
818 784
       then
819
-         frameworklines="`add_cmake_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"`"
820
-         librarylines="`add_cmake_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"`"
785
+         frameworklines="`add_cmake_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"`"
786
+         librarylines="`add_cmake_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"`"
821 787
       fi
822 788
 
823
-      includelines="`add_cmake_path "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}"`"
824
-      includelines="`add_cmake_path "${includelines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${HEADER_DIR_NAME}"`"
789
+      includelines="`add_cmake_path_if_exists "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}"`"
790
+      includelines="`add_cmake_path_if_exists "${includelines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${HEADER_DIR_NAME}"`"
825 791
 
826
-      librarylines="`add_cmake_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${LIBRARY_DIR_NAME}"`"
827
-      librarylines="`add_cmake_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${LIBRARY_DIR_NAME}"`"
792
+      librarylines="`add_cmake_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${LIBRARY_DIR_NAME}"`"
793
+      librarylines="`add_cmake_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${LIBRARY_DIR_NAME}"`"
828 794
 
829
-      frameworklines="`add_cmake_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${FRAMEWORK_DIR_NAME}"`"
830
-      frameworklines="`add_cmake_path "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${FRAMEWORK_DIR_NAME}"`"
795
+      frameworklines="`add_cmake_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${FRAMEWORK_DIR_NAME}"`"
796
+      frameworklines="`add_cmake_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${FRAMEWORK_DIR_NAME}"`"
831 797
 
832 798
       if [ "${OPTION_ADD_USR_LOCAL}" = "YES" ]
833 799
       then
834
-         includelines="`add_cmake_path "${includelines}" "${USR_LOCAL_INCLUDE}"`"
835
-         librarylines="`add_cmake_path "${librarylines}" "${USR_LOCAL_LIB}"`"
800
+         includelines="`add_cmake_path_if_exists "${includelines}" "${USR_LOCAL_INCLUDE}"`"
801
+         librarylines="`add_cmake_path_if_exists "${librarylines}" "${USR_LOCAL_LIB}"`"
836 802
       fi
837 803
 
838 804
       local relative_srcdir
... ...
@@ -843,9 +809,9 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
843 809
 
844 810
       relative_srcdir="`relative_path_between "${owd}/${srcdir}" "${PWD}"`"
845 811
 
846
-      prefixbuild="`add_cmake_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCIES_DIR}"`"
847
-      dependenciesdir="`add_cmake_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}"`"
848
-      addictionsdir="`add_cmake_path "${addictionsdir}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}"`"
812
+      prefixbuild="`add_cmake_path_if_exists "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCIES_DIR}"`"
813
+      dependenciesdir="`add_cmake_path_if_exists "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}"`"
814
+      addictionsdir="`add_cmake_path_if_exists "${addictionsdir}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}"`"
849 815
 
850 816
 #      cmakemodulepath="\${CMAKE_MODULE_PATH}"
851 817
 #      if [ ! -z "${CMAKE_MODULE_PATH}" ]
... ...
@@ -1094,35 +1060,35 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1094 1060
 
1095 1061
       if [ ! -z "${suffixsubdir}" ]
1096 1062
       then
1097
-         frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"`"
1098
-         librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"`"
1063
+         frameworklines="`add_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"`"
1064
+         librarylines="`add_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"`"
1099 1065
       fi
1100 1066
 
1101 1067
       if [ ! -z "${mappedsubdir}" -a "${mappedsubdir}" != "${suffixsubdir}" ]
1102 1068
       then
1103
-         frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"`"
1104
-         librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"`"
1069
+         frameworklines="`add_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"`"
1070
+         librarylines="`add_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"`"
1105 1071
       fi
1106 1072
 
1107 1073
       if [ ! -z "${fallbacksubdir}" -a "${fallbacksubdir}" != "${suffixsubdir}" -a "${fallbacksubdir}" != "${mappedsubdir}" ]
1108 1074
       then
1109
-         frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"`"
1110
-         librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"`"
1075
+         frameworklines="`add_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}"`"
1076
+         librarylines="`add_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}"`"
1111 1077
       fi
1112 1078
 
1113
-      includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}"`"
1114
-      includelines="`add_path "${includelines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${HEADER_DIR_NAME}"`"
1079
+      includelines="`add_path_if_exists "${includelines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${HEADER_DIR_NAME}"`"
1080
+      includelines="`add_path_if_exists "${includelines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${HEADER_DIR_NAME}"`"
1115 1081
 
1116
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${LIBRARY_DIR_NAME}"`"
1117
-      librarylines="`add_path "${librarylines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${LIBRARY_DIR_NAME}"`"
1082
+      librarylines="`add_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${LIBRARY_DIR_NAME}"`"
1083
+      librarylines="`add_path_if_exists "${librarylines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${LIBRARY_DIR_NAME}"`"
1118 1084
 
1119
-      frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${FRAMEWORK_DIR_NAME}"`"
1120
-      frameworklines="`add_path "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${FRAMEWORK_DIR_NAME}"`"
1085
+      frameworklines="`add_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}/${FRAMEWORK_DIR_NAME}"`"
1086
+      frameworklines="`add_path_if_exists "${frameworklines}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}/${FRAMEWORK_DIR_NAME}"`"
1121 1087
 
1122 1088
       if [ "${OPTION_ADD_USR_LOCAL}" = "YES" ]
1123 1089
       then
1124
-         includelines="`add_path "${includelines}" "${USR_LOCAL_INCLUDE}"`"
1125
-         librarylines="`add_path "${librarylines}" "${USR_LOCAL_LIB}"`"
1090
+         includelines="`add_path_if_exists "${includelines}" "${USR_LOCAL_INCLUDE}"`"
1091
+         librarylines="`add_path_if_exists "${librarylines}" "${USR_LOCAL_LIB}"`"
1126 1092
       fi
1127 1093
 
1128 1094
       local prefixbuild
... ...
@@ -1130,9 +1096,9 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
1130 1096
       local addictionsdir
1131 1097
       #local linker
1132 1098
 
1133
-      prefixbuild="`add_path "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCIES_DIR}"`"
1134
-      dependenciesdir="`add_path "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}"`"
1135
-      addictionsdir="`add_path "${addictionsdir}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}"`"
1099
+      prefixbuild="`add_path_if_exists "${prefixbuild}" "${nativewd}/${BUILD_DEPENDENCIES_DIR}"`"
1100
+      dependenciesdir="`add_path_if_exists "${dependenciesdir}" "${nativewd}/${REFERENCE_DEPENDENCIES_DIR}"`"
1101
+      addictionsdir="`add_path_if_exists "${addictionsdir}" "${nativewd}/${REFERENCE_ADDICTIONS_DIR}"`"
1136 1102
 
1137 1103
       case "${UNAME}" in
1138 1104
          darwin)
... ...
@@ -1580,7 +1546,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1580 1546
       fi
1581 1547
 
1582 1548
       inherited="`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`" || exit 1
1583
-      path=`combined_escaped_search_path \
1549
+      path=`combined_escaped_search_path_if_exists \
1584 1550
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${LIBRARY_DIR_NAME}" \
1585 1551
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}" \
1586 1552
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}/${LIBRARY_DIR_NAME}" \
... ...
@@ -1604,7 +1570,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1604 1570
       fi
1605 1571
 
1606 1572
       inherited="`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`" || exit 1
1607
-      path=`combined_escaped_search_path \
1573
+      path=`combined_escaped_search_path_if_exists \
1608 1574
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}" \
1609 1575
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}" \
1610 1576
 "${owd}/${REFERENCE_DEPENDENCIES_DIR}/${FRAMEWORK_DIR_NAME}" \
... ...
@@ -394,8 +394,6 @@ clean_main()
394 394
 
395 395
    [ -z "${DEFAULT_IFS}" ] && internal_fail "IFS fail"
396 396
 
397
-   build_complete_environment
398
-
399 397
    while [ $# -ne 0 ]
400 398
    do
401 399
       case "$1" in
... ...
@@ -420,8 +418,8 @@ clean_main()
420 418
 
421 419
    style=${1:-"output"}
422 420
 
423
-   case "$1" in
424
-      output|dist|build|install)
421
+   case "${style}" in
422
+      "output"|"dist"|"build"|"install")
425 423
          clean_execute "${style}"
426 424
       ;;
427 425
 
... ...
@@ -31,16 +31,21 @@
31 31
 #
32 32
 MULLE_BOOTSTRAP_COMMON_SETTINGS_SH="included"
33 33
 
34
+#
34 35
 # only needed for true builds
35
-
36
+#
36 37
 build_complete_environment()
37 38
 {
38 39
    #
39 40
    # Global Settings
40
-   #
41
-   HEADER_DIR_NAME="`read_config_setting "header_dir_name" "include"`"
42
-   LIBRARY_DIR_NAME="`read_config_setting "library_dir_name" "lib"`"
43
-   FRAMEWORK_DIR_NAME="`read_config_setting "framework_dir_name" "Frameworks"`"
41
+   # used to be configurable, but just slows me down
42
+   HEADER_DIR_NAME="include"
43
+   LIBRARY_DIR_NAME="lib"
44
+   FRAMEWORK_DIR_NAME="Frameworks"
45
+
46
+   # HEADER_DIR_NAME="`read_config_setting "header_dir_name" "include"`"
47
+   # LIBRARY_DIR_NAME="`read_config_setting "library_dir_name" "lib"`"
48
+   # FRAMEWORK_DIR_NAME="`read_config_setting "framework_dir_name" "Frameworks"`"
44 49
 
45 50
    OPTION_CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build"`
46 51
    if [ -z "${OPTION_CONFIGURATIONS}" ]
... ...
@@ -96,26 +101,28 @@ common_settings_initialize()
96 101
    log_debug ":common_settings_initialize:"
97 102
 
98 103
    [ -z "${MULLE_BOOTSTRAP_LOCAL_ENVIRONMENT_SH}" ] && . mulle-bootstrap-local-environment.sh
99
-   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ] && . mulle-bootstrap-settings.sh
104
+   [ -z "${MULLE_BOOTSTRAP_SETTINGS_SH}" ]          && . mulle-bootstrap-settings.sh
100 105
 
101 106
    # experimentally, these could reside outside the project folder but never tested
102 107
    CLONESBUILD_SUBDIR="`read_sane_config_path_setting "build_dir" "build/.repos"`"
103 108
    BUILDLOGS_SUBDIR="`read_sane_config_path_setting "build_log_dir" "${CLONESBUILD_SUBDIR}/.logs"`"
104 109
 
105 110
    # all of these must reside in the project folder
106
-   DEPENDENCIES_DIR="`read_sane_config_path_setting "dependencies_dir" "dependencies"`"
107
-   ADDICTIONS_DIR="`read_sane_config_path_setting "addictions_dir" "addictions"`"
108
-   STASHES_DEFAULT_DIR="`read_sane_config_path_setting "stashes_dir" "stashes"`"
111
+   # used to be configurable, but what's the point really ? just slows us down
112
+
113
+   DEPENDENCIES_DIR="dependencies"
114
+   ADDICTIONS_DIR="addictions"
115
+   STASHES_DEFAULT_DIR="stashes"
109 116
 
110
-   # "repository" caches can and usually are outside the project folder
111
-   # this can be multiple paths!
112
-   CACHES_PATH="`read_config_setting "cashes_dir" "${DEFAULT_CACHES_PATH}"`"
117
+   # DEPENDENCIES_DIR="`read_sane_config_path_setting "dependencies_dir" "dependencies"`"
118
+   # ADDICTIONS_DIR="`read_sane_config_path_setting "addictions_dir" "addictions"`"
119
+   # STASHES_DEFAULT_DIR="`read_sane_config_path_setting "stashes_dir" "stashes"`"
113 120
 
114
-   [ -z "${CLONESBUILD_SUBDIR}" ] && internal_fail "variable CLONESBUILD_SUBDIR is empty"
121
+   [ -z "${CLONESBUILD_SUBDIR}" ]  && internal_fail "variable CLONESBUILD_SUBDIR is empty"
115 122
    [ -z "${BUILDLOGS_SUBDIR}" ]    && internal_fail "variable BUILDLOGS_SUBDIR is empty"
116
-   [ -z "${DEPENDENCIES_DIR}" ]   && internal_fail "variable DEPENDENCIES_DIR is empty"
117
-   [ -z "${ADDICTIONS_DIR}" ]     && internal_fail "variable ADDICTIONS_DIR is empty"
118
-   [ -z "${STASHES_DEFAULT_DIR}" ]        && internal_fail "variable STASHES_DEFAULT_DIR is empty"
123
+#   [ -z "${DEPENDENCIES_DIR}" ]    && internal_fail "variable DEPENDENCIES_DIR is empty"
124
+#   [ -z "${ADDICTIONS_DIR}" ]      && internal_fail "variable ADDICTIONS_DIR is empty"
125
+#   [ -z "${STASHES_DEFAULT_DIR}" ] && internal_fail "variable STASHES_DEFAULT_DIR is empty"
119 126
 }
120 127
 
121 128
 common_settings_initialize
... ...
@@ -135,6 +135,11 @@ defer_main()
135 135
 
136 136
    master_add_minion_bootstrap_project "${masterpath}" "${minionpath}"
137 137
 
138
+   #
139
+   # clean the master, because cmake doesn't like old paths
140
+   # kinda superzealous though...
141
+   #
142
+   mulle-bootstrap clean output
138 143
 }
139 144
 
140 145
 
... ...
@@ -842,19 +842,31 @@ clone"
842 842
 
843 843
    if [ "${stashdir}" != "${newstashdir}" ]
844 844
    then
845
-      log_fluff "Destination has changed from \"${stashdir}\" to \"${newstashdir}\", need to move"
845
+      if [ -e "${newstashdir}" ]
846
+      then
847
+         log_fluff "Destination already exists. Remove old."
848
+         echo "remove"
849
+
850
+         # hacque ?
851
+         if is_minion_bootstrap_project "${newstashdir}"
852
+         then
853
+            return
854
+         fi
855
+      else
856
+         log_fluff "Destination has changed from \"${stashdir}\" to \"${newstashdir}\", need to move"
846 857
 
847
-      local oldstashdir
858
+         local oldstashdir
848 859
 
849
-      oldstashdir="`get_old_stashdir "${reposdir}" "${name}"`"
850
-      if [ "${oldstashdir}" != "${newstashdir}" ]
851
-      then
852
-         if [ -d "${oldstashdir}" ]
860
+         oldstashdir="`get_old_stashdir "${reposdir}" "${name}"`"
861
+         if [ "${oldstashdir}" != "${newstashdir}" ]
853 862
          then
854
-            echo "move ${oldstashdir}"
855
-         else
856
-            log_warning "Can't find ${name} in ${oldstashdir}. Will clone again"
857
-            echo "clone"
863
+            if [ -d "${oldstashdir}" ]
864
+            then
865
+               echo "move ${oldstashdir}"
866
+            else
867
+               log_warning "Can't find ${name} in ${oldstashdir}. Will clone again"
868
+               echo "clone"
869
+            fi
858 870
          fi
859 871
       fi
860 872
    fi
... ...
@@ -899,7 +911,6 @@ get_old_stashdir()
899 911
    name="`_canonical_clone_name "${url}"`"
900 912
    dstdir="`_dstdir_part_from_clone "${oldclone}"`"
901 913
 
902
-
903 914
    oldparent="`parentclone_of_repository "${reposdir}" "${name}"`"
904 915
    if [ ! -z "${oldparent}" ]
905 916
    then
... ...
@@ -1031,11 +1042,6 @@ work_clones()
1031 1042
                remember="NO"
1032 1043
             ;;
1033 1044
 
1034
-            #
1035
-            # its actually wrong to do this here
1036
-            # because deeply embedded repos might lose contact
1037
-            # if also moved at same time
1038
-            #
1039 1045
             move*)
1040 1046
                oldstashdir="${item:5}"
1041 1047
 
... ...
@@ -1361,6 +1367,25 @@ _common_main()
1361 1367
    local OVERRIDE_BRANCH
1362 1368
    local DONT_WARN_SCRIPTS="NO"
1363 1369
 
1370
+
1371
+   local ROOT_DIR="`pwd -P`"
1372
+   local CACHES_PATH
1373
+
1374
+   #
1375
+   # where we look for symlink sources
1376
+   # user can set also seT via environment "CACHES_PATH"
1377
+   #
1378
+   # "repository" caches can and usually are outside the project folder
1379
+   # this can be multiple paths!
1380
+   local parent
1381
+   local default_caches_path
1382
+
1383
+   # our "sandbox" root, probably not changeable
1384
+   parent="`dirname -- "${ROOT_DIR}"`"
1385
+   default_caches_path="${CACHES_PATH:-${parent}}"
1386
+
1387
+   CACHES_PATH="`read_config_setting "cashes_dir" "${default_caches_path}"`"
1388
+
1364 1389
    OPTION_CHECK_USR_LOCAL_INCLUDE="`read_config_setting "check_usr_local_include" "NO"`"
1365 1390
    OVERRIDE_BRANCH="`read_config_setting "override_branch"`"
1366 1391
 
... ...
@@ -39,7 +39,6 @@ usage:
39 39
    Options:
40 40
       -1             : output is a one-liner
41 41
       -m             : emit regardless of directory existence
42
-      -c             : suppress -F output for cflags
43 42
       -l             : emit link directives for libraries
44 43
       -f             : emit link directives for Frameworks
45 44
 
... ...
@@ -49,6 +48,7 @@ usage:
49 48
       cflags         : output CFLAGS for gcc, clang and friends
50 49
       cxxflags       : output CXXFLAGS
51 50
       ldflags        : output LDFLAGS
51
+      path           : output PATH
52 52
       environment*   : output CFLAGS, CXXFLAGS, LDFLAGS (default)
53 53
       frameworkpath  : output framework search paths PATH style
54 54
       headerpath     : output framework search paths PATH style
... ...
@@ -90,12 +90,12 @@ __collect_frameworks()
90 90
 
91 91
 _collect_libraries()
92 92
 {
93
-   if [ "${WITH_DEPENDENCIES}" ]
93
+   if [ "${OPTION_WITH_DEPENDENCIES}" ]
94 94
    then
95 95
       __collect_libraries "${DEPENDENCIES_DIR}/lib"
96 96
    fi
97 97
 
98
-   if [ "${WITH_ADDICTIONS}" ]
98
+   if [ "${OPTION_WITH_ADDICTIONS}" ]
99 99
    then
100 100
       __collect_libraries "${ADDICTIONS_DIR}/lib"
101 101
    fi
... ...
@@ -104,12 +104,12 @@ _collect_libraries()
104 104
 
105 105
 _collect_frameworks()
106 106
 {
107
-   if [ "${WITH_DEPENDENCIES}" ]
107
+   if [ "${OPTION_WITH_DEPENDENCIES}" ]
108 108
    then
109 109
       __collect_frameworks "${DEPENDENCIES_DIR}/Frameworks"
110 110
    fi
111 111
 
112
-   if [ "${WITH_ADDICTIONS}" ]
112
+   if [ "${OPTION_WITH_ADDICTIONS}" ]
113 113
    then
114 114
       __collect_frameworks "${ADDICTIONS_DIR}/Frameworks"
115 115
    fi
... ...
@@ -131,15 +131,41 @@ collect_frameworks()
131 131
 #
132 132
 # Construct FLAGS paths
133 133
 #
134
+_flags_emit_path()
135
+{
136
+   local directory="$1"
137
+
138
+   if [ "${OPTION_WITH_MISSING_PATHS}" = "YES" -o -d "${directory}" ]
139
+   then
140
+      if [ "${OPTION_USE_ABSOLUTE_PATHS}" = "YES" ]
141
+      then
142
+         directory="`absolutepath "${directory}"`"
143
+      fi
144
+      echo "${directory}"
145
+   fi
146
+}
147
+
148
+
149
+_flags_binpath_value()
150
+{
151
+   local pathline
152
+   local line
153
+
154
+   pathline="`_flags_emit_path "${DEPENDENCIES_DIR}/bin"`"
155
+   line="`_flags_emit_path "${ADDICTIONS_DIR}/bin"`"
156
+
157
+   add_path "${pathline}" "${line}"
158
+}
159
+
134 160
 
135 161
 _flags_emit_option()
136 162
 {
137 163
    local prefix="$1"
138 164
    local directory="$2"
139 165
 
140
-   if [ "${FUTURE}" = "YES" -o -d "${directory}" ]
166
+   if [ "${OPTION_WITH_MISSING_PATHS}" = "YES" -o -d "${directory}" ]
141 167
    then
142
-      if [ "${ABSOLUTE_PATHS}" = "YES" ]
168
+      if [ "${OPTION_USE_ABSOLUTE_PATHS}" = "YES" ]
143 169
       then
144 170
          directory="`absolutepath "${directory}"`"
145 171
       fi
... ...
@@ -150,25 +176,25 @@ _flags_emit_option()
150 176
 
151 177
 _flags_cflags_value()
152 178
 {
153
-   if [ "${WITH_HEADERPATHS}" = "YES" ]
179
+   if [ "${OPTION_WITH_HEADERPATHS}" = "YES" ]
154 180
    then
155
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
181
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
156 182
       then
157 183
          _flags_emit_option "-I" "${DEPENDENCIES_DIR}/include"
158 184
       fi
159
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
185
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
160 186
       then
161 187
          _flags_emit_option "-I" "${ADDICTIONS_DIR}/include"
162 188
       fi
163 189
    fi
164 190
 
165
-   if [ "${WITH_FRAMEWORKPATHS}" = "YES" -a -z "${COMBINE}" ]
191
+   if [ "${OPTION_WITH_FRAMEWORKPATHS}" = "YES" -a "${OPTION_SUPPRESS_FRAMEWORK_CFLAGS}" = "NO" ]
166 192
    then
167
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
193
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
168 194
       then
169 195
          _flags_emit_option "-F" "${DEPENDENCIES_DIR}/Frameworks"
170 196
       fi
171
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
197
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
172 198
       then
173 199
          _flags_emit_option "-F" "${ADDICTIONS_DIR}/Frameworks"
174 200
       fi
... ...
@@ -184,31 +210,31 @@ _flags_cxxflags_value()
184 210
 
185 211
 _flags_ldflags_value()
186 212
 {
187
-   if [ "${WITH_LIBRARYPATHS}" = "YES" ]
213
+   if [ "${OPTION_WITH_LIBRARYPATHS}" = "YES" ]
188 214
    then
189
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
215
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
190 216
       then
191 217
          _flags_emit_option "-L" "${DEPENDENCIES_DIR}/lib"
192 218
       fi
193
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
219
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
194 220
       then
195 221
          _flags_emit_option "-L" "${ADDICTIONS_DIR}/lib"
196 222
       fi
197 223
    fi
198 224
 
199
-   if [ "${WITH_FRAMEWORKPATHS}" = "YES" ]
225
+   if [ "${OPTION_WITH_FRAMEWORKPATHS}" = "YES" -a "${OPTION_SUPPRESS_FRAMEWORK_LDFLAGS}" = "NO" ]
200 226
    then
201
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
227
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
202 228
       then
203 229
          _flags_emit_option "-F" "${DEPENDENCIES_DIR}/Frameworks"
204 230
       fi
205
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
231
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
206 232
       then
207 233
          _flags_emit_option "-F" "${ADDICTIONS_DIR}/Frameworks"
208 234
       fi
209 235
    fi
210 236
 
211
-   if [ "${WITH_LIBRARIES}" = "YES" ]
237
+   if [ "${OPTION_WITH_LIBRARIES}" = "YES" ]
212 238
    then
213 239
       local i
214 240
 
... ...
@@ -223,7 +249,7 @@ _flags_ldflags_value()
223 249
    fi
224 250
 
225 251
 
226
-   if [ "${WITH_FRAMEWORKS}" = "YES" ]
252
+   if [ "${OPTION_WITH_FRAMEWORKS}" = "YES" ]
227 253
    then
228 254
       local i
229 255
 
... ...
@@ -247,9 +273,9 @@ _flags_add_search_path()
247 273
    local result="$1"
248 274
    local searchpath="$2"
249 275
 
250
-   if [ "${FUTURE}" = "YES" -o -d "${searchpath}" ]
276
+   if [ "${OPTION_WITH_MISSING_PATHS}" = "YES" -o -d "${searchpath}" ]
251 277
    then
252
-      if [ "${ABSOLUTE_PATHS}" = "YES" ]
278
+      if [ "${OPTION_USE_ABSOLUTE_PATHS}" = "YES" ]
253 279
       then
254 280
          searchpath="`absolutepath "${searchpath}"`"
255 281
       fi
... ...
@@ -264,13 +290,13 @@ _flags_frameworkpath_value()
264 290
 {
265 291
    local result
266 292
 
267
-   if [ "${WITH_FRAMEWORKPATHS}" = "YES" ]
293
+   if [ "${OPTION_WITH_FRAMEWORKPATHS}" = "YES" ]
268 294
    then
269
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
295
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
270 296
       then
271 297
          result="`_flags_add_search_path "${result}" "${DEPENDENCIES_DIR}/Frameworks"`"
272 298
       fi
273
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
299
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
274 300
       then
275 301
          result="`_flags_add_search_path "${result}" "${ADDICTIONS_DIR}/Frameworks"`"
276 302
       fi
... ...
@@ -287,13 +313,13 @@ _flags_headerpath_value()
287 313
 {
288 314
    local result
289 315
 
290
-   if [ "${WITH_HEADERPATHS}" = "YES" ]
316
+   if [ "${OPTION_WITH_HEADERPATHS}" = "YES" ]
291 317
    then
292
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
318
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
293 319
       then
294 320
          result="`_flags_add_search_path "${result}" "${DEPENDENCIES_DIR}/include"`"
295 321
       fi
296
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
322
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
297 323
       then
298 324
          result="`_flags_add_search_path "${result}" "${ADDICTIONS_DIR}/include"`"
299 325
       fi
... ...
@@ -308,16 +334,16 @@ _flags_headerpath_value()
308 334
 
309 335
 _flags_librarypath_value()
310 336
 {
311
-   if [ "${WITH_LIBRARYPATHS}" = "YES" ]
337
+   if [ "${OPTION_WITH_LIBRARYPATHS}" = "YES" ]
312 338
    then
313
-      if [ "${WITH_DEPENDENCIES}" = "YES" ]
339
+      if [ "${OPTION_WITH_DEPENDENCIES}" = "YES" ]
314 340
       then
315
-         if [ "${FUTURE}" = "YES" -o -d "${DEPENDENCIES_DIR}/lib" ]
341
+         if [ "${OPTION_WITH_MISSING_PATHS}" = "YES" -o -d "${DEPENDENCIES_DIR}/lib" ]
316 342
          then
317 343
             result="`_flags_add_search_path "${result}" "${DEPENDENCIES_DIR}/lib"`"
318 344
          fi
319 345
       fi
320
-      if [ "${WITH_ADDICTIONS}" = "YES" ]
346
+      if [ "${OPTION_WITH_ADDICTIONS}" = "YES" ]
321 347
       then
322 348
          result="`_flags_add_search_path "${result}" "${ADDICTIONS_DIR}/lib"`"
323 349
       fi
... ...
@@ -330,42 +356,97 @@ _flags_librarypath_value()
330 356
 }
331 357
 
332 358
 
359
+_flags_do_path()
360
+{
361
+   local result="$1"
362
+
363
+   local values
364
+   local line
365
+
366
+   values="`_flags_binpath_value`"
367
+   if [ ! -z "${values}" ]
368
+   then
369
+      line="PATH='${values}:${PATH}'"
370
+      result="`add_line "${result}" "${line}"`"
371
+   fi
372
+
373
+   printf "%s" "$result"
374
+}
375
+
376
+
377
+_flags_do_environment()
378
+{
379
+   local result="$1"
380
+
381
+   local values
382
+   local line
383
+
384
+   values="`_flags_cflags_value`"
385
+   if [ ! -z "${values}" ]
386
+   then
387
+      values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
388
+      line="CFLAGS=\"${values}\""
389
+      result="`add_line "${result}" "${line}"`"
390
+   fi
391
+
392
+   values="`_flags_cxxflags_value`"
393
+   if [ ! -z "${values}" ]
394
+   then
395
+      values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
396
+      line="CXXFLAGS=\"${values}\""
397
+      result="`add_line "${result}" "${line}"`"
398
+   fi
399
+
400
+   values="`_flags_ldflags_value`"
401
+   if [ ! -z "${values}" ]
402
+   then
403
+      values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
404
+      line="LDFLAGS=\"${values}\""
405
+      result="`add_line "${result}" "${line}"`"
406
+   fi
407
+
408
+   printf "%s" "$result"
409
+}
410
+
411
+
333 412
 flags_main()
334 413
 {
335 414
    local types
336 415
    local separator
337 416
 
338 417
    # semi-local
339
-   local WITH_HEADERPATHS
340
-   local WITH_LIBRARYPATHS
341
-   local WITH_FRAMEWORKPATHS
342
-   local WITH_LIBRARIES
343
-   local WITH_FRAMEWORKS
344
-   local WITH_ADDICTIONS
345
-   local WITH_DEPENDENCIES
346
-   local FUTURE
347
-   local COMBINE
348
-   local ABSOLUTE_PATHS
418
+   local OPTION_SUPPRESS_FRAMEWORK_CFLAGS="NO"
419
+   local OPTION_SUPPRESS_FRAMEWORK_LDFLAGS="NO"
420
+   local OPTION_USE_ABSOLUTE_PATHS="YES"
421
+   local OPTION_WITH_ADDICTIONS="YES"
422
+   local OPTION_WITH_DEPENDENCIES="NO"
423
+   local OPTION_WITH_FRAMEWORKPATHS="NO"
424
+   local OPTION_WITH_FRAMEWORKS="NO"
425
+   local OPTION_WITH_HEADERPATHS="YES"
426
+   local OPTION_WITH_LIBRARIES="NO"
427
+   local OPTION_WITH_LIBRARYPATHS="YES"
428
+   local OPTION_WITH_MISSING_PATHS="NO"
429
+   local OPTION_PATH_SEPARATOR=":"
349 430
 
350 431
    log_debug ":flags_main:"
351 432
 
352 433
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
353 434
 
354
-   WITH_HEADERPATHS="YES"
355
-   WITH_LIBRARYPATHS="YES"
356
-   WITH_ADDICTIONS="YES"
357
-   ABSOLUTE_PATHS="YES"
435
+   OPTION_WITH_HEADERPATHS="YES"
436
+   OPTION_WITH_LIBRARYPATHS="YES"
437
+   OPTION_WITH_ADDICTIONS="YES"
438
+   OPTION_USE_ABSOLUTE_PATHS="YES"
358 439
 
359 440
    case "${UNAME}" in
360 441
       darwin)
361
-         WITH_FRAMEWORKS="YES"
362
-         WITH_FRAMEWORKPATHS="YES"
442
+         OPTION_WITH_FRAMEWORKS="YES"
443
+         OPTION_WITH_FRAMEWORKPATHS="YES"
363 444
       ;;
364 445
    esac
365 446
 
366 447
    if [ "${MULLE_BOOTSTRAP_EXECUTABLE}" = "mulle-bootstrap" ]
367 448
    then
368
-      WITH_DEPENDENCIES="YES"
449
+      OPTION_WITH_DEPENDENCIES="YES"
369 450
    fi
370 451
 
371 452
    separator="\n"
... ...
@@ -380,42 +461,53 @@ flags_main()
380 461
             separator=" "
381 462
          ;;
382 463
 
383
-         -c|--COMBINE)
384
-            COMBINE="YES"
464
+         -s|--separator)
465
+            shift
466
+            [ $# -eq 0 ] && fail "separator missing"
467
+
468
+            OPTION_PATH_SEPARATOR="$1"
385 469
          ;;
386 470
 
387 471
          -d|--dependencies)
388
-            WITH_DEPENDENCIES="YES"
472
+            OPTION_WITH_DEPENDENCIES="YES"
389 473
          ;;
390 474
 
391 475
          -f|--frameworks)
392
-            WITH_FRAMEWORKS="YES"
393
-            WITH_FRAMEWORKPATHS="YES"
476
+            OPTION_WITH_FRAMEWORKS="YES"
477
+            OPTION_WITH_FRAMEWORKPATHS="YES"
394 478
          ;;
395 479
 
396 480
          -l|--libraries)
397
-            WITH_LIBRARYPATHS="YES"
398
-            WITH_LIBRARIES="YES"
481
+            OPTION_WITH_LIBRARYPATHS="YES"
482
+            OPTION_WITH_LIBRARIES="YES"
399 483
          ;;
400 484
 
401 485
          -m|--missing)
402
-            FUTURE="YES"
486
+            OPTION_WITH_MISSING_PATHS="YES"
403 487
          ;;
404 488
 
405 489
          -na|--no-addictions)
406
-            WITH_ADDICTIONS=
490
+            OPTION_WITH_ADDICTIONS="NO"
491
+         ;;
492
+
493
+         -nc|-no-cflags-frameworks)
494
+            OPTION_SUPPRESS_FRAMEWORK_CFLAGS="YES"
495
+         ;;
496
+
497
+         -nd|-no-ldflags-frameworks)
498
+            OPTION_SUPPRESS_FRAMEWORK_LDFLAGS="YES"
407 499
          ;;
408 500
 
409 501
          -nh|--no-header-paths)
410
-            WITH_HEADERPATHS=
502
+            OPTION_WITH_HEADERPATHS="NO"
411 503
          ;;
412 504
 
413 505
          -nl|--no-library-paths)
414
-            WITH_LIBRARYPATHS=
506
+            OPTION_WITH_LIBRARYPATHS="NO"
415 507
          ;;
416 508
 
417 509
          -nf|--no-framework-paths)
418
-            WITH_FRAMEWORKPATHS=
510
+            OPTION_WITH_FRAMEWORKPATHS="NO"
419 511
          ;;
420 512
 
421 513
          -*)
... ...
@@ -432,8 +524,8 @@ flags_main()
432 524
    done
433 525
 
434 526
    [ -z "${MULLE_BOOTSTRAP_COMMON_SETTINGS_SH}" ] && . mulle-bootstrap-common-settings.sh
435
-
436
-   build_complete_environment
527
+   [ -z "${DEPENDENCIES_DIR}" ] && internal_fail "missing DEPENDENCIES_DIR"
528
+   [ -z "${ADDICTIONS_DIR}" ]   && internal_fail "missing ADDICTIONS_DIR"
437 529
 
438 530
    local type
439 531
    local values
... ...
@@ -442,62 +534,29 @@ flags_main()
442 534
    result=""
443 535
    type="${1:-environment}"
444 536
 
537
+
538
+   local memo
539
+
540
+   # hacque
541
+   PATH_SEPARATOR="${OPTION_PATH_SEPARATOR}"
542
+
445 543
    while [ ! -z "${type}" ]
446 544
    do
447 545
       [ $# -ne 0 ] && shift
448 546
 
449 547
       case "${type}" in
450
-         "cflags"|"cxxflags"|"ldflags"|"frameworkpath"|"headerpath"|"librarypath")
451
-            values="`_flags_${type}_value "${WITH_HEADERPATHS}"  \
452
-                                          "${WITH_LIBRARYPATHS}" \
453
-                                          "${WITH_FRAMEWORKPATHS}" \
454
-                                          "${WITH_LIBRARIES}"   \
455
-                                          "${WITH_FRAMEWORKS}"  \
456
-                                          "${WITH_ADDICTIONS}" \
457
-                                          "${WITH_DEPENDENCIES}"`"
548
+         "cflags"|"cxxflags"|"ldflags"|"binpath"|"frameworkpath"|"headerpath"|"librarypath")
549
+            values="`_flags_${type}_value`"
458 550
             result="`add_line "${result}" "${values}"`"
459 551
          ;;
460 552
 
461 553
 
554
+         "path")
555
+            result="`_flags_do_path "${result}"`"
556
+         ;;
557
+
462 558
          "environment")
463
-            values="`_flags_cflags_value "${WITH_HEADERPATHS}"  \
464
-                                         "${WITH_LIBRARYPATHS}" \
465
-                                         "${WITH_FRAMEWORKPATHS}" \
466
-                                         "${WITH_LIBRARIES}"   \
467
-                                         "${WITH_FRAMEWORKS}"  \
468
-                                         "${WITH_ADDICTIONS}" \
469
-                                         "${WITH_DEPENDENCIES}"`"
470
-            if [ ! -z "${values}" ]
471
-            then
472
-               values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
473
-               result="`add_line "${result}" "CFLAGS='${values}'"`"
474
-            fi
475
-
476
-            values="`_flags_cxxflags_value "${WITH_HEADERPATHS}"  \
477
-                                           "${WITH_LIBRARYPATHS}" \
478
-                                           "${WITH_FRAMEWORKPATHS}" \
479
-                                           "${WITH_LIBRARIES}"   \
480
-                                           "${WITH_FRAMEWORKS}"  \
481
-                                           "${WITH_ADDICTIONS}" \
482
-                                           "${WITH_DEPENDENCIES}"`"
483
-            if [ ! -z "${values}" ]
484
-            then
485
-               values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
486
-               result="`add_line "${result}" "CXXFLAGS='${values}'"`"
487
-            fi
488
-
489
-            values="`_flags_ldflags_value "${WITH_HEADERPATHS}"  \
490
-                                          "${WITH_LIBRARYPATHS}" \
491
-                                          "${WITH_FRAMEWORKPATHS}" \
492
-                                          "${WITH_LIBRARIES}"   \
493
-                                          "${WITH_FRAMEWORKS}"  \
494
-                                          "${WITH_ADDICTIONS}" \
495
-                                          "${WITH_DEPENDENCIES}"`"
496
-            if [ ! -z "${values}" ]
497
-            then
498
-               values="`echo "${values}" | tr '\012' ' ' | sed 's/ *$//'`"
499
-               result="`add_line "${result}" "LDFLAGS='${values}'"`"
500
-            fi
559
+            result="`_flags_do_environment "${result}"`"
501 560
          ;;
502 561
 
503 562
          *)
... ...
@@ -513,11 +572,10 @@ flags_main()
513 572
    then
514 573
       if [ "${separator}" = " " ]
515 574
       then
516
-         echo "${result}" | tr '\012' ' '  | sed 's/ *$//'
517
-         echo ""
575
+         printf "${result}" | tr '\012' ' '  | sed 's/ *$//'
576
+         printf "\n"
518 577
       else
519
-         echo "${result}"
578
+         printf "%s\n" "${result}"
520 579
       fi
521 580
    fi
522 581
 }
523
-
... ...
@@ -201,6 +201,23 @@ is_yes()
201 201
 }
202 202
 
203 203
 
204
+add_cmake_path_if_exists()
205
+{
206
+   local line
207
+   local path
208
+
209
+   line="$1"
210
+   path="$2"
211
+
212
+   if [ -z "${line}" -o ! -e "${line}" ]
213
+   then
214
+      echo "${path}"
215
+   else
216
+      echo "${line};${path}"
217
+   fi
218
+}
219
+
220
+
204 221
 add_cmake_path()
205 222
 {
206 223
    local line
... ...
@@ -682,6 +699,31 @@ escaped_spaces()
682 699
 }
683 700
 
684 701
 
702
+combined_escaped_search_path_if_exists()
703
+{
704
+   local i
705
+   local combinedpath
706
+
707
+   for i in "$@"
708
+   do
709
+      if [ ! -z "${i}" ]
710
+      then
711
+         i="`escaped_spaces "${i}"`"
712
+         if [ -e "${i}" ]
713
+         then
714
+           if [ -z "$combinedpath" ]
715
+           then
716
+              combinedpath="${i}"
717
+           else
718
+              combinedpath="${combinedpath} ${i}"
719
+           fi
720
+        fi
721
+      fi
722
+   done
723
+
724
+   echo "${combinedpath}"
725
+}
726
+
685 727
 combined_escaped_search_path()
686 728
 {
687 729
    local i
... ...
@@ -283,8 +283,6 @@ install_main()
283 283
    DEFAULT_PREFIX="/usr/local"
284 284
    DEFAULT_FRAMEWORK_PREFIX="/Library"
285 285
 
286
-   OPTION_CONFIGURATIONS="`read_config_setting "configurations" "Release"`"
287
-   N_CONFIGURATIONS="`echo "${OPTION_CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
288 286
 
289 287
    while [ $# -ne 0 ]
290 288
    do
... ...
@@ -321,10 +319,11 @@ install_main()
321 319
       continue
322 320
    done
323 321
 
324
-
325 322
    PREFIX="${1:-${DEFAULT_PREFIX}}"
326 323
    [ $# -eq 0 ] || shift
327 324
 
325
+   build_complete_environment
326
+
328 327
    case "${UNAME}" in
329 328
       *)
330 329
          INSTALL_FRAMEWORKS=
... ...
@@ -89,14 +89,11 @@ get_core_count()
89 89
 
90 90
 add_path()
91 91
 {
92
-   local line
93
-   local path
92
+   local line="$1"
93
+   local path="$2"
94 94
 
95 95
    [ -z "${PATH_SEPARATOR}" ] && fail "PATH_SEPARATOR is undefined"
96 96
 
97
-   line="$1"
98
-   path="$2"
99
-
100 97
    case "${UNAME}" in
101 98
       mingw)
102 99
          path="`echo "${path}" | tr '/' '\\' 2> /dev/null`"
... ...
@@ -112,6 +109,17 @@ add_path()
112 109
 }
113 110
 
114 111
 
112
+add_path_if_exists()
113
+{
114
+   if [ -e "${path}" ]
115
+   then
116
+      add_path "$@"
117
+   else
118
+      echo "$1"
119
+   fi
120
+}
121
+
122
+
115 123
 unpostpone_trace()
116 124
 {
117 125
    if [ ! -z "${MULLE_TRACE_POSTPONE}" -a "${MULLE_TRACE}" = "1848" ]
... ...
@@ -362,6 +370,8 @@ is_minion_bootstrap_project()
362 370
 #
363 371
 # read local environment
364 372
 # source this file
373
+# there should be nothing project specific in here
374
+# especially no setting or config reads
365 375
 #
366 376
 local_environment_initialize()
367 377
 {
... ...
@@ -383,18 +393,6 @@ local_environment_initialize()
383 393
    # used by embedded repositories to change location
384 394
    STASHES_ROOT_DIR=""
385 395
 
386
-   # our "sandbox" root, probably not changeable
387
-   ROOT_DIR="`pwd -P`"
388
-
389
-   #
390
-   # where we look for symlink sources
391
-   # user can set also seT via environment "CACHES_PATH"
392
-   #
393
-   local parent
394
-
395
-   parent="`dirname -- "${ROOT_DIR}"`"
396
-   DEFAULT_CACHES_PATH="${CACHES_PATH:-${parent}}"
397
-
398 396
    log_fluff "${UNAME} detected"
399 397
    case "${UNAME}" in
400 398
       mingw)
... ...
@@ -410,7 +408,7 @@ local_environment_initialize()
410 408
       ;;
411 409
 
412 410
       "")
413
-         fail "UNAME not set"
411
+         fail "UNAME not set yet"
414 412
       ;;
415 413
 
416 414
       *)
... ...
@@ -33,26 +33,32 @@ MULLE_BOOTSTRAP_SCRIPTS_SH="included"
33 33
 
34 34
 run_script()
35 35
 {
36
-   local script
37
-
38
-   script="$1"
39
-   shift
36
+   local script="$1" ; shift
40 37
 
41 38
    [ ! -z "$script" ] || internal_fail "script is empty"
42 39
 
40
+   local directory
41
+
42
+   directory="${PWD}/$3"
43
+   [ -d "$directory" ] || internal_fail "expected directory \"${directory}\" is missing from \"${PWD}\""
44
+
43 45
    if [ -x "${script}" ]
44 46
    then
47
+      script="`absolutepath "${script}"`"
45 48
       log_verbose "Executing script ${C_RESET_BOLD}${script}${C_VERBOSE} $1 ..."
46 49
       if  [ "${MULLE_FLAG_LOG_SCRIPTS}" = "YES" ]
47 50
       then
48 51
          echo "ARGV=" "$@" >&2
49
-         echo "DIRECTORY=$PWD/$3" >&2
52
+         echo "DIRECTORY=${directory}" >&2
50 53
          echo "ENVIRONMENT=" >&2
51 54
          echo "{" >&2
52 55
          env | sed 's/^\(.\)/   \1/' >&2
53 56
          echo "}" >&2
54 57
       fi
55
-      exekutor "${script}" "$@" >&2 || fail "script \"${script}\" did not run successfully"
58
+      (
59
+         cd "${directory}"
60
+         exekutor "${script}" "$@" >&2
61
+      ) || fail "script \"${script}\" did not run successfully"
56 62
    else
57 63
       if [ ! -e "${script}" ]
58 64
       then
... ...
@@ -93,43 +99,6 @@ run_build_settings_script()
93 99
 }
94 100
 
95 101
 
96
-#
97
-# various scripts runner for fetch, designed to source in the build
98
-# environment (slow on mingw, if needed)
99
-#
100
-fetch__run_root_settings_script()
101
-{
102
-   local scriptname="$1" ; shift
103
-
104
-   local script
105
-
106
-   script="`find_root_setting_file "bin/${scriptname}.sh"`"
107
-   if [ ! -z "${script}" ]
108
-   then
109
-      build_complete_environment
110
-
111
-      run_script "${script}" "$@"
112
-   fi
113
-}
114
-
115
-
116
-fetch__run_build_settings_script()
117
-{
118
-   local scriptname="$1" ; shift
119
-   local name="$1" ; shift
120
-
121
-   local script
122
-
123
-   script="`find_build_setting_file "${name}" "bin/${scriptname}.sh"`"
124
-   if [ ! -z "${script}" ]
125
-   then
126
-      build_complete_environment
127
-
128
-      run_script "${script}" "$@"
129
-   fi
130
-}
131
-
132
-
133 102
 scripts_initialize()
134 103
 {
135 104
    log_debug ":scripts_initialize:"
... ...
@@ -65,20 +65,7 @@ warn_user_setting()
65 65
 
66 66
    path="$1"
67 67
 
68
-   if [ "$MULLE_BOOTSTRAP_NO_WARN_USER_SETTINGS" != "YES" ]
69
-   then
70
-      log_warning "Using `dirname -- "${path}"` for `basename -- "${path}"`"
71
-   fi
72
-}
73
-
74
-
75
-warn_local_setting()
76
-{
77
-   local path
78
-
79
-   path="$1"
80
-
81
-   if [ "$MULLE_BOOTSTRAP_NO_WARN_LOCAL_SETTINGS" != "YES" ]
68
+   if [ "$MULLE_BOOTSTRAP_WARN_USER_SETTINGS" = "YES" ]
82 69
    then
83 70
       log_warning "Using `dirname -- "${path}"` for `basename -- "${path}"`"
84 71
    fi
... ...
@@ -90,7 +77,7 @@ warn_environment_setting()
90 77
    local name
91 78
 
92 79
    name="$1"
93
-   if [ "$MULLE_BOOTSTRAP_NO_WARN_ENVIRONMENT_SETTINGS" != "YES" ]
80
+   if [ "$MULLE_BOOTSTRAP_WARN_ENVIRONMENT_SETTINGS" = "YES" ]
94 81
    then
95 82
       # don't trace some boring ones
96 83
       if [ "${name}" != "MULLE_FLAG_ANSWER" -a \
... ...
@@ -314,7 +301,7 @@ _read_home_setting()
314 301
 
315 302
    if [ "${MULLE_FLAG_LOG_SETTINGS}" = "YES" ]
316 303
    then
317
-      log_trace2 "Looking for setting \"${name}\" in \"~/.mulle-bootstrap\""
304
+      log_trace2 "Looking for setting \"${name}\" in \"~/.mulle-bootstrap/${name}\""
318 305
    fi
319 306
 
320 307
    if ! value="`_read_setting "${HOME}/.mulle-bootstrap/${name}"`"
... ...
@@ -324,7 +311,7 @@ _read_home_setting()
324 311
 
325 312
    if [ "${MULLE_FLAG_LOG_SETTINGS}" = "YES" ]
326 313
    then
327
-      log_trace "Setting ${C_MAGENTA}${C_BOLD}${name}${C_TRACE} found in \"~/.mulle-bootstrap\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
314
+      log_trace "Setting ${C_MAGENTA}${C_BOLD}${name}${C_TRACE} found in \"~/.mulle-bootstrap/${name}\" as ${C_MAGENTA}${C_BOLD}${value}${C_TRACE}"
328 315
    fi
329 316
    warn_user_setting "${HOME}/.mulle-bootstrap/${name}"
330 317
 
... ...
@@ -924,17 +911,18 @@ setting_main()
924 911
 }
925 912
 
926 913
 
914
+#
927 915
 # read some config stuff now
928
-
916
+#
929 917
 settings_initialize()
930 918
 {
931 919
    log_debug ":settings_initialize:"
932 920
 
933 921
    [ -z "${MULLE_BOOTSTRAP_FUNCTIONS_SH}" ] && . mulle-bootstrap-functions.sh
934 922
 
935
-   MULLE_BOOTSTRAP_NO_WARN_LOCAL_SETTINGS="`read_config_setting "no_warn_local_setting"`"
936
-   MULLE_BOOTSTRAP_NO_WARN_USER_SETTINGS="`read_config_setting "no_warn_user_setting"`"
937
-   MULLE_BOOTSTRAP_NO_WARN_ENVIRONMENT_SETTINGS="`read_config_setting "no_warn_environment_setting"`"
923
+   # MULLE_BOOTSTRAP_NO_WARN_LOCAL_SETTINGS="`read_config_setting "no_warn_local_setting"`"
924
+   MULLE_BOOTSTRAP_WARN_USER_SETTINGS="`read_config_setting "warn_user_setting" "YES"`"
925
+   MULLE_BOOTSTRAP_WARN_ENVIRONMENT_SETTINGS="`read_config_setting "warn_environment_setting" "YES"`"
938 926
 }
939 927
 
940 928
 settings_initialize
... ...
@@ -45,6 +45,8 @@ EOF
45 45
    then
46 46
       cat <<EOF >&2
47 47
       -b : show brews
48
+      -d : show deeply embedded repositories
49
+      -r : show raw repository content
48 50
       -u : show URL
49 51
       -s : show scm, branch, tag info
50 52
 EOF
... ...
@@ -180,7 +182,7 @@ show_raw_repository()
180 182
          cd "${stashdir}"
181 183
          SHOW_PREFIX="${SHOW_PREFIX}   " \
182 184
          MULLE_BOOTSTRAP_DONT_DEFER="YES" \
183
-            mulle-bootstrap show ${MULLE_EXECUTABLE_OPTIONS}
185
+            mulle-bootstrap show -n ${MULLE_EXECUTABLE_OPTIONS}
184 186
       )
185 187
    fi
186 188
 }
... ...
@@ -262,15 +264,31 @@ show_brews()
262 264
 
263 265
 _common_show()
264 266
 {
267
+   if [ "${SHOW_HEADER}" = "YES" ]
268
+   then
269
+      log_info "${SHOW_PREFIX}Project:"
270
+      printf "${SHOW_PREFIX}   "
271
+      printf "${C_INFO}Directory${C_RESET}: "
272
+      printf "%s\n" "${PWD}"
273
+
274
+      # minions won't see this ever
275
+      printf "${SHOW_PREFIX}   "
276
+      printf "${C_INFO}Master${C_RESET}: "
277
+      if is_master_bootstrap_project
278
+      then
279
+         printf "YES\n"
280
+      else
281
+         printf "NO\n"
282
+      fi
283
+      log_info ""
284
+   fi
285
+
265 286
    if [ "${MULLE_BOOTSTRAP_EXECUTABLE}" = "mulle-bootstrap" ]
266 287
    then
267 288
       log_info "${SHOW_PREFIX}Repositories:"
268 289
       if [ "${SHOW_RAW}" = "YES" ]
269 290
       then
270
-         if [ "${SHOW_RAW}" = "YES" ]
271
-         then
272
-           log_info "${SHOW_PREFIX}   ${C_FAINT}URL;DSTDIR;BRANCH;SCM;TAG"
273
-         fi
291
+         log_info "${SHOW_PREFIX}   ${C_FAINT}URL;DSTDIR;BRANCH;SCM;TAG"
274 292
          show_raw_repositories
275 293
       else
276 294
          show_repositories
... ...
@@ -286,7 +304,7 @@ _common_show()
286 304
       fi
287 305
 
288 306
 
289
-      if [ "${SHOW_RAW}" = "NO" ]
307
+      if [ "${SHOW_RAW}" = "NO" -a "${SHOW_DEEP}" = "YES" ]
290 308
       then
291 309
          log_info ""
292 310
          log_info "${SHOW_PREFIX}Deeply Embedded Repositories:"
... ...
@@ -307,10 +325,14 @@ show_main()
307 325
 {
308 326
    log_debug ":show_main:"
309 327
 
328
+   local ROOT_DIR="`pwd -P`"
329
+
310 330
    local SHOW_SCM="NO"
311 331
    local SHOW_URL="NO"
312 332
    local SHOW_BREWS="YES"
313 333
    local SHOW_RAW="NO"
334
+   local SHOW_DEEP="NO"
335
+   local SHOW_HEADER="YES"
314 336
 
315 337
    [ -z "${MULLE_BOOTSTRAP_REPOSITORIES_SH}" ] && . mulle-bootstrap-repositories.sh
316 338
    [ -z "${MULLE_BOOTSTRAP_FETCH_SH}" ]        && . mulle-bootstrap-fetch.sh
... ...
@@ -333,6 +355,10 @@ show_main()
333 355
             SHOW_BREWS="YES"
334 356
          ;;
335 357
 
358
+         -d|--show-deep)
359
+            SHOW_DEEP="YES"
360
+         ;;
361
+
336 362
          -r|--raw)
337 363
             SHOW_RAW="YES"
338 364
          ;;
... ...
@@ -344,6 +370,11 @@ show_main()
344 370
          -u|--show-url)
345 371
             SHOW_URL="YES"
346 372
          ;;
373
+
374
+         -n|--no-header)
375
+            SHOW_HEADER="NO"
</