From a05600b3a5e17d20fe055de39ab6a05f6a4a49ec Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Tue, 21 Apr 2026 22:20:18 -0500 Subject: [PATCH] Bugfix: The bootstrap script improperly loads settings resulting in incorrectly failed builds. I suspect this situation happened due to various changes over time without a thorough review of everything that needs to be changed. Reserve the variable index position of 0 to designate not found. Update all checks to then check for `key` to not be 0 after calling `bootstrap_id()`. This fixes problems where the position after the last valid index might get set and used as a value. When the position after the last valid index is read, it could read these values even if it should report not found. The index position checks are updated to more properly check and assign the index using the appropraite `has-*` and `has-*-mode` vs the normal value `*` and `*-mode`, respectively. Update all index position checks to check the `has-*` and `has-*-mode` accordingly. This change fixes the primary problem that is causing the build to fail due to incorrect variable loading. The `has-*` and `has-*-mode` checks checks for existence. Then and only then should the actual respective values be used. In particular, the `*-mode` settings should only be assigned if the respective `has-*-mode` is set to `yes`. This bug is observed in my **TKIS** script development where the `path_headers` is being treated as an empty string despite being designated as `fll`. The **Featureless Make** program compiles properly but not this `bootstrap.sh` script. The **TKIS** scripts are expected to be run on a system without the **FLL** project at all. I have not observed this problem because I have been using the **Featureless Make** directly for years now. The packaging and unit tests scripts provided by this project are coincidentally not triggering any obvious errors with the improper behavior. If the existing scripts were working before then these changes might cause problems with those scripts. I will follow this up and investigate and fix these issues. Running the **Featureless Make** on these works and so these changes likely expose existing problems rather than causes regressions. I would love to find a way to reduce the repetitive assignments to variables in a safe/sane manner. This would require more research on my part, if it is even possible. I don't plan on doing such research any time soon and so I am continuing to consider the bootstrap script design as tolerable. Additional Changes: - Simplify logic in for loops for `bootstrap_id()` by combining all of the passes into a single pass (The actual index values are irrelevant and so restructuring/reordering caused by this is not a problem). - Ensure the key is an integer in all cases. - Remove unnecessary `key` variable assignments. - Remove some redundant assignments. --- build/scripts/bootstrap.sh | 1018 ++++++++++++++++++++---------------- 1 file changed, 569 insertions(+), 449 deletions(-) diff --git a/build/scripts/bootstrap.sh b/build/scripts/bootstrap.sh index bc3af0f11..d52e07daf 100644 --- a/build/scripts/bootstrap.sh +++ b/build/scripts/bootstrap.sh @@ -43,7 +43,7 @@ bootstrap_main() { local c_subtle="\\033[1;30m" local c_prefix="\\" - local key= + local -i key=0 local -A variables=() local define_extra= local failure=0 @@ -261,7 +261,6 @@ bootstrap_main() { project_built="${project_built}-${process}" fi - key= stage= bootstrap_id "stage" if [[ ${variables[${key}]} != "" ]] ; then @@ -537,40 +536,34 @@ bootstrap_id() { local match=${1} local name= - let key=0 + # Start index position at index 1. + let key=1 for name in build_compiler build_indexer build_indexer_arguments build_language build_libraries build_libraries_shared build_libraries_static build_name build_objects_library build_objects_library_shared build_objects_library_static build_objects_program build_objects_program_shared build_objects_program_static build_script build_shared build_sources_documentation build_sources_headers build_sources_headers_shared build_sources_headers_static build_sources_library build_sources_library_shared build_sources_library_static build_sources_object build_sources_object_shared build_sources_object_static build_sources_program build_sources_program_shared build_sources_program_static build_sources_script build_sources_setting build_static defines defines_library defines_library_shared defines_library_static defines_object defines_object_shared defines_object_static defines_program defines_program_shared defines_program_static defines_shared defines_static environment flags flags_library flags_library_shared flags_library_static flags_object flags_object_shared flags_object_static flags_program flags_program_shared flags_program_static flags_shared flags_static has_path_standard modes modes_default path_headers path_language path_library_script path_library_shared path_library_static path_object_script path_object_shared path_object_static path_program_script path_program_shared path_program_static path_sources path_sources_headers path_sources_library path_sources_object path_sources_program path_sources_script preserve_path_headers process_post process_pre search_exclusive search_shared search_static stage version_file version_major version_major_prefix version_micro version_micro_prefix version_minor version_minor_prefix version_nano version_nano_prefix version_target ; do if [[ ${name} == ${match} ]] ; then return ; fi let key++ - done - for name in build_compiler-mode build_indexer-mode build_indexer_arguments-mode build_language-mode build_libraries-mode build_libraries_shared-mode build_libraries_static-mode build_name-mode build_objects_library-mode build_objects_library_shared-mode build_objects_library_static-mode build_objects_program-mode build_objects_program_shared-mode build_objects_program_static-mode build_script-mode build_shared-mode build_sources_documentation-mode build_sources_headers-mode build_sources_headers_shared-mode build_sources_headers_static-mode build_sources_library-mode build_sources_library_shared-mode build_sources_library_static-mode build_sources_object-mode build_sources_object_shared-mode build_sources_object_static-mode build_sources_program-mode build_sources_program_shared-mode build_sources_program_static-mode build_sources_script-mode build_sources_setting-mode build_static-mode defines-mode defines_library-mode defines_library_shared-mode defines_library_static-mode defines_object-mode defines_object_shared-mode defines_object_static-mode defines_program-mode defines_program_shared-mode defines_program_static-mode defines_shared-mode defines_static-mode environment-mode flags-mode flags_library-mode flags_library_shared-mode flags_library_static-mode flags_object-mode flags_object_shared-mode flags_object_static-mode flags_program-mode flags_program_shared-mode flags_program_static-mode flags_shared-mode flags_static-mode has_path_standard-mode path_headers-mode path_language-mode path_library_script-mode path_library_shared-mode path_library_static-mode path_object_script-mode path_object_shared-mode path_object_static-mode path_program_script-mode path_program_shared-mode path_program_static-mode path_sources-mode path_sources_headers-mode path_sources_library-mode path_sources_object-mode path_sources_program-mode path_sources_script-mode preserve_path_headers-mode process_post-mode process_pre-mode search_exclusive-mode search_shared-mode search_static-mode stage-mode version_file-mode version_major-mode version_major_prefix-mode version_micro-mode version_micro_prefix-mode version_minor-mode version_minor_prefix-mode version_nano-mode version_nano_prefix-mode version_target-mode ; do - - if [[ ${name} == ${match} ]] ; then return ; fi + if [[ "${name}-mode" == ${match} ]] ; then return ; fi let key++ - done - - for name in has-build_compiler has-build_indexer has-build_indexer_arguments has-build_name has-has_path_standard has-path_library_script has-path_library_shared has-path_library_static has-path_object_script has-path_object_shared has-path_object_static has-path_program_script has-path_program_shared has-path_program_static has-path_sources has-path_sources_headers has-path_sources_library has-path_sources_object has-path_sources_program has-path_sources_script has-search_exclusive has-search_shared has-search_static has-stage has-version_major_prefix has-version_micro_prefix has-version_minor_prefix has-version_nano_prefix; do - if [[ ${name} == ${match} ]] ; then return ; fi + if [[ "has-${name}" == ${match} ]] ; then return ; fi let key++ - done - - for name in has-build_compiler-mode has-build_indexer-mode has-build_indexer_arguments-mode has-build_name-mode has-has_path_standard-mode has-path_library_script-mode has-path_library_shared-mode has-path_library_static-mode has-path_object_script-mode has-path_object_shared-mode has-path_object_static-mode has-path_program_script-mode has-path_program_shared-mode has-path_program_static-mode has-path_sources-mode has-path_sources_headers-mode has-path_sources_library-mode has-path_sources_object-mode has-path_sources_program-mode has-path_sources_script-mode has-search_exclusive-mode has-search_shared-mode has-search_static-mode has-stage-mode has-version_major_prefix-mode has-version_micro_prefix-mode has-version_minor_prefix-mode has-version_nano_prefix-mode; do - if [[ ${name} == ${match} ]] ; then return ; fi + if [[ "has-${name}-mode" == ${match} ]] ; then return ; fi let key++ done + + # Use index 0 to represent not found. + let key=0 } bootstrap_load_settings() { local i= - local key= local value= if [[ ! -d ${path_data}build/ ]] ; then @@ -604,12 +597,15 @@ bootstrap_load_settings() { modes=${modes_default} fi + # Initialize index 0, which is used for key not found. + variables[0]="" + # Provide known defaults that have value of "yes". for i in build_script build_shared build_static has_path_standard preserve_path_headers search_exclusive search_shared search_static ; do bootstrap_id "${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi done @@ -619,7 +615,7 @@ bootstrap_load_settings() { bootstrap_id "${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="script" fi done @@ -629,7 +625,7 @@ bootstrap_load_settings() { bootstrap_id "${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="shared" fi done @@ -639,29 +635,43 @@ bootstrap_load_settings() { bootstrap_id "${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="static" fi done + # Provide compiler default. + bootstrap_id "build_compiler" + + if [[ ${key} -ne 0 ]] ; then + variables[${key}]="gcc" + fi + + # Provide indexer default. + bootstrap_id "build_indexer" + + if [[ ${key} -ne 0 ]] ; then + variables[${key}]="ar" + fi + # Provide language default. bootstrap_id "build_language" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="c" fi # Provide version_file default. bootstrap_id "version_file" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="micro" fi # Provide version_target default. bootstrap_id "version_target" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="major" fi @@ -675,9 +685,8 @@ bootstrap_load_settings() { echo -e "${c_warning}WARNING: Failed to find index for '${c_notice}${i}${c_warning}' when calling ${c_notice}bootstrap_id()${c_warning}.${c_reset}" fi - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi else @@ -685,23 +694,20 @@ bootstrap_load_settings() { value=$(grep -sho "^[[:space:]]*${i}[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*${i}\>||" -e 's|^[[:space:]]*||') variables[${key}]="${value}" - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi elif [[ $(grep -sho "^[[:space:]]*${i}\$" ${settings_file}) != "" ]] ; then variables[${key}]="" - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi else - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi fi @@ -718,9 +724,8 @@ bootstrap_load_settings() { echo -e "${c_warning}WARNING: Failed to find index for '${c_notice}${i}${c_warning}' when calling ${c_notice}bootstrap_id()${c_warning}.${c_reset}" fi - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi else @@ -728,23 +733,20 @@ bootstrap_load_settings() { value=$(grep -sho "^[[:space:]]*${i}[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*${i}\>||" -e 's|^[[:space:]]*||') variables[${key}]="${variables[${key}]}${value} " - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi elif [[ $(grep -sho "^[[:space:]]*${i}\$" ${settings_file}) != "" ]] ; then variables[${key}]="" - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi else - key= bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi fi @@ -754,10 +756,11 @@ bootstrap_load_settings() { bootstrap_load_settings_mode() { local i= - local key= local m= local value= + local -i key=0 + for m in ${modes} ; do # Single value Objects. @@ -765,39 +768,34 @@ bootstrap_load_settings_mode() { bootstrap_id "${i}-mode" - if [[ ${key} == "" ]] ; then + if [[ ${key} -eq 0 ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Failed to find index for '${c_notice}${i}-${m}${c_warning}' when calling ${c_notice}bootstrap_id()${c_warning}.${c_reset}" fi - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi else - if [[ $(grep -sho "^[[:space:]]*${i}-${m}[[:space:]].*\$" ${settings_file}) != "" ]] ; then value=$(grep -sho "^[[:space:]]*${i}-${m}[[:space:]].*\$" ${settings_file} | sed -e "H;/${i}-${m}/h;\$!d;x" | sed -e "s|^[[:space:]]*${i}-${m}\>||" -e 's|^[[:space:]]*||') variables[${key}]="${value}" - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi elif [[ $(grep -sho "^[[:space:]]*${i}-${m}\$" ${settings_file}) != "" ]] ; then variables[${key}]="" - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi else - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi fi @@ -814,9 +812,8 @@ bootstrap_load_settings_mode() { echo -e "${c_warning}WARNING: Failed to find index for '${c_notice}${i}-${m}${c_warning}' when calling ${c_notice}bootstrap_id()${c_warning}.${c_reset}" fi - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi else @@ -824,23 +821,20 @@ bootstrap_load_settings_mode() { value=$(grep -sho "^[[:space:]]*${i}-${m}[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*${i}-${m}\>||" -e 's|^[[:space:]]*||') variables[${key}]="${variables[${key}]}${value} " - key= - bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + bootstrap_id "has-${i}-mode" + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi elif [[ $(grep -sho "^[[:space:]]*${i}-${m}\$" ${settings_file}) != "" ]] ; then variables[${key}]="" - key= - bootstrap_id "has-${i}" - if [[ ${key} != "" ]] ; then + bootstrap_id "has-${i}-mode" + if [[ ${key} -ne 0 ]] ; then variables[${key}]="yes" fi else - key= bootstrap_id "has-${i}-mode" - if [[ ${key} != "" && ${variables[${key}]} != "yes" ]] ; then + if [[ ${key} -ne 0 ]] ; then variables[${key}]="no" fi fi @@ -852,6 +846,7 @@ bootstrap_load_settings_mode() { bootstrap_prepare_build() { local alt=${1} local i= + local path_headers= mkdir ${verbose_common} -p ${path_build}{documents,documentation,includes,libraries/{script,shared,static},objects/{script,shared,static},programs/{script,shared,static},settings,stage} || failure=1 @@ -865,18 +860,28 @@ bootstrap_prepare_build() { bootstrap_id "path_headers-mode" if [[ ${variables[${key}]} != "" ]] ; then - mkdir ${verbose_common} -p ${path_build}includes/${variables[${key}]} || failure=1 + path_headers=${variables[${key}]} else bootstrap_id "path_headers" if [[ ${variables[${key}]} != "" ]] ; then - mkdir ${verbose_common} -p ${path_build}includes/${variables[${key}]} || failure=1 + path_headers=${variables[${key}]} fi fi + if [[ ${path_headers} != "" ]] ; then + path_headers=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_headers}) + fi + + if [[ ${path_headers} != "" ]] ; then + path_headers="${path_build}includes/${path_headers}" + mkdir ${verbose_common} -p ${path_headers} || failure=1 + fi + + if [[ ${failure} -eq 1 ]] ; then if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then - echo -e "${c_warning}WARNING: Failed to create ${c_notice}path_heades${c_error} build directories in '${c_notice}${path_build}${c_error}'.${c_reset}" + echo -e "${c_warning}WARNING: Failed to create ${c_notice}path_heades${c_error} build directories in '${c_notice}${path_headers}${c_error}'.${c_reset}" fi return 1 @@ -895,11 +900,12 @@ bootstrap_operation_build() { local alt=${1} local directory= local i= - local key= local n= local version_file= local version_target= + local -i key=0 + bootstrap_id "build_compiler" local build_compiler=${variables[${key}]} @@ -1268,6 +1274,7 @@ bootstrap_operation_build() { fi done else + for i in ${sources_headers} ; do cp ${verbose_common} -f ${path_sources_headers}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 done @@ -1510,11 +1517,9 @@ bootstrap_operation_build() { } bootstrap_operation_build_prepare_defaults() { - local key= bootstrap_id "has-version_major_prefix-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-version_major_prefix" if [[ ${variables[${key}]} != "yes" ]] ; then version_major_prefix="." @@ -1523,7 +1528,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-version_minor_prefix-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-version_minor_prefix" if [[ ${variables[${key}]} != "yes" ]] ; then version_minor_prefix="." @@ -1532,7 +1536,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-version_micro_prefix-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-version_micro_prefix" if [[ ${variables[${key}]} != "yes" ]] ; then version_micro_prefix="." @@ -1541,7 +1544,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-version_nano_prefix-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-version_nano_prefix" if [[ ${variables[${key}]} != "yes" ]] ; then version_nano_prefix="." @@ -1550,7 +1552,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-build_compiler-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-build_compiler" if [[ ${variables[${key}]} != "yes" ]] ; then build_compiler="gcc" @@ -1559,7 +1560,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-build_indexer-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-build_indexer" if [[ ${variables[${key}]} != "yes" ]] ; then build_indexer="ar" @@ -1568,7 +1568,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_library_script-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_library_script" if [[ ${variables[${key}]} != "yes" ]] ; then path_library_script="script/" @@ -1577,7 +1576,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_library_shared-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_library_shared" if [[ ${variables[${key}]} != "yes" ]] ; then path_library_shared="shared/" @@ -1586,7 +1584,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_library_static-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_library_static" if [[ ${variables[${key}]} != "yes" ]] ; then path_library_static="static/" @@ -1595,7 +1592,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_object_script-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_object_script" if [[ ${variables[${key}]} != "yes" ]] ; then path_object_script="script/" @@ -1604,7 +1600,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_object_shared-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_object_shared" if [[ ${variables[${key}]} != "yes" ]] ; then path_object_shared="shared/" @@ -1613,7 +1608,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_object_static-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_object_static" if [[ ${variables[${key}]} != "yes" ]] ; then path_object_static="static/" @@ -1622,7 +1616,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_program_script-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_program_script" if [[ ${variables[${key}]} != "yes" ]] ; then path_program_script="script/" @@ -1631,7 +1624,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_program_shared-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_program_shared" if [[ ${variables[${key}]} != "yes" ]] ; then path_program_shared="shared/" @@ -1640,7 +1632,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_program_static-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_program_static" if [[ ${variables[${key}]} != "yes" ]] ; then path_program_static="static/" @@ -1649,7 +1640,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources="sources/" @@ -1658,7 +1648,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources_headers-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources_headers" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_headers=${path_sources} @@ -1667,7 +1656,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources_library-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources_library" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_library=${path_sources} @@ -1676,7 +1664,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources_object-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources_object" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_object=${path_sources} @@ -1685,7 +1672,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources_program-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources_program" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_program=${path_sources} @@ -1694,7 +1680,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-path_sources_script-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-path_sources_script" if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_script=${path_sources} @@ -1703,7 +1688,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-has_path_standard-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-has_path_standard" if [[ ${variables[${key}]} != "yes" ]] ; then has_path_standard="yes" @@ -1712,7 +1696,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-search_shared-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-search_shared" if [[ ${variables[${key}]} != "yes" ]] ; then search_shared="yes" @@ -1721,7 +1704,6 @@ bootstrap_operation_build_prepare_defaults() { bootstrap_id "has-build_shared-mode" if [[ ${variables[${key}]} != "yes" ]] ; then - bootstrap_id "has-build_shared" if [[ ${variables[${key}]} != "yes" ]] ; then build_shared="yes" @@ -1730,253 +1712,329 @@ bootstrap_operation_build_prepare_defaults() { } bootstrap_operation_build_prepare_defines() { - local key= - bootstrap_id "defines-mode" - if [[ ${defines} == "" ]] ; then - defines=${variables[${key}]} - else - defines="${defines} ${variables[${key}]}" + bootstrap_id "has-defines-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines-mode" + if [[ ${defines} == "" ]] ; then + defines=${variables[${key}]} + else + defines="${defines} ${variables[${key}]}" + fi fi - bootstrap_id "defines_library-mode" - if [[ ${defines_library} == "" ]] ; then - defines_library=${variables[${key}]} - else - defines_library="${defines_library} ${variables[${key}]}" + bootstrap_id "has-defines_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_library-mode" + if [[ ${defines_library} == "" ]] ; then + defines_library=${variables[${key}]} + else + defines_library="${defines_library} ${variables[${key}]}" + fi fi - bootstrap_id "defines_library_shared-mode" - if [[ ${defines_library_shared} == "" ]] ; then - defines_library_shared=${variables[${key}]} - else - defines_library_shared="${defines_library_shared} ${variables[${key}]}" + bootstrap_id "has-defines_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_library_shared-mode" + if [[ ${defines_library_shared} == "" ]] ; then + defines_library_shared=${variables[${key}]} + else + defines_library_shared="${defines_library_shared} ${variables[${key}]}" + fi fi - bootstrap_id "defines_library_static-mode" - if [[ ${defines_library_static} == "" ]] ; then - defines_library_static=${variables[${key}]} - else - defines_library_static="${defines_library_static} ${variables[${key}]}" + bootstrap_id "has-defines_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_library_static-mode" + if [[ ${defines_library_static} == "" ]] ; then + defines_library_static=${variables[${key}]} + else + defines_library_static="${defines_library_static} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_library-mode" - if [[ ${defines_object_library} == "" ]] ; then - defines_object_library=${variables[${key}]} - else - defines_object_library="${defines_object_library} ${variables[${key}]}" + bootstrap_id "has-defines_object_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_library-mode" + if [[ ${defines_object_library} == "" ]] ; then + defines_object_library=${variables[${key}]} + else + defines_object_library="${defines_object_library} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_library_shared-mode" - if [[ ${defines_object_library_shared} == "" ]] ; then - defines_object_library_shared=${variables[${key}]} - else - defines_object_library_shared="${defines_object_library_shared} ${variables[${key}]}" + bootstrap_id "has-defines_object_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_library_shared-mode" + if [[ ${defines_object_library_shared} == "" ]] ; then + defines_object_library_shared=${variables[${key}]} + else + defines_object_library_shared="${defines_object_library_shared} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_library_static-mode" - if [[ ${defines_object_library_static} == "" ]] ; then - defines_object_library_static=${variables[${key}]} - else - defines_object_library_static="${defines_object_library_static} ${variables[${key}]}" + bootstrap_id "has-defines_object_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_library_static-mode" + if [[ ${defines_object_library_static} == "" ]] ; then + defines_object_library_static=${variables[${key}]} + else + defines_object_library_static="${defines_object_library_static} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_program-mode" - if [[ ${defines_object_program} == "" ]] ; then - defines_object_program=${variables[${key}]} - else - defines_object_program="${defines_object_program} ${variables[${key}]}" + bootstrap_id "has-defines_object_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_program-mode" + if [[ ${defines_object_program} == "" ]] ; then + defines_object_program=${variables[${key}]} + else + defines_object_program="${defines_object_program} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_program_shared-mode" - if [[ ${defines_object_program_shared} == "" ]] ; then - defines_object_program_shared=${variables[${key}]} - else - defines_object_program_shared="${defines_object_program_shared} ${variables[${key}]}" + bootstrap_id "has-defines_object_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_program_shared-mode" + if [[ ${defines_object_program_shared} == "" ]] ; then + defines_object_program_shared=${variables[${key}]} + else + defines_object_program_shared="${defines_object_program_shared} ${variables[${key}]}" + fi fi - bootstrap_id "defines_object_program_static-mode" - if [[ ${defines_object_program_static} == "" ]] ; then - defines_object_program_static=${variables[${key}]} - else - defines_object_program_static="${defines_object_program_static} ${variables[${key}]}" + bootstrap_id "has-defines_object_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_object_program_static-mode" + if [[ ${defines_object_program_static} == "" ]] ; then + defines_object_program_static=${variables[${key}]} + else + defines_object_program_static="${defines_object_program_static} ${variables[${key}]}" + fi fi - bootstrap_id "defines_program-mode" - if [[ ${defines_program} == "" ]] ; then - defines_program=${variables[${key}]} - else - defines_program="${defines_program} ${variables[${key}]}" + bootstrap_id "has-defines_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_program-mode" + if [[ ${defines_program} == "" ]] ; then + defines_program=${variables[${key}]} + else + defines_program="${defines_program} ${variables[${key}]}" + fi fi - bootstrap_id "defines_program_shared-mode" - if [[ ${defines_program_shared} == "" ]] ; then - defines_program_shared=${variables[${key}]} - else - defines_program_shared="${defines_program_shared} ${variables[${key}]}" + bootstrap_id "has-defines_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_program_shared-mode" + if [[ ${defines_program_shared} == "" ]] ; then + defines_program_shared=${variables[${key}]} + else + defines_program_shared="${defines_program_shared} ${variables[${key}]}" + fi fi - bootstrap_id "defines_program_static-mode" - if [[ ${defines_program_static} == "" ]] ; then - defines_program_static=${variables[${key}]} - else - defines_program_static="${defines_program_static} ${variables[${key}]}" + bootstrap_id "has-defines_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_program_static-mode" + if [[ ${defines_program_static} == "" ]] ; then + defines_program_static=${variables[${key}]} + else + defines_program_static="${defines_program_static} ${variables[${key}]}" + fi fi - bootstrap_id "defines_shared-mode" - if [[ ${defines_shared} == "" ]] ; then - defines_shared=${variables[${key}]} - else - defines_shared="${defines_shared} ${variables[${key}]}" + bootstrap_id "has-defines_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_shared-mode" + if [[ ${defines_shared} == "" ]] ; then + defines_shared=${variables[${key}]} + else + defines_shared="${defines_shared} ${variables[${key}]}" + fi fi - bootstrap_id "defines_static-mode" - if [[ ${defines_static} == "" ]] ; then - defines_static=${variables[${key}]} - else - defines_static="${defines_static} ${variables[${key}]}" + bootstrap_id "has-defines_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "defines_static-mode" + if [[ ${defines_static} == "" ]] ; then + defines_static=${variables[${key}]} + else + defines_static="${defines_static} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_documentation() { - local key= - bootstrap_id "build_sources_documentation-mode" - if [[ ${sources_documentation} == "" ]] ; then - sources_documentation=${variables[${key}]} - else - sources_documentation="${sources_documentation} ${variables[${key}]}" + bootstrap_id "has-build_sources_documentation-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_documentation-mode" + if [[ ${sources_documentation} == "" ]] ; then + sources_documentation=${variables[${key}]} + else + sources_documentation="${sources_documentation} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_flags() { - local key= - bootstrap_id "flags-mode" - if [[ ${flags} == "" ]] ; then - flags=${variables[${key}]} - else - flags="${flags} ${variables[${key}]}" + bootstrap_id "has-flags-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags-mode" + if [[ ${flags} == "" ]] ; then + flags=${variables[${key}]} + else + flags="${flags} ${variables[${key}]}" + fi fi - bootstrap_id "flags_library-mode" - if [[ ${flags_library} == "" ]] ; then - flags_library=${variables[${key}]} - else - flags_library="${flags_library} ${variables[${key}]}" + bootstrap_id "has-bootstrap_id-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_library-mode" + if [[ ${flags_library} == "" ]] ; then + flags_library=${variables[${key}]} + else + flags_library="${flags_library} ${variables[${key}]}" + fi fi - bootstrap_id "flags_library_shared-mode" - if [[ ${flags_library_shared} == "" ]] ; then - flags_library_shared=${variables[${key}]} - else - flags_library_shared="${flags_library_shared} ${variables[${key}]}" + bootstrap_id "has-flags_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_library_shared-mode" + if [[ ${flags_library_shared} == "" ]] ; then + flags_library_shared=${variables[${key}]} + else + flags_library_shared="${flags_library_shared} ${variables[${key}]}" + fi fi - bootstrap_id "flags_library_static-mode" - if [[ ${flags_library_static} == "" ]] ; then - flags_library_static=${variables[${key}]} - else - flags_library_static="${flags_library_static} ${variables[${key}]}" + bootstrap_id "has-flags_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_library_static-mode" + if [[ ${flags_library_static} == "" ]] ; then + flags_library_static=${variables[${key}]} + else + flags_library_static="${flags_library_static} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_library-mode" - if [[ ${flags_object_library} == "" ]] ; then - flags_object_library=${variables[${key}]} - else - flags_object_library="${flags_object_library} ${variables[${key}]}" + bootstrap_id "has-flags_object_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_library-mode" + if [[ ${flags_object_library} == "" ]] ; then + flags_object_library=${variables[${key}]} + else + flags_object_library="${flags_object_library} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_library_shared-mode" - if [[ ${flags_object_library_shared} == "" ]] ; then - flags_object_library_shared=${variables[${key}]} - else - flags_object_library_shared="${flags_object_library_shared} ${variables[${key}]}" + bootstrap_id "has-flags_object_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_library_shared-mode" + if [[ ${flags_object_library_shared} == "" ]] ; then + flags_object_library_shared=${variables[${key}]} + else + flags_object_library_shared="${flags_object_library_shared} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_library_static-mode" - if [[ ${flags_object_library_static} == "" ]] ; then - flags_object_library_static=${variables[${key}]} - else - flags_object_library_static="${flags_object_library_static} ${variables[${key}]}" + bootstrap_id "has-flags_object_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_library_static-mode" + if [[ ${flags_object_library_static} == "" ]] ; then + flags_object_library_static=${variables[${key}]} + else + flags_object_library_static="${flags_object_library_static} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_program-mode" - if [[ ${flags_object_program} == "" ]] ; then - flags_object_program=${variables[${key}]} - else - flags_object_program="${flags_object_program} ${variables[${key}]}" + bootstrap_id "has-flags_object_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_program-mode" + if [[ ${flags_object_program} == "" ]] ; then + flags_object_program=${variables[${key}]} + else + flags_object_program="${flags_object_program} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_program_shared-mode" - if [[ ${flags_object_program_shared} == "" ]] ; then - flags_object_program_shared=${variables[${key}]} - else - flags_object_program_shared="${flags_object_program_shared} ${variables[${key}]}" + bootstrap_id "has-flags_object_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_program_shared-mode" + if [[ ${flags_object_program_shared} == "" ]] ; then + flags_object_program_shared=${variables[${key}]} + else + flags_object_program_shared="${flags_object_program_shared} ${variables[${key}]}" + fi fi - bootstrap_id "flags_object_program_static-mode" - if [[ ${flags_object_program_static} == "" ]] ; then - flags_object_program_static=${variables[${key}]} - else - flags_object_program_static="${flags_object_program_static} ${variables[${key}]}" + bootstrap_id "has-flags_object_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_object_program_static-mode" + if [[ ${flags_object_program_static} == "" ]] ; then + flags_object_program_static=${variables[${key}]} + else + flags_object_program_static="${flags_object_program_static} ${variables[${key}]}" + fi fi - bootstrap_id "flags_program-mode" - if [[ ${flags_program} == "" ]] ; then - flags_program=${variables[${key}]} - else - flags_program="${flags_program} ${variables[${key}]}" + bootstrap_id "has-flags_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_program-mode" + if [[ ${flags_program} == "" ]] ; then + flags_program=${variables[${key}]} + else + flags_program="${flags_program} ${variables[${key}]}" + fi fi - bootstrap_id "flags_program_shared-mode" - if [[ ${flags_program_shared} == "" ]] ; then - flags_program_shared=${variables[${key}]} - else - flags_program_shared="${flags_program_shared} ${variables[${key}]}" + bootstrap_id "has-flags_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_program_shared-mode" + if [[ ${flags_program_shared} == "" ]] ; then + flags_program_shared=${variables[${key}]} + else + flags_program_shared="${flags_program_shared} ${variables[${key}]}" + fi fi - bootstrap_id "flags_program_static-mode" - if [[ ${flags_program_static} == "" ]] ; then - flags_program_static=${variables[${key}]} - else - flags_program_static="${flags_program_static} ${variables[${key}]}" + bootstrap_id "has-flags_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_program_static-mode" + if [[ ${flags_program_static} == "" ]] ; then + flags_program_static=${variables[${key}]} + else + flags_program_static="${flags_program_static} ${variables[${key}]}" + fi fi - bootstrap_id "flags_shared-mode" - if [[ ${flags_shared} == "" ]] ; then - flags_shared=${variables[${key}]} - else - flags_shared="${flags_shared} ${variables[${key}]}" + bootstrap_id "has-flags_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_shared-mode" + if [[ ${flags_shared} == "" ]] ; then + flags_shared=${variables[${key}]} + else + flags_shared="${flags_shared} ${variables[${key}]}" + fi fi - bootstrap_id "flags_static-mode" - if [[ ${flags_static} == "" ]] ; then - flags_static=${variables[${key}]} - else - flags_static="${flags_static} ${variables[${key}]}" + bootstrap_id "has-flags_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "flags_static-mode" + if [[ ${flags_static} == "" ]] ; then + flags_static=${variables[${key}]} + else + flags_static="${flags_static} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_headers() { - local key= - - bootstrap_id "build_sources_headers-mode" - if [[ ${sources_headers} == "" ]] ; then - sources_headers=${variables[${key}]} - else - sources_headers="${sources_headers} ${variables[${key}]}" - fi - - if [[ ${build_shared} == "yes" ]] ; then - bootstrap_id "build_sources_headers_shared" - if [[ ${sources_headers} == "" ]] ; then - sources_headers=${variables[${key}]} - else - sources_headers="${sources_headers} ${variables[${key}]}" - fi - bootstrap_id "build_sources_headers_static" + bootstrap_id "has-build_sources_headers-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_headers-mode" if [[ ${sources_headers} == "" ]] ; then sources_headers=${variables[${key}]} else @@ -1984,156 +2042,195 @@ bootstrap_operation_build_prepare_headers() { fi fi - if [[ ${build_static} == "yes" ]] ; then - bootstrap_id "build_sources_headers_shared-mode" - if [[ ${sources_headers} == "" ]] ; then - sources_headers=${variables[${key}]} - else - sources_headers="${sources_headers} ${variables[${key}]}" + if [[ ${build_shared} == "yes" ]] ; then + + bootstrap_id "has-build_sources_headers_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_headers_shared" + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} + else + sources_headers="${sources_headers} ${variables[${key}]}" + fi fi - bootstrap_id "build_sources_headers_static-mode" - if [[ ${sources_headers} == "" ]] ; then - sources_headers=${variables[${key}]} - else - sources_headers="${sources_headers} ${variables[${key}]}" + + bootstrap_id "has-build_sources_headers_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_headers_static" + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} + else + sources_headers="${sources_headers} ${variables[${key}]}" + fi fi fi - bootstrap_id "path_headers-mode" - if [[ ${variables[${key}]} != "" ]] ; then - path_headers=${variables[${key}]} - else - bootstrap_id "path_headers" - if [[ ${variables[${key}]} != "" ]] ; then - path_headers=${variables[${key}]} + if [[ ${build_static} == "yes" ]] ; then + + bootstrap_id "has-build_sources_headers_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_headers_shared-mode" + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} + else + sources_headers="${sources_headers} ${variables[${key}]}" + fi fi - fi - if [[ ${path_headers} != "" ]] ; then - path_headers=$(sed -e 's|/*$|/|' <<< ${path_headers}) + bootstrap_id "has-build_sources_headers_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_headers_static-mode" + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} + else + sources_headers="${sources_headers} ${variables[${key}]}" + fi + fi fi } bootstrap_operation_build_prepare_libraries() { - local key= - bootstrap_id "build_libraries-mode" - if [[ ${libraries} == "" ]] ; then - libraries=${variables[${key}]} - else - libraries="${variables[${key}]} ${libraries}" + bootstrap_id "has-libraries-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${libraries} == "" ]] ; then + libraries=${variables[${key}]} + else + libraries="${variables[${key}]} ${libraries}" + fi fi - bootstrap_id "build_libraries_shared-mode" - if [[ ${libraries_shared} == "" ]] ; then - libraries_shared=${variables[${key}]} - else - libraries_shared="${variables[${key}]} ${libraries_shared}" + bootstrap_id "has-libraries_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${libraries_shared} == "" ]] ; then + libraries_shared=${variables[${key}]} + else + libraries_shared="${variables[${key}]} ${libraries_shared}" + fi fi - bootstrap_id "build_libraries_static-mode" - if [[ ${libraries_static} == "" ]] ; then - libraries_static=${variables[${key}]} - else - libraries_static="${variables[${key}]} ${libraries_static}" + bootstrap_id "has-libraries_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${libraries_static} == "" ]] ; then + libraries_static=${variables[${key}]} + else + libraries_static="${variables[${key}]} ${libraries_static}" + fi fi - bootstrap_id "build_sources_library-mode" - if [[ ${sources_library} == "" ]] ; then - sources_library=${variables[${key}]} - else - sources_library="${sources_library} ${variables[${key}]}" + bootstrap_id "has-sources_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${sources_library} == "" ]] ; then + sources_library=${variables[${key}]} + else + sources_library="${sources_library} ${variables[${key}]}" + fi fi - bootstrap_id "build_sources_library_shared-mode" - if [[ ${sources_library_shared} == "" ]] ; then - sources_library_shared=${variables[${key}]} - else - sources_library_shared="${build_sources_library_shared} ${variables[${key}]}" + bootstrap_id "has-sources_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${sources_library_shared} == "" ]] ; then + sources_library_shared=${variables[${key}]} + else + sources_library_shared="${build_sources_library_shared} ${variables[${key}]}" + fi fi - bootstrap_id "build_sources_library_static-mode" - if [[ ${sources_library_static} == "" ]] ; then - sources_library_static=${variables[${key}]} - else - sources_library_static="${build_sources_library_static} ${variables[${key}]}" + bootstrap_id "has-build_sources_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_library_static-mode" + if [[ ${sources_library_static} == "" ]] ; then + sources_library_static=${variables[${key}]} + else + sources_library_static="${build_sources_library_static} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_objects() { - local key= - bootstrap_id "build_objects_library-mode" - if [[ ${objects_library} == "" ]] ; then - objects_library=${variables[${key}]} - else - objects_library="${variables[${key}]} ${objects_library}" + bootstrap_id "has-objects_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_objects_library-mode" + if [[ ${objects_library} == "" ]] ; then + objects_library=${variables[${key}]} + else + objects_library="${variables[${key}]} ${objects_library}" + fi fi - bootstrap_id "build_objects_library_shared-mode" - if [[ ${objects_library_shared} == "" ]] ; then - objects_library_shared=${variables[${key}]} - else - objects_library_shared="${variables[${key}]} ${objects_library_shared}" + bootstrap_id "has-objects_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${objects_library_shared} == "" ]] ; then + objects_library_shared=${variables[${key}]} + else + objects_library_shared="${variables[${key}]} ${objects_library_shared}" + fi fi - bootstrap_id "build_objects_library_static-mode" - if [[ ${objects_library_static} == "" ]] ; then - objects_library_static=${variables[${key}]} - else - objects_library_static="${variables[${key}]} ${objects_library_static}" + bootstrap_id "has-objects_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${objects_library_static} == "" ]] ; then + objects_library_static=${variables[${key}]} + else + objects_library_static="${variables[${key}]} ${objects_library_static}" + fi fi - bootstrap_id "build_objects_program-mode" - if [[ ${objects_program} == "" ]] ; then - objects_program=${variables[${key}]} - else - objects_program="${variables[${key}]} ${objects_program}" + bootstrap_id "has-objects_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${objects_program} == "" ]] ; then + objects_program=${variables[${key}]} + else + objects_program="${variables[${key}]} ${objects_program}" + fi fi - bootstrap_id "build_objects_program_shared-mode" - if [[ ${objects_program_shared} == "" ]] ; then - objects_program_shared=${variables[${key}]} - else - objects_program_shared="${variables[${key}]} ${objects_program_shared}" + bootstrap_id "has-objects_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${objects_program_shared} == "" ]] ; then + objects_program_shared=${variables[${key}]} + else + objects_program_shared="${variables[${key}]} ${objects_program_shared}" + fi fi - bootstrap_id "build_objects_program_static-mode" - if [[ ${objects_program_static} == "" ]] ; then - objects_program_static=${variables[${key}]} - else - objects_program_static="${variables[${key}]} ${objects_program_static}" + bootstrap_id "hasobjects_program_static--mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + if [[ ${objects_program_static} == "" ]] ; then + objects_program_static=${variables[${key}]} + else + objects_program_static="${variables[${key}]} ${objects_program_static}" + fi fi - if [[ ${sources_object} == "" ]] ; then + bootstrap_id "has-build_sources_object-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_sources_object-mode" sources_object=${variables[${key}]} fi - if [[ ${sources_object_shared} == "" ]] ; then + bootstrap_id "has-build_sources_object_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_sources_object_shared-mode" sources_object_shared=${variables[${key}]} fi - if [[ ${sources_object_static} == "" ]] ; then + bootstrap_id "has-build_sources_object_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_sources_object_static-mode" sources_object_static=${variables[${key}]} fi } bootstrap_operation_build_prepare_paths() { - local key= if [[ ${override_path_sources} == "" ]] ; then - bootstrap_id "path_sources-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_sources-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_sources-mode" path_sources=${variables[${key}]} - else - bootstrap_id "path_sources" - if [[ ${variables[${key}]} != "" ]] ; then - path_sources=${variables[${key}]} - fi fi fi @@ -2141,22 +2238,19 @@ bootstrap_operation_build_prepare_paths() { path_sources=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_sources}) fi - bootstrap_id "path_sources_object-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_sources_object-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_sources_object-mode" path_sources_object=${variables[${key}]} - else - bootstrap_id "path_sources_object" - if [[ ${variables[${key}]} != "" ]] ; then - path_sources_object=${variables[${key}]} - fi fi if [[ ${path_sources_object} != "" ]] ; then path_sources_object=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_sources_object}) fi - bootstrap_id "path_headers-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_headers-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_headers-mode" path_headers=${variables[${key}]} fi @@ -2164,21 +2258,23 @@ bootstrap_operation_build_prepare_paths() { path_headers=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_headers}) fi - bootstrap_id "has_path_standard-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-has_path_standard-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "has_path_standard-mode" has_path_standard=${variables[${key}]} fi if [[ ${has_path_standard} == "no" ]] ; then path_language= else - bootstrap_id "path_language-mode" - if [[ ${variables[${key}]} != "" ]] ; then - path_language=${variables[${key}]} - else - bootstrap_id "path_language" + bootstrap_id "has-path_language-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_language-mode" if [[ ${variables[${key}]} != "" ]] ; then path_language=${variables[${key}]} + else + bootstrap_id "path_language" + path_language=${variables[${key}]} fi fi @@ -2187,8 +2283,9 @@ bootstrap_operation_build_prepare_paths() { fi fi - bootstrap_id "path_object_library-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_library-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_library-mode" path_object_library=${variables[${key}]} fi @@ -2196,8 +2293,9 @@ bootstrap_operation_build_prepare_paths() { path_object_library=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_library}) fi - bootstrap_id "path_object_program-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_program-mode" path_object_program=${variables[${key}]} fi @@ -2205,8 +2303,9 @@ bootstrap_operation_build_prepare_paths() { path_object_program=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_program}) fi - bootstrap_id "path_library_script-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_library_script-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_library_script-mode" path_library_script=${variables[${key}]} fi @@ -2214,8 +2313,9 @@ bootstrap_operation_build_prepare_paths() { path_library_script=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_library_script}) fi - bootstrap_id "path_library_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_library_shared-mode" path_library_shared=${variables[${key}]} fi @@ -2223,8 +2323,9 @@ bootstrap_operation_build_prepare_paths() { path_library_shared=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_library_shared}) fi - bootstrap_id "path_library_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_library_static-mode" path_library_static=${variables[${key}]} fi @@ -2232,8 +2333,9 @@ bootstrap_operation_build_prepare_paths() { path_library_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_library_static}) fi - bootstrap_id "path_object_library_script-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_library_script-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_library_script-mode" path_object_library_script=${variables[${key}]} fi @@ -2241,8 +2343,9 @@ bootstrap_operation_build_prepare_paths() { path_object_library_script=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_library_script}) fi - bootstrap_id "path_object_library_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_library_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_library_shared-mode" path_object_library_shared=${variables[${key}]} fi @@ -2250,8 +2353,9 @@ bootstrap_operation_build_prepare_paths() { path_object_library_shared=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_library_shared}) fi - bootstrap_id "path_object_library_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_library_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_library_static-mode" path_object_library_static=${variables[${key}]} fi @@ -2259,8 +2363,9 @@ bootstrap_operation_build_prepare_paths() { path_object_library_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_library_static}) fi - bootstrap_id "path_object_program_script-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_program_script-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_program_script-mode" path_object_program_script=${variables[${key}]} fi @@ -2268,8 +2373,9 @@ bootstrap_operation_build_prepare_paths() { path_object_program_script=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_program_script}) fi - bootstrap_id "path_object_program_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_program_shared-mode" path_object_program_shared=${variables[${key}]} fi @@ -2277,8 +2383,9 @@ bootstrap_operation_build_prepare_paths() { path_object_program_shared=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_program_shared}) fi - bootstrap_id "path_object_program_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_program_static-mode" path_object_program_static=${variables[${key}]} fi @@ -2286,8 +2393,9 @@ bootstrap_operation_build_prepare_paths() { path_object_program_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_program_static}) fi - bootstrap_id "path_object_script-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_script-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_script-mode" path_object_script=${variables[${key}]} fi @@ -2295,8 +2403,9 @@ bootstrap_operation_build_prepare_paths() { path_object_script=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_script}) fi - bootstrap_id "path_object_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_shared-mode" path_object_shared=${variables[${key}]} fi @@ -2304,8 +2413,9 @@ bootstrap_operation_build_prepare_paths() { path_object_shared=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_shared}) fi - bootstrap_id "path_object_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_object_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_object_static-mode" path_object_static=${variables[${key}]} fi @@ -2313,12 +2423,9 @@ bootstrap_operation_build_prepare_paths() { path_object_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_static}) fi - if [[ ${path_object_static} != "" ]] ; then - path_object_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_object_static}) - fi - - bootstrap_id "path_program_script-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_program_script-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_program_script-mode" path_program_script=${variables[${key}]} fi @@ -2326,8 +2433,9 @@ bootstrap_operation_build_prepare_paths() { path_program_script=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_program_script}) fi - bootstrap_id "path_program_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_program_shared-mode" path_program_shared=${variables[${key}]} fi @@ -2335,47 +2443,51 @@ bootstrap_operation_build_prepare_paths() { path_program_shared=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_program_shared}) fi - bootstrap_id "path_program_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-path_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "path_program_static-mode" path_program_static=${variables[${key}]} fi if [[ ${path_program_static} != "" ]] ; then path_program_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_program_static}) fi - - if [[ ${path_program_static} != "" ]] ; then - path_program_static=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_program_static}) - fi } bootstrap_operation_build_prepare_programs() { - local key= - bootstrap_id "build_sources_program-mode" - if [[ ${sources_program} == "" ]] ; then - sources_program=${variables[${key}]} - else - sources_program="${sources_program} ${variables[${key}]}" + bootstrap_id "has-build_sources_program-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_program-mode" + if [[ ${sources_program} == "" ]] ; then + sources_program=${variables[${key}]} + else + sources_program="${sources_program} ${variables[${key}]}" + fi fi - bootstrap_id "build_sources_program_shared-mode" - if [[ ${sources_program_shared} == "" ]] ; then - sources_program_shared=${variables[${key}]} - else - sources_program_shared="${sources_program_shared} ${variables[${key}]}" + bootstrap_id "has-build_sources_program_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_program_shared-mode" + if [[ ${sources_program_shared} == "" ]] ; then + sources_program_shared=${variables[${key}]} + else + sources_program_shared="${sources_program_shared} ${variables[${key}]}" + fi fi - bootstrap_id "build_sources_program_static-mode" - if [[ ${sources_program_static} == "" ]] ; then - sources_program_static=${variables[${key}]} - else - sources_program_static="${sources_program_static} ${variables[${key}]}" + bootstrap_id "has-build_sources_program_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_program_static-mode" + if [[ ${sources_program_static} == "" ]] ; then + sources_program_static=${variables[${key}]} + else + sources_program_static="${sources_program_static} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_remaining() { - local key= bootstrap_id "has-build_compiler-mode" if [[ ${variables[${key}]} == "yes" ]] ; then @@ -2453,6 +2565,10 @@ bootstrap_operation_build_prepare_remaining() { if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_headers-mode" path_headers=${variables[${key}]} + + if [[ ${path_headers} != "" ]] ; then + path_headers=$(sed -e 's|//*|/|g' -e 's|/*$|/|' <<< ${path_headers}) + fi fi bootstrap_id "has-preserve_path_headers-mode" @@ -2547,26 +2663,29 @@ bootstrap_operation_build_prepare_remaining() { } bootstrap_operation_build_prepare_settings() { - local key= - bootstrap_id "build_sources_setting-mode" - if [[ ${sources_setting} == "" ]] ; then - sources_setting=${variables[${key}]} - else - sources_setting="${sources_setting} ${variables[${key}]}" + bootstrap_id "has-build_sources_setting-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_sources_setting-mode" + if [[ ${sources_setting} == "" ]] ; then + sources_setting=${variables[${key}]} + else + sources_setting="${sources_setting} ${variables[${key}]}" + fi fi } bootstrap_operation_build_prepare_shared_static() { - local key= - bootstrap_id "build_shared-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-build_shared-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_shared-mode" build_shared=${variables[${key}]} fi - bootstrap_id "build_static-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-build_static-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "build_static-mode" build_static=${variables[${key}]} fi @@ -2768,15 +2887,16 @@ bootstrap_operation_build_validate_sources() { } bootstrap_operation_build_prepare_versions() { - local key= - bootstrap_id "version_file-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-version_file-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "version_file-mode" version_file_value=${variables[${key}]} fi - bootstrap_id "version_target-mode" - if [[ ${variables[${key}]} != "" ]] ; then + bootstrap_id "has-version_target-mode" + if [[ ${variables[${key}]} == "yes" ]] ; then + bootstrap_id "version_target-mode" version_target_value=${variables[${key}]} fi -- 2.47.3