Browse code

Add mulle-bootstrap-install.sh Improve documentation a little. Fix demo for 1.0 Add new clean mode and streamline mulle-bootstrap-clean mulle-bootstrap tag now only tags .repos, which is just more understandable.

Nat! authored on 22-06-2016 11:51:20
Showing 14 changed files
... ...
@@ -33,11 +33,9 @@ find compiler flags, targets, sdks et.c.
33 33
 
34 34
 ## Where is what in .bootstrap.auto ?
35 35
 
36
-* Files in `.bootstrap.auto` are an amalgamation of .bootstrap and the contents of
37
-.bootstrap of the dependencies.
38
-* .bootstrap/config should not exist
39
-* Folders in `.bootstrap.auto/repos` are the settings inherited from
40
-.bootstrap`.
36
+* Files in `.bootstrap.auto` are an amalgamation of .bootstrap and the contents of the `.bootstrap` folders of the dependencies.
37
+* `.bootstrap/config` should not exist
38
+* Folders in `.bootstrap.auto/repos` are the settings inherited from `.bootstrap`.
41 39
 
42 40
 
43 41
 
... ...
@@ -53,7 +51,7 @@ Release" > .bootstrap/settings/configurations # RIGHT
53 51
 ```
54 52
 
55 53
 
56
-### Can I change the build folder from build/.repos to something else  ?
54
+### Can I change the build folder from `build/.repos`to something else  ?
57 55
 
58 56
 Better not. You can set it with "build_foldername".
59 57
 But beware:
... ...
@@ -1,3 +1,20 @@
1
+1.0
2
+===
3
+
4
+Version 1.0 breaks compatibility with the previous version. You should "clean" everything.
5
+
6
+* **change in the dependencies/ structure**
7
+   it's now dependencies/Debug/lib for Debug and dependencies/lib for Release
8
+* The default built is Release only
9
+* mulle-bootstrap can now '-f' force tags and '-d' delete tags
10
+* mulle-bootstrap no longer places headers into `dependencies/usr/local/include`
11
+but just into `dependencies/include`
12
+* the 'tag' command is now less powerful. It just tags the fetched repositories,
13
+because that's mulle-bootstraps scope. The tag script facility has been
14
+eliminated.
15
+* new clean target "install"
16
+
17
+
1 18
 0.26
2 19
 ===
3 20
 
... ...
@@ -9,23 +9,23 @@ Build Settings (Global only)
9 9
 
10 10
 #### Search Paths
11 11
 
12
-1. ./bootstrap.auto/settings
13
-2. ./bootstrap.local/settings
14
-3. ./bootstrap/settings
12
+1. `.bootstrap.auto/settings`
13
+2. `.bootstrap.local/settings`
14
+3. `.bootstrap/settings`
15 15
 
16 16
 #### Settings
17 17
 
18 18
 
19
-Setting Name            | Description                           |  Default
20
-build_ignore            | repositories not to build             |
21
-build_order             | repositories to build in that order.  |
22
-                        | You only need to specify those, that  |
23
-                        | need ordering. Otherwise              |
24
-                        | mulle-bootstrap builds in default `ls`|
25
-                        | sort order by name.                   |
26
-configurations          | configurations to build               | Debug\nRelease
27
-sdks                    | SDKs to build                         | Default
19
+Setting Name              | Description                           |  Default
20
+--------------------------|---------------------------------------|----------------------------
21
+`build_ignore`            | repositories not to build             |
22
+`build_order`             | repositories to build in that order.  |
23
+                          | You only need to specify those, that  |
24
+                          | need ordering. Otherwise              |
25
+                          | mulle-bootstrap builds in default `ls`|
26
+                          | sort order by name.                   |
27
+`configurations`          | configurations to build               | Debug\nRelease
28
+`sdks`                    | SDKs to build                         | Default
28 29
 
29 30
 
30 31
 Build Settings
... ...
@@ -37,42 +37,43 @@ as a repository.
37 37
 
38 38
 #### Search Paths
39 39
 
40
-1. ./bootstrap.local/${reponame}/settings
41
-2. ./bootstrap/${reponame}/settings
42
-3. ./bootstrap.auto/${reponame}/settings
43
-4. ./bootstrap.auto/settings
44
-5. ./bootstrap.local/settings
45
-6. ./bootstrap/settings
40
+1. `.bootstrap.local/${reponame}/settings`
41
+2. `.bootstrap/${reponame}/settings`
42
+3. `.bootstrap.auto/${reponame}/settings`
43
+
44
+4. `.bootstrap.auto/settings`
45
+5. `.bootstrap.local/settings`
46
+6. `.bootstrap/settings`
46 47
 
47 48
 #### Settings
48 49
 
49
-Setting Name                   |  Description                               | Default
50
-build_preferences              | list order of preferred build tools. Will  |
51
-                               | be used in deciding if to use cmake or     |
52
-                               | xcodebuild, if both are available          |  config setting
53
-${configuration}.map           | rename configuration for xcodebuild        |
54
-cmake-${configuration}.map     | rename configuration for cmake             |
55
-configure-${configuration}.map | rename configuration for configure         |
56
-dispense_headers_path          | where the build should put headers,        |
57
-                               | relative to dependencies. Preferred way    |
58
-                               | for cmake and  configure projects to place |
59
-                               | headers.                                   | /usr/local/${HEADER_DIR_NAME}
60
-dispense_other_path            | where the build should put other files     |
61
-                               | (excluding libraries, frameworks and headers),|
62
-                               | relative to dependencies                   | /usr/local
63
-dispense_other_product         | if the build should dispense other files   | NO
64
-xcode_proper_skip_install      | assume SKIP_INSTALL is set correctly in    |
65
-                               | Xcode project                              | NO
66
-xcode_public_headers           | Substitute for PUBLIC_HEADERS_FOLDER_PATH  |
67
-xcode_private_headers          | Substitute for PRIVATE_HEADERS_FOLDER_PATH |
68
-                               |                                            |
69
-xcode_mangle_header_paths      | Mangle Xcode header paths. Specifcally     |
70
-                               | PUBLIC_HEADERS_FOLDER_PATH and             |
71
-                               | PRIVATE_HEADERS_FOLDER_PATH. Mangling is   |
72
-                               | controlled by the following settings       | NO
73
-xcode_mangle_include_prefix    | remove /usr/local from Xcode header paths  | NO
74
-xcode_mangle_header_dash       | convert '-' to '_' in Xcode header paths   | NO
50
+Setting Name                     |  Description                               | Default
51
+---------------------------------|--------------------------------------------|---------------
52
+`build_preferences`              | list order of preferred build tools. Will  |
53
+                                 | be used in deciding if to use cmake or     |
54
+                                 | xcodebuild, if both are available          |  config setting
55
+`${configuration}.map`           | rename configuration for xcodebuild        |
56
+`cmake-${configuration}.map`     | rename configuration for cmake             |
57
+`configure-${configuration}.map` | rename configuration for configure         |
58
+`dispense_headers_path`          | where the build should put headers,        |
59
+                                 | relative to dependencies. Preferred way    |
60
+                                 | for cmake and  configure projects to place |
61
+                                 | headers.                                   | `/usr/local/${HEADER_DIR_NAME}`
62
+`dispense_other_path`            | where the build should put other files     |
63
+                                 | (excluding libraries, frameworks and headers),|
64
+                                 | relative to dependencies                   | `/usr/local`
65
+`dispense_other_product`         | if the build should dispense other files   | NO
66
+`xcode_proper_skip_install`      | assume SKIP_INSTALL is set correctly in    |
67
+                                 | Xcode project                              | NO
68
+`xcode_public_headers`           | Substitute for PUBLIC_HEADERS_FOLDER_PATH  |
69
+`xcode_private_headers`          | Substitute for PRIVATE_HEADERS_FOLDER_PATH |
70
+                                 |                                            |
71
+`xcode_mangle_header_paths`      | Mangle Xcode header paths. Specifcally     |
72
+                                 | PUBLIC_HEADERS_FOLDER_PATH and             |
73
+                                 | PRIVATE_HEADERS_FOLDER_PATH. Mangling is   |
74
+                                 | controlled by the following settings       | NO
75
+`xcode_mangle_include_prefix`    | remove /usr/local from Xcode header paths  | NO
76
+`xcode_mangle_header_dash`       | convert '-' to '_' in Xcode header paths   | NO
75 77
 
76 78
 
77 79
 
... ...
@@ -82,38 +83,38 @@ Settings Repository Specific
82 83
 
83 84
 #### Search Paths
84 85
 
85
-1. ./bootstrap.local/${reponame}/settings
86
-2. ./bootstrap/${reponame}/settings
87
-3. ./bootstrap.auto/${reponame}/settings
86
+1. `.bootstrap.local/${reponame}/settings`
87
+2. `.bootstrap/${reponame}/settings`
88
+3. `.bootstrap.auto/${reponame}/settings`
88 89
 
89 90
 
90 91
 #### Settings
91 92
 
92
-Setting Name   | Used by       | Description
93
-tag            | fetch         | What to checkout after cloning/symlinking a repository.
94
-project        | build,xcode   | The Xcode project file to use
95
-schemes        | build         | The Xcode schemes to build
96
-targets        | build         | The Xcode targets to build
93
+Setting Name     | Used by       | Description
94
+-----------------|---------------|---------------------------
95
+`tag`            | fetch         | What to checkout after cloning/symlinking a repository.
96
+`project`        | build,xcode   | The Xcode project file to use
97
+`schemes`        | build         | The Xcode schemes to build
98
+`targets`        | build         | The Xcode targets to build
97 99
 
98 100
 
99 101
 Fetch Settings
100 102
 ===================
101 103
 
102
-1. ./bootstrap.auto/settings
103
-2. ./bootstrap.local/settings
104
-3. ./bootstrap/settings
104
+1. `.bootstrap.auto/settings`
105
+2. `.bootstrap.local/settings`
106
+3. `.bootstrap/settings`
105 107
 
106 108
 
107
-Setting Name          |  Description
108
-brews                 | Homebrew formulae to install
109
-gems                  | Ruby packages to install with gem
110
-repositories          | Repositories to clone, specify the URLs
111
-embedded_repositories | Repositories to embed, specify the URLs
112
-pips                  | Python packages to install with pip
113
-taps                  | Homebrew taps to install
114
-tarballs              | Tarballs to install (currently filesystem only)
109
+Setting Name            |  Description
110
+------------------------|----------------------------------------
111
+`brews`                 | Homebrew formulae to install
112
+`gems`                  | Ruby packages to install with gem
113
+`repositories`          | Repositories to clone, specify the URLs
114
+`embedded_repositories` | Repositories to embed, specify the URLs
115
+`pips`                  | Python packages to install with pip
116
+`taps`                  | Homebrew taps to install
117
+`tarballs`              | Tarballs to install (currently filesystem only)
115 118
 
116 119
 
117 120
 
... ...
@@ -127,111 +128,112 @@ in the environment.
127 128
 #### Search Paths
128 129
 
129 130
 1. ENVIRONMENT
130
-1. ./bootstrap.local/config
131
-2. ./bootstrap/config
132
-3. ./bootstrap.auto/config
133
-5. ~/.mulle-bootstrap
131
+2. `.bootstrap.local/config`
132
+3. `.bootstrap/config`
133
+4. `.bootstrap.auto/config`
134
+5. `~/.mulle-bootstrap`
134 135
 
135 136
 ##### General Settings
136 137
 
137
-Setting Name                    |  Description                                  | Default
138
-repos_foldername                | Where to place cloned repositories            | .repos
139
-output_foldername               | DSTROOT, --prefix of headers and libraries    | dependencies
140
-trace                           | see MULLE_BOOTSTRAP_TRACE for more info       | NO
141
-terse                           | set output to less verbose                    | NO
142
-verbose                         | set output to more verbose                    | NO
143
-no_warn_environment_setting     | don't warn when a setting is defined by       |
144
-                                | environment                                   | NO
145
-no_warn_local_setting           | don't warn when a setting is defined by       |
146
-                                | .bootstrap.local                              | NO
147
-no_warn_user_setting            | don't warn when a setting is defined by       |
148
-                                | ~/.mulle-bootstrap                            | NO
138
+Setting Name                      |  Description                                  | Default
139
+----------------------------------|-----------------------------------------------|--------------
140
+`repos_foldername`                | Where to place cloned repositories            | `.repos`
141
+`output_foldername`               | DSTROOT, --prefix of headers and libraries    | `dependencies`
142
+`trace`                           | see `MULLE_BOOTSTRAP_TRACE` for more info     | NO
143
+`terse`                           | set output to less verbose                    | NO
144
+`verbose`                         | set output to more verbose                    | NO
145
+`no_warn_environment_setting`     | don't warn when a setting is defined by       |
146
+                                  | environment                                   | NO
147
+`no_warn_local_setting`           | don't warn when a setting is defined by       |
148
+                                  | `.bootstrap.local`                            | NO
149
+`no_warn_user_setting`            | don't warn when a setting is defined by       |
150
+                                  | `~/.mulle-bootstrap`                          | NO
149 151
 
150 152
 
151 153
 ##### Fetch Config Settings
152 154
 
153
-Setting Name                    |  Description                                  | Default
154
-absolute_symlinks               | Use absolute symlinks instead of relatives    | NO
155
-symlink_forbidden               | mulle-bootstrap will not attempt to symlink   | NO
156
-update_gitignore                | add cleanable directories to .gitignore       | YES
155
+Setting Name                      |  Description                                  | Default
156
+----------------------------------|-----------------------------------------------|--------------
157
+`absolute_symlinks`               | Use absolute symlinks instead of relatives    | NO
158
+`symlink_forbidden`               | mulle-bootstrap will not attempt to symlink   | NO
159
+`update_gitignore`                | add cleanable directories to .gitignore       | YES
157 160
 
158 161
 
159 162
 Build Config Settings
160 163
 
161
-Setting Name                    |  Description                                  | Default
162
-build_preferences               | list order of preferred build tools. Will be  |
163
-                                | used in deciding if to use cmake or           |
164
-                                | xcodebuild, if both are available             | script\nxcodebuild\ncmake\nconfigure
165
-build_foldername                | OBJROOT, build root for intermediate files    |
166
-                                | like .o                                       | build/.repos
167
-build_log_foldername            | name of the output folder for logs            | build/.repos/.logs
168
-clean_before_build              | should mulle-bootstrap clean before building  | YES
169
-clean_dependencies_before_build | usually before a build, mulle-bootstrap       |
170
-                                | cleans dependencies to avoid surprising       |
171
-                                | worked the second time" builds due to a wrong |
172
-framework_dir_name              | name of the Frameworks folder                 | Frameworks
173
-header_dir_name                 | name of the headers folder in dependencies.   |
174
-                                | e.g. You dislike "include" and favor          |
175
-                                | "headers".                                    | include
176
-library_dir_name                | as above, but for libraries                   | lib
177
-skip_collect_and_dispense       | don't collect and dispense products           | NO
178
-xcodebuild                      | tool to use instead of xcodebuild (xctool ?)  | xcodebuild
164
+Setting Name                      |  Description                                  | Default
165
+----------------------------------|-----------------------------------------------|--------------
166
+`build_preferences`               | list order of preferred build tools. Will be  |
167
+                                  | used in deciding if to use cmake or           |
168
+                                  | xcodebuild, if both are available             | script\nxcodebuild\ncmake\nconfigure
169
+`build_foldername`                | OBJROOT, build root for intermediate files    |
170
+                                  | like .o                                       | `build/.repos`
171
+`build_log_foldername`            | name of the output folder for logs            | `build/.repos/.logs
172
+`clean_before_build`              | should mulle-bootstrap clean before building  | YES
173
+`clean_dependencies_before_build` | usually before a build, mulle-bootstrap       |
174
+                                  | cleans dependencies to avoid surprising       |
175
+                                  | worked the second time" builds due to a wrong |
176
+`framework_dir_name`              | name of the Frameworks folder                 | `Frameworks`
177
+`header_dir_name`                 | name of the headers folder in dependencies.   |
178
+                                  | e.g. You dislike "include" and favor          |
179
+                                  | "headers".                                    | `include`
180
+`library_dir_name`                | as above, but for libraries                   | `lib`
181
+`skip_collect_and_dispense`       | don't collect and dispense products           | NO
182
+`xcodebuild`                      | tool to use instead of xcodebuild (xctool ?)  | `xcodebuild`
179 183
 
180 184
 
181 185
 ##### Init Config Settings
182 186
 
183 187
 Setting Name                    |  Description                                  | Default
184 188
 --------------------------------|-----------------------------------------------|--------------
185
-create_default_files            | if mulle-bootstrap init should populate       |
189
+`create_default_files`          | if mulle-bootstrap init should populate       |
186 190
                                 | .bootstrap with some default files            | YES
187
-create_example_files            | if mulle-bootstrap init should populate       |
191
+`create_example_files`          | if mulle-bootstrap init should populate       |
188 192
                                 | .bootstrap with some example files            | YES
189
-editor                          | the editor mulle-bootstrap init should use    |
193
+`editor`                        | the editor mulle-bootstrap init should use    |
190 194
                                 | to edit repositories                          | EDITOR environment variable
191
-open_repositories_file          | if mulle-bootstrap init should open an editor |
195
+`open_repositories_file`        | if mulle-bootstrap init should open an editor |
192 196
                                 | to edit repositories (YES/NO/ASK)             | ASK
193 197
 
194 198
 
195 199
 ##### Clean Config Settings
196 200
 
197
-Setting Name                    |  Description                                  | Default
198
-clean_empty_parent_folders      | e.g remove build, if its empty after removing |
199
-                                | build/.repos ?                                | YES
200
-clean_folders                   | folders to delete for mulle-bootstrap clean   | build/.repos
201
-dist_clean_folders              | folders to delete for mulle-bootstrap clean   |
202
-                                | dist                                          | .repos\n/.bootstrap.auto
203
-output_clean_folders            | folders to delete for mulle-bootstrap clean   |
204
-                                | output                                        | dependencies
201
+Setting Name                      |  Description                                  | Default
202
+----------------------------------|-----------------------------------------------|--------------
203
+`clean_empty_parent_folders`      | e.g remove build, if its empty after removing |
204
+                                  | build/.repos ?                                | YES
205
+`clean_folders`                   | folders to delete for mulle-bootstrap clean   | `build/.repos`
206
+`dist_clean_folders`              | folders to delete for mulle-bootstrap clean   |
207
+                                  | dist                                          | `.repos\n/.bootstrap.auto`
208
+`output_clean_folders`            | folders to delete for mulle-bootstrap clean   |
209
+                                  | output                                        | `dependencies`
205 210
 
206 211
 
207 212
 Fetch Script Settings
208 213
 ==========================
209 214
 
210
-1. ./bootstrap.auto/settings/bin
211
-2. ./bootstrap.local/settings/bin
212
-3. ./bootstrap/settings/bin
215
+1. `.bootstrap.auto/settings/bin`
216
+2. `.bootstrap.local/settings/bin`
217
+3. `.bootstrap/settings/bin`
218
+
219
+`pre-install.sh`
220
+`post-install.sh`
221
+`pre-upgrade.sh`
222
+`post-upgrade.sh`
223
+`pre-tag.sh`
224
+`post-tag.sh`
213 225
 
214
-pre-install.sh
215
-post-install.sh
216
-pre-upgrade.sh
217
-post-upgrade.sh
218
-pre-tag.sh
219
-post-tag.sh
220 226
 
221 227
 Build Script Settings
222 228
 ==========================
223 229
 
224
-1. ./bootstrap.local/${reponame}/settings/bin
225
-2. ./bootstrap/${reponame}/settings/bin
226
-3. ./bootstrap.auto/${reponame}/settings/bin
230
+1. `.bootstrap.local/${reponame}/settings/bin`
231
+2. `.bootstrap/${reponame}/settings/bin`
232
+3. `.bootstrap.auto/${reponame}/settings/bin`
227 233
 
228
-pre-install.sh
229
-post-install.sh
230
-pre-upgrade.sh
231
-post-upgrade.sh
232
-pre-tag.sh
233
-post-tag.sh
234
+`pre-install.sh
235
+`post-install.sh`
236
+`pre-upgrade.sh`
237
+`post-upgrade.sh`
238
+`pre-tag.sh`
239
+`post-tag.sh`
... ...
@@ -1 +1 @@
1
-/usr/local/include/zlib
1
+/include/zlib
2 2
new file mode 100644
... ...
@@ -0,0 +1,67 @@
1
+
2
+digraph install
3
+{
4
+   node [shape=folder];
5
+
6
+   subgraph cluster_bootstrap
7
+   {
8
+      ".bootstrap" -> "repositories"
9
+      "repositories"  [ shape="note" ]
10
+   }
11
+
12
+   subgraph cluster_bootstrap_auto
13
+   {
14
+      ".bootstrap.auto" -> "repositories auto"
15
+      "repositories auto"  [ shape="note" label="repositories" ]
16
+   }
17
+
18
+   subgraph cluster_src
19
+   {
20
+      ".repos" -> "foo src"
21
+      "foo src"  [ label="foo" ]
22
+      "foo src" -> "src"
23
+      "foo src" -> "CMakeLists.txt"
24
+      "CMakeLists.txt"  [ shape="note" ]
25
+      "src" -> "foo.h src"
26
+      "src" -> "foo.c src"
27
+      "foo.h src"   [ label="foo.h" shape="note" ]
28
+      "foo.c src"   [ label="foo.c" shape="note" ]
29
+   }
30
+
31
+   subgraph cluster_build
32
+   {
33
+      "build" -> ".repos build"
34
+      ".repos build"  [ label=".repos" ]
35
+      ".repos build" -> "Release"
36
+      "Release" -> "foo Release"
37
+      "foo Release" -> "libfoo.a Release"
38
+      "foo Release"     [ label="foo" ]
39
+      "libfoo.a Release"   [ label="libfoo.a" shape="note" ]
40
+   }
41
+
42
+   subgraph cluster_tmp
43
+   {
44
+      "dependencies tmp" [ label="dependencies" ]
45
+      "dependencies tmp" -> "tmp"
46
+      "tmp" -> "lib"
47
+      "tmp" -> "include"
48
+      "lib" ->  "libfoo.a install"
49
+      "include" ->  "foo.h install"
50
+      "libfoo.a install"   [ label="libfoo.a" shape="note" ]
51
+      "foo.h install"   [ label="foo.h" shape="note" ]
52
+   }
53
+
54
+   subgraph cluster_dependencies
55
+   {
56
+      "dependencies" -> "lib dependencies"
57
+      "dependencies" -> "include dependencies"
58
+      "lib dependencies" ->  "libfoo.a dependencies"
59
+      "lib dependencies"  [ label="lib" ]
60
+      "include dependencies"  [ label="include" ]
61
+      "include dependencies" ->  "foo dependencies"
62
+      "foo dependencies" ->  "foo.h dependencies"
63
+      "foo dependencies"     [ label="foo" ]
64
+      "libfoo.a dependencies"   [ label="libfoo.a" shape="note" ]
65
+      "foo.h dependencies"   [ label="foo.h" shape="note" ]
66
+   }
67
+}
0 68
\ No newline at end of file
... ...
@@ -29,7 +29,7 @@
29 29
 #   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 30
 #   POSSIBILITY OF SUCH DAMAGE.
31 31
 
32
-VERSION=0.26
32
+VERSION=1.0
33 33
 export VERSION
34 34
 
35 35
 #
... ...
@@ -168,6 +168,7 @@ cat <<EOF
168 168
    fetch     : fetches required repositories recursively.
169 169
    update    : updates repositories (pull).
170 170
    refresh   : rebuild .bootstrap.auto
171
+   install   : install dependencies as system headers
171 172
 
172 173
  Specify the -h or --help option after each command to get more help.
173 174
 EOF
... ...
@@ -257,6 +258,10 @@ main()
257 258
          mulle-bootstrap-project.sh "$@" || exit 1
258 259
          ;;
259 260
 
261
+      install)
262
+         mulle-bootstrap-install.sh "$@" || exit 1
263
+         ;;
264
+
260 265
       build)
261 266
          COMMAND="refresh" mulle-bootstrap-refresh.sh  || exit 1
262 267
          COMMAND="${command}" mulle-bootstrap-build.sh "$@" || exit 1
... ...
@@ -36,8 +36,8 @@
36 36
 
37 37
 
38 38
 CLEAN_BEFORE_BUILD=`read_config_setting "clean_before_build" "YES"`
39
-CONFIGURATIONS="`read_build_root_setting "configurations" "Debug
40
-Release"`"
39
+CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
40
+N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
41 41
 
42 42
 # get number of cores, use 50% more for make -j
43 43
 CORES="`get_core_count`"
... ...
@@ -139,12 +139,11 @@ dispense_headers()
139 139
    local name
140 140
    local src
141 141
 
142
-   name="${1}"
142
+   name="$1"
143 143
    src="$2"
144 144
 
145 145
    local dst
146
-   local headers
147
-   local suffix
146
+   local headerpath
148 147
 
149 148
    log_fluff "Consider copying headers from \"${src}\""
150 149
 
... ...
@@ -152,9 +151,9 @@ dispense_headers()
152 151
    then
153 152
       if dir_has_files "${src}"
154 153
       then
155
-         headers="`read_build_setting "${name}" "dispense_headers_path" "/usr/local/${HEADER_DIR_NAME}"`"
154
+         headerpath="`read_build_setting "${name}" "dispense_headers_path" "/${HEADER_DIR_NAME}"`"
156 155
 
157
-         dst="${REFERENCE_DEPENDENCY_SUBDIR}${headers}"
156
+         dst="${REFERENCE_DEPENDENCY_SUBDIR}${headerpath}"
158 157
          mkdir_if_missing "${dst}"
159 158
 
160 159
          # this fails with more nested header set ups, need to fix!
... ...
@@ -174,18 +173,19 @@ dispense_headers()
174 173
 
175 174
 dispense_binaries()
176 175
 {
176
+   local name
177 177
    local src
178 178
    local findtype
179
+   local depend_subdir
179 180
    local subpath
180
-   local name
181 181
 
182 182
    name="$1"
183 183
    src="$2"
184 184
    findtype="$3"
185
-   subpath="$4"
185
+   depend_subdir="$4"
186
+   subpath="$5"
186 187
 
187 188
    local dst
188
-   local usrlocal
189 189
    local findtype2
190 190
    local copyflag
191 191
 
... ...
@@ -201,7 +201,7 @@ dispense_binaries()
201 201
    then
202 202
       if dir_has_files "${src}"
203 203
       then
204
-         dst="${REFERENCE_DEPENDENCY_SUBDIR}${subpath}${subdir}"
204
+         dst="${REFERENCE_DEPENDENCY_SUBDIR}${depend_subdir}${subpath}"
205 205
 
206 206
          log_fluff "Copying \"${src}\" to \"${dst}\""
207 207
          mkdir_if_missing "${dst}"
... ...
@@ -221,12 +221,14 @@ dispense_binaries()
221 221
 collect_and_dispense_product()
222 222
 {
223 223
    local  name
224
-   local  subdir
224
+   local  build_subdir
225
+   local  depend_subdir
225 226
    local  name
226 227
 
227 228
    name="${1}"
228
-   subdir="${2}"
229
-   wasxcode="${3}"
229
+   build_subdir="${2}"
230
+   depend_subdir="${3}"
231
+   wasxcode="${4}"
230 232
 
231 233
    local  dst
232 234
    local  src
... ...
@@ -237,53 +239,52 @@ collect_and_dispense_product()
237 239
       return 0
238 240
    fi
239 241
 
240
-   log_fluff "Collecting and dispensing \"${name}\" \"`basename -- "${subdir}"`\" products "
242
+   log_fluff "Collecting and dispensing \"${name}\" \"`basename -- "${build_subdir}"`\" products "
243
+
241 244
    #
242 245
    # probably should use install_name_tool to hack all dylib paths that contain .ref
243 246
    # (will this work with signing stuff ?)
244 247
    #
245
-   if [ "${wasxcode}" = "YES" ]
248
+   if true
246 249
    then
247 250
       log_fluff "Choosing xcode dispense path"
248 251
 
252
+      # cmake
253
+
249 254
       src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/include"
250 255
       dispense_headers "${name}" "${src}"
251 256
 
257
+      src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/lib"
258
+      dispense_binaries "${name}" "${src}" "f" "${depend_subdir}" "/${LIBRARY_DIR_NAME}"
259
+
260
+      # pretty much xcodetool specific
261
+
252 262
       src="${BUILD_DEPENDENCY_SUBDIR}/usr/include"
253 263
       dispense_headers "${name}" "${src}"
254 264
 
255 265
       src="${BUILD_DEPENDENCY_SUBDIR}/include"
256 266
       dispense_headers "${name}" "${src}"
257 267
 
258
-      src="${BUILD_DEPENDENCY_SUBDIR}/lib${subdir}"
259
-      dispense_binaries "${name}" "${src}" "f" "/${LIBRARY_DIR_NAME}"
260
-
261
-      src="${BUILD_DEPENDENCY_SUBDIR}/Library/Frameworks${subdir}"
262
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
268
+      src="${BUILD_DEPENDENCY_SUBDIR}${build_subdir}/lib"
269
+      dispense_binaries "${name}" "${src}" "f" "${depend_subdir}" "/${LIBRARY_DIR_NAME}"
263 270
 
264
-      src="${BUILD_DEPENDENCY_SUBDIR}/Frameworks${subdir}"
265
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
271
+      src="${BUILD_DEPENDENCY_SUBDIR}${build_subdir}/Library/Frameworks"
272
+      dispense_binaries "${name}" "${src}" "d" "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
266 273
 
267
-      src="${BUILD_DEPENDENCY_SUBDIR}${subdir}/Library/Frameworks"
268
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
274
+      src="${BUILD_DEPENDENCY_SUBDIR}${build_subdir}/Frameworks"
275
+      dispense_binaries "${name}" "${src}" "d" "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
269 276
 
270
-      src="${BUILD_DEPENDENCY_SUBDIR}${subdir}/Frameworks"
271
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
277
+      src="${BUILD_DEPENDENCY_SUBDIR}${build_subdir}/Library/Frameworks"
278
+      dispense_binaries "${name}" "${src}" "d" "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
272 279
 
280
+      src="${BUILD_DEPENDENCY_SUBDIR}${build_subdir}/Frameworks"
281
+      dispense_binaries "${name}" "${src}" "d" "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
273 282
 
274 283
       src="${BUILD_DEPENDENCY_SUBDIR}/Library/Frameworks"
275
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
284
+      dispense_binaries "${name}" "${src}" "d"  "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
276 285
 
277 286
       src="${BUILD_DEPENDENCY_SUBDIR}/Frameworks"
278
-      dispense_binaries "${name}" "${src}" "d" "/${FRAMEWORK_DIR_NAME}"
279
-   else
280
-      log_fluff "Choosing cmake/configure dispense path"
281
-
282
-      src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/include"
283
-      dispense_headers "${name}" "${src}"
284
-
285
-      src="${BUILD_DEPENDENCY_SUBDIR}/usr/local/lib"
286
-      dispense_binaries "${name}" "${src}" "f" "/${LIBRARY_DIR_NAME}"
287
+      dispense_binaries "${name}" "${src}" "d" "${depend_subdir}" "/${FRAMEWORK_DIR_NAME}"
287 288
    fi
288 289
 
289 290
    #
... ...
@@ -318,7 +319,7 @@ collect_and_dispense_product()
318 319
       src="${BUILD_DEPENDENCY_SUBDIR}"
319 320
       if [ "${wasxcode}" = "YES" ]
320 321
       then
321
-         src="${src}${subdir}"
322
+         src="${src}${build_subdir}"
322 323
       fi
323 324
 
324 325
       if dir_has_files "${src}"
... ...
@@ -377,7 +378,7 @@ determine_suffix()
377 378
    [ ! -z "$configuration" ] || fail "configuration must not be empty"
378 379
    [ ! -z "$sdk" ] || fail "sdk must not be empty"
379 380
 
380
-   suffix="/${configuration}"
381
+   suffix="${configuration}"
381 382
    if [ "${sdk}" != "Default" ]
382 383
    then
383 384
       hackish=`echo "${sdk}" | sed 's/^\([a-zA-Z]*\).*$/\1/g'`
... ...
@@ -387,6 +388,29 @@ determine_suffix()
387 388
 }
388 389
 
389 390
 
391
+#
392
+# if only one configuration is chosen, make it the default
393
+# if there are multiple configurations, make Release the default
394
+# if Release is not in multiple configurations, then there is no default
395
+#
396
+determine_build_subdir()
397
+{
398
+   echo "/$1"
399
+}
400
+
401
+
402
+determine_dependencies_subdir()
403
+{
404
+   if [ "${N_CONFIGURATIONS}" -gt 1 ]
405
+   then
406
+      if [ "$1" != "Release" ]
407
+      then
408
+         echo "/$1"
409
+      fi
410
+   fi
411
+}
412
+
413
+
390 414
 cmake_sdk_parameter()
391 415
 {
392 416
    local sdk
... ...
@@ -407,29 +431,25 @@ cmake_sdk_parameter()
407 431
 create_dummy_dirs_against_warnings()
408 432
 {
409 433
    local builddir
410
-   local configuration
411
-   local suffix
434
+   local mappedsubdir
435
+   local suffixsubdir
412 436
 
413 437
    builddir="$1"
414
-   configuration="$2"
415
-   suffix="$3"
438
+   mappedsubdir="$2"
439
+   suffixsubdir="$3"
416 440
 
417 441
    local owd
418 442
 
419 443
    owd="${PWD}"
420 444
 
421
-   # to avoid warnings make sure directories are all there
445
+   # to avoid warnings, make sure directories are all there
422 446
    mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"
423
-   if [ ! -z "${configuration}" ]
424
-   then
425
-      mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${configuration}"
426
-      mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${configuration}"
427
-   fi
428
-   if [ ! -z "${suffix}" ]
429
-   then
430
-       mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix}"
431
-       mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix}"
432
-   fi
447
+
448
+   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"
449
+   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"
450
+
451
+   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME}"
452
+   mkdir_if_missing "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME}"
433 453
 }
434 454
 
435 455
 
... ...
@@ -475,12 +495,12 @@ build_log_name()
475 495
    echo "${logfile}.${tool}.log"
476 496
 }
477 497
 
498
+
478 499
 #
479 500
 # remove old builddir, create a new one
480 501
 # depending on configuration cmake with flags
481 502
 # build stuff into dependencies
482 503
 #
483
-#
484 504
 build_cmake()
485 505
 {
486 506
    local configuration
... ...
@@ -508,6 +528,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
508 528
    local fallback
509 529
    local localcmakeflags
510 530
 
531
+
511 532
    fallback="`echo "${CONFIGURATIONS}" | tail -1`"
512 533
    fallback="`read_build_setting "${name}" "fallback-configuration" "${fallback}"`"
513 534
    mapped="`read_build_setting "${name}" "cmake-${configuration}.map" "${configuration}"`"
... ...
@@ -515,6 +536,14 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
515 536
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
516 537
    sdkparameter="`cmake_sdk_parameter "${sdk}"`"
517 538
 
539
+   local mappedsubdir
540
+   local fallbacksubdir
541
+   local suffixsubdir
542
+
543
+   mappedsubdir="`determine_build_subdir "${mapped}"`"
544
+   suffixsubdir="`determine_build_subdir "${suffix}"`"
545
+   fallbacksubdir="`determine_build_subdir "${fallback}"`"
546
+
518 547
    local other_cflags
519 548
    local other_cppflags
520 549
    local other_ldflags
... ...
@@ -523,7 +552,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
523 552
    other_cppflags="`gcc_cppflags_value "${name}"`"
524 553
    other_ldflags="`gcc_ldflags_value "${name}"`"
525 554
 
526
-   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
555
+   create_dummy_dirs_against_warnings "${builddir}" "${mappedsubdir}" "${suffixsubdir}"
527 556
 
528 557
    local logfile1
529 558
    local logfile2
... ...
@@ -579,28 +608,28 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
579 608
 "-DCMAKE_INSTALL_PREFIX:PATH=${owd}/${BUILD_DEPENDENCY_SUBDIR}/usr/local"  \
580 609
 "-DCMAKE_C_FLAGS=\
581 610
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
582
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
583
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped} \
584
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
611
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
612
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
613
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
585 614
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
586 615
 ${other_cflags}" \
587 616
 "-DCMAKE_CXX_FLAGS=\
588 617
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
589
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
590
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped} \
591
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
618
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
619
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
620
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
592 621
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
593 622
 ${other_cppflags}" \
594 623
 "-DCMAKE_EXE_LINKER_FLAGS=\
595
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix} \
596
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${mapped} \
597
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback} \
624
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
625
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
626
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
598 627
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
599 628
 ${other_ldflags}" \
600 629
 "-DCMAKE_SHARED_LINKER_FLAGS=\
601
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix} \
602
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${mapped} \
603
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback} \
630
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
631
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
632
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
604 633
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
605 634
 ${other_ldflags}" \
606 635
 "-DCMAKE_MODULE_PATH=${CMAKE_MODULE_PATH};\${CMAKE_MODULE_PATH}" \
... ...
@@ -614,7 +643,10 @@ ${localcmakeflags} \
614 643
 
615 644
    exekutor cd "${owd}"
616 645
 
617
-   collect_and_dispense_product "${name}" "${suffix}" || internal_fail "collect failed silently"
646
+   local depend_subdir
647
+
648
+   depend_subdir="`determine_dependencies_subdir "${suffix}"`"
649
+   collect_and_dispense_product "${name}" "${suffixsubdir}" "${depend_subdir}" || internal_fail "collect failed silently"
618 650
 }
619 651
 
620 652
 
... ...
@@ -662,6 +694,14 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
662 694
    sdkpath="`gcc_sdk_parameter "${sdk}"`"
663 695
    sdkpath="`echo "${sdkpath}" | sed -e 's/ /\\ /g'`"
664 696
 
697
+   local mappedsubdir
698
+   local fallbacksubdir
699
+   local suffixsubdir
700
+
701
+   mappedsubdir="`determine_build_subdir "${mapped}"`"
702
+   suffixsubdir="`determine_build_subdir "${suffix}"`"
703
+   fallbacksubdir="`determine_build_subdir "${fallback}"`"
704
+
665 705
    local other_cflags
666 706
    local other_cppflags
667 707
    local other_ldflags
... ...
@@ -670,7 +710,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
670 710
    other_cppflags="`gcc_cppflags_value "${name}"`"
671 711
    other_ldflags="`gcc_ldflags_value "${name}"`"
672 712
 
673
-   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
713
+   create_dummy_dirs_against_warnings "${builddir}" "${mappedsubdir}" "${suffixsubdir}"
674 714
 
675 715
    local logfile1
676 716
    local logfile2
... ...
@@ -706,28 +746,28 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO} in \"${builddir}\" ..."
706 746
        DEPENDENCIES_DIR="'${owd}/${REFERENCE_DEPENDENCY_SUBDIR}'" \
707 747
        CFLAGS="\
708 748
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
709
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
710
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped} \
711
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
749
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
750
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
751
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
712 752
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
713 753
 ${other_cflags} \
714 754
 -isysroot ${sdkpath}" \
715 755
       CPPFLAGS="\
716 756
 -I${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME} \
717
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
718
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped} \
719
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
757
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
758
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
759
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
720 760
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
721 761
 ${other_cppflags} \
722 762
 -isysroot ${sdkpath}" \
723 763
       LDFLAGS="\
724
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}${suffix} \
725
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped} \
726
--F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback} \
764
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${FRAMEWORK_DIR_NAME} \
765
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME} \
766
+-F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME} \
727 767
 -F${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME} \
728
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}${suffix} \
729
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${mapped} \
730
--L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback} \
768
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${suffixsubdir}/${LIBRARY_DIR_NAME} \
769
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME} \
770
+-L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME} \
731 771
 -L${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME} \
732 772
 ${other_ldflags} \
733 773
 -isysroot ${sdkpath}" \
... ...
@@ -742,7 +782,10 @@ ${other_ldflags} \
742 782
 
743 783
    exekutor cd "${owd}"
744 784
 
745
-   collect_and_dispense_product "${name}" "${suffix}" || exit 1
785
+   local depend_subdir
786
+
787
+   depend_subdir="`determine_dependencies_subdir "${suffix}"`"
788
+   collect_and_dispense_product "${name}" "${suffixsubdir}" "${depend_subdir}" || exit 1
746 789
 }
747 790
 
748 791
 
... ...
@@ -918,7 +961,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
918 961
    local targetname
919 962
    local suffix
920 963
 
921
-   suffix="/${configuration}"
964
+   suffix="${configuration}"
922 965
    if [ "${sdk}" != "Default" ]
923 966
    then
924 967
       hackish="`echo "${sdk}" | sed 's/^\([a-zA-Z]*\).*$/\1/g'`"
... ...
@@ -927,6 +970,14 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
927 970
       sdk=
928 971
    fi
929 972
 
973
+   local mappedsubdir
974
+   local fallbacksubdir
975
+   local suffixsubdir
976
+
977
+   mappedsubdir="`determine_build_subdir "${mapped}"`"
978
+   suffixsubdir="`determine_build_subdir "${suffix}"`"
979
+   fallbacksubdir="`determine_build_subdir "${fallback}"`"
980
+
930 981
    local xcode_proper_skip_install
931 982
    local skip_install
932 983
 
... ...
@@ -1069,7 +1120,7 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1069 1120
    fi
1070 1121
 
1071 1122
 
1072
-   create_dummy_dirs_against_warnings "${builddir}" "${configuration}" "${suffix}"
1123
+   create_dummy_dirs_against_warnings "${builddir}" "${mappedsubdir}" "${suffixsubdir}"
1073 1124
 
1074 1125
    owd=`pwd`
1075 1126
    exekutor cd "${srcdir}" || exit 1
... ...
@@ -1111,13 +1162,13 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1111 1162
 
1112 1163
       inherited="`xcode_get_setting LIBRARY_SEARCH_PATHS ${arguments}`" || exit 1
1113 1164
       path=`combined_escaped_search_path \
1114
-"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${mapped}" \
1115
-"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${fallback}" \
1165
+"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME}" \
1166
+"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${LIBRARY_DIR_NAME}" \
1116 1167
 "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}" \
1117 1168
 "/usr/local/lib"`
1118 1169
       if [ ! -z "$sdk" ]
1119 1170
       then
1120
-         escaped="`escaped_spaces "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}/${mapped}"'-$(EFFECTIVE_PLATFORM_NAME)'`"
1171
+         escaped="`escaped_spaces "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${LIBRARY_DIR_NAME}"'-$(EFFECTIVE_PLATFORM_NAME)'`"
1121 1172
          path="${escaped} ${path}" # prepend
1122 1173
       fi
1123 1174
       if [ -z "${inherited}" ]
... ...
@@ -1129,12 +1180,12 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1129 1180
 
1130 1181
       inherited="`xcode_get_setting FRAMEWORK_SEARCH_PATHS ${arguments}`" || exit 1
1131 1182
       path=`combined_escaped_search_path \
1132
-"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped}" \
1133
-"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${fallback}" \
1183
+"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}" \
1184
+"${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${fallbacksubdir}/${FRAMEWORK_DIR_NAME}" \
1134 1185
 "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}"`
1135 1186
       if [ ! -z "$sdk" ]
1136 1187
       then
1137
-         escaped="`escaped_spaces "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}/${FRAMEWORK_DIR_NAME}/${mapped}"'-$(EFFECTIVE_PLATFORM_NAME)'`"
1188
+         escaped="`escaped_spaces "${owd}/${REFERENCE_DEPENDENCY_SUBDIR}${mappedsubdir}/${FRAMEWORK_DIR_NAME}"'-$(EFFECTIVE_PLATFORM_NAME)'`"
1138 1189
          path="${escaped} ${path}" # prepend
1139 1190
       fi
1140 1191
       if [ -z "${inherited}" ]
... ...
@@ -1176,7 +1227,10 @@ FRAMEWORK_SEARCH_PATHS='${dependencies_framework_search_path}'"
1176 1227
 
1177 1228
    exekutor cd "${owd}"
1178 1229
 
1179
-   collect_and_dispense_product "${name}" "${suffix}" "YES" || exit 1
1230
+   local depend_subdir
1231
+
1232
+   depend_subdir="`determine_dependencies_subdir "${suffix}"`"
1233
+   collect_and_dispense_product "${name}" "${suffixsubdir}" "${depend_subdir}" "YES" || exit 1
1180 1234
 }
1181 1235
 
1182 1236
 
... ...
@@ -1328,9 +1382,13 @@ ${C_MAGENTA}${C_BOLD}${sdk}${C_INFO}${info} in \
1328 1382
    exekutor cd "${owd}"
1329 1383
 
1330 1384
    local suffix
1385
+   local depend_subdir
1386
+   local suffixsubdir
1331 1387
 
1332 1388
    suffix="`determine_suffix "${configuration}" "${sdk}"`"
1333
-   collect_and_dispense_product "${name}" "${suffix}" || internal_fail "collect failed silently"
1389
+   suffixsubdir="`determine_build_subdir "${suffix}"`"
1390
+   depend_subdir="`determine_dependencies_subdir "${suffix}"`"
1391
+   collect_and_dispense_product "${name}" "${suffixsubdir}" "${depend_subdir}" || internal_fail "collect failed silently"
1334 1392
 }
1335 1393
 
1336 1394
 
... ...
@@ -1660,7 +1718,7 @@ build_clones()
1660 1718
             then
1661 1719
                build_if_alive "${name}" "${srcdir}" || exit  1
1662 1720
             else
1663
-               fail "repo for \"${clone}\" not found (\"${srcdir}\") ($PWD)"
1721
+               fail "build failed for repository\"${clone}\": not found in (\"${srcdir}\") ($PWD)"
1664 1722
             fi
1665 1723
          done
1666 1724
       fi
... ...
@@ -1754,8 +1812,6 @@ main()
1754 1812
    # if present then we didnt't want to clean and we do nothing special
1755 1813
    if [ ! -d "${DEPENDENCY_SUBDIR}" ]
1756 1814
    then
1757
-      mkdir_if_missing "${DEPENDENCY_SUBDIR}/usr/local/include"
1758
-      exekutor ln -s "usr/local/include" "${DEPENDENCY_SUBDIR}/include" || fail "failed to symlink future usr/local/include"
1759 1815
       install_tars "$@"
1760 1816
    else
1761 1817
       if have_tars
... ...
@@ -31,13 +31,17 @@
31 31
 
32 32
 . mulle-bootstrap-local-environment.sh
33 33
 
34
+CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
35
+
34 36
 
35 37
 BUILD_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "clean_folders" "${CLONESBUILD_SUBDIR}
36 38
 ${DEPENDENCY_SUBDIR}/tmp"`"
37 39
 OUTPUT_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "output_clean_folders" "${DEPENDENCY_SUBDIR}"`"
38 40
 DIST_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "dist_clean_folders" "${CLONES_SUBDIR}
39 41
 .bootstrap.auto"`"
40
-CLEAN_EMPTY_PARENTS="`read_config_setting "clean_empty_parent_folders" "YES"`"
42
+INSTALL_CLEANABLE_SUBDIRS="`read_sane_config_path_setting "install_clean_folders" "${BUILD_CLEANABLE_SUBDIRS}
43
+${CLONES_SUBDIR}
44
+.bootstrap.auto"`"
41 45
 
42 46
 
43 47
 embedded_repositories()
... ...
@@ -67,28 +71,41 @@ embedded_repositories()
67 71
 }
68 72
 
69 73
 
70
-DIST_CLEANABLE_SUBDIRS="${DIST_CLEANABLE_SUBDIRS}
71
-`embedded_repositories`"
74
+EMBEDDED="`embedded_repositories`"
75
+
76
+if [ ! -z "$EMBEDDED" ]
77
+then
78
+   DIST_CLEANABLE_SUBDIRS="${DIST_CLEANABLE_SUBDIRS}
79
+${EMBEDDED}"
80
+fi
72 81
 
73 82
 
74 83
 usage()
75 84
 {
76 85
    cat <<EOF
77
-clean [build|output|dist]
86
+clean [build|dist|install|output]
78 87
 
79
-   build   : it cleans
88
+   build   : useful to remove intermediate build files. it cleans
80 89
 ---
81 90
 ${BUILD_CLEANABLE_SUBDIRS}
82 91
 ---
83 92
 
84
-   output  : is the default, it cleans additionaly
93
+   output  : useful to rebuild. This is the default. It cleans
85 94
 ---
95
+${BUILD_CLEANABLE_SUBDIRS}
86 96
 ${OUTPUT_CLEANABLE_SUBDIRS}
87 97
 ---
88 98
 
89
-   dist    : cleans additionaly
99
+   dist    : remove all clones and dependencies. It cleans
90 100
 ---
101
+${BUILD_CLEANABLE_SUBDIRS}
102
+${OUTPUT_CLEANABLE_SUBDIRS}
91 103
 ${DIST_CLEANABLE_SUBDIRS}
104
+---
105
+
106
+   install  : useful if you know, you don't want to rebuild ever. It cleans
107
+---
108
+${INSTALL_CLEANABLE_SUBDIRS}
92 109
 ---
93 110
 EOF
94 111
 }
... ...
@@ -103,6 +120,8 @@ check_and_usage_and_help()
103 120
       ;;
104 121
       build)
105 122
       ;;
123
+      install)
124
+      ;;
106 125
       *)
107 126
       usage >&2
108 127
       exit 1
... ...
@@ -179,7 +198,7 @@ clean()
179 198
 "
180 199
 
181 200
    flag="NO"
182
-   if [ ! -z "$BUILD_CLEANABLE_SUBDIRS" ]
201
+   if [ ! -z "${BUILD_CLEANABLE_SUBDIRS}" ]
183 202
    then
184 203
       if [ "${COMMAND}" = "build" -o "${COMMAND}" = "dist" -o "${COMMAND}" = "output"  ]
185 204
       then
... ...
@@ -193,9 +212,9 @@ clean()
193 212
    fi
194 213
 
195 214
 
196
-   if [ ! -z "$OUTPUT_CLEANABLE_SUBDIRS" ]
215
+   if [ ! -z "${OUTPUT_CLEANABLE_SUBDIRS}" ]
197 216
    then
198
-      if [ "${COMMAND}" = "dist" -o "${COMMAND}" = "output"  ]
217
+      if [ "${COMMAND}" = "dist" -o "${COMMAND}" = "output" ]
199 218
       then
200 219
          for dir in ${OUTPUT_CLEANABLE_SUBDIRS}
201 220
          do
... ...
@@ -207,7 +226,20 @@ clean()
207 226
    fi
208 227
 
209 228
 
210
-   if [ ! -z "$DIST_CLEANABLE_SUBDIRS" ]
229
+   if [ ! -z "${INSTALL_CLEANABLE_SUBDIRS}" ]
230
+   then
231
+      if [ "${COMMAND}" = "install" ]
232
+      then
233
+         for dir in ${INSTALL_CLEANABLE_SUBDIRS}
234
+         do
235
+            clean_asserted_folder "${dir}"
236
+            clean_parent_folders_if_empty "${dir}" "${PWD}"
237
+            flag="YES"
238
+         done
239
+      fi
240
+   fi
241
+
242
+   if [ ! -z "${DIST_CLEANABLE_SUBDIRS}" ]
211 243
    then
212 244
       if [ "${COMMAND}" = "dist" ]
213 245
       then
... ...
@@ -443,6 +443,7 @@ remove_file_if_present()
443 443
    if [ -f "${1}" ]
444 444
    then
445 445
       log_fluff "Removing \"$1\" (`pwd -P`)"
446
+      exekutor chmod u+w "$1" || fail "Failed to make $1 writable"
446 447
       exekutor rm -f "$1" || fail "failed to remove \"$1\""
447 448
    fi
448 449
 }
... ...
@@ -45,7 +45,7 @@ BOOTSTRAP_SUBDIR=.bootstrap
45 45
 
46 46
 
47 47
 CREATE_DEFAULT_FILES="`read_config_setting "create_default_files" "YES"`"
48
-CREATE_EXAMPLE_FILES="`read_config_setting "create_example_files" "YES"`"
48
+CREATE_EXAMPLE_FILES="`read_config_setting "create_example_files" "NO"`"
49 49
 
50 50
 
51 51
 if [ -d "${BOOTSTRAP_SUBDIR}" ]
... ...
@@ -77,11 +77,6 @@ main()
77 77
    then
78 78
       log_fluff "Create default files"
79 79
 
80
-      exekutor cat <<EOF > "${BOOTSTRAP_SUBDIR}/brews"
81
-# add projects that should be installed by brew
82
-# e.g.
83
-# zlib
84
-EOF
85 80
 
86 81
 #cat <<EOF > "${BOOTSTRAP_SUBDIR}/pips"
87 82
 # add projects that should be installed by pip
... ...
@@ -90,11 +85,11 @@ EOF
90 85
 #EOF
91 86
 
92 87
       exekutor cat <<EOF > "${BOOTSTRAP_SUBDIR}/repositories"
93
-# add projects that should be cloned with git in order
94
-# of their inter-dependencies
88
+# Add git URLs to this file.
89
+#
90
+# Possible types of repository specifications:
95 91
 #
96
-# some possible types of repository specifications:
97
-# http://www.mulle-kybernetik.com/repositories/MulleScion
92
+# https://www.mulle-kybernetik.com/repositories/MulleScion
98 93
 # git@github.com:mulle-nat/MulleScion.git
99 94
 # ../MulleScion
100 95
 # /Volumes/Source/srcM/MulleScion
... ...
@@ -104,7 +99,15 @@ EOF
104 99
 
105 100
    if [ "${CREATE_EXAMPLE_FILES}" = "YES" ]
106 101
    then
107
-     log_fluff "Create example repository settings"
102
+      log_fluff "Create example repository files"
103
+
104
+      exekutor cat <<EOF > "${BOOTSTRAP_SUBDIR}/brews"
105
+# add projects that should be installed by brew
106
+# e.g.
107
+# zlib
108
+EOF
109
+
110
+      log_fluff "Create example repository settings"
108 111
 
109 112
       mkdir_if_missing "${BOOTSTRAP_SUBDIR}/settings/MulleScion.example/bin"
110 113
 
111 114
new file mode 100644
... ...
@@ -0,0 +1,345 @@
1
+#! /bin/sh
2
+#
3
+#   Copyright (c) 2015 Nat! - Mulle kybernetiK
4
+#   All rights reserved.
5
+#
6
+#   Redistribution and use in source and binary forms, with or without
7
+#   modification, are permitted provided that the following conditions are met:
8
+#
9
+#   Redistributions of source code must retain the above copyright notice, this
10
+#   list of conditions and the following disclaimer.
11
+#
12
+#   Redistributions in binary form must reproduce the above copyright notice,
13
+#   this list of conditions and the following disclaimer in the documentation
14
+#   and/or other materials provided with the distribution.
15
+#
16
+#   Neither the name of Mulle kybernetiK nor the names of its contributors
17
+#   may be used to endorse or promote products derived from this software
18
+#   without specific prior written permission.
19
+#
20
+#   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+#   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+#   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23
+#   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24
+#   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25
+#   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26
+#   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27
+#   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28
+#   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29
+#   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30
+#   POSSIBILITY OF SUCH DAMAGE.
31
+
32
+. mulle-bootstrap-local-environment.sh
33
+
34
+
35
+DEFAULT_PREFIX="/usr/local"
36
+DEFAULT_FRAMEWORK_PREFIX="/Library"
37
+
38
+CONFIGURATIONS="`read_build_root_setting "configurations" "Release"`"
39
+N_CONFIGURATIONS="`echo "${CONFIGURATIONS}" | wc -l | awk '{ print $1 }'`"
40
+
41
+
42
+check_and_usage_and_help()
43
+{
44
+   cat <<EOF
45
+usage: install [libraryprefix] [frameworkprefix]
46
+
47
+   You may need to run this as sudo.
48
+   The default libraryprefix is ${DEFAULT_PREFIX}
49
+   The default frameworkprefix is ${DEFAULT_FRAMEWORK_PREFIX}
50
+EOF
51
+}
52
+
53
+
54
+while :
55
+do
56
+   if [ "$1" = "-h" -o "$1" = "--help" ]
57
+   then
58
+      check_and_usage_and_help >&2
59
+      exit 1
60
+   fi
61
+
62
+   break
63
+done
64
+
65
+
66
+PREFIX="${1:-${DEFAULT_PREFIX}}"
67
+[ $# -eq 0 ] || shift
68
+
69
+
70
+case "`uname`" in
71
+   *)
72
+      INSTALL_FRAMEWORKS="NO"
73
+      ;;
74
+
75
+   Darwin)
76
+      FRAMEWORK_PREFIX="${1:-${DEFAULT_FRAMEWORK_PREFIX}}"
77
+      [ $# -eq 0 ] || shift
78
+      INSTALL_FRAMEWORKS="YES"
79
+      ;;
80
+esac
81
+
82
+
83
+install_libraries_with_action()
84
+{
85
+   local action
86
+   local dstdir
87
+   local srcdir
88
+
89
+   action="$1"
90
+   dstdir="${PREFIX}/${LIBRARY_DIR_NAME}"
91
+   srcdir="${DEPENDENCY_SUBDIR}/${LIBRARY_DIR_NAME}"
92
+
93
+   local name
94
+   local owd
95
+   local library
96
+
97
+   if [ ! -d "${srcdir}" ]
98
+   then
99
+      return 0
100
+   fi
101
+
102
+   owd="`pwd`"
103
+   cd "${srcdir}"
104
+
105
+   for library in *
106
+   do
107
+      if [ -f "${library}" ]
108
+      then
109
+         if [ -f "${dstdir}/${library}" ]
110
+         then
111
+            remove_file_if_present "${dstdir}/${library}"
112
+         fi
113
+
114
+         log_info "Installing library ${C_MAGENTA}${C_BOLD}${library}${C_INFO} into ${dstdir}..."
115
+         mkdir_if_missing "${dstdir}"
116
+         exekutor $action "`pwd`/${library}" "${dstdir}/${library}"
117
+         if [ -x "${dstdir}/${library}" ]
118
+         then
119
+            exekutor chmod 755 "${dstdir}/${library}"
120
+         fi
121
+      fi
122
+   done
123
+
124
+   cd "${owd}"
125
+}
126
+
127
+
128
+
129
+install_libraries_by_copying()
130
+{
131
+   install_libraries_with_action "cp -Ra" "$@"
132
+}
133
+
134
+
135
+install_libraries_by_symlinking()
136
+{
137
+   install_libraries_with_action "ln -s" "$@"
138
+}
139
+
140
+
141
+install_headers_with_action()
142
+{
143
+   local action
144
+   local dstdir
145
+   local srcdir
146
+
147
+   action="$1"
148
+   dstdir="${PREFIX}/${HEADER_DIR_NAME}"
149
+   srcdir="${DEPENDENCY_SUBDIR}/${HEADER_DIR_NAME}"
150
+
151
+   local name
152
+   local owd
153
+   local header
154
+
155
+   if [ ! -d "${srcdir}" ]
156
+   then
157
+      return 0
158
+   fi
159
+
160
+   owd="`pwd`"
161
+   cd "${srcdir}"
162
+
163
+   #
164
+   # copy lonely header files (unusual)
165
+   #
166
+   for header in *.h
167
+   do
168
+      if [ -f "${header}" ]
169
+      then
170
+         if [ -f "${dstdir}/${header}" ]
171
+         then
172
+            remove_file_if_present "${dstdir}/${header}"
173
+         fi
174
+         log_info "Installing header ${C_MAGENTA}${C_BOLD}${header}${C_INFO} into \"${dstdir}\" ..."
175
+         mkdir_if_missing "${dstdir}"
176
+         exekutor $action "`pwd`/${header}" "${dstdir}/${header}"
177
+      fi
178
+   done
179
+
180
+   #
181
+   # copy directories (usual)
182
+   #
183
+   for header in *
184
+   do
185
+      if [ -d "${header}" -a "${header}" != '.' -a "${header}" != '..' ]
186
+      then
187