From: Kevin Day Date: Tue, 4 Apr 2023 23:49:22 +0000 (-0500) Subject: Progress: Improve thread support across programs and update threaded usage. X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=d62cb6a8ded254df06986fa0f114d18d2ffdb109;p=fll Progress: Improve thread support across programs and update threaded usage. Enable the threaded signal handled consistently across all programs that are currently migrated (see commit 9e0529297bfdb1529be685eacd3ca5784ea8e946). Improve the thread configuration to make it easier to enable or disable thread support. Add documentation regarding the build modes supported in each of the build settings files. Update the build scripts to better handle the now additional build modes. The build scripts now use braces everywhere. Doing this should make it easier to be compatible with other scripting engines such as ZSH. --- diff --git a/build/level_0/settings b/build/level_0/settings index 813997b..d7e88d8 100644 --- a/build/level_0/settings +++ b/build/level_0/settings @@ -1,4 +1,18 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# +# Note: This adds "individual" and "monolithic" for consistency reasons. This should never use "individual" or "monolithic". +# build_name fll_0 @@ -8,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes level level_threadless clang test fanalyzer -modes_default level +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default level thread build_compiler gcc build_compiler-clang clang @@ -64,7 +78,7 @@ build_sources_library utf.c private-utf.c private-utf_alphabetic.c private-utf_c build_sources_library utf/common.c utf/convert.c utf/dynamic.c utf/dynamics.c utf/dynamicss.c utf/is.c utf/is_character.c utf/map.c utf/maps.c utf/mapss.c utf/map_multi.c utf/map_multis.c utf/map_multiss.c utf/static.c utf/statics.c utf/staticss.c utf/string.c utf/triple.c utf/triples.c utf/tripless.c build_sources_library utf/private-dynamic.c utf/private-dynamics.c utf/private-dynamicss.c utf/private-maps.c utf/private-mapss.c utf/private-map_multis.c utf/private-map_multiss.c utf/private-string.c utf/private-triples.c utf/private-tripless.c -build_sources_library-level thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c +build_sources_library-thread thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c build_sources_headers account.h account/accounts.h account/common.h build_sources_headers capability.h capability/common.h @@ -104,7 +118,7 @@ build_sources_headers type_array.h type_array/common.h build_sources_headers type_array/array_length.h type_array/cell.h type_array/fll_id.h type_array/int8.h type_array/int16.h type_array/int32.h type_array/int64.h type_array/int128.h type_array/state.h type_array/status.h type_array/uint8.h type_array/uint16.h type_array/uint32.h type_array/uint64.h type_array/uint128.h build_sources_headers utf.h utf/common.h utf/convert.h utf/dynamic.h utf/dynamics.h utf/dynamicss.h utf/is.h utf/is_character.h utf/map.h utf/maps.h utf/mapss.h utf/map_multi.h utf/map_multis.h utf/map_multiss.h utf/static.h utf/statics.h utf/staticss.h utf/string.h utf/triple.h utf/triples.h utf/tripless.h -build_sources_headers-level thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h +build_sources_headers-thread thread.h thread/attribute.h thread/barrier.h thread/barrier_attribute.h thread/condition.h thread/condition_attribute.h thread/id.h thread/key.h thread/lock.h thread/lock_attribute.h thread/mutex.h thread/mutex_attribute.h thread/once.h thread/semaphore.h thread/set.h thread/spin.h build_script yes build_shared yes @@ -133,15 +147,16 @@ environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY L #defines -D_di_libcap_ #defines -D_f_file_rename_use_renameat2_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ defines-clang -D_clang_not_a_compile_time_constant_workaround_ -defines-level_threadless -D_di_pthread_support_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -fstack-protector -Wall flags-fanalyzer -fanalyzer -flags-level -pthread flags_library -fPIC flags_object -fPIC diff --git a/build/level_1/settings b/build/level_1/settings index d61f45b..3cb05e1 100644 --- a/build/level_1/settings +++ b/build/level_1/settings @@ -1,4 +1,18 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# +# Note: This adds "individual" and "monolithic" for consistency reasons. This should never use "individual" or "monolithic". +# build_name fll_1 @@ -8,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes level level_threadless clang test fanalyzer -modes_default level +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default level thread build_compiler gcc build_compiler-clang clang @@ -19,7 +33,6 @@ build_language c build_libraries -lc -lcap build_libraries-level -lfll_0 -build_libraries-level_threadless -lfll_0 build_sources_library control_group.c build_sources_library conversion.c private-conversion.c conversion/common.c @@ -72,14 +85,15 @@ environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -defines-level_threadless -D_di_pthread_support_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -fstack-protector -Wall flags-fanalyzer -fanalyzer -flags-level -pthread flags_library -fPIC flags_object -fPIC diff --git a/build/level_2/settings b/build/level_2/settings index 606cb6b..dec8158 100644 --- a/build/level_2/settings +++ b/build/level_2/settings @@ -1,4 +1,18 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# +# Note: This adds "individual" and "monolithic" for consistency reasons. This should never use "individual" or "monolithic". +# build_name fll_2 @@ -8,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes level level_threadless clang test fanalyzer -modes_default level +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default level thread build_compiler gcc build_compiler-clang clang @@ -19,7 +33,6 @@ build_language c build_libraries -lc -lcap build_libraries-level -lfll_1 -lfll_0 -build_libraries-level_threadless -lfll_1 -lfll_0 build_sources_library control_group.c build_sources_library error.c private-error.c error/common.c @@ -67,14 +80,15 @@ environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -defines-level_threadless -D_di_pthread_support_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -fstack-protector -Wall flags-fanalyzer -fanalyzer -flags-level -pthread flags_library -fPIC flags_object -fPIC diff --git a/build/monolithic/settings b/build/monolithic/settings index 25aff4a..c735cbd 100644 --- a/build/monolithic/settings +++ b/build/monolithic/settings @@ -1,4 +1,18 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# +# Note: This adds "individual" and "level" for consistency reasons. This should never use "individual" or "level". +# build_name fll @@ -8,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes monolithic monolithic_threadless clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -86,7 +100,7 @@ build_sources_library level_2/iki.c level_2/private-iki.c build_sources_library level_2/print.c build_sources_library level_2/program.c level_2/program/common.c level_2/program/print.c level_2/private-program.c -build_sources_library-monolithic level_0/thread.c level_0/private-thread.c level_0/thread/attribute.c level_0/thread/barrier.c level_0/thread/barrier_attribute.c level_0/thread/condition.c level_0/thread/condition_attribute.c level_0/thread/id.c level_0/thread/key.c level_0/thread/lock.c level_0/thread/lock_attribute.c level_0/thread/mutex.c level_0/thread/mutex_attribute.c level_0/thread/once.c level_0/thread/semaphore.c level_0/thread/set.c level_0/thread/spin.c +build_sources_library-thread level_0/thread.c level_0/private-thread.c level_0/thread/attribute.c level_0/thread/barrier.c level_0/thread/barrier_attribute.c level_0/thread/condition.c level_0/thread/condition_attribute.c level_0/thread/id.c level_0/thread/key.c level_0/thread/lock.c level_0/thread/lock_attribute.c level_0/thread/mutex.c level_0/thread/mutex_attribute.c level_0/thread/once.c level_0/thread/semaphore.c level_0/thread/set.c level_0/thread/spin.c build_sources_headers level_0/account.h level_0/account/accounts.h level_0/account/common.h build_sources_headers level_0/capability.h level_0/capability/common.h @@ -149,7 +163,7 @@ build_sources_headers level_2/iki.h build_sources_headers level_2/print.h build_sources_headers level_2/program.h level_2/program/common.h level_2/program/print.h -build_sources_headers-monolithic level_0/thread.h level_0/thread/attribute.h level_0/thread/barrier.h level_0/thread/barrier_attribute.h level_0/thread/condition.h level_0/thread/condition_attribute.h level_0/thread/id.h level_0/thread/key.h level_0/thread/lock.h level_0/thread/lock_attribute.h level_0/thread/mutex.h level_0/thread/mutex_attribute.h level_0/thread/once.h level_0/thread/semaphore.h level_0/thread/set.h level_0/thread/spin.h +build_sources_headers-thread level_0/thread.h level_0/thread/attribute.h level_0/thread/barrier.h level_0/thread/barrier_attribute.h level_0/thread/condition.h level_0/thread/condition_attribute.h level_0/thread/id.h level_0/thread/key.h level_0/thread/lock.h level_0/thread/lock_attribute.h level_0/thread/mutex.h level_0/thread/mutex_attribute.h level_0/thread/once.h level_0/thread/semaphore.h level_0/thread/set.h level_0/thread/spin.h build_script yes build_shared yes @@ -178,15 +192,16 @@ environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY L #defines -D_di_libcap_ #defines -D_f_file_rename_use_renameat2_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ defines-clang -D_clang_not_a_compile_time_constant_workaround_ -defines-monolithic_threadless -D_di_pthread_support_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -fstack-protector -Wall flags-fanalyzer -fanalyzer -flags-monolithic -pthread flags_library -fPIC flags_object -fPIC diff --git a/build/scripts/bootstrap-example.sh b/build/scripts/bootstrap-example.sh index 8e1703b..095c49d 100644 --- a/build/scripts/bootstrap-example.sh +++ b/build/scripts/bootstrap-example.sh @@ -39,11 +39,11 @@ # SHELL_ENGINE="zsh" zsh ./bootstrap-example.sh --help # -if [[ $SHELL_ENGINE == "zsh" ]] ; then +if [[ ${SHELL_ENGINE} == "zsh" ]] ; then emulate ksh fi -path_original="$PWD/" +path_original="${PWD}/" path_work="${path_original}fll/" verbose= @@ -57,196 +57,228 @@ mode_part= mode_parameter= mode_path= mode_value= +build_mode= +build_mode_extra_param_1= +build_mode_extra_value_1= +build_mode_extra_param_2= +build_mode_extra_value_2= shell_command=bash suppress_first="+F" -if [[ $SHELL_ENGINE == "zsh" ]] ; then +if [[ ${SHELL_ENGINE} == "zsh" ]] ; then shell_command=zsh fi let i=2 p= -while [[ $i -le $# ]] ; do +while [[ ${i} -le $# ]] ; do - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then p=${(P)i} else p=${!i} fi - if [[ $p == "+d" ]] ; then + if [[ ${p} == "+d" ]] ; then color="+d" - elif [[ $p == "+l" ]] ; then + elif [[ ${p} == "+l" ]] ; then color="+l" - elif [[ $p == "+n" ]] ; then + elif [[ ${p} == "+n" ]] ; then color="+n" - elif [[ $p == "+Q" ]] ; then + elif [[ ${p} == "+Q" ]] ; then verbose="+Q" verbose_common= - elif [[ $p == "+E" ]] ; then + elif [[ ${p} == "+E" ]] ; then verbose="+E" verbose_common= - elif [[ $p == "+N" ]] ; then + elif [[ ${p} == "+N" ]] ; then verbose="+N" verbose_common= - elif [[ $p == "+V" ]] ; then + elif [[ ${p} == "+V" ]] ; then verbose="+V" verbose_common="-v" - elif [[ $p == "+D" ]] ; then + elif [[ ${p} == "+D" ]] ; then verbose="+D" verbose_common="-v" - elif [[ $p == "--enable-static" ]] ; then + elif [[ ${p} == "--enable-static" ]] ; then static="--enable-static" - elif [[ $p == "--disable-static" ]] ; then + elif [[ ${p} == "--disable-static" ]] ; then static="--disable-static" - elif [[ $p == "--enable-shared" ]] ; then + elif [[ ${p} == "--enable-shared" ]] ; then shared="--enable-shared" - elif [[ $p == "--disable-shared" ]] ; then + elif [[ ${p} == "--disable-shared" ]] ; then shared="--disable-shared" - elif [[ $p == "clang" ]] ; then + elif [[ ${p} == "clang" ]] ; then clang="-m clang" - elif [[ $p == "-w" || $p == "--work" ]] ; then + elif [[ ${p} == "-w" || ${p} == "--work" ]] ; then let i++ - if [[ $i -le $# ]] ; then - path_work=$p + if [[ ${i} -le $# ]] ; then + path_work=${p} fi fi let i++ done -if [[ ! -d $path_work ]] ; then - mkdir $verbose_common -p $path_work +if [[ ! -d ${path_work} ]] ; then + mkdir ${verbose_common} -p ${path_work} fi -if [[ $1 == "individual" ]] ; then - $shell_command build/scripts/package.sh $verbose $color rebuild -i +if [[ ${1} == "individual" ]] ; then + ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild -i - if [[ $? -eq 0 ]] ; then + if [[ ${?} -eq 0 ]] ; then for i in f_type f_status f_memory f_type_array f_string f_utf f_account f_capability f_color f_compare f_console f_control_group f_conversion f_directory f_environment f_execute f_file f_fss f_iki f_limit f_parse f_path f_pipe f_print f_rip f_status_string f_serialize f_signal f_socket f_thread fl_control_group fl_conversion fl_directory fl_environment fl_execute fl_fss fl_iki fl_path fl_print fl_signal fl_status_string fl_utf_file fll_control_group fll_error fll_execute fll_file fll_fss fll_fss_status_string fll_iki fll_print fll_program ; do - echo && echo "Processing $i." && + echo && echo "Processing ${i}." && - cd package/individual/$i-$version/ && + cd package/individual/${i}-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m individual $clang && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m individual -m individual_thread -m thread ${clang} && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work && + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && - cd $path_original || break + cd ${path_original} || break done fi fi -if [[ $1 == "level" ]] ; then - $shell_command build/scripts/package.sh $verbose $color rebuild -l && +if [[ ${1} == "level" ]] ; then + ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild -l && - cd package/level/fll-level_0-$version/ && + cd package/level/fll-level_0-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m level $clang && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level -m thread ${clang} && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work && + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && - cd $path_original && + cd ${path_original} && - cd package/level/fll-level_1-$version/ && + cd package/level/fll-level_1-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m level && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level -m thread && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work && + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} && - cd $path_original && + cd ${path_original} && - cd package/level/fll-level_2-$version/ && + cd package/level/fll-level_2-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m level && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m level -m thread && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} fi -if [[ $1 == "monolithic" ]] ; then - $shell_command build/scripts/package.sh $verbose $color rebuild -m && +if [[ ${1} == "monolithic" ]] ; then + ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild -m && - cd package/monolithic/fll-$version/ && + cd package/monolithic/fll-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m monolithic $clang && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m monolithic -m thread ${clang} && - $shell_command ./install.sh $verbose $color $shared $suppress_first $static -w $path_work + ${shell_command} ./install.sh ${verbose} ${color} ${shared} ${suppress_first} ${static} -w ${path_work} fi # The following in an example on building individual projects. for mode_part in fake utf8 ; do - if [[ $1 == "$mode_part-individual" || $1 == "$mode_part-level" || $1 == "$mode_part-monolithic" || $1 == "$mode_part-stand_alone" ]] ; then + if [[ ${1} == "${mode_part}-individual" || ${1} == "${mode_part}-level" || ${1} == "${mode_part}-monolithic" || ${1} == "${mode_part}-stand_alone" ]] ; then break; fi mode_part= done -if [[ $mode_part != "" ]] ; then +if [[ ${mode_part} != "" ]] ; then mode_parameter="-p" mode_path="program" mode_value= + build_mode_extra_param_1= + build_mode_extra_value_1= + build_mode_extra_param_2= + build_mode_extra_value_2= - if [[ $1 == "$mode_part-individual" ]] ; then + if [[ ${1} == "${mode_part}-individual" ]] ; then build_mode="individual" - elif [[ $1 == "$mode_part-level" ]] ; then + build_mode_extra_param_1="-m" + build_mode_extra_value_1="individual_thread" + build_mode_extra_param_2="-m" + build_mode_extra_value_2="thread" + elif [[ ${1} == "${mode_part}-level" ]] ; then build_mode="level" - elif [[ $1 == "$mode_part-monolithic" ]] ; then + build_mode_extra_param_1="-m" + build_mode_extra_value_1="thread" + elif [[ ${1} == "${mode_part}-monolithic" ]] ; then build_mode="monolithic" - elif [[ $1 == "$mode_part-stand_alone" ]] ; then + build_mode_extra_param_1="-m" + build_mode_extra_value_1="thread" + elif [[ ${1} == "${mode_part}-stand_alone" ]] ; then build_mode="stand_alone" mode_path="stand_alone" mode_parameter="-S" - mode_value="$mode_part" + mode_value="${mode_part}" + build_mode_extra_param_1="-m" + build_mode_extra_value_1="thread" fi - $shell_command build/scripts/package.sh $verbose $color rebuild $mode_parameter $mode_value && + ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild ${mode_parameter} ${mode_value} && - cd package/$mode_path/$mode_part-$version/ && + cd package/${mode_path}/${mode_part}-${version}/ && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m $build_mode && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} # The following in an example on building all FLL program projects using the project bootstrapped from above. -elif [[ $1 == "programs-individual" || $1 == "programs-level" || $1 == "programs-monolithic" ]] ; then - if [[ $1 == "programs-individual" ]] ; then +elif [[ ${1} == "programs-individual" || ${1} == "programs-level" || ${1} == "programs-monolithic" ]] ; then + build_mode_extra_param_1= + build_mode_extra_value_1= + build_mode_extra_param_2= + build_mode_extra_value_2= + + if [[ ${1} == "programs-individual" ]] ; then build_mode="individual" - elif [[ $1 == "programs-level" ]] ; then + build_mode_extra_param_1="-m" + build_mode_extra_value_1="individual_thread" + build_mode_extra_param_2="-m" + build_mode_extra_value_2="thread" + elif [[ ${1} == "programs-level" ]] ; then build_mode="level" - elif [[ $1 == "programs-monolithic" ]] ; then + build_mode_extra_param_1="-m" + build_mode_extra_value_1="thread" + elif [[ ${1} == "programs-monolithic" ]] ; then build_mode="monolithic" + build_mode_extra_param_1="-m" + build_mode_extra_value_1="thread" fi - $shell_command build/scripts/package.sh $verbose $color rebuild -p && + ${shell_command} build/scripts/package.sh ${verbose} ${color} rebuild -p && cd package/program - if [[ $? -eq 0 ]] ; then + if [[ ${?} -eq 0 ]] ; then for i in * ; do - cd ${path_original}package/program/$i && + cd ${path_original}package/program/${i} && - $shell_command ./bootstrap.sh clean $verbose $color $suppress_first && + ${shell_command} ./bootstrap.sh clean ${verbose} ${color} ${suppress_first} && - $shell_command ./bootstrap.sh build $verbose $color $suppress_first $shared $static -w $path_work -m $build_mode && + ${shell_command} ./bootstrap.sh build ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} -m ${build_mode} ${build_mode_extra_param_1} ${build_mode_extra_value_1} ${build_mode_extra_param_2} ${build_mode_extra_value_2} && - $shell_command ./install.sh $verbose $color $suppress_first $shared $static -w $path_work || + ${shell_command} ./install.sh ${verbose} ${color} ${suppress_first} ${shared} ${static} -w ${path_work} || break done @@ -255,11 +287,11 @@ elif [[ $1 == "programs-individual" || $1 == "programs-level" || $1 == "programs echo "ERROR: failed to change directory to 'package/program'." echo fi -elif [[ $1 != "individual" && $1 != "level" && $1 != "monolithic" ]] ; then +elif [[ ${1} != "individual" && ${1} != "level" && ${1} != "monolithic" ]] ; then echo - echo "ERROR: '$1' is not a supported build mode." + echo "ERROR: '${1}' is not a supported build mode." echo fi # Regardless of what happens always return to the starting directory. -cd $path_original +cd ${path_original} diff --git a/build/scripts/bootstrap.sh b/build/scripts/bootstrap.sh index 4ef5f0d..c39fa97 100644 --- a/build/scripts/bootstrap.sh +++ b/build/scripts/bootstrap.sh @@ -14,13 +14,13 @@ bootstrap_main() { - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then emulate ksh fi local public_name="Simple FLL Bootstrap Script" local system_name=bootstrap - local called_name=$(basename $0) + local called_name=$(basename ${0}) local version=0.7.0 local grab_next= @@ -84,109 +84,109 @@ bootstrap_main() { if [[ $# -gt 0 ]] ; then t=$# - while [[ $i -lt $t ]] ; do - let i=$i+1 + while [[ ${i} -lt ${t} ]] ; do + let i=${i}+1 - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then p=${(P)i} else p=${!i} fi - if [[ $grab_next == "" ]] ; then - if [[ $p == "-h" || $p == "--help" ]] ; then + if [[ ${grab_next} == "" ]] ; then + if [[ ${p} == "-h" || ${p} == "--help" ]] ; then do_help=yes - elif [[ $p == "+C" || $p == "++copyright" ]] ; then + elif [[ ${p} == "+C" || ${p} == "++copyright" ]] ; then do_copyright="yes" - elif [[ $p == "+d" || $p == "++dark" ]] ; then + elif [[ ${p} == "+d" || ${p} == "++dark" ]] ; then do_color=dark context="+d" - elif [[ $p == "+l" || $p == "++light" ]] ; then + elif [[ ${p} == "+l" || ${p} == "++light" ]] ; then do_color=light context="+l" - elif [[ $p == "+n" || $p == "++no_color" ]] ; then + elif [[ ${p} == "+n" || ${p} == "++no_color" ]] ; then do_color=none context="+n" - elif [[ $p == "+Q" || $p == "++quiet" ]] ; then + elif [[ ${p} == "+Q" || ${p} == "++quiet" ]] ; then verbosity="quiet" verbose="+Q" verbose_common= - elif [[ $p == "+E" || $p == "++error" ]] ; then + elif [[ ${p} == "+E" || ${p} == "++error" ]] ; then verbosity="error" verbose="+E" verbose_common= - elif [[ $p == "+N" || $p == "++normal" ]] ; then + elif [[ ${p} == "+N" || ${p} == "++normal" ]] ; then verbosity= verbose="+N" verbose_common= - elif [[ $p == "+V" || $p == "++verbose" ]] ; then + elif [[ ${p} == "+V" || ${p} == "++verbose" ]] ; then verbosity="verbose" verbose="+V" verbose_common="-v" - elif [[ $p == "+D" || $p == "++debug" ]] ; then + elif [[ ${p} == "+D" || ${p} == "++debug" ]] ; then verbosity="debug" verbose="+D" verbose_common="-v" - elif [[ $p == "+F" || $p == "++line_first_no" ]] ; then + elif [[ ${p} == "+F" || ${p} == "++line_first_no" ]] ; then print_line_first="no" - elif [[ $p == "+L" || $p == "++line_last_no" ]] ; then + elif [[ ${p} == "+L" || ${p} == "++line_last_no" ]] ; then print_line_last="no" - elif [[ $p == "+v" || $p == "++version" ]] ; then - echo $version + elif [[ ${p} == "+v" || ${p} == "++version" ]] ; then + echo ${version} return 0 - elif [[ $p == "-d" || $p == "--define" ]] ; then + elif [[ ${p} == "-d" || ${p} == "--define" ]] ; then grab_next=define_extra - elif [[ $p == "-m" || $p == "--mode" ]] ; then + elif [[ ${p} == "-m" || ${p} == "--mode" ]] ; then grab_next="mode" - elif [[ $p == "-p" || $p == "--process" ]] ; then + elif [[ ${p} == "-p" || ${p} == "--process" ]] ; then grab_next="process" - elif [[ $p == "-s" || $p == "--settings" ]] ; then + elif [[ ${p} == "-s" || ${p} == "--settings" ]] ; then grab_next=settings_name - elif [[ $p == "-b" || $p == "--build" ]] ; then + elif [[ ${p} == "-b" || ${p} == "--build" ]] ; then grab_next=path_build - elif [[ $p == "-d" || $p == "--data" ]] ; then + elif [[ ${p} == "-d" || ${p} == "--data" ]] ; then grab_next=path_data - elif [[ $p == "-S" || $p == "--sources" ]] ; then + elif [[ ${p} == "-S" || ${p} == "--sources" ]] ; then grab_next=path_sources - elif [[ $p == "-w" || $p == "--work" ]] ; then + elif [[ ${p} == "-w" || ${p} == "--work" ]] ; then grab_next=path_work - elif [[ $p == "--enable-doc" ]] ; then + elif [[ ${p} == "--enable-doc" ]] ; then enable_documentation="yes" - elif [[ $p == "--disable-doc" ]] ; then + elif [[ ${p} == "--disable-doc" ]] ; then enable_documentation="no" - elif [[ $p == "--enable-shared" ]] ; then + elif [[ ${p} == "--enable-shared" ]] ; then enable_shared="yes" - elif [[ $p == "--disable-shared" ]] ; then + elif [[ ${p} == "--disable-shared" ]] ; then enable_shared="no" - elif [[ $p == "--enable-static" ]] ; then + elif [[ ${p} == "--enable-static" ]] ; then enable_static="yes" - elif [[ $p == "--disable-static" ]] ; then + elif [[ ${p} == "--disable-static" ]] ; then enable_static="no" - elif [[ $operation == "" ]] ; then - operation="$p" - elif [[ $operation_failure == "" ]] ; then + elif [[ ${operation} == "" ]] ; then + operation="${p}" + elif [[ ${operation_failure} == "" ]] ; then operation_failure=fail-multiple fi else - if [[ $grab_next == "define_extra" ]] ; then + if [[ ${grab_next} == "define_extra" ]] ; then define_extra="${define_extra}${p} " - elif [[ $grab_next == "mode" ]] ; then - modes="$modes$p " - elif [[ $grab_next == "process" ]] ; then - process="$p" - elif [[ $grab_next == "settings_name" ]] ; then - settings_name="$p" - elif [[ $grab_next == "path_build" ]] ; then - path_build=$(echo $p | sed -e 's|//*|/|g' -e 's|/*$|/|') + elif [[ ${grab_next} == "mode" ]] ; then + modes="${modes}${p} " + elif [[ ${grab_next} == "process" ]] ; then + process="${p}" + elif [[ ${grab_next} == "settings_name" ]] ; then + settings_name="${p}" + elif [[ ${grab_next} == "path_build" ]] ; then + path_build=$(echo ${p} | sed -e 's|//*|/|g' -e 's|/*$|/|') override_path_build="y" - elif [[ $grab_next == "path_data" ]] ; then - path_data=$(echo $p | sed -e 's|//*|/|g' -e 's|/*$|/|') + elif [[ ${grab_next} == "path_data" ]] ; then + path_data=$(echo ${p} | sed -e 's|//*|/|g' -e 's|/*$|/|') override_path_data="y" - elif [[ $grab_next == "path_sources" ]] ; then - path_sources=$(echo $p | sed -e 's|//*|/|g' -e 's|/*$|/|') + elif [[ ${grab_next} == "path_sources" ]] ; then + path_sources=$(echo ${p} | sed -e 's|//*|/|g' -e 's|/*$|/|') override_path_sources="y" - elif [[ $grab_next == "path_work" ]] ; then - path_work=$(echo $p | sed -e 's|//*|/|g' -e 's|/*$|/|') + elif [[ ${grab_next} == "path_work" ]] ; then + path_work=$(echo ${p} | sed -e 's|//*|/|g' -e 's|/*$|/|') override_path_work="y" fi @@ -197,19 +197,19 @@ bootstrap_main() { p= fi - if [[ $verbosity == "quiet" ]] ; then + if [[ ${verbosity} == "quiet" ]] ; then print_line_first="no" print_line_last="no" fi # If the settings_name has a directory separator, then assume it is a path to the settings file. - if [[ $(echo $settings_name | grep -s -o '/') == "" ]] ; then - settings_file="${path_data}build/$settings_name" + if [[ $(echo ${settings_name} | grep -s -o '/') == "" ]] ; then + settings_file="${path_data}build/${settings_name}" else - settings_file="$settings_name" + settings_file="${settings_name}" # Extract the settings name from the path. - settings_name=$(basename $settings_name) + settings_name=$(basename ${settings_name}) fi settings_defines="${path_data}build/defines" @@ -219,14 +219,14 @@ bootstrap_main() { bootstrap_handle_colors - if [[ $do_help == "yes" ]] ; then + if [[ ${do_help} == "yes" ]] ; then bootstrap_help bootstrap_cleanup return 0 fi - if [[ $do_copyright == "yes" ]] ; then + if [[ ${do_copyright} == "yes" ]] ; then bootstrap_copyright bootstrap_cleanup @@ -236,10 +236,10 @@ bootstrap_main() { bootstrap_load_settings # FSS and Featurless Make supports more flexible mode names, but for the purpose of this bootstrap script and avoiding potential problems, keep it simple. - if [[ $modes != "" ]] ; then - for mode in $modes ; do - if [[ $(echo "$mode" | grep -s -o "[^_[:alnum:]+-]") != "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${modes} != "" ]] ; then + for mode in ${modes} ; do + if [[ $(echo "${mode}" | grep -s -o "[^_[:alnum:]+-]") != "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The mode ${c_notice}${mode}${c_error} includes invalid characters, only alphanumeric, underscore, minus, and plus are allowed.${c_reset}" @@ -254,7 +254,7 @@ bootstrap_main() { done fi - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then bootstrap_cleanup return 1 @@ -262,24 +262,24 @@ bootstrap_main() { bootstrap_load_settings_mode - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then bootstrap_cleanup return 1 fi bootstrap_id "build_name" - project_built="${path_build_stage}${variables[$key]}" - if [[ $process != "" ]] ; then - project_built="${project_built}-$process" + project_built="${path_build_stage}${variables[${key}]}" + if [[ ${process} != "" ]] ; then + project_built="${project_built}-${process}" fi project_built_shared="${project_built}.shared" project_built_static="${project_built}.static" - if [[ $modes_available == "" ]] ; then - if [[ $modes != "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${modes_available} == "" ]] ; then + if [[ ${modes} != "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The mode(s) ${c_notice}${modes}${c_error} are not a valid modes, there are no available modes.${c_error}${c_reset}" @@ -293,25 +293,25 @@ bootstrap_main() { fi else let i=0 - for m in $modes_available ; do + for m in ${modes_available} ; do - for mode in $modes ; do + for mode in ${modes} ; do - if [[ "$mode" == "$m" ]] ; then + if [[ "${mode}" == "${m}" ]] ; then let i=1 break fi done - if [[ $i -eq 1 ]] ; then break ; fi + if [[ ${i} -eq 1 ]] ; then break ; fi done - if [[ $i -eq 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${i} -eq 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first - echo -e "${c_error}ERROR: The mode(s) ${c_notice}${modes}${c_error} are not valid modes, they must be one of: ${c_notice}$modes_available${c_error}.${c_reset}" + echo -e "${c_error}ERROR: The mode(s) ${c_notice}${modes}${c_error} are not valid modes, they must be one of: ${c_notice}${modes_available}${c_error}.${c_reset}" bootstrap_print_last fi @@ -323,8 +323,8 @@ bootstrap_main() { fi bootstrap_id "build_name" - if [[ ${variables[$key]} == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${variables[${key}]} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The required setting '${c_notice}build_name${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" @@ -338,8 +338,8 @@ bootstrap_main() { fi bootstrap_id "version_major" - if [[ ${variables[$key]} == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${variables[${key}]} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The required setting '${c_notice}version_major${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" @@ -353,8 +353,8 @@ bootstrap_main() { fi bootstrap_id "version_minor" - if [[ ${variables[$key]} == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${variables[${key}]} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The required setting '${c_notice}version_minor${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" @@ -368,8 +368,8 @@ bootstrap_main() { fi bootstrap_id "version_micro" - if [[ ${variables[$key]} == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${variables[${key}]} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The required setting '${c_notice}version_micro${c_error}' is not specified in the build settings file '${c_notice}${settings_file}${c_error}'.${c_reset}" @@ -382,8 +382,8 @@ bootstrap_main() { return 1 fi - if [[ $path_data == "" || ! -d $path_data ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${path_data} == "" || ! -d ${path_data} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The data directory ${c_notice}${path_data}${c_error} is not a valid directory.${c_reset}" @@ -396,8 +396,8 @@ bootstrap_main() { return 1 fi - if [[ $path_sources == "" || ! -d $path_sources ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${path_sources} == "" || ! -d ${path_sources} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The sources directory ${c_notice}${path_sources}${c_error} is not a valid directory.${c_reset}" @@ -410,8 +410,8 @@ bootstrap_main() { return 1 fi - if [[ $path_work != "" && ! -d $path_work ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${path_work} != "" && ! -d ${path_work} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The work directory ${c_notice}${path_work}${c_error} is not a valid directory.${c_reset}" @@ -425,25 +425,25 @@ bootstrap_main() { fi bootstrap_id "build_name" - project_label="${variables[$key]}" + project_label="${variables[${key}]}" bootstrap_id "version_major" - if [[ "${variables[$key]}" != "" ]] ; then - project_label="${project_label}-${variables[$key]}" + if [[ "${variables[${key}]}" != "" ]] ; then + project_label="${project_label}-${variables[${key}]}" bootstrap_id "version_minor" - if [[ "${variables[$key]}" != "" ]] ; then - project_label="${project_label}.${variables[$key]}" + if [[ "${variables[${key}]}" != "" ]] ; then + project_label="${project_label}.${variables[${key}]}" bootstrap_id "version_micro" - if [[ "${variables[$key]}" != "" ]] ; then - project_label="${project_label}.${variables[$key]}" + if [[ "${variables[${key}]}" != "" ]] ; then + project_label="${project_label}.${variables[${key}]}" fi fi fi - if [[ $operation_failure == "fail-multiple" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${operation_failure} == "fail-multiple" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Only one operation may be specified at a time.${c_reset}" @@ -454,17 +454,17 @@ bootstrap_main() { bootstrap_cleanup return 1 - elif [[ $operation == "build" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + elif [[ ${operation} == "build" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then bootstrap_print_first - echo -e "${c_highlight}Building:${c_reset} ${c_notice}${project_label}${c_highlight}.${c_reset}" + echo -e "${c_highlight}Building:${c_reset} ${c_notice}${project_label}${c_highlight} with modes: ${c_notice}${modes}${c_highlight}.${c_reset}" fi if [[ ! -f ${project_built}.prepared ]] ; then bootstrap_prepare_build - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then bootstrap_cleanup return 1 @@ -473,21 +473,21 @@ bootstrap_main() { bootstrap_operation_build - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then bootstrap_cleanup return 1 fi - elif [[ $operation == "clean" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + elif [[ ${operation} == "clean" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then bootstrap_print_first echo -e "${c_highlight}Cleaning Project:${c_reset} ${c_notice}${project_label}${c_highlight}.${c_reset}" fi bootstrap_operation_clean - elif [[ $operation == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + elif [[ ${operation} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: No operation was given.${c_reset}" @@ -497,7 +497,7 @@ bootstrap_main() { return 1 else - if [[ $verbosity != "quiet" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}" @@ -510,8 +510,8 @@ bootstrap_main() { return 1 fi - if [[ $verbosity != "quiet" ]] ; then - if [[ $failure != "" || $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then + if [[ ${failure} != "" || ${verbosity} != "error" ]] ; then bootstrap_print_last fi fi @@ -523,14 +523,14 @@ bootstrap_main() { bootstrap_handle_colors() { - if [[ $do_color == "light" ]] ; then + if [[ ${do_color} == "light" ]] ; then c_error="\\033[1;31m" c_warning="\\033[0;31m" c_title="\\033[1;34m" c_highlight="\\033[0;34m" c_notice="\\033[0;01m" c_important="\\033[0;35m" - elif [[ $do_color == "none" ]] ; then + elif [[ ${do_color} == "none" ]] ; then c_reset= c_title= c_error= @@ -606,7 +606,7 @@ bootstrap_copyright() { bootstrap_id() { - case $1 in + case ${1} in "build_compiler") let key=0;; "build_indexer") let key=1;; "build_indexer_arguments") let key=2;; @@ -841,15 +841,15 @@ bootstrap_load_settings() { local value= if [[ ! -d ${path_data}build/ ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: No build settings directory '${c_notice}${path_data}build/${c_error}' could not be found or is not a valid directory.${c_reset}" fi let failure=1 - elif [[ ! -f $settings_file ]] ; then - if [[ $verbosity != "quiet" ]] ; then + elif [[ ! -f ${settings_file} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: No settings file ${c_notice}${settings_file}${c_error} could not be found or is not a valid file.${c_reset}" @@ -858,61 +858,61 @@ bootstrap_load_settings() { let failure=1 fi - if [[ $failure != "" ]] ; then + if [[ ${failure} != "" ]] ; then return 1 fi # Get available modes. - if [[ $modes_available == "" ]] ; then - modes_available=$(grep -s -o "^[[:space:]]*modes[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*modes\>||" -e 's|^[[:space:]]*||') + if [[ ${modes_available} == "" ]] ; then + modes_available=$(grep -s -o "^[[:space:]]*modes[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*modes\>||" -e 's|^[[:space:]]*||') fi # Get default modes. - modes_default=$(grep -s -o "^[[:space:]]*modes_default[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*modes_default\>||" -e 's|^[[:space:]]*||') + modes_default=$(grep -s -o "^[[:space:]]*modes_default[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*modes_default\>||" -e 's|^[[:space:]]*||') # Use default modes if no mode is explicitly provided. - if [[ $modes == "" ]] ; then - modes=$modes_default + if [[ ${modes} == "" ]] ; then + modes=${modes_default} fi # Single value Objects. for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard 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_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static 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 - bootstrap_id "$i" + bootstrap_id "${i}" - if [[ $key == "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${key} == "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then 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 - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi else - if [[ $(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" $settings_file) != "" ]] ; then - value=$(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*${i}\>||" -e 's|^[[:space:]]*||') - variables[$key]="$value" + if [[ $(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" ${settings_file}) != "" ]] ; then + value=$(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" ${settings_file} | sed -e "s|^[[:space:]]*${i}\>||" -e 's|^[[:space:]]*||') + variables[${key}]="${value}" key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi - elif [[ $(grep -s -o "^[[:space:]]*${i}\$" $settings_file) != "" ]] ; then - variables[$key]="" + elif [[ $(grep -s -o "^[[:space:]]*${i}\$" ${settings_file}) != "" ]] ; then + variables[${key}]="" key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi else key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi fi fi @@ -921,41 +921,41 @@ bootstrap_load_settings() { # Multi value Objects. for i in build_indexer_arguments build_libraries build_libraries_shared build_libraries_static build_objects_library build_objects_library_shared build_objects_library_static build_objects_program build_objects_program_shared build_objects_program_static 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_program build_sources_program_shared build_sources_program_static build_sources_script build_sources_setting 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 ; do - bootstrap_id "$i" + bootstrap_id "${i}" - if [[ $key == "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${key} == "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then 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 - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi else - if [[ $(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" $settings_file) != "" ]] ; then - value=$(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*${i}\>||" -e 's|^[[:space:]]*||') - variables[$key]="$value" + if [[ $(grep -s -o "^[[:space:]]*${i}[[:space:]].*\$" ${settings_file}) != "" ]] ; then + value=$(grep -s -o "^[[: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 - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi - elif [[ $(grep -s -o "^[[:space:]]*${i}\$" $settings_file) != "" ]] ; then - variables[$key]="" + elif [[ $(grep -s -o "^[[:space:]]*${i}\$" ${settings_file}) != "" ]] ; then + variables[${key}]="" key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi else key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi fi fi @@ -968,46 +968,47 @@ bootstrap_load_settings_mode() { local m= local value= - for m in $modes ; do + for m in ${modes} ; do # Single value Objects. for i in build_compiler build_indexer build_language build_name build_script build_shared build_sources_object build_sources_object_shared build_sources_object_static build_static has_path_standard 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_object preserve_path_headers process_post process_pre search_exclusive search_shared search_static 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 bootstrap_id "${i}-mode" - if [[ $key == "" ]] ; 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}" + if [[ ${key} == "" ]] ; 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 - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi else - if [[ $(grep -s -o "^[[:space:]]*${i}-${m}[[:space:]].*\$" $settings_file) != "" ]] ; then - value=$(grep -s -o "^[[: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" + + if [[ $(grep -s -o "^[[:space:]]*${i}-${m}[[:space:]].*\$" ${settings_file}) != "" ]] ; then + value=$(grep -s -o "^[[: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 - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi - elif [[ $(grep -s -o "^[[:space:]]*${i}-${m}\$" $settings_file) != "" ]] ; then - variables[$key]="" + elif [[ $(grep -s -o "^[[:space:]]*${i}-${m}\$" ${settings_file}) != "" ]] ; then + variables[${key}]="" key= bootstrap_id "has-${i}-mode" - if [[ $key != "" ]] ; then - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi else key= bootstrap_id "has-${i}-mode" - if [[ $key != "" ]] ; then - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi fi fi @@ -1018,39 +1019,39 @@ bootstrap_load_settings_mode() { bootstrap_id "${i}-mode" - if [[ $key == "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${key} == "" ]] ; 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 - variables[$key]="no" + if [[ ${key} != "" ]] ; then + variables[${key}]="no" fi else - if [[ $(grep -s -o "^[[:space:]]*${i}-${m}[[:space:]].*\$" $settings_file) != "" ]] ; then - value=$(grep -s -o "^[[:space:]]*${i}-${m}[[:space:]].*\$" $settings_file | sed -e "s|^[[:space:]]*${i}-${m}\>||" -e 's|^[[:space:]]*||') - variables[$key]="$value" + if [[ $(grep -s -o "^[[:space:]]*${i}-${m}[[:space:]].*\$" ${settings_file}) != "" ]] ; then + value=$(grep -s -o "^[[: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 - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi - elif [[ $(grep -s -o "^[[:space:]]*${i}-${m}\$" $settings_file) != "" ]] ; then - variables[$key]="" + elif [[ $(grep -s -o "^[[:space:]]*${i}-${m}\$" ${settings_file}) != "" ]] ; then + variables[${key}]="" key= bootstrap_id "has-${i}" - if [[ $key != "" ]] ; then - variables[$key]="yes" + if [[ ${key} != "" ]] ; then + variables[${key}]="yes" fi else key= bootstrap_id "has-${i}-mode" - if [[ $key != "" ]] ; then - variables[$key]="no" + if [[ ${key} != "" && ${variables[${key}]} != "yes" ]] ; then + variables[${key}]="no" fi fi fi @@ -1059,13 +1060,13 @@ bootstrap_load_settings_mode() { } bootstrap_prepare_build() { - local alt=$1 + local alt=${1} local i= - mkdir $verbose_common -p ${path_build}{documents,includes,libraries/{script,shared,static},objects/{script,shared,static},programs/{script,shared,static},settings,stage} || failure=1 + mkdir ${verbose_common} -p ${path_build}{documents,includes,libraries/{script,shared,static},objects/{script,shared,static},programs/{script,shared,static},settings,stage} || failure=1 - if [[ $failure != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${failure} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Failed to create build directories in '${c_notice}${path_build}${c_error}'.${c_reset}" fi @@ -1073,18 +1074,18 @@ bootstrap_prepare_build() { fi bootstrap_id "path_headers-mode" - if [[ ${variables[$key]} != "" ]] ; then - mkdir $verbose_common -p ${path_build}includes/${variables[$key]} || failure=1 + if [[ ${variables[${key}]} != "" ]] ; then + mkdir ${verbose_common} -p ${path_build}includes/${variables[${key}]} || failure=1 else bootstrap_id "path_headers" - if [[ ${variables[$key]} != "" ]] ; then - mkdir $verbose_common -p ${path_build}includes/${variables[$key]} || failure=1 + if [[ ${variables[${key}]} != "" ]] ; then + mkdir ${verbose_common} -p ${path_build}includes/${variables[${key}]} || failure=1 fi fi - if [[ $failure != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${failure} != "" ]] ; 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}" fi @@ -1093,7 +1094,7 @@ bootstrap_prepare_build() { touch ${project_built}-${settings_name}.prepared - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -1105,240 +1106,240 @@ bootstrap_operation_build() { local n= local version_file= local version_target= - local alt=$1 + local alt=${1} local directory= local key= bootstrap_id "build_compiler" - local build_compiler=${variables[$key]} + local build_compiler=${variables[${key}]} bootstrap_id "build_indexer" - local build_indexer=${variables[$key]} + local build_indexer=${variables[${key}]} bootstrap_id "build_indexer_arguments" - local build_indexer_arguments=${variables[$key]} + local build_indexer_arguments=${variables[${key}]} bootstrap_id "build_name" - local build_name=${variables[$key]} + local build_name=${variables[${key}]} bootstrap_id "build_shared" - local build_shared=${variables[$key]} + local build_shared=${variables[${key}]} bootstrap_id "build_static" - local build_static=${variables[$key]} + local build_static=${variables[${key}]} bootstrap_id "defines" - local defines=${variables[$key]} + local defines=${variables[${key}]} bootstrap_id "defines_library" - local defines_library=${variables[$key]} + local defines_library=${variables[${key}]} bootstrap_id "defines_library_shared" - local defines_library_shared=${variables[$key]} + local defines_library_shared=${variables[${key}]} bootstrap_id "defines_library_static" - local defines_library_static=${variables[$key]} + local defines_library_static=${variables[${key}]} bootstrap_id "defines_object" - local defines_object=${variables[$key]} + local defines_object=${variables[${key}]} bootstrap_id "defines_object_shared" - local defines_object_shared=${variables[$key]} + local defines_object_shared=${variables[${key}]} bootstrap_id "defines_object_static" - local defines_object_static=${variables[$key]} + local defines_object_static=${variables[${key}]} bootstrap_id "defines_program" - local defines_program=${variables[$key]} + local defines_program=${variables[${key}]} bootstrap_id "defines_program_shared" - local defines_program_shared=${variables[$key]} + local defines_program_shared=${variables[${key}]} bootstrap_id "defines_program_static" - local defines_program_static=${variables[$key]} + local defines_program_static=${variables[${key}]} bootstrap_id "defines_shared" - local defines_shared=${variables[$key]} + local defines_shared=${variables[${key}]} bootstrap_id "defines_static" - local defines_static=${variables[$key]} + local defines_static=${variables[${key}]} bootstrap_id "flags" - local flags=${variables[$key]} + local flags=${variables[${key}]} bootstrap_id "flags_library" - local flags_library=${variables[$key]} + local flags_library=${variables[${key}]} bootstrap_id "flags_library_shared" - local flags_library_shared=${variables[$key]} + local flags_library_shared=${variables[${key}]} bootstrap_id "flags_library_static" - local flags_library_static=${variables[$key]} + local flags_library_static=${variables[${key}]} bootstrap_id "flags_object" - local flags_object=${variables[$key]} + local flags_object=${variables[${key}]} bootstrap_id "flags_object_shared" - local flags_object_shared=${variables[$key]} + local flags_object_shared=${variables[${key}]} bootstrap_id "flags_object_static" - local flags_object_static=${variables[$key]} + local flags_object_static=${variables[${key}]} bootstrap_id "flags_program" - local flags_program=${variables[$key]} + local flags_program=${variables[${key}]} bootstrap_id "flags_program_shared" - local flags_program_shared=${variables[$key]} + local flags_program_shared=${variables[${key}]} bootstrap_id "flags_program_static" - local flags_program_static=${variables[$key]} + local flags_program_static=${variables[${key}]} bootstrap_id "flags_shared" - local flags_shared=${variables[$key]} + local flags_shared=${variables[${key}]} bootstrap_id "flags_static" - local flags_static=${variables[$key]} + local flags_static=${variables[${key}]} bootstrap_id "build_libraries" - local libraries=${variables[$key]} + local libraries=${variables[${key}]} bootstrap_id "build_libraries_shared" - local libraries_shared=${variables[$key]} + local libraries_shared=${variables[${key}]} bootstrap_id "build_libraries_static" - local libraries_static=${variables[$key]} + local libraries_static=${variables[${key}]} bootstrap_id "build_objects_library" - local objects_library=${variables[$key]} + local objects_library=${variables[${key}]} bootstrap_id "build_objects_library_shared" - local objects_library_shared=${variables[$key]} + local objects_library_shared=${variables[${key}]} bootstrap_id "build_objects_library_static" - local objects_library_static=${variables[$key]} + local objects_library_static=${variables[${key}]} bootstrap_id "build_objects_program" - local objects_program=${variables[$key]} + local objects_program=${variables[${key}]} bootstrap_id "build_objects_program_shared" - local objects_program_shared=${variables[$key]} + local objects_program_shared=${variables[${key}]} bootstrap_id "build_objects_program_static" - local objects_program_static=${variables[$key]} + local objects_program_static=${variables[${key}]} bootstrap_id "path_headers" - local path_headers=${variables[$key]} + local path_headers=${variables[${key}]} bootstrap_id "preserve_path_headers" - local preserve_path_headers=${variables[$key]} + local preserve_path_headers=${variables[${key}]} bootstrap_id "path_library_script" - local path_library_script=${variables[$key]} + local path_library_script=${variables[${key}]} bootstrap_id "path_library_shared" - local path_library_shared=${variables[$key]} + local path_library_shared=${variables[${key}]} bootstrap_id "path_library_static" - local path_library_static=${variables[$key]} + local path_library_static=${variables[${key}]} bootstrap_id "path_object_script" - local path_object_script=${variables[$key]} + local path_object_script=${variables[${key}]} bootstrap_id "path_object_shared" - local path_object_shared=${variables[$key]} + local path_object_shared=${variables[${key}]} bootstrap_id "path_object_static" - local path_object_static=${variables[$key]} + local path_object_static=${variables[${key}]} bootstrap_id "path_program_script" - local path_program_script=${variables[$key]} + local path_program_script=${variables[${key}]} bootstrap_id "path_program_shared" - local path_program_shared=${variables[$key]} + local path_program_shared=${variables[${key}]} bootstrap_id "path_program_static" - local path_program_static=${variables[$key]} + local path_program_static=${variables[${key}]} bootstrap_id "has_path_standard" - local has_path_standard=${variables[$key]} + local has_path_standard=${variables[${key}]} bootstrap_id "search_exclusive" - local search_exclusive=${variables[$key]} + local search_exclusive=${variables[${key}]} bootstrap_id "search_shared" - local search_shared=${variables[$key]} + local search_shared=${variables[${key}]} bootstrap_id "search_static" - local search_static=${variables[$key]} + local search_static=${variables[${key}]} bootstrap_id "build_sources_documentation" - local sources_documentation=${variables[$key]} + local sources_documentation=${variables[${key}]} bootstrap_id "build_sources_headers" - local sources_headers=${variables[$key]} + local sources_headers=${variables[${key}]} bootstrap_id "build_sources_library" - local sources_library=${variables[$key]} + local sources_library=${variables[${key}]} bootstrap_id "build_sources_library_shared" - local sources_library_shared=${variables[$key]} + local sources_library_shared=${variables[${key}]} bootstrap_id "build_sources_library_static" - local sources_library_static=${variables[$key]} + local sources_library_static=${variables[${key}]} bootstrap_id "build_sources_object" - local sources_object=${variables[$key]} + local sources_object=${variables[${key}]} bootstrap_id "build_sources_object_shared" - local sources_object_shared=${variables[$key]} + local sources_object_shared=${variables[${key}]} bootstrap_id "build_sources_object_static" - local sources_object_static=${variables[$key]} + local sources_object_static=${variables[${key}]} bootstrap_id "build_sources_program" - local sources_program=${variables[$key]} + local sources_program=${variables[${key}]} bootstrap_id "build_sources_program_shared" - local sources_program_shared=${variables[$key]} + local sources_program_shared=${variables[${key}]} bootstrap_id "build_sources_program_static" - local sources_program_static=${variables[$key]} + local sources_program_static=${variables[${key}]} bootstrap_id "build_sources_script" - local sources_script=${variables[$key]} + local sources_script=${variables[${key}]} bootstrap_id "build_sources_setting" - local sources_setting=${variables[$key]} + local sources_setting=${variables[${key}]} bootstrap_id "version_file" - local version_file_value=${variables[$key]} + local version_file_value=${variables[${key}]} bootstrap_id "version_major" - local version_major=${variables[$key]} + local version_major=${variables[${key}]} bootstrap_id "version_major_prefix" - local version_major_prefix=${variables[$key]} + local version_major_prefix=${variables[${key}]} bootstrap_id "version_minor" - local version_minor=${variables[$key]} + local version_minor=${variables[${key}]} bootstrap_id "version_minor_prefix" - local version_minor_prefix=${variables[$key]} + local version_minor_prefix=${variables[${key}]} bootstrap_id "version_micro" - local version_micro=${variables[$key]} + local version_micro=${variables[${key}]} bootstrap_id "version_micro_prefix" - local version_micro_prefix=${variables[$key]} + local version_micro_prefix=${variables[${key}]} bootstrap_id "version_nano" - local version_nano=${variables[$key]} + local version_nano=${variables[${key}]} bootstrap_id "version_nano_prefix" - local version_nano_prefix=${variables[$key]} + local version_nano_prefix=${variables[${key}]} bootstrap_id "version_target" - local version_target_value=${variables[$key]} + local version_target_value=${variables[${key}]} local links= local sources= @@ -1369,8 +1370,8 @@ bootstrap_operation_build() { bootstrap_operation_build_prepare_remaining - if [[ $build_shared == "yes" && -f ${project_built_shared}.built || $build_static == "yes" && -f ${project_built_static}.built ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${build_shared} == "yes" && -f ${project_built_shared}.built || ${build_static} == "yes" && -f ${project_built_static}.built ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: This project has already been built.${c_reset}" fi @@ -1381,10 +1382,10 @@ bootstrap_operation_build() { local arguments_shared="-L${path_build}libraries/${path_library_shared}" local arguments_static="-L${path_build}libraries/${path_library_static}" - if [[ $path_work != "" ]] ; then - arguments_include="$arguments_include -I${path_work}includes/" - arguments_shared="$arguments_shared -L${path_work}libraries/${path_library_shared}" - arguments_static="$arguments_static -L${path_work}libraries/${path_library_static}" + if [[ ${path_work} != "" ]] ; then + arguments_include="${arguments_include} -I${path_work}includes/" + arguments_shared="${arguments_shared} -L${path_work}libraries/${path_library_shared}" + arguments_static="${arguments_static} -L${path_work}libraries/${path_library_static}" fi bootstrap_operation_build_validate_paths @@ -1397,252 +1398,252 @@ bootstrap_operation_build() { bootstrap_operation_build_validate_build - if [[ $failure != "" ]] ; then + if [[ ${failure} != "" ]] ; then return 1 fi - if [[ $sources_documentation != "" ]] ; then - for i in $sources_documentation ; do - directory=$(dirname $i) + if [[ ${sources_documentation} != "" ]] ; then + for i in ${sources_documentation} ; do + directory=$(dirname ${i}) - if [[ $directory == "." ]] ; then - cp $verbose_common -R ${path_documentation}${i} ${path_build}documentation/ || failure=1 + if [[ ${directory} == "." ]] ; then + cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/ || failure=1 else - mkdir $verbose_common -p ${path_build}documentation/${directory} || failure=1 + mkdir ${verbose_common} -p ${path_build}documentation/${directory} || failure=1 - if [[ $failure == "" ]] ; then - cp $verbose_common -R ${path_documentation}${i} ${path_build}documentation/${directory}/ || failure=1 + if [[ ${failure} == "" ]] ; then + cp ${verbose_common} -R ${path_documentation}${i} ${path_build}documentation/${directory}/ || failure=1 fi fi done fi - if [[ $sources_setting != "" ]] ; then - for i in $sources_setting ; do - directory=$(dirname $i) + if [[ ${sources_setting} != "" ]] ; then + for i in ${sources_setting} ; do + directory=$(dirname ${i}) - if [[ $directory == "." ]] ; then - cp $verbose_common -R ${path_settings}${i} ${path_build}settings/ || failure=1 + if [[ ${directory} == "." ]] ; then + cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/ || failure=1 else - mkdir $verbose_common -p ${path_build}settings/${directory} || failure=1 + mkdir ${verbose_common} -p ${path_build}settings/${directory} || failure=1 - if [[ $failure == "" ]] ; then - cp $verbose_common -R ${path_settings}${i} ${path_build}settings/${directory}/ || failure=1 + if [[ ${failure} == "" ]] ; then + cp ${verbose_common} -R ${path_settings}${i} ${path_build}settings/${directory}/ || failure=1 fi fi done fi - if [[ $failure == "" && $sources_headers != "" ]] ; then - if [[ $preserve_path_headers == "yes" ]] ; then - for i in $sources_headers ; do - directory=$(dirname $i) + if [[ ${failure} == "" && ${sources_headers} != "" ]] ; then + if [[ ${preserve_path_headers} == "yes" ]] ; then + for i in ${sources_headers} ; do + directory=$(dirname ${i}) - if [[ $directory == "." ]] ; then - cp $verbose_common -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 + if [[ ${directory} == "." ]] ; then + cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 else if [[ ! -d ${path_build}includes/${path_headers}${directory} ]] ; then - mkdir $verbose_common -p ${path_build}includes/${path_headers}${directory} || failure=1 + mkdir ${verbose_common} -p ${path_build}includes/${path_headers}${directory} || failure=1 fi - if [[ $failure == "" ]] ; then - cp $verbose_common -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers}${i} || failure=1 + if [[ ${failure} == "" ]] ; then + cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers}${i} || failure=1 fi fi done else - for i in $sources_headers ; do - cp $verbose_common -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 + for i in ${sources_headers} ; do + cp ${verbose_common} -f ${path_sources}${path_language}${i} ${path_build}includes/${path_headers} || failure=1 done fi fi - if [[ $failure == "" && $build_shared == "yes" && ! -f ${project_built_shared}.built ]] ; then - if [[ $sources_object != "" || $sources_object_shared != "" ]] ; then + if [[ ${failure} == "" && ${build_shared} == "yes" && ! -f ${project_built_shared}.built ]] ; then + if [[ ${sources_object} != "" || ${sources_object_shared} != "" ]] ; then sources= let count=0 # Sources object only allows for a single value. - if [[ $sources_object_shared != "" ]] ; then - for i in $sources_object_shared ; do + if [[ ${sources_object_shared} != "" ]] ; then + for i in ${sources_object_shared} ; do let count++ done - if [[ $count -gt 1 ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${count} -gt 1 ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_shared${c_warning}' found, only using the first one found is going to be used.${c_reset}" fi fi - for i in $sources_object_shared ; do + for i in ${sources_object_shared} ; do sources="${path_sources_object}${path_language}${i} " break done else - for i in $sources_object ; do + for i in ${sources_object} ; do let count++ done - if [[ $count -gt 1 ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${count} -gt 1 ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}" fi fi - for i in $sources_object ; do + for i in ${sources_object} ; do sources="${path_sources_object}${path_language}${i} " break done fi - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler $sources -c -o ${path_build}objects/${path_object_shared}${build_name}.o $arguments_shared $arguments_include $libraries $libraries_shared $flags $flags_shared $flags_object $flags_object_shared $defines $defines_shared $defines_object $defines_object_shared $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} fi - $build_compiler $sources -c -o ${path_build}objects/${path_object_shared}${build_name}.o $arguments_shared $arguments_include $libraries $libraries_shared $flags $flags_shared $flags_object $flags_object_shared $defines $defines_shared $defines_object $defines_object_shared $define_extra || failure=1 + ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_shared}${build_name}.o ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_object} ${flags_object_shared} ${defines} ${defines_shared} ${defines_object} ${defines_object_shared} ${define_extra} || failure=1 fi - if [[ $sources_library != "" || $sources_library_shared != "" ]] ; then + if [[ ${sources_library} != "" || ${sources_library_shared} != "" ]] ; then sources= - if [[ $objects_library != "" || $objects_library_shared != "" ]] ; then - for i in $objects_library $objects_library_shared ; do + if [[ ${objects_library} != "" || ${objects_library_shared} != "" ]] ; then + for i in ${objects_library} ${objects_library_shared} ; do sources="${sources}${path_build}objects/${path_object_shared}${i} " done fi - for i in $sources_library $sources_library_shared ; do + for i in ${sources_library} ${sources_library_shared} ; do sources="${sources}${path_sources}${path_language}${i} " done - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler $sources -shared -Wl,-soname,lib${build_name}.so${version_target} -o ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_file} $arguments_shared $arguments_include $libraries $libraries_shared $flags $flags_shared $flags_library $flags_library_shared $defines $defines_shared $defines_library $defines_library_shared $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -shared -Wl,-soname,lib${build_name}.so${version_target} -o ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_file} ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_library} ${flags_library_shared} ${defines} ${defines_shared} ${defines_library} ${defines_library_shared} ${define_extra} fi - $build_compiler $sources -shared -Wl,-soname,lib${build_name}.so${version_target} -o ${path_build}libraries/${path_library_shared}lib${build_name}.so$version_file $arguments_shared $arguments_include $libraries $libraries_shared $flags $flags_shared $flags_library $flags_library_shared $defines $defines_shared $defines_library $defines_library_shared $define_extra || failure=1 + ${build_compiler} ${sources} -shared -Wl,-soname,lib${build_name}.so${version_target} -o ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_file} ${arguments_shared} ${arguments_include} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_library} ${flags_library_shared} ${defines} ${defines_shared} ${defines_library} ${defines_library_shared} ${define_extra} || failure=1 - if [[ $failure == "" ]] ; then - if [[ $version_file_value != "major" ]] ; then - if [[ $version_file_value == "minor" ]] ; then - ln $verbose_common -sf lib${build_name}.so${version_file} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major} || failure=1 + if [[ ${failure} == "" ]] ; then + if [[ ${version_file_value} != "major" ]] ; then + if [[ ${version_file_value} == "minor" ]] ; then + ln ${verbose_common} -sf lib${build_name}.so${version_file} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major} || failure=1 else - ln $verbose_common -sf lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major} || failure=1 + ln ${verbose_common} -sf lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major} || failure=1 - if [[ $failure == "" ]] ; then - if [[ $version_file_value == "micro" ]] ; then - ln $verbose_common -sf lib$build_name.so$version_file ${path_build}libraries/${path_library_shared}lib$build_name.so$version_major_prefix$version_major$version_minor_prefix$version_minor || failure=1 + if [[ ${failure} == "" ]] ; then + if [[ ${version_file_value} == "micro" ]] ; then + ln ${verbose_common} -sf lib${build_name}.so${version_file} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor} || failure=1 else - ln $verbose_common -sf lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor} || failure=1 + ln ${verbose_common} -sf lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor} || failure=1 - if [[ $failure == "" ]] ; then - ln $verbose_common -sf lib${build_name}.so${version_file} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro} || failure=1 + if [[ ${failure} == "" ]] ; then + ln ${verbose_common} -sf lib${build_name}.so${version_file} ${path_build}libraries/${path_library_shared}lib${build_name}.so${version_major_prefix}${version_major}${version_minor_prefix}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro} || failure=1 fi fi fi fi fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then ln ${verbose_common} -sf lib${build_name}.so${version_major_prefix}${version_major} ${path_build}libraries/${path_library_shared}lib${build_name}.so || failure=1 fi fi fi - if [[ $failure == "" && $sources_program != "" ]] ; then + if [[ ${failure} == "" && ${sources_program} != "" ]] ; then sources= links= - if [[ $sources_library != "" || $sources_library_shared != "" ]] ; then - links="-l$build_name " + if [[ ${sources_library} != "" || ${sources_library_shared} != "" ]] ; then + links="-l${build_name} " fi - if [[ $objects_program != "" || $objects_program_shared != "" ]] ; then - for i in $objects_program $objects_program_shared ; do + if [[ ${objects_program} != "" || ${objects_program_shared} != "" ]] ; then + for i in ${objects_program} ${objects_program_shared} ; do sources="${sources}${path_build}objects/${path_object_shared}${i} " done fi - for i in $sources_program $sources_program_shared ; do + for i in ${sources_program} ${sources_program_shared} ; do sources="${sources}${path_sources}${path_language}${i} " done - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler $sources -o ${path_build}programs/${path_program_shared}${build_name} $arguments_shared $arguments_include $links $libraries $libraries_shared $flags $flags_shared $flags_program $flags_program_shared $defines $defines_shared $defines_program $defines_program_shared $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -o ${path_build}programs/${path_program_shared}${build_name} ${arguments_shared} ${arguments_include} ${links} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_program} ${flags_program_shared} ${defines} ${defines_shared} ${defines_program} ${defines_program_shared} ${define_extra} fi - $build_compiler $sources -o ${path_build}programs/${path_program_shared}${build_name} $arguments_shared $arguments_include $links $libraries $libraries_shared $flags $flags_shared $flags_program $flags_program_shared $defines $defines_shared $defines_program $defines_program_shared $define_extra || failure=1 + ${build_compiler} ${sources} -o ${path_build}programs/${path_program_shared}${build_name} ${arguments_shared} ${arguments_include} ${links} ${libraries} ${libraries_shared} ${flags} ${flags_shared} ${flags_program} ${flags_program_shared} ${defines} ${defines_shared} ${defines_program} ${defines_program_shared} ${define_extra} || failure=1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then touch ${project_built_shared}-${settings_name}.built fi fi - if [[ $failure == "" && $build_static == "yes" && ! -f ${project_built_static}.built ]] ; then - if [[ $sources_object != "" || $sources_object_static != "" ]] ; then + if [[ ${failure} == "" && ${build_static} == "yes" && ! -f ${project_built_static}.built ]] ; then + if [[ ${sources_object} != "" || ${sources_object_static} != "" ]] ; then let count=0 # Sources object only allows for a single value. - if [[ $sources_object_static != "" ]] ; then - for i in $sources_object_static ; do + if [[ ${sources_object_static} != "" ]] ; then + for i in ${sources_object_static} ; do let count++ done - if [[ $count -gt 1 ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${count} -gt 1 ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object_static${c_warning}' found, only using the first one found is going to be used.${c_reset}" fi fi - for i in $sources_object_static ; do + for i in ${sources_object_static} ; do sources="${path_sources_object}${path_language}${i} " break done else - for i in $sources_object ; do + for i in ${sources_object} ; do let count++ done - if [[ $count -gt 1 ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${count} -gt 1 ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then echo -e "${c_warning}WARNING: Multiple '${c_notice}sources_object${c_warning}' found, only using the first one found is going to be used.${c_reset}" fi fi - for i in $sources_object ; do + for i in ${sources_object} ; do sources="${path_sources_object}${path_language}${i} " break done fi - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler $sources -c -o ${path_build}objects/${path_object_static}${build_name}.o $arguments_static $arguments_include $libraries $libraries_static $flags $flags_static $flags_object $flags_object_static $defines $defines_static $defines_object $defines_object_static $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} fi - $build_compiler $sources -c -o ${path_build}objects/${path_object_static}${build_name}.o $arguments_static $arguments_include $libraries $libraries_static $flags $flags_static $flags_object $flags_object_static $defines $defines_static $defines_object $defines_object_static $define_extra || failure=1 + ${build_compiler} ${sources} -c -o ${path_build}objects/${path_object_static}${build_name}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_object} ${flags_object_static} ${defines} ${defines_static} ${defines_object} ${defines_object_static} ${define_extra} || failure=1 fi - if [[ $sources_library != "" || $sources_library_static != "" ]] ; then + if [[ ${sources_library} != "" || ${sources_library_static} != "" ]] ; then sources= - if [[ $objects_library != "" || $objects_library_static != "" ]] ; then - for i in $objects_library $objects_library_static ; do + if [[ ${objects_library} != "" || ${objects_library_static} != "" ]] ; then + for i in ${objects_library} ${objects_library_static} ; do sources="${sources}${path_build}objects/${path_object_static}${i} " done fi - for i in $sources_library $sources_library_static ; do - directory=$(dirname $i) - n=$(basename $i | sed -e 's|\.c$||') + for i in ${sources_library} ${sources_library_static} ; do + directory=$(dirname ${i}) + n=$(basename ${i} | sed -e 's|\.c$||') - if [[ $directory != "." && ! -d ${path_build}objects/${directory} ]] ; then - mkdir $verbose_common -p ${path_build}objects/${directory} + if [[ ${directory} != "." && ! -d ${path_build}objects/${directory} ]] ; then + mkdir ${verbose_common} -p ${path_build}objects/${directory} - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 break; @@ -1650,61 +1651,61 @@ bootstrap_operation_build() { fi # These are objects created by the static build step rather than objects created by the object build step. - sources="${sources}${path_build}objects/$directory/$n.o " + sources="${sources}${path_build}objects/${directory}/${n}.o " - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o $arguments_static $arguments_include $libraries $libraries_static $flags $flags_static $flags_library $flags_library_static $defines $defines_static $defines_library $defines_library_static $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} fi - $build_compiler ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o $arguments_static $arguments_include $libraries $libraries_static $flags $flags_static $flags_library $flags_library_static $defines $defines_static $defines_library $defines_library_static $define_extra || failure=1 + ${build_compiler} ${path_sources}${path_language}${i} -c -static -o ${path_build}objects/${directory}/${n}.o ${arguments_static} ${arguments_include} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_library} ${flags_library_static} ${defines} ${defines_static} ${defines_library} ${defines_library_static} ${define_extra} || failure=1 - if [[ $failure != "" ]] ; then + if [[ ${failure} != "" ]] ; then break; fi done - if [[ $failure == "" && ( $sources_library != "" || $sources_library_static != "" ) ]] ; then + if [[ ${failure} == "" && ( ${sources_library} != "" || ${sources_library_static} != "" ) ]] ; then - if [[ $verbosity == "verbose" ]] ; then - echo $build_indexer $build_indexer_arguments ${path_build}libraries/${path_library_static}lib${build_name}.a $sources + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_indexer} ${build_indexer_arguments} ${path_build}libraries/${path_library_static}lib${build_name}.a ${sources} fi - $build_indexer $build_indexer_arguments ${path_build}libraries/${path_library_static}lib${build_name}.a $sources || failure=1 + ${build_indexer} ${build_indexer_arguments} ${path_build}libraries/${path_library_static}lib${build_name}.a ${sources} || failure=1 fi fi - if [[ $failure == "" && $sources_program != "" ]] ; then + if [[ ${failure} == "" && ${sources_program} != "" ]] ; then sources= links= - if [[ $sources_library != "" || $sources_library_static != "" ]] ; then + if [[ ${sources_library} != "" || ${sources_library_static} != "" ]] ; then links="-l${build_name} " fi - if [[ $objects_program != "" || $objects_program_static != "" ]] ; then - for i in $objects_program $objects_program_static ; do + if [[ ${objects_program} != "" || ${objects_program_static} != "" ]] ; then + for i in ${objects_program} ${objects_program_static} ; do sources="${sources}${path_build}objects/${path_object_static}${i} " done fi - for i in $sources_program $sources_program_static ; do + for i in ${sources_program} ${sources_program_static} ; do sources="${sources}${path_sources}${path_language}${i} " done - if [[ $verbosity == "verbose" ]] ; then - echo $build_compiler $sources -static -o ${path_build}programs/${path_program_static}${build_name} $arguments_static $arguments_include $links $libraries $libraries_static $flags $flags_static $flags_program $flags_program_static $defines $defines_static $defines_program $defines_program_static $define_extra + if [[ ${verbosity} == "verbose" ]] ; then + echo ${build_compiler} ${sources} -static -o ${path_build}programs/${path_program_static}${build_name} ${arguments_static} ${arguments_include} ${links} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_program} ${flags_program_static} ${defines} ${defines_static} ${defines_program} ${defines_program_static} ${define_extra} fi - $build_compiler $sources -static -o ${path_build}programs/${path_program_static}${build_name} $arguments_static $arguments_include $links $libraries $libraries_static $flags $flags_static $flags_program $flags_program_static $defines $defines_static $defines_program $defines_program_static $define_extra || failure=1 + ${build_compiler} ${sources} -static -o ${path_build}programs/${path_program_static}${build_name} ${arguments_static} ${arguments_include} ${links} ${libraries} ${libraries_static} ${flags} ${flags_static} ${flags_program} ${flags_program_static} ${defines} ${defines_static} ${defines_program} ${defines_program_static} ${define_extra} || failure=1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then touch ${project_built_static}-${settings_name}.built fi fi - if [[ $failure != "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} != "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Failed to build.${c_reset}" @@ -1715,7 +1716,7 @@ bootstrap_operation_build() { return 1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -1726,181 +1727,181 @@ bootstrap_operation_build_prepare_defaults() { local key= bootstrap_id "has-version_major_prefix-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-version_major_prefix" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then version_major_prefix="." fi fi bootstrap_id "has-version_minor_prefix-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-version_minor_prefix" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then version_minor_prefix="." fi fi bootstrap_id "has-version_micro_prefix-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-version_micro_prefix" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then version_micro_prefix="." fi fi bootstrap_id "has-version_nano_prefix-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-version_nano_prefix" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then version_nano_prefix="." fi fi bootstrap_id "has-build_compiler-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-build_compiler" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then build_compiler="gcc" fi fi bootstrap_id "has-build_indexer-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-build_indexer" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then build_indexer="ar" fi fi bootstrap_id "has-path_library_script-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_library_script" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_library_script="script/" fi fi bootstrap_id "has-path_library_shared-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_library_shared" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_library_shared="shared/" fi fi bootstrap_id "has-path_library_static-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_library_static" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_library_static="static/" fi fi bootstrap_id "has-path_object_script-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_object_script" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_object_script="script/" fi fi bootstrap_id "has-path_object_shared-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_object_shared" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_object_shared="shared/" fi fi bootstrap_id "has-path_object_static-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_object_static" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_object_static="static/" fi fi bootstrap_id "has-path_program_script-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_program_script" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_program_script="script/" fi fi bootstrap_id "has-path_program_shared-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_program_shared" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_program_shared="shared/" fi fi bootstrap_id "has-path_program_static-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_program_static" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_program_static="static/" fi fi bootstrap_id "has-path_sources-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_sources" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_sources="sources/" fi fi bootstrap_id "has-path_sources_object-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-path_sources_object" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then path_sources_object="sources/" fi fi bootstrap_id "has-has_path_standard-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-has_path_standard" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then has_path_standard="yes" fi fi bootstrap_id "has-search_shared-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-search_shared" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then search_shared="yes" fi fi bootstrap_id "has-build_shared-mode" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then bootstrap_id "has-build_shared" - if [[ ${variables[$key]} != "yes" ]] ; then + if [[ ${variables[${key}]} != "yes" ]] ; then build_shared="yes" fi fi @@ -1910,108 +1911,108 @@ bootstrap_operation_build_prepare_defines() { local key= bootstrap_id "defines-mode" - if [[ $defines == "" ]] ; then - defines=${variables[$key]} + if [[ ${defines} == "" ]] ; then + defines=${variables[${key}]} else - defines="$defines ${variables[$key]}" + defines="${defines} ${variables[${key}]}" fi bootstrap_id "defines_library-mode" - if [[ $defines_library == "" ]] ; then - defines_library=${variables[$key]} + if [[ ${defines_library} == "" ]] ; then + defines_library=${variables[${key}]} else - defines_library="$defines_library ${variables[$key]}" + defines_library="${defines_library} ${variables[${key}]}" fi bootstrap_id "defines_library_shared-mode" - if [[ $defines_library_shared == "" ]] ; then - defines_library_shared=${variables[$key]} + if [[ ${defines_library_shared} == "" ]] ; then + defines_library_shared=${variables[${key}]} else - defines_library_shared="$defines_library_shared ${variables[$key]}" + defines_library_shared="${defines_library_shared} ${variables[${key}]}" fi bootstrap_id "defines_library_static-mode" - if [[ $defines_library_static == "" ]] ; then - defines_library_static=${variables[$key]} + if [[ ${defines_library_static} == "" ]] ; then + defines_library_static=${variables[${key}]} else - defines_library_static="$defines_library_static ${variables[$key]}" + defines_library_static="${defines_library_static} ${variables[${key}]}" fi bootstrap_id "defines_object_library-mode" - if [[ $defines_object_library == "" ]] ; then - defines_object_library=${variables[$key]} + if [[ ${defines_object_library} == "" ]] ; then + defines_object_library=${variables[${key}]} else - defines_object_library="$defines_object_library ${variables[$key]}" + defines_object_library="${defines_object_library} ${variables[${key}]}" fi bootstrap_id "defines_object_library_shared-mode" - if [[ $defines_object_library_shared == "" ]] ; then - defines_object_library_shared=${variables[$key]} + if [[ ${defines_object_library_shared} == "" ]] ; then + defines_object_library_shared=${variables[${key}]} else - defines_object_library_shared="$defines_object_library_shared ${variables[$key]}" + defines_object_library_shared="${defines_object_library_shared} ${variables[${key}]}" fi bootstrap_id "defines_object_library_static-mode" - if [[ $defines_object_library_static == "" ]] ; then - defines_object_library_static=${variables[$key]} + if [[ ${defines_object_library_static} == "" ]] ; then + defines_object_library_static=${variables[${key}]} else - defines_object_library_static="$defines_object_library_static ${variables[$key]}" + defines_object_library_static="${defines_object_library_static} ${variables[${key}]}" fi bootstrap_id "defines_object_program-mode" - if [[ $defines_object_program == "" ]] ; then - defines_object_program=${variables[$key]} + if [[ ${defines_object_program} == "" ]] ; then + defines_object_program=${variables[${key}]} else - defines_object_program="$defines_object_program ${variables[$key]}" + defines_object_program="${defines_object_program} ${variables[${key}]}" fi bootstrap_id "defines_object_program_shared-mode" - if [[ $defines_object_program_shared == "" ]] ; then - defines_object_program_shared=${variables[$key]} + if [[ ${defines_object_program_shared} == "" ]] ; then + defines_object_program_shared=${variables[${key}]} else - defines_object_program_shared="$defines_object_program_shared ${variables[$key]}" + defines_object_program_shared="${defines_object_program_shared} ${variables[${key}]}" fi bootstrap_id "defines_object_program_static-mode" - if [[ $defines_object_program_static == "" ]] ; then - defines_object_program_static=${variables[$key]} + if [[ ${defines_object_program_static} == "" ]] ; then + defines_object_program_static=${variables[${key}]} else - defines_object_program_static="$defines_object_program_static ${variables[$key]}" + defines_object_program_static="${defines_object_program_static} ${variables[${key}]}" fi bootstrap_id "defines_program-mode" - if [[ $defines_program == "" ]] ; then - defines_program=${variables[$key]} + if [[ ${defines_program} == "" ]] ; then + defines_program=${variables[${key}]} else - defines_program="$defines_program ${variables[$key]}" + defines_program="${defines_program} ${variables[${key}]}" fi bootstrap_id "defines_program_shared-mode" - if [[ $defines_program_shared == "" ]] ; then - defines_program_shared=${variables[$key]} + if [[ ${defines_program_shared} == "" ]] ; then + defines_program_shared=${variables[${key}]} else - defines_program_shared="$defines_program_shared ${variables[$key]}" + defines_program_shared="${defines_program_shared} ${variables[${key}]}" fi bootstrap_id "defines_program_static-mode" - if [[ $defines_program_static == "" ]] ; then - defines_program_static=${variables[$key]} + if [[ ${defines_program_static} == "" ]] ; then + defines_program_static=${variables[${key}]} else - defines_program_static="$defines_program_static ${variables[$key]}" + defines_program_static="${defines_program_static} ${variables[${key}]}" fi bootstrap_id "defines_shared-mode" - if [[ $defines_shared == "" ]] ; then - defines_shared=${variables[$key]} + if [[ ${defines_shared} == "" ]] ; then + defines_shared=${variables[${key}]} else - defines_shared="$defines_shared ${variables[$key]}" + defines_shared="${defines_shared} ${variables[${key}]}" fi bootstrap_id "defines_static-mode" - if [[ $defines_static == "" ]] ; then - defines_static=${variables[$key]} + if [[ ${defines_static} == "" ]] ; then + defines_static=${variables[${key}]} else - defines_static="$defines_static ${variables[$key]}" + defines_static="${defines_static} ${variables[${key}]}" fi } @@ -2019,10 +2020,10 @@ bootstrap_operation_build_prepare_documentation() { local key= bootstrap_id "build_sources_documentation-mode" - if [[ $sources_documentation == "" ]] ; then - sources_documentation=${variables[$key]} + if [[ ${sources_documentation} == "" ]] ; then + sources_documentation=${variables[${key}]} else - sources_documentation="$sources_documentation ${variables[$key]}" + sources_documentation="${sources_documentation} ${variables[${key}]}" fi } @@ -2030,108 +2031,108 @@ bootstrap_operation_build_prepare_flags() { local key= bootstrap_id "flags-mode" - if [[ $flags == "" ]] ; then - flags=${variables[$key]} + if [[ ${flags} == "" ]] ; then + flags=${variables[${key}]} else - flags="$flags ${variables[$key]}" + flags="${flags} ${variables[${key}]}" fi bootstrap_id "flags_library-mode" - if [[ $flags_library == "" ]] ; then - flags_library=${variables[$key]} + if [[ ${flags_library} == "" ]] ; then + flags_library=${variables[${key}]} else - flags_library="$flags_library ${variables[$key]}" + flags_library="${flags_library} ${variables[${key}]}" fi bootstrap_id "flags_library_shared-mode" - if [[ $flags_library_shared == "" ]] ; then - flags_library_shared=${variables[$key]} + if [[ ${flags_library_shared} == "" ]] ; then + flags_library_shared=${variables[${key}]} else - flags_library_shared="$flags_library_shared ${variables[$key]}" + flags_library_shared="${flags_library_shared} ${variables[${key}]}" fi bootstrap_id "flags_library_static-mode" - if [[ $flags_library_static == "" ]] ; then - flags_library_static=${variables[$key]} + if [[ ${flags_library_static} == "" ]] ; then + flags_library_static=${variables[${key}]} else - flags_library_static="$flags_library_static ${variables[$key]}" + flags_library_static="${flags_library_static} ${variables[${key}]}" fi bootstrap_id "flags_object_library-mode" - if [[ $flags_object_library == "" ]] ; then - flags_object_library=${variables[$key]} + if [[ ${flags_object_library} == "" ]] ; then + flags_object_library=${variables[${key}]} else - flags_object_library="$flags_object_library ${variables[$key]}" + flags_object_library="${flags_object_library} ${variables[${key}]}" fi bootstrap_id "flags_object_library_shared-mode" - if [[ $flags_object_library_shared == "" ]] ; then - flags_object_library_shared=${variables[$key]} + if [[ ${flags_object_library_shared} == "" ]] ; then + flags_object_library_shared=${variables[${key}]} else - flags_object_library_shared="$flags_object_library_shared ${variables[$key]}" + flags_object_library_shared="${flags_object_library_shared} ${variables[${key}]}" fi bootstrap_id "flags_object_library_static-mode" - if [[ $flags_object_library_static == "" ]] ; then - flags_object_library_static=${variables[$key]} + if [[ ${flags_object_library_static} == "" ]] ; then + flags_object_library_static=${variables[${key}]} else - flags_object_library_static="$flags_object_library_static ${variables[$key]}" + flags_object_library_static="${flags_object_library_static} ${variables[${key}]}" fi bootstrap_id "flags_object_program-mode" - if [[ $flags_object_program == "" ]] ; then - flags_object_program=${variables[$key]} + if [[ ${flags_object_program} == "" ]] ; then + flags_object_program=${variables[${key}]} else - flags_object_program="$flags_object_program ${variables[$key]}" + flags_object_program="${flags_object_program} ${variables[${key}]}" fi bootstrap_id "flags_object_program_shared-mode" - if [[ $flags_object_program_shared == "" ]] ; then - flags_object_program_shared=${variables[$key]} + if [[ ${flags_object_program_shared} == "" ]] ; then + flags_object_program_shared=${variables[${key}]} else - flags_object_program_shared="$flags_object_program_shared ${variables[$key]}" + flags_object_program_shared="${flags_object_program_shared} ${variables[${key}]}" fi bootstrap_id "flags_object_program_static-mode" - if [[ $flags_object_program_static == "" ]] ; then - flags_object_program_static=${variables[$key]} + if [[ ${flags_object_program_static} == "" ]] ; then + flags_object_program_static=${variables[${key}]} else - flags_object_program_static="$flags_object_program_static ${variables[$key]}" + flags_object_program_static="${flags_object_program_static} ${variables[${key}]}" fi bootstrap_id "flags_program-mode" - if [[ $flags_program == "" ]] ; then - flags_program=${variables[$key]} + if [[ ${flags_program} == "" ]] ; then + flags_program=${variables[${key}]} else - flags_program="$flags_program ${variables[$key]}" + flags_program="${flags_program} ${variables[${key}]}" fi bootstrap_id "flags_program_shared-mode" - if [[ $flags_program_shared == "" ]] ; then - flags_program_shared=${variables[$key]} + if [[ ${flags_program_shared} == "" ]] ; then + flags_program_shared=${variables[${key}]} else - flags_program_shared="$flags_program_shared ${variables[$key]}" + flags_program_shared="${flags_program_shared} ${variables[${key}]}" fi bootstrap_id "flags_program_static-mode" - if [[ $flags_program_static == "" ]] ; then - flags_program_static=${variables[$key]} + if [[ ${flags_program_static} == "" ]] ; then + flags_program_static=${variables[${key}]} else - flags_program_static="$flags_program_static ${variables[$key]}" + flags_program_static="${flags_program_static} ${variables[${key}]}" fi bootstrap_id "flags_shared-mode" - if [[ $flags_shared == "" ]] ; then - flags_shared=${variables[$key]} + if [[ ${flags_shared} == "" ]] ; then + flags_shared=${variables[${key}]} else - flags_shared="$flags_shared ${variables[$key]}" + flags_shared="${flags_shared} ${variables[${key}]}" fi bootstrap_id "flags_static-mode" - if [[ $flags_static == "" ]] ; then - flags_static=${variables[$key]} + if [[ ${flags_static} == "" ]] ; then + flags_static=${variables[${key}]} else - flags_static="$flags_static ${variables[$key]}" + flags_static="${flags_static} ${variables[${key}]}" fi } @@ -2139,56 +2140,56 @@ bootstrap_operation_build_prepare_headers() { local key= bootstrap_id "build_sources_headers-mode" - if [[ $sources_headers == "" ]] ; then - sources_headers=${variables[$key]} + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} else - sources_headers="$sources_headers ${variables[$key]}" + sources_headers="${sources_headers} ${variables[${key}]}" fi - if [[ $build_shared == "yes" ]] ; then + if [[ ${build_shared} == "yes" ]] ; then bootstrap_id "build_sources_headers_shared" - if [[ $sources_headers == "" ]] ; then - sources_headers=${variables[$key]} + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} else - sources_headers="$sources_headers ${variables[$key]}" + sources_headers="${sources_headers} ${variables[${key}]}" fi bootstrap_id "build_sources_headers_static" - if [[ $sources_headers == "" ]] ; then - sources_headers=${variables[$key]} + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} else - sources_headers="$sources_headers ${variables[$key]}" + sources_headers="${sources_headers} ${variables[${key}]}" fi fi - if [[ $build_static == "yes" ]] ; then + if [[ ${build_static} == "yes" ]] ; then bootstrap_id "build_sources_headers_shared-mode" - if [[ $sources_headers == "" ]] ; then - sources_headers=${variables[$key]} + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} else - sources_headers="$sources_headers ${variables[$key]}" + sources_headers="${sources_headers} ${variables[${key}]}" fi bootstrap_id "build_sources_headers_static-mode" - if [[ $sources_headers == "" ]] ; then - sources_headers=${variables[$key]} + if [[ ${sources_headers} == "" ]] ; then + sources_headers=${variables[${key}]} else - sources_headers="$sources_headers ${variables[$key]}" + sources_headers="${sources_headers} ${variables[${key}]}" fi fi bootstrap_id "path_headers-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_headers=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_headers=${variables[${key}]} else bootstrap_id "path_headers" - if [[ ${variables[$key]} != "" ]] ; then - path_headers=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_headers=${variables[${key}]} fi fi - if [[ $path_headers != "" ]] ; then - path_headers=$(echo $path_headers | sed -e 's|/*$|/|') + if [[ ${path_headers} != "" ]] ; then + path_headers=$(echo ${path_headers} | sed -e 's|/*$|/|') fi } @@ -2196,45 +2197,45 @@ bootstrap_operation_build_prepare_libraries() { local key= bootstrap_id "build_libraries-mode" - if [[ $libraries == "" ]] ; then - libraries=${variables[$key]} + if [[ ${libraries} == "" ]] ; then + libraries=${variables[${key}]} else - libraries="${variables[$key]} $libraries" + libraries="${variables[${key}]} ${libraries}" fi bootstrap_id "build_libraries_shared-mode" - if [[ $libraries_shared == "" ]] ; then - libraries_shared=${variables[$key]} + if [[ ${libraries_shared} == "" ]] ; then + libraries_shared=${variables[${key}]} else - libraries_shared="${variables[$key]} $libraries_shared" + libraries_shared="${variables[${key}]} ${libraries_shared}" fi bootstrap_id "build_libraries_static-mode" - if [[ $libraries_static == "" ]] ; then - libraries_static=${variables[$key]} + if [[ ${libraries_static} == "" ]] ; then + libraries_static=${variables[${key}]} else - libraries_static="${variables[$key]} $libraries_static" + libraries_static="${variables[${key}]} ${libraries_static}" fi bootstrap_id "build_sources_library-mode" - if [[ $sources_library == "" ]] ; then - sources_library=${variables[$key]} + if [[ ${sources_library} == "" ]] ; then + sources_library=${variables[${key}]} else - sources_library="$sources_library ${variables[$key]}" + sources_library="${sources_library} ${variables[${key}]}" fi bootstrap_id "build_sources_library_shared-mode" - if [[ $sources_library_shared == "" ]] ; then - sources_library_shared=${variables[$key]} + if [[ ${sources_library_shared} == "" ]] ; then + sources_library_shared=${variables[${key}]} else - sources_library_shared="$build_sources_library_shared ${variables[$key]}" + sources_library_shared="${build_sources_library_shared} ${variables[${key}]}" fi bootstrap_id "build_sources_library_static-mode" - if [[ $sources_library_static == "" ]] ; then - sources_library_static=${variables[$key]} + if [[ ${sources_library_static} == "" ]] ; then + sources_library_static=${variables[${key}]} else - sources_library_static="$build_sources_library_static ${variables[$key]}" + sources_library_static="${build_sources_library_static} ${variables[${key}]}" fi } @@ -2242,287 +2243,287 @@ bootstrap_operation_build_prepare_objects() { local key= bootstrap_id "build_objects_library-mode" - if [[ $objects_library == "" ]] ; then - objects_library=${variables[$key]} + if [[ ${objects_library} == "" ]] ; then + objects_library=${variables[${key}]} else - objects_library="${variables[$key]} $objects_library" + objects_library="${variables[${key}]} ${objects_library}" fi bootstrap_id "build_objects_library_shared-mode" - if [[ $objects_library_shared == "" ]] ; then - objects_library_shared=${variables[$key]} + if [[ ${objects_library_shared} == "" ]] ; then + objects_library_shared=${variables[${key}]} else - objects_library_shared="${variables[$key]} $objects_library_shared" + objects_library_shared="${variables[${key}]} ${objects_library_shared}" fi bootstrap_id "build_objects_library_static-mode" - if [[ $objects_library_static == "" ]] ; then - objects_library_static=${variables[$key]} + if [[ ${objects_library_static} == "" ]] ; then + objects_library_static=${variables[${key}]} else - objects_library_static="${variables[$key]} $objects_library_static" + objects_library_static="${variables[${key}]} ${objects_library_static}" fi bootstrap_id "build_objects_program-mode" - if [[ $objects_program == "" ]] ; then - objects_program=${variables[$key]} + if [[ ${objects_program} == "" ]] ; then + objects_program=${variables[${key}]} else - objects_program="${variables[$key]} $objects_program" + objects_program="${variables[${key}]} ${objects_program}" fi bootstrap_id "build_objects_program_shared-mode" - if [[ $objects_program_shared == "" ]] ; then - objects_program_shared=${variables[$key]} + if [[ ${objects_program_shared} == "" ]] ; then + objects_program_shared=${variables[${key}]} else - objects_program_shared="${variables[$key]} $objects_program_shared" + objects_program_shared="${variables[${key}]} ${objects_program_shared}" fi bootstrap_id "build_objects_program_static-mode" - if [[ $objects_program_static == "" ]] ; then - objects_program_static=${variables[$key]} + if [[ ${objects_program_static} == "" ]] ; then + objects_program_static=${variables[${key}]} else - objects_program_static="${variables[$key]} $objects_program_static" + objects_program_static="${variables[${key}]} ${objects_program_static}" fi - if [[ $sources_object == "" ]] ; then + if [[ ${sources_object} == "" ]] ; then bootstrap_id "build_sources_object-mode" - sources_object=${variables[$key]} + sources_object=${variables[${key}]} fi - if [[ $sources_object_shared == "" ]] ; then + if [[ ${sources_object_shared} == "" ]] ; then bootstrap_id "build_sources_object_shared-mode" - sources_object_shared=${variables[$key]} + sources_object_shared=${variables[${key}]} fi - if [[ $sources_object_static == "" ]] ; then + if [[ ${sources_object_static} == "" ]] ; then bootstrap_id "build_sources_object_static-mode" - sources_object_static=${variables[$key]} + sources_object_static=${variables[${key}]} fi } bootstrap_operation_build_prepare_paths() { local key= - if [[ $override_path_sources == "" ]] ; then + if [[ ${override_path_sources} == "" ]] ; then bootstrap_id "path_sources-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_sources=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_sources=${variables[${key}]} else bootstrap_id "path_sources" - if [[ ${variables[$key]} != "" ]] ; then - path_sources=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_sources=${variables[${key}]} fi fi fi - if [[ $path_sources != "" ]] ; then - path_sources=$(echo $path_sources | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_sources} != "" ]] ; then + path_sources=$(echo ${path_sources} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_sources_object-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_sources_object=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_sources_object=${variables[${key}]} else bootstrap_id "path_sources_object" - if [[ ${variables[$key]} != "" ]] ; then - path_sources_object=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_sources_object=${variables[${key}]} fi fi - if [[ $path_sources_object != "" ]] ; then - path_sources_object=$(echo $path_sources_object | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_sources_object} != "" ]] ; then + path_sources_object=$(echo ${path_sources_object} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_headers-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_headers=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_headers=${variables[${key}]} fi - if [[ $path_headers != "" ]] ; then - path_headers=$(echo $path_headers | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_headers} != "" ]] ; then + path_headers=$(echo ${path_headers} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "has_path_standard-mode" - if [[ ${variables[$key]} != "" ]] ; then - has_path_standard=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + has_path_standard=${variables[${key}]} fi - if [[ $has_path_standard == "no" ]] ; then + if [[ ${has_path_standard} == "no" ]] ; then path_language= else bootstrap_id "path_language-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_language=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_language=${variables[${key}]} else bootstrap_id "path_language" - if [[ ${variables[$key]} != "" ]] ; then - path_language=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_language=${variables[${key}]} fi fi - if [[ $path_language != "" ]] ; then - path_language=$(echo $path_language | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_language} != "" ]] ; then + path_language=$(echo ${path_language} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi fi bootstrap_id "path_object_library-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_library=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_library=${variables[${key}]} fi - if [[ $path_object_library != "" ]] ; then - path_object_library=$(echo $path_object_library | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_library} != "" ]] ; then + path_object_library=$(echo ${path_object_library} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_program-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_program=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_program=${variables[${key}]} fi - if [[ $path_object_program != "" ]] ; then - path_object_program=$(echo $path_object_program | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_program} != "" ]] ; then + path_object_program=$(echo ${path_object_program} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_library_script-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_library_script=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_library_script=${variables[${key}]} fi - if [[ $path_library_script != "" ]] ; then - path_library_script=$(echo $path_library_script | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_library_script} != "" ]] ; then + path_library_script=$(echo ${path_library_script} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_library_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_library_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_library_shared=${variables[${key}]} fi - if [[ $path_library_shared != "" ]] ; then - path_library_shared=$(echo $path_library_shared | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_library_shared} != "" ]] ; then + path_library_shared=$(echo ${path_library_shared} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_library_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_library_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_library_static=${variables[${key}]} fi - if [[ $path_library_static != "" ]] ; then - path_library_static=$(echo $path_library_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_library_static} != "" ]] ; then + path_library_static=$(echo ${path_library_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_library_script-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_library_script=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_library_script=${variables[${key}]} fi - if [[ $path_object_library_script != "" ]] ; then - path_object_library_script=$(echo $path_object_library_script | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_library_script} != "" ]] ; then + path_object_library_script=$(echo ${path_object_library_script} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_library_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_library_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_library_shared=${variables[${key}]} fi - if [[ $path_object_library_shared != "" ]] ; then - path_object_library_shared=$(echo $path_object_library_shared | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_library_shared} != "" ]] ; then + path_object_library_shared=$(echo ${path_object_library_shared} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_library_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_library_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_library_static=${variables[${key}]} fi - if [[ $path_object_library_static != "" ]] ; then - path_object_library_static=$(echo $path_object_library_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_library_static} != "" ]] ; then + path_object_library_static=$(echo ${path_object_library_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_program_script-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_program_script=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_program_script=${variables[${key}]} fi - if [[ $path_object_program_script != "" ]] ; then - path_object_program_script=$(echo $path_object_program_script | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_program_script} != "" ]] ; then + path_object_program_script=$(echo ${path_object_program_script} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_program_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_program_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_program_shared=${variables[${key}]} fi - if [[ $path_object_program_shared != "" ]] ; then - path_object_program_shared=$(echo $path_object_program_shared | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_program_shared} != "" ]] ; then + path_object_program_shared=$(echo ${path_object_program_shared} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_program_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_program_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_program_static=${variables[${key}]} fi - if [[ $path_object_program_static != "" ]] ; then - path_object_program_static=$(echo $path_object_program_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_program_static} != "" ]] ; then + path_object_program_static=$(echo ${path_object_program_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_script-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_script=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_script=${variables[${key}]} fi - if [[ $path_object_script != "" ]] ; then - path_object_script=$(echo $path_object_script | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_script} != "" ]] ; then + path_object_script=$(echo ${path_object_script} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_shared=${variables[${key}]} fi - if [[ $path_object_shared != "" ]] ; then - path_object_shared=$(echo $path_object_shared | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_shared} != "" ]] ; then + path_object_shared=$(echo ${path_object_shared} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_object_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_object_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_object_static=${variables[${key}]} fi - if [[ $path_object_static != "" ]] ; then - path_object_static=$(echo $path_object_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_static} != "" ]] ; then + path_object_static=$(echo ${path_object_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi - if [[ $path_object_static != "" ]] ; then - path_object_static=$(echo $path_object_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_object_static} != "" ]] ; then + path_object_static=$(echo ${path_object_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_program_script-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_program_script=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_program_script=${variables[${key}]} fi - if [[ $path_program_script != "" ]] ; then - path_program_script=$(echo $path_program_script | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_program_script} != "" ]] ; then + path_program_script=$(echo ${path_program_script} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_program_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_program_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_program_shared=${variables[${key}]} fi - if [[ $path_program_shared != "" ]] ; then - path_program_shared=$(echo $path_program_shared | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_program_shared} != "" ]] ; then + path_program_shared=$(echo ${path_program_shared} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi bootstrap_id "path_program_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - path_program_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + path_program_static=${variables[${key}]} fi - if [[ $path_program_static != "" ]] ; then - path_program_static=$(echo $path_program_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_program_static} != "" ]] ; then + path_program_static=$(echo ${path_program_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi - if [[ $path_program_static != "" ]] ; then - path_program_static=$(echo $path_program_static | sed -e 's|//*|/|g' -e 's|/*$|/|') + if [[ ${path_program_static} != "" ]] ; then + path_program_static=$(echo ${path_program_static} | sed -e 's|//*|/|g' -e 's|/*$|/|') fi } @@ -2530,24 +2531,24 @@ bootstrap_operation_build_prepare_programs() { local key= bootstrap_id "build_sources_program-mode" - if [[ $sources_program == "" ]] ; then - sources_program=${variables[$key]} + if [[ ${sources_program} == "" ]] ; then + sources_program=${variables[${key}]} else - sources_program="$sources_program ${variables[$key]}" + sources_program="${sources_program} ${variables[${key}]}" fi bootstrap_id "build_sources_program_shared-mode" - if [[ $sources_program_shared == "" ]] ; then - sources_program_shared=${variables[$key]} + if [[ ${sources_program_shared} == "" ]] ; then + sources_program_shared=${variables[${key}]} else - sources_program_shared="$sources_program_shared ${variables[$key]}" + sources_program_shared="${sources_program_shared} ${variables[${key}]}" fi bootstrap_id "build_sources_program_static-mode" - if [[ $sources_program_static == "" ]] ; then - sources_program_static=${variables[$key]} + if [[ ${sources_program_static} == "" ]] ; then + sources_program_static=${variables[${key}]} else - sources_program_static="$sources_program_static ${variables[$key]}" + sources_program_static="${sources_program_static} ${variables[${key}]}" fi } @@ -2555,165 +2556,165 @@ bootstrap_operation_build_prepare_remaining() { local key= bootstrap_id "has-build_compiler-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_compiler-mode" - build_compiler=${variables[$key]} + build_compiler=${variables[${key}]} fi bootstrap_id "has-build_indexer-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_indexer-mode" - build_indexer=${variables[$key]} + build_indexer=${variables[${key}]} fi bootstrap_id "has-build_indexer_arguments-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_indexer_arguments-mode" - build_indexer_arguments=${variables[$key]} + build_indexer_arguments=${variables[${key}]} fi bootstrap_id "has-build_name-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "build_name-mode" - build_name=${variables[$key]} + build_name=${variables[${key}]} fi bootstrap_id "has-version_major-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_major-mode" - version_major=${variables[$key]} + version_major=${variables[${key}]} fi bootstrap_id "has-version_major_prefix-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_major_prefix-mode" - version_major_prefix=${variables[$key]} + version_major_prefix=${variables[${key}]} fi bootstrap_id "has-version_minor-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_minor-mode" - version_minor=${variables[$key]} + version_minor=${variables[${key}]} fi bootstrap_id "has-version_minor_prefix-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_minor_prefix-mode" - version_minor_prefix=${variables[$key]} + version_minor_prefix=${variables[${key}]} fi bootstrap_id "has-version_micro-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_micro-mode" - version_micro=${variables[$key]} + version_micro=${variables[${key}]} fi bootstrap_id "has-version_micro_prefix-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_micro_prefix-mode" - version_micro_prefix=${variables[$key]} + version_micro_prefix=${variables[${key}]} fi bootstrap_id "has-version_nano-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_nano-mode" - version_nano=${variables[$key]} + version_nano=${variables[${key}]} fi bootstrap_id "has-version_nano_prefix-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "version_nano_prefix-mode" - version_nano_prefix=${variables[$key]} + version_nano_prefix=${variables[${key}]} fi bootstrap_id "has-path_headers-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_headers-mode" - path_headers=${variables[$key]} + path_headers=${variables[${key}]} fi bootstrap_id "has-preserve_path_headers-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "preserve_path_headers-mode" - preserve_path_headers=${variables[$key]} + preserve_path_headers=${variables[${key}]} fi bootstrap_id "has-path_library_script-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_library_script-mode" - path_library_script=${variables[$key]} + path_library_script=${variables[${key}]} fi bootstrap_id "has-path_library_shared-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_library_shared-mode" - path_library_shared=${variables[$key]} + path_library_shared=${variables[${key}]} fi bootstrap_id "has-path_library_static-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_library_static-mode" - path_library_static=${variables[$key]} + path_library_static=${variables[${key}]} fi bootstrap_id "has-path_object_script-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_object_script-mode" - path_object_script=${variables[$key]} + path_object_script=${variables[${key}]} fi bootstrap_id "has-path_object_shared-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_object_shared-mode" - path_object_shared=${variables[$key]} + path_object_shared=${variables[${key}]} fi bootstrap_id "has-path_object_static-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_object_static-mode" - path_object_static=${variables[$key]} + path_object_static=${variables[${key}]} fi bootstrap_id "has-path_program_script-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_program_script-mode" - path_program_script=${variables[$key]} + path_program_script=${variables[${key}]} fi bootstrap_id "has-path_program_shared-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_program_shared-mode" - path_program_shared=${variables[$key]} + path_program_shared=${variables[${key}]} fi bootstrap_id "has-path_program_static-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "path_program_static-mode" - path_program_static=${variables[$key]} + path_program_static=${variables[${key}]} fi bootstrap_id "has-has_path_standard-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "has_path_standard-mode" - has_path_standard=${variables[$key]} + has_path_standard=${variables[${key}]} fi bootstrap_id "has-search_exclusive-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "search_exclusive-mode" - search_exclusive=${variables[$key]} + search_exclusive=${variables[${key}]} fi bootstrap_id "has-search_shared-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "search_shared-mode" - search_shared=${variables[$key]} + search_shared=${variables[${key}]} fi bootstrap_id "has-search_static-mode" - if [[ ${variables[$key]} == "yes" ]] ; then + if [[ ${variables[${key}]} == "yes" ]] ; then bootstrap_id "search_static-mode" - search_static=${variables[$key]} + search_static=${variables[${key}]} fi } @@ -2721,10 +2722,10 @@ bootstrap_operation_build_prepare_settings() { local key= bootstrap_id "build_sources_setting-mode" - if [[ $sources_setting == "" ]] ; then - sources_setting=${variables[$key]} + if [[ ${sources_setting} == "" ]] ; then + sources_setting=${variables[${key}]} else - sources_setting="$sources_setting ${variables[$key]}" + sources_setting="${sources_setting} ${variables[${key}]}" fi } @@ -2732,44 +2733,44 @@ bootstrap_operation_build_prepare_shared_static() { local key= bootstrap_id "build_shared-mode" - if [[ ${variables[$key]} != "" ]] ; then - build_shared=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + build_shared=${variables[${key}]} fi bootstrap_id "build_static-mode" - if [[ ${variables[$key]} != "" ]] ; then - build_static=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + build_static=${variables[${key}]} fi - if [[ $enable_shared == "yes" ]] ; then + if [[ ${enable_shared} == "yes" ]] ; then build_shared="yes" search_shared="yes" - elif [[ $enable_shared == "no" ]] ; then + elif [[ ${enable_shared} == "no" ]] ; then build_shared="no" search_shared="no" fi - if [[ $enable_static == "yes" ]] ; then + if [[ ${enable_static} == "yes" ]] ; then build_static="yes" search_static="yes" - elif [[ $enable_static == "no" ]] ; then + elif [[ ${enable_static} == "no" ]] ; then build_static="no" search_static="no" fi - if [[ $search_shared == "no" ]] ; then + if [[ ${search_shared} == "no" ]] ; then arguments_shared= fi - if [[ $search_static == "no" ]] ; then + if [[ ${search_static} == "no" ]] ; then arguments_static= fi } bootstrap_operation_build_validate_build() { - if [[ $build_compiler == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${build_compiler} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, no '${c_notice}build_compiler${c_error}' specified, such as '${c_notice}gcc${c_error}'.${c_reset}" @@ -2778,8 +2779,8 @@ bootstrap_operation_build_validate_build() { let failure=1 fi - if [[ $build_indexer == "" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${build_indexer} == "" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, no '${c_notice}build_indexer${c_error}' specified, such as '${c_notice}ar${c_error}'.${c_reset}" @@ -2788,7 +2789,7 @@ bootstrap_operation_build_validate_build() { let failure=1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -2797,8 +2798,8 @@ bootstrap_operation_build_validate_build() { bootstrap_operation_build_validate_paths() { - if [[ $path_sources == "" || ! -d $path_sources ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${path_sources} == "" || ! -d ${path_sources} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The sources directory ${c_notice}${path_sources}${c_error} is not a valid directory.${c_reset}" @@ -2807,8 +2808,8 @@ bootstrap_operation_build_validate_paths() { let failure=1 fi - if [[ $failure == "" && $path_sources_object != "" && ! -d $path_sources_object ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} == "" && ${path_sources_object} != "" && ! -d ${path_sources_object} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: The sources object directory ${c_notice}${path_sources_object}${c_error} is not a valid directory.${c_reset}" @@ -2817,7 +2818,7 @@ bootstrap_operation_build_validate_paths() { let failure=1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -2827,15 +2828,15 @@ bootstrap_operation_build_validate_paths() { bootstrap_operation_build_validate_search() { # When not in search exclusive mode, allow static libraries to be linked into shared libraries if the shared library is not found first. - if [[ $search_exclusive == "no" ]] ; then - arguments_shared="$arguments_shared $arguments_static" + if [[ ${search_exclusive} == "no" ]] ; then + arguments_shared="${arguments_shared} ${arguments_static}" fi } bootstrap_operation_build_validate_shared_static() { - if [[ $build_shared != "yes" && $build_static != "yes" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${build_shared} != "yes" && ${build_static} != "yes" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, either build_shared or build_static must be set to 'yes'.${c_reset}" @@ -2844,8 +2845,8 @@ bootstrap_operation_build_validate_shared_static() { let failure=1 fi - if [[ $search_shared != "yes" && $search_static != "yes" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${search_shared} != "yes" && ${search_static} != "yes" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, either search_shared or search_static must be set to 'yes'.${c_reset}" @@ -2854,7 +2855,7 @@ bootstrap_operation_build_validate_shared_static() { let failure=1 fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -2863,9 +2864,9 @@ bootstrap_operation_build_validate_shared_static() { bootstrap_operation_build_validate_sources() { - for i in $sources_script ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_script} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_script path provided: '${i}'.${c_reset}" @@ -2875,9 +2876,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_headers ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_headers} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_headers path provided: '${i}'.${c_reset}" @@ -2887,9 +2888,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_library ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_library} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_library path provided: '${i}'.${c_reset}" @@ -2899,9 +2900,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_library_object ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_library_object} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_library_object path provided: '${i}'.${c_reset}" @@ -2911,9 +2912,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_program_object ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_program_object} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_program_object path provided: '${i}'.${c_reset}" @@ -2923,9 +2924,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_program ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_program} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_program path provided: '${i}'.${c_reset}" @@ -2935,9 +2936,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_documentation ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_documentation} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_documentation path provided: '${i}'.${c_reset}" @@ -2947,9 +2948,9 @@ bootstrap_operation_build_validate_sources() { fi done - for i in $sources_setting ; do - if [[ $i != "$(echo $i | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + for i in ${sources_setting} ; do + if [[ ${i} != "$(echo ${i} | sed -e 's|^//*||' -e 's|^\.\.//*||' -e 's|/*$||')" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then bootstrap_print_first echo -e "${c_error}ERROR: Cannot Build, invalid build_sources_setting path provided: '${i}'.${c_reset}" @@ -2959,7 +2960,7 @@ bootstrap_operation_build_validate_sources() { fi done - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -2970,57 +2971,57 @@ bootstrap_operation_build_prepare_versions() { local key= bootstrap_id "version_file-mode" - if [[ ${variables[$key]} != "" ]] ; then - version_file_value=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + version_file_value=${variables[${key}]} fi bootstrap_id "version_target-mode" - if [[ ${variables[$key]} != "" ]] ; then - version_target_value=${variables[$key]} + if [[ ${variables[${key}]} != "" ]] ; then + version_target_value=${variables[${key}]} fi - if [[ $version_file_value == "" ]] ; then + if [[ ${version_file_value} == "" ]] ; then version_file_value="micro" fi - if [[ $version_target_value == "" ]] ; then + if [[ ${version_target_value} == "" ]] ; then version_target_value="major" fi - if [[ $version_major == "" ]] ; then + if [[ ${version_major} == "" ]] ; then version_major_prefix= fi - if [[ $version_minor == "" ]] ; then + if [[ ${version_minor} == "" ]] ; then version_minor_prefix= fi - if [[ $version_micro == "" ]] ; then + if [[ ${version_micro} == "" ]] ; then version_micro_prefix= fi - if [[ $version_nano == "" ]] ; then + if [[ ${version_nano} == "" ]] ; then version_nano_prefix= fi - if [[ $version_file_value == "major" ]] ; then - version_file="$version_major_prefix$version_major" - elif [[ $version_file_value == "minor" ]] ; then - version_file="$version_major_prefix$version_major$version_minor_prefix$version_minor" - elif [[ $version_file_value == "micro" ]] ; then - version_file="$version_major_prefix$version_major$version_minor_prefix$version_minor$version_micro_prefix$version_micro" - elif [[ $version_file_value == "nano" ]] ; then - version_file="$version_major_prefix$version_major$version_minor_prefix$version_minor$version_micro_prefix$version_micro$version_nano_prefix$version_nano" + if [[ ${version_file_value} == "major" ]] ; then + version_file="${version_major_prefix}${version_major}" + elif [[ ${version_file_value} == "minor" ]] ; then + version_file="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}" + elif [[ ${version_file_value} == "micro" ]] ; then + version_file="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro}" + elif [[ ${version_file_value} == "nano" ]] ; then + version_file="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro}${version_nano_prefix}${version_nano}" fi - if [[ $version_target_value == "major" ]] ; then - version_target="$version_major_prefix$version_major" - elif [[ $version_target_value == "minor" ]] ; then - version_target="$version_major_prefix$version_major$version_minor_prefix$version_minor" - elif [[ $version_target_value == "micro" ]] ; then - version_target="$version_major_prefix$version_major$version_minor_prefix$version_minor$version_micro_prefix$version_micro" - elif [[ $version_target_value == "nano" ]] ; then - version_target="$version_major_prefix$version_major$version_minor_prefix$version_minor$version_micro_prefix$version_micro$version_nano_prefix$version_nano" + if [[ ${version_target_value} == "major" ]] ; then + version_target="${version_major_prefix}${version_major}" + elif [[ ${version_target_value} == "minor" ]] ; then + version_target="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}" + elif [[ ${version_target_value} == "micro" ]] ; then + version_target="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro}" + elif [[ ${version_target_value} == "nano" ]] ; then + version_target="${version_major_prefix}${version_major}${version_minor_prefix}${version_minor}${version_micro_prefix}${version_micro}${version_nano_prefix}${version_nano}" fi } @@ -3029,27 +3030,27 @@ bootstrap_operation_clean() { local i= for i in ${path_build}{documents,includes,libraries,objects,programs,settings,stage} ; do - if [[ -e $i ]] ; then - rm $verbose_common -Rf $i + if [[ -e ${i} ]] ; then + rm ${verbose_common} -Rf ${i} fi done if [[ -f ${project_built}.prepared ]] ; then - rm $verbose_common -f ${project_built}-${settings_name}.prepared + rm ${verbose_common} -f ${project_built}-${settings_name}.prepared fi if [[ -f ${project_built_shared}-${settings_name}.built ]] ; then - rm $verbose_common -f ${project_built_shared}-${settings_name}.built + rm ${verbose_common} -f ${project_built_shared}-${settings_name}.built fi if [[ -f ${project_built_static}-${settings_name}.built ]] ; then - rm $verbose_common -f ${project_built_static}-${settings_name}.built + rm ${verbose_common} -f ${project_built_static}-${settings_name}.built fi } bootstrap_print_first() { - if [[ $print_line_first == "yes" ]] ; then + if [[ ${print_line_first} == "yes" ]] ; then echo print_line_first= @@ -3058,7 +3059,7 @@ bootstrap_print_first() { bootstrap_print_last() { - if [[ $print_line_last == "yes" ]] ; then + if [[ ${print_line_last} == "yes" ]] ; then echo fi } diff --git a/build/scripts/install.sh b/build/scripts/install.sh index 5dfbb02..7234d3e 100644 --- a/build/scripts/install.sh +++ b/build/scripts/install.sh @@ -15,13 +15,13 @@ install_main() { - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then emulate ksh fi local public_name="Simple FLL Project Install Script" local system_name=install - local called_name=$(basename $0) + local called_name=$(basename ${0}) local version=0.7.0 local grab_next= @@ -87,137 +87,137 @@ install_main() { if [[ $# -gt 0 ]] ; then t=$# - while [[ $i -lt $t ]] ; do - let i=$i+1 + while [[ ${i} -lt ${t} ]] ; do + let i=${i}+1 - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then p=${(P)i} else p=${!i} fi - if [[ $grab_next == "" ]] ; then - if [[ $p == "-h" || $p == "--help" ]] ; then + if [[ ${grab_next} == "" ]] ; then + if [[ ${p} == "-h" || ${p} == "--help" ]] ; then do_help=yes - elif [[ $p == "+C" || $p == "++copyright" ]] ; then + elif [[ ${p} == "+C" || ${p} == "++copyright" ]] ; then do_copyright="yes" - elif [[ $p == "+d" || $p == "++dark" ]] ; then + elif [[ ${p} == "+d" || ${p} == "++dark" ]] ; then do_color="dark" context="+d" - elif [[ $p == "+l" || $p == "++light" ]] ; then + elif [[ ${p} == "+l" || ${p} == "++light" ]] ; then do_color="light" context="+l" - elif [[ $p == "+n" || $p == "++no_color" ]] ; then + elif [[ ${p} == "+n" || ${p} == "++no_color" ]] ; then do_color=none context="+n" - elif [[ $p == "+Q" || $p == "++quiet" ]] ; then + elif [[ ${p} == "+Q" || ${p} == "++quiet" ]] ; then verbosity="quiet" verbose="+Q" verbose_common= - elif [[ $p == "+N" || $p == "++normal" ]] ; then + elif [[ ${p} == "+N" || ${p} == "++normal" ]] ; then verbosity= verbose="+N" verbose_common= - elif [[ $p == "+E" || $p == "++error" ]] ; then + elif [[ ${p} == "+E" || ${p} == "++error" ]] ; then verbosity="error" verbose="+E" verbose_common= - elif [[ $p == "+V" || $p == "++verbose" ]] ; then + elif [[ ${p} == "+V" || ${p} == "++verbose" ]] ; then verbosity="verbose" verbose="+V" verbose_common="-v" - elif [[ $p == "+D" || $p == "++debug" ]] ; then + elif [[ ${p} == "+D" || ${p} == "++debug" ]] ; then verbosity="debug" verbose="+D" verbose_common="-v" - elif [[ $p == "+F" || $p == "++line_first_no" ]] ; then + elif [[ ${p} == "+F" || ${p} == "++line_first_no" ]] ; then print_line_first="no" - elif [[ $p == "+L" || $p == "++line_last_no" ]] ; then + elif [[ ${p} == "+L" || ${p} == "++line_last_no" ]] ; then print_line_last="no" - elif [[ $p == "+v" || $p == "++version" ]] ; then - echo $version + elif [[ ${p} == "+v" || ${p} == "++version" ]] ; then + echo ${version} return 0 - elif [[ $p == "-b" || $p == "--build" ]] ; then + elif [[ ${p} == "-b" || ${p} == "--build" ]] ; then grab_next=path_build - elif [[ $p == "-P" || $p == "--prefix" ]] ; then + elif [[ ${p} == "-P" || ${p} == "--prefix" ]] ; then grab_next=prefix - elif [[ $p == "-B" || $p == "--bindir" ]] ; then + elif [[ ${p} == "-B" || ${p} == "--bindir" ]] ; then grab_next=bindir - elif [[ $p == "-D" || $p == "--docdir" ]] ; then + elif [[ ${p} == "-D" || ${p} == "--docdir" ]] ; then grab_next=docdir - elif [[ $p == "-E" || $p == "--etcdir" ]] ; then + elif [[ ${p} == "-E" || ${p} == "--etcdir" ]] ; then grab_next=etcdir - elif [[ $p == "-I" || $p == "--includedir" ]] ; then + elif [[ ${p} == "-I" || ${p} == "--includedir" ]] ; then grab_next=includedir - elif [[ $p == "-L" || $p == "--libdir" ]] ; then + elif [[ ${p} == "-L" || ${p} == "--libdir" ]] ; then grab_next=libdir - elif [[ $p == "-w" || $p == "--work" ]] ; then + elif [[ ${p} == "-w" || ${p} == "--work" ]] ; then grab_next=work - elif [[ $p == "--enable-doc" ]] ; then + elif [[ ${p} == "--enable-doc" ]] ; then enable_documentation="yes" - elif [[ $p == "--disable-doc" ]] ; then + elif [[ ${p} == "--disable-doc" ]] ; then enable_documentation="no" - elif [[ $p == "--enable-settings" ]] ; then + elif [[ ${p} == "--enable-settings" ]] ; then enable_settings="yes" - elif [[ $p == "--disable-settings" ]] ; then + elif [[ ${p} == "--disable-settings" ]] ; then enable_settings="no" - elif [[ $p == "--enable-shared" ]] ; then + elif [[ ${p} == "--enable-shared" ]] ; then enable_shared="yes" - elif [[ $p == "--disable-shared" ]] ; then + elif [[ ${p} == "--disable-shared" ]] ; then enable_shared="no" - elif [[ $p == "--disable-shared-programs" ]] ; then + elif [[ ${p} == "--disable-shared-programs" ]] ; then enable_shared_programs="no" - elif [[ $p == "--disable-shared-libraries" ]] ; then + elif [[ ${p} == "--disable-shared-libraries" ]] ; then enable_shared_libraries="no" - elif [[ $p == "--disable-static-programs" ]] ; then + elif [[ ${p} == "--disable-static-programs" ]] ; then enable_static_programs="no" - elif [[ $p == "--disable-static-libraries" ]] ; then + elif [[ ${p} == "--disable-static-libraries" ]] ; then enable_static_libraries="no" - elif [[ $p == "--enable-static" ]] ; then + elif [[ ${p} == "--enable-static" ]] ; then enable_static="yes" - elif [[ $p == "--disable-static" ]] ; then + elif [[ ${p} == "--disable-static" ]] ; then enable_static="no" - elif [[ $p == "--enable-includes" ]] ; then + elif [[ ${p} == "--enable-includes" ]] ; then enable_includes="yes" - elif [[ $p == "--disable-includes" ]] ; then + elif [[ ${p} == "--disable-includes" ]] ; then enable_includes="no" - elif [[ $p == "--libraries-static" ]] ; then + elif [[ ${p} == "--libraries-static" ]] ; then grab_next="destination_libraries_static" - elif [[ $p == "--libraries-shared" ]] ; then + elif [[ ${p} == "--libraries-shared" ]] ; then grab_next="destination_libraries_shared" - elif [[ $p == "--programs-static" ]] ; then + elif [[ ${p} == "--programs-static" ]] ; then grab_next="destination_programs_static" - elif [[ $p == "--programs-shared" ]] ; then + elif [[ ${p} == "--programs-shared" ]] ; then grab_next="destination_programs_shared" - elif [[ $operation_failure == "" ]] ; then - operation="$p" + elif [[ ${operation_failure} == "" ]] ; then + operation="${p}" operation_failure=fail-unsupported fi else - if [[ $grab_next == "path_build" ]] ; then - path_build=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "prefix" ]] ; then - destination_prefix=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "bindir" ]] ; then - destination_programs=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "docdir" ]] ; then - destination_documentation=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "etcdir" ]] ; then - destination_settings=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "includedir" ]] ; then - destination_includes=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "libdir" ]] ; then - destination_libraries=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "work" ]] ; then - work=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "destination_libraries_static" ]] ; then - destination_libraries_static=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "destination_libraries_shared" ]] ; then - destination_libraries_shared=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "destination_programs_static" ]] ; then - destination_programs_static=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') - elif [[ $grab_next == "destination_programs_shared" ]] ; then - destination_programs_shared=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') + if [[ ${grab_next} == "path_build" ]] ; then + path_build=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "prefix" ]] ; then + destination_prefix=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "bindir" ]] ; then + destination_programs=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "docdir" ]] ; then + destination_documentation=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "etcdir" ]] ; then + destination_settings=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "includedir" ]] ; then + destination_includes=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "libdir" ]] ; then + destination_libraries=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "work" ]] ; then + work=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "destination_libraries_static" ]] ; then + destination_libraries_static=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "destination_libraries_shared" ]] ; then + destination_libraries_shared=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "destination_programs_static" ]] ; then + destination_programs_static=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "destination_programs_shared" ]] ; then + destination_programs_shared=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') fi grab_next= @@ -227,32 +227,32 @@ install_main() { p= fi - if [[ $verbosity == "quiet" ]] ; then + if [[ ${verbosity} == "quiet" ]] ; then print_line_first="no" print_line_last="no" fi install_handle_colors - if [[ $do_help == "yes" ]] ; then + if [[ ${do_help} == "yes" ]] ; then install_help install_cleanup return 0 fi - if [[ $do_copyright == "yes" ]] ; then + if [[ ${do_copyright} == "yes" ]] ; then install_copyright install_cleanup return 0 fi - if [[ $operation_failure == "fail-unsupported" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${operation_failure} == "fail-unsupported" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The operation ${c_notice}$operation${c_error} was not recognized.${c_reset}" + echo -e "${c_error}ERROR: The operation ${c_notice}${operation}${c_error} was not recognized.${c_reset}" install_print_last fi @@ -262,11 +262,11 @@ install_main() { return 1 fi - if [[ ! -d $path_build ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ! -d ${path_build} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The build path ${c_notice}$path_build${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The build path ${c_notice}${path_build}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -276,11 +276,11 @@ install_main() { return 1 fi - if [[ $work == "" && $destination_prefix != "" && ! -d $destination_prefix ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && ${destination_prefix} != "" && ! -d ${destination_prefix} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination prefix ${c_notice}$destination_prefix${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination prefix ${c_notice}${destination_prefix}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -290,65 +290,65 @@ install_main() { return 1 fi - if [[ $destination_prefix != "" ]] ; then - if [[ $(echo $destination_documentation | grep -o '^/') == "" ]] ; then - destination_documentation="$destination_prefix$destination_documentation" + if [[ ${destination_prefix} != "" ]] ; then + if [[ $(echo ${destination_documentation} | grep -o '^/') == "" ]] ; then + destination_documentation="${destination_prefix}${destination_documentation}" fi - if [[ $(echo $destination_programs | grep -o '^/') == "" ]] ; then - destination_programs="$destination_prefix$destination_programs" + if [[ $(echo ${destination_programs} | grep -o '^/') == "" ]] ; then + destination_programs="${destination_prefix}${destination_programs}" fi - if [[ $(echo $destination_includes | grep -o '^/') == "" ]] ; then - destination_includes="$destination_prefix$destination_includes" + if [[ $(echo ${destination_includes} | grep -o '^/') == "" ]] ; then + destination_includes="${destination_prefix}${destination_includes}" fi - if [[ $(echo $destination_libraries | grep -o '^/') == "" ]] ; then - destination_libraries="$destination_prefix$destination_libraries" + if [[ $(echo ${destination_libraries} | grep -o '^/') == "" ]] ; then + destination_libraries="${destination_prefix}${destination_libraries}" fi - if [[ $(echo $destination_settings | grep -o '^/') == "" ]] ; then - destination_settings="$destination_prefix$destination_settings" + if [[ $(echo ${destination_settings} | grep -o '^/') == "" ]] ; then + destination_settings="${destination_prefix}${destination_settings}" fi fi - if [[ $destination_libraries_static != "" ]] ; then - if [[ $(echo $destination_libraries_static | grep -o '^/') == "" ]] ; then - destination_libraries_static=$destination_libraries$destination_libraries_static + if [[ ${destination_libraries_static} != "" ]] ; then + if [[ $(echo ${destination_libraries_static} | grep -o '^/') == "" ]] ; then + destination_libraries_static=${destination_libraries}${destination_libraries_static} fi else - destination_libraries_static=$destination_libraries + destination_libraries_static=${destination_libraries} fi - if [[ $destination_libraries_shared != "" ]] ; then - if [[ $(echo $destination_libraries_shared | grep -o '^/') == "" ]] ; then - destination_libraries_shared=$destination_libraries$destination_libraries_shared + if [[ ${destination_libraries_shared} != "" ]] ; then + if [[ $(echo ${destination_libraries_shared} | grep -o '^/') == "" ]] ; then + destination_libraries_shared=${destination_libraries}${destination_libraries_shared} fi else - destination_libraries_shared=$destination_libraries + destination_libraries_shared=${destination_libraries} fi - if [[ $destination_programs_static != "" ]] ; then - if [[ $(echo $destination_programs_static | grep -o '^/') == "" ]] ; then - destination_programs_static=$destination_programs$destination_programs_static + if [[ ${destination_programs_static} != "" ]] ; then + if [[ $(echo ${destination_programs_static} | grep -o '^/') == "" ]] ; then + destination_programs_static=${destination_programs}${destination_programs_static} fi else - destination_programs_static=$destination_programs + destination_programs_static=${destination_programs} fi - if [[ $destination_programs_shared != "" ]] ; then - if [[ $(echo $destination_programs_shared | grep -o '^/') == "" ]] ; then - destination_programs_shared=$destination_programs$destination_programs_shared + if [[ ${destination_programs_shared} != "" ]] ; then + if [[ $(echo ${destination_programs_shared} | grep -o '^/') == "" ]] ; then + destination_programs_shared=${destination_programs}${destination_programs_shared} fi else - destination_programs_shared=$destination_programs + destination_programs_shared=${destination_programs} fi - if [[ $work != "" && ! -d $work ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} != "" && ! -d ${work} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The work directory ${c_notice}$work${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The work directory ${c_notice}${work}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -358,11 +358,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_programs && ! -d $destination_programs ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_programs} && ! -d ${destination_programs} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination bindir ${c_notice}$destination_programs${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination bindir ${c_notice}${destination_programs}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -372,11 +372,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_programs_static && ! -d $destination_programs_static ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_programs_static} && ! -d ${destination_programs_static} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) bindir ${c_notice}$destination_programs_static${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) bindir ${c_notice}${destination_programs_static}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -386,11 +386,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_programs_shared && ! -d $destination_programs_shared ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_programs_shared} && ! -d ${destination_programs_shared} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) bindir ${c_notice}$destination_programs_shared${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) bindir ${c_notice}${destination_programs_shared}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -400,11 +400,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_includes && ! -d $destination_includes ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_includes} && ! -d ${destination_includes} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination incluedir ${c_notice}$destination_includes${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination incluedir ${c_notice}${destination_includes}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -414,11 +414,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_libraries_static && ! -d $destination_libraries_static ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_libraries_static} && ! -d ${destination_libraries_static} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) libdir ${c_notice}$destination_libraries_static${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination (${c_notice}static${c_error}) libdir ${c_notice}${destination_libraries_static}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -428,11 +428,11 @@ install_main() { return 1 fi - if [[ $work == "" && -e $destination_libraries_shared && ! -d $destination_libraries_shared ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${work} == "" && -e ${destination_libraries_shared} && ! -d ${destination_libraries_shared} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first - echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) libdir ${c_notice}$destination_libraries_shared${c_error} is not a valid directory.${c_reset}" + echo -e "${c_error}ERROR: The destination (${c_notice}shared${c_error}) libdir ${c_notice}${destination_libraries_shared}${c_error} is not a valid directory.${c_reset}" install_print_last fi @@ -444,15 +444,15 @@ install_main() { install_perform_install - if [[ $verbosity != "quiet" ]] ; then - if [[ $failure != "" || $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then + if [[ ${failure} != "" || ${verbosity} != "error" ]] ; then install_print_last fi fi install_cleanup - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -461,14 +461,14 @@ install_main() { install_handle_colors() { - if [[ $do_color == "light" ]] ; then + if [[ ${do_color} == "light" ]] ; then c_error="\\033[1;31m" c_warning="\\033[0;31m" c_title="\\033[1;34m" c_highlight="\\033[0;34m" c_notice="\\033[0;01m" c_important="\\033[0;35m" - elif [[ $do_color == "none" ]] ; then + elif [[ ${do_color} == "none" ]] ; then c_reset= c_title= c_error= @@ -557,17 +557,17 @@ install_perform_install() { local path= local message= - if [[ $enable_shared == "no" ]] ; then + if [[ ${enable_shared} == "no" ]] ; then enable_shared_programs="no" enable_shared_libraries="no" fi - if [[ $enable_static == "no" ]] ; then + if [[ ${enable_static} == "no" ]] ; then enable_static_programs="no" enable_static_libraries="no" fi - if [[ $work == "" ]] ; then + if [[ ${work} == "" ]] ; then message="install destination directory" else message="work directory" @@ -584,10 +584,10 @@ install_perform_install() { fi if [[ ! -d ${destination_prefix} ]] ; then - mkdir $verbose_common ${destination_prefix} + mkdir ${verbose_common} ${destination_prefix} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_prefix}${c_error}.${c_reset}" @@ -597,12 +597,12 @@ install_perform_install() { fi fi - if [[ $enable_shared_programs == "yes" || $enable_static_programs == "yes" ]] ; then + if [[ ${enable_shared_programs} == "yes" || ${enable_static_programs} == "yes" ]] ; then if [[ -d ${path_build}${path_programs} && ! -d ${destination_programs} ]] ; then - mkdir $verbose_common ${destination_programs} + mkdir ${verbose_common} ${destination_programs} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs}${c_error}.${c_reset}" @@ -612,11 +612,11 @@ install_perform_install() { fi fi - if [[ $enable_shared_programs == "yes" && -d ${path_build}${path_programs}${path_shared} && ! -d ${destination_programs_shared} ]] ; then - mkdir $verbose_common ${destination_programs_shared} + if [[ ${enable_shared_programs} == "yes" && -d ${path_build}${path_programs}${path_shared} && ! -d ${destination_programs_shared} ]] ; then + mkdir ${verbose_common} ${destination_programs_shared} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_shared}${c_error}.${c_reset}" @@ -626,11 +626,11 @@ install_perform_install() { fi fi - if [[ $enable_static_programs == "yes" && -d ${path_build}${path_programs}${path_static} && ! -d ${destination_programs_static} ]] ; then - mkdir $verbose_common ${destination_programs_static} + if [[ ${enable_static_programs} == "yes" && -d ${path_build}${path_programs}${path_static} && ! -d ${destination_programs_static} ]] ; then + mkdir ${verbose_common} ${destination_programs_static} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_programs_static}${c_error}.${c_reset}" @@ -641,12 +641,12 @@ install_perform_install() { fi fi - if [[ $enable_shared_libraries == "yes" || $enable_static_libraries == "yes" ]] ; then + if [[ ${enable_shared_libraries} == "yes" || ${enable_static_libraries} == "yes" ]] ; then if [[ -d ${path_build}${path_libraries} && ! -d ${destination_libraries} ]] ; then - mkdir $verbose_common ${destination_libraries} + mkdir ${verbose_common} ${destination_libraries} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create install ${message} ${c_notice}${destination_libraries}${c_error}.${c_reset}" @@ -656,11 +656,11 @@ install_perform_install() { fi fi - if [[ $enable_shared_libraries == "yes" && -d ${path_build}${path_libraries}${path_shared} && ! -d ${destination_libraries_shared} ]] ; then - mkdir $verbose_common ${destination_libraries_shared} + if [[ ${enable_shared_libraries} == "yes" && -d ${path_build}${path_libraries}${path_shared} && ! -d ${destination_libraries_shared} ]] ; then + mkdir ${verbose_common} ${destination_libraries_shared} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}" @@ -670,11 +670,11 @@ install_perform_install() { fi fi - if [[ $enable_static_libraries == "yes" && -d ${path_build}${path_libraries}${path_static} && ! -d ${destination_libraries_static} ]] ; then - mkdir $verbose_common ${destination_libraries_static} + if [[ ${enable_static_libraries} == "yes" && -d ${path_build}${path_libraries}${path_static} && ! -d ${destination_libraries_static} ]] ; then + mkdir ${verbose_common} ${destination_libraries_static} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_libraries_static}${c_error}.${c_reset}" @@ -685,12 +685,12 @@ install_perform_install() { fi fi - if [[ $enable_includes == "yes" ]] ; then + if [[ ${enable_includes} == "yes" ]] ; then if [[ -d ${path_build}${path_includes} && ! -d ${destination_includes} ]] ; then - mkdir $verbose_common ${destination_includes} + mkdir ${verbose_common} ${destination_includes} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_includes}${c_error}.${c_reset}" @@ -701,12 +701,12 @@ install_perform_install() { fi fi - if [[ $enable_documentation == "yes" ]] ; then + if [[ ${enable_documentation} == "yes" ]] ; then if [[ -d ${path_build}${path_documentation} && ! -d ${destination_documentation} ]] ; then - mkdir $verbose_common ${destination_documentation} + mkdir ${verbose_common} ${destination_documentation} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_documentation}${c_error}.${c_reset}" @@ -717,12 +717,12 @@ install_perform_install() { fi fi - if [[ $enable_settings == "yes" ]] ; then + if [[ ${enable_settings} == "yes" ]] ; then if [[ -d ${path_build}${path_settings} && ! -d ${destination_settings} ]] ; then - mkdir $verbose_common ${destination_settings} + mkdir ${verbose_common} ${destination_settings} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to create ${message} ${c_notice}${destination_settings}${c_error}.${c_reset}" @@ -733,29 +733,29 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_includes} && $enable_includes == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_includes} && ${enable_includes} == "yes" ]] ; then for i in ${path_build}${path_includes}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_includes}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_includes}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_includes}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_includes}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing Includes to: ${c_reset}${c_notice}${destination_includes}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_includes}* ${destination_includes} + cp ${verbose_common} -R ${path_build}${path_includes}* ${destination_includes} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to copy include files from ${c_notice}${path_build}${path_includes}${c_error} to ${c_notice}${destination_includes}${c_error}.${c_reset}" @@ -766,30 +766,30 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_libraries} && ( $enable_shared_libraries == "yes" || $enable_static_libraries == "yes" ) ]] ; then - if [[ -d ${path_build}${path_libraries}${path_static} && $enable_static_libraries == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_libraries} && ( ${enable_shared_libraries} == "yes" || ${enable_static_libraries} == "yes" ) ]] ; then + if [[ -d ${path_build}${path_libraries}${path_static} && ${enable_static_libraries} == "yes" ]] ; then for i in ${path_build}${path_libraries}${path_static}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_libraries}${path_static}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_libraries}${path_static}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_libraries}${path_static}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_libraries}${path_static}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_static}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_libraries}${path_static}* ${destination_libraries_static} + cp ${verbose_common} -R ${path_build}${path_libraries}${path_static}* ${destination_libraries_static} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to copy (${c_notice}static${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_static}${c_error} to ${c_notice}${destination_libraries_static}${c_error}.${c_reset}" @@ -800,29 +800,29 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_libraries}${path_shared} && $enable_shared_libraries == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_libraries}${path_shared} && ${enable_shared_libraries} == "yes" ]] ; then for i in ${path_build}${path_libraries}${path_shared}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_libraries}${path_shared}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_libraries}${path_shared}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_libraries}${path_shared}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_libraries}${path_shared}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Libraries to: ${c_reset}${c_notice}${destination_libraries_shared}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_libraries}${path_shared}* ${destination_libraries_shared} + cp ${verbose_common} -R ${path_build}${path_libraries}${path_shared}* ${destination_libraries_shared} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: Failed to copy (${c_notice}shared${c_error}) library files from ${c_notice}${path_build}${path_libraries}${path_shared}${c_error} to ${c_notice}${destination_libraries_shared}${c_error}.${c_reset}" @@ -834,30 +834,30 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_programs} && ( $enable_shared_programs == "yes" || $enable_static_programs == "yes" ) ]] ; then - if [[ -d ${path_build}${path_programs}${path_static} && $enable_static_programs == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_programs} && ( ${enable_shared_programs} == "yes" || ${enable_static_programs} == "yes" ) ]] ; then + if [[ -d ${path_build}${path_programs}${path_static} && ${enable_static_programs} == "yes" ]] ; then for i in ${path_build}${path_programs}${path_static}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_programs}${path_static}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_programs}${path_static}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_programs}${path_static}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_programs}${path_static}*" ]] ; then file= fi - if [[ $file != "" && $enable_static_programs == "yes" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" && ${enable_static_programs} == "yes" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing (${c_notice}static${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_static}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_programs}${path_static}* ${destination_programs_static} + cp ${verbose_common} -R ${path_build}${path_programs}${path_static}* ${destination_programs_static} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: failed to copy (${c_notice}static${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_static}${c_error} to ${c_notice}${destination_programs_static}${c_error}.${c_reset}" @@ -868,29 +868,29 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_programs}${path_shared} && $enable_shared_programs == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_programs}${path_shared} && ${enable_shared_programs} == "yes" ]] ; then for i in ${path_build}${path_programs}${path_shared}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_programs}${path_shared}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_programs}${path_shared}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_programs}${path_shared}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_programs}${path_shared}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing (${c_notice}shared${c_highlight}) Programs to: ${c_reset}${c_notice}${destination_programs_shared}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_programs}${path_shared}* ${destination_programs_shared} + cp ${verbose_common} -R ${path_build}${path_programs}${path_shared}* ${destination_programs_shared} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: failed to copy (${c_notice}shared${c_error}) program files from ${c_notice}${path_build}${path_programs}${path_shared}${c_error} to ${c_notice}${destination_programs_shared}${c_error}.${c_reset}" @@ -902,29 +902,29 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_settings} && $enable_settings == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_settings} && ${enable_settings} == "yes" ]] ; then for i in ${path_build}${path_settings}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_settings}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_settings}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_settings}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_settings}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing Settings to: ${c_reset}${c_notice}${destination_settings}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_settings}* ${destination_settings} + cp ${verbose_common} -R ${path_build}${path_settings}* ${destination_settings} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: failed to copy settings files from ${c_notice}${path_build}${path_settings}${c_error} to ${c_notice}${destination_settings}${c_error}.${c_reset}" @@ -935,29 +935,29 @@ install_perform_install() { fi fi - if [[ $failure == "" && -d ${path_build}${path_documentation} && $enable_documentation == "yes" ]] ; then + if [[ ${failure} == "" && -d ${path_build}${path_documentation} && ${enable_documentation} == "yes" ]] ; then for i in ${path_build}${path_documentation}* ; do - file=$(echo $i | sed -e "s|^${path_build}${path_documentation}||") + file=$(echo ${i} | sed -e "s|^${path_build}${path_documentation}||") break done - if [[ $file == "*" && ! -f "${path_build}${path_documentation}*" ]] ; then + if [[ ${file} == "*" && ! -f "${path_build}${path_documentation}*" ]] ; then file= fi - if [[ $file != "" ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${file} != "" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then install_print_first_or_always echo -e "${c_highlight}Installing Documentation to: ${c_reset}${c_notice}${destination_documentation}${c_reset}${c_highlight}.${c_reset}" fi - cp $verbose_common -R ${path_build}${path_documentation}* ${destination_documentation} + cp ${verbose_common} -R ${path_build}${path_documentation}* ${destination_documentation} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then install_print_first echo -e "${c_error}ERROR: failed to copy documentation files from ${c_notice}${path_build}${path_documentation}${c_error} to ${c_notice}${destination_documentation}${c_error}.${c_reset}" @@ -968,7 +968,7 @@ install_perform_install() { fi fi - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -977,7 +977,7 @@ install_perform_install() { install_print_first() { - if [[ $print_line_first == "yes" ]] ; then + if [[ ${print_line_first} == "yes" ]] ; then echo print_line_first= @@ -986,11 +986,11 @@ install_print_first() { install_print_first_or_always() { - if [[ $print_line_first == "yes" ]] ; then + if [[ ${print_line_first} == "yes" ]] ; then echo print_line_first= - elif [[ $print_line_first == "no" ]] ; then + elif [[ ${print_line_first} == "no" ]] ; then print_line_first= else echo @@ -999,7 +999,7 @@ install_print_first_or_always() { install_print_last() { - if [[ $print_line_last == "yes" ]] ; then + if [[ ${print_line_last} == "yes" ]] ; then echo fi } diff --git a/build/scripts/test.sh b/build/scripts/test.sh index b24e799..4e899df 100644 --- a/build/scripts/test.sh +++ b/build/scripts/test.sh @@ -16,7 +16,7 @@ test_main() { local shell_command=bash - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then shell_command=zsh emulate ksh @@ -24,7 +24,7 @@ test_main() { local public_name="FLL Project Mass Test Script" local system_name=install - local called_name=$(basename $0) + local called_name=$(basename ${0}) local version=0.7.0 local grab_next= @@ -47,9 +47,10 @@ test_main() { local build_compiler= local build_project=no - local path_scripts=$PWD/build/scripts/ + local build_project_thread="thread" + local path_scripts=${PWD}/build/scripts/ local path_scripts_package=${path_scripts}package.sh - local path_test=$PWD/test/ + local path_test=${PWD}/test/ local path_test_package=${path_test}package/ local path_test_project=${path_test}project/ local path_test_work=${path_test}work/ @@ -58,6 +59,8 @@ test_main() { local print_line_first="yes" local print_line_last="yes" local test_system= + local test_thread="thread" + local test_thread_individual="thread_individual" local context= local failure= @@ -73,81 +76,87 @@ test_main() { if [[ $# -gt 0 ]] ; then t=$# - while [[ $i -lt $t ]] ; do + while [[ ${i} -lt ${t} ]] ; do - let i=$i+1 + let i=${i}+1 - if [[ $SHELL_ENGINE == "zsh" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then p=${(P)i} else p=${!i} fi - if [[ $grab_next == "" ]] ; then - if [[ $p == "-h" || $p == "--help" ]] ; then + if [[ ${grab_next} == "" ]] ; then + if [[ ${p} == "-h" || ${p} == "--help" ]] ; then do_help=yes - elif [[ $p == "+C" || $p == "++copyright" ]] ; then + elif [[ ${p} == "+C" || ${p} == "++copyright" ]] ; then do_copyright="yes" - elif [[ $p == "+d" || $p == "++dark" ]] ; then + elif [[ ${p} == "+d" || ${p} == "++dark" ]] ; then do_color=dark context="+d" - elif [[ $p == "+l" || $p == "++light" ]] ; then + elif [[ ${p} == "+l" || ${p} == "++light" ]] ; then do_color=light context="+l" - elif [[ $p == "+n" || $p == "++no_color" ]] ; then + elif [[ ${p} == "+n" || ${p} == "++no_color" ]] ; then do_color=none context="+n" - elif [[ $p == "+Q" || $p == "++quiet" ]] ; then + elif [[ ${p} == "+Q" || ${p} == "++quiet" ]] ; then verbosity="quiet" verbose="+Q" verbose_common= - elif [[ $p == "+E" || $p == "++error" ]] ; then + elif [[ ${p} == "+E" || ${p} == "++error" ]] ; then verbosity="error" verbose="+E" verbose_common= - elif [[ $p == "+N" || $p == "++normal" ]] ; then + elif [[ ${p} == "+N" || ${p} == "++normal" ]] ; then verbosity= verbose="+N" verbose_common= - elif [[ $p == "+V" || $p == "++verbose" ]] ; then + elif [[ ${p} == "+V" || ${p} == "++verbose" ]] ; then verbosity="verbose" verbose="+V" verbose_common="-v" - elif [[ $p == "+D" || $p == "++debug" ]] ; then + elif [[ ${p} == "+D" || ${p} == "++debug" ]] ; then verbosity="debug" verbose="+D" verbose_common="-v" - elif [[ $p == "+F" || $p == "++line_first_no" ]] ; then + elif [[ ${p} == "+F" || ${p} == "++line_first_no" ]] ; then print_line_first="no" - elif [[ $p == "+L" || $p == "++line_last_no" ]] ; then + elif [[ ${p} == "+L" || ${p} == "++line_last_no" ]] ; then print_line_last="no" - elif [[ $p == "+v" || $p == "++version" ]] ; then - echo $version + elif [[ ${p} == "+v" || ${p} == "++version" ]] ; then + echo ${version} return 0 - elif [[ $p == "-c" || $p == "--compiler" ]] ; then + elif [[ ${p} == "-c" || ${p} == "--compiler" ]] ; then grab_next=build_compiler - elif [[ $p == "-p" || $p == "--project" ]] ; then + elif [[ ${p} == "-p" || ${p} == "--project" ]] ; then build_project=yes - elif [[ $p == "-s" || $p == "--path_scripts" ]] ; then + elif [[ ${p} == "-s" || ${p} == "--path_scripts" ]] ; then grab_next=path_scripts path_scripts= - elif [[ $p == "-t" || $p == "--path_test" ]] ; then + elif [[ ${p} == "-t" || ${p} == "--path_test" ]] ; then grab_next=path_test path_test= - elif [[ $test_system == "" ]] ; then - test_system="$p" + elif [[ ${p} == "-T" || ${p} == "--thread" ]] ; then + test_thread="thread" + test_thread_individual="thread_individual" + elif [[ ${p} == "-L" || ${p} == "--threadless" ]] ; then + test_thread="threadless" + test_thread_individual="" + elif [[ ${test_system} == "" ]] ; then + test_system="${p}" else - operation="$operation " + operation="${operation} " operation_failure=fail-too_many fi else - if [[ $grab_next == "build_compiler" ]] ; then - build_compiler=$p - elif [[ $grab_next == "path_scripts" ]] ; then - path_scripts=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') + if [[ ${grab_next} == "build_compiler" ]] ; then + build_compiler=${p} + elif [[ ${grab_next} == "path_scripts" ]] ; then + path_scripts=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') path_scripts_package=${path_scripts}package.sh - elif [[ $grab_next == "path_test" ]] ; then - path_test=$(echo $p | sed -e 's|^//*|/|' -e 's|/*$|/|') + elif [[ ${grab_next} == "path_test" ]] ; then + path_test=$(echo ${p} | sed -e 's|^//*|/|' -e 's|/*$|/|') path_test_package=${path_test}package/ path_test_package_individual=${path_test_package}individual/ path_test_package_stand_alone=${path_test_package}stand_alone/ @@ -162,29 +171,29 @@ test_main() { p= fi - if [[ $verbosity == "quiet" ]] ; then + if [[ ${verbosity} == "quiet" ]] ; then print_line_first="no" print_line_last="no" fi test_handle_colors - if [[ $do_help == "yes" ]] ; then + if [[ ${do_help} == "yes" ]] ; then test_help test_cleanup return 0 fi - if [[ $do_copyright == "yes" ]] ; then + if [[ ${do_copyright} == "yes" ]] ; then test_copyright test_cleanup return 0 fi - if [[ $operation_failure == "fail-too_many" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${operation_failure} == "fail-too_many" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Only a single build system is supported, received the following test systems ${c_notice}${test_system} ${operation}${c_error} was not recognized.${c_reset}" @@ -193,16 +202,16 @@ test_main() { let failure=1 fi - if [[ $test_system == "" ]] ; then + if [[ ${test_system} == "" ]] ; then test_system=normal fi - if [[ $grab_next != "build_compiler" && $build_compiler == "" ]] ; then + if [[ ${grab_next} != "build_compiler" && ${build_compiler} == "" ]] ; then build_compiler=gcc fi - if [[ $failure -eq 0 && $test_system != "normal" && $test_system != "github" && $test_system != "gitlab" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} -eq 0 && ${test_system} != "normal" && ${test_system} != "github" && ${test_system} != "gitlab" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The test system must be one of ${c_notice}normal${c_error}, ${c_notice}github${c_error}, or ${c_notice}gitlab${c_error}.${c_reset}" @@ -211,8 +220,8 @@ test_main() { let failure=1 fi - if [[ $failure -eq 0 && $build_compiler != "gcc" && $build_compiler != "clang" ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} -eq 0 && ${build_compiler} != "gcc" && ${build_compiler} != "clang" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The build compiler ${c_notice}${build_compiler}${c_error} is not currently directly supported.${c_reset}" @@ -221,8 +230,8 @@ test_main() { let failure=1 fi - if [[ $failure -eq 0 && ! -d $path_scripts ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} -eq 0 && ! -d ${path_scripts} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The build scripts path ${c_notice}${path_scripts}${c_error} is not a valid directory.${c_reset}" @@ -231,8 +240,8 @@ test_main() { let failure=1 fi - if [[ $failure -eq 0 && ! -f $path_scripts_package ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${failure} -eq 0 && ! -f ${path_scripts_package} ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Unable to find the package build script file under the build scripts path at ${c_notice}${path_scripts_package}${c_error}.${c_reset}" @@ -241,11 +250,11 @@ test_main() { let failure=1 fi - if [[ $failure -eq 0 && ! -d $path_test ]] ; then - mkdir $verbose_common -p $path_test + if [[ ${failure} -eq 0 && ! -d ${path_test} ]] ; then + mkdir ${verbose_common} -p ${path_test} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The test path ${c_notice}${path_test}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" @@ -255,11 +264,11 @@ test_main() { fi fi - if [[ $failure -eq 0 && ! -d $path_test_package ]] ; then - mkdir $verbose_common $path_test_package + if [[ ${failure} -eq 0 && ! -d ${path_test_package} ]] ; then + mkdir ${verbose_common} ${path_test_package} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The package path ${c_notice}${path_test_package}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" @@ -269,11 +278,11 @@ test_main() { fi fi - if [[ $failure -eq 0 && ! -d $path_test_project ]] ; then - mkdir $verbose_common $path_test_project + if [[ ${failure} -eq 0 && ! -d ${path_test_project} ]] ; then + mkdir ${verbose_common} ${path_test_project} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The test project path ${c_notice}${path_test_project}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" @@ -283,11 +292,11 @@ test_main() { fi fi - if [[ $failure -eq 0 && ! -d $path_test_work ]] ; then - mkdir $verbose_common $path_test_work + if [[ ${failure} -eq 0 && ! -d ${path_test_work} ]] ; then + mkdir ${verbose_common} ${path_test_work} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: The test work path ${c_notice}${path_test_work}${c_error}, does not exist and could not be created or exists and is not a valid directory.${c_reset}" @@ -297,20 +306,20 @@ test_main() { fi fi - if [[ $failure -eq 0 ]] ; then + if [[ ${failure} -eq 0 ]] ; then test_operate let failure=$? fi - if [[ $verbosity != "quiet" ]] ; then - if [[ $failure != "" || $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then + if [[ ${failure} != "" || ${verbosity} != "error" ]] ; then test_print_last fi fi test_cleanup - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -319,14 +328,14 @@ test_main() { test_handle_colors() { - if [[ $do_color == "light" ]] ; then + if [[ ${do_color} == "light" ]] ; then c_error="\\033[1;31m" c_warning="\\033[0;31m" c_title="\\033[1;34m" c_highlight="\\033[0;34m" c_notice="\\033[0;01m" c_important="\\033[0;35m" - elif [[ $do_color == "none" ]] ; then + elif [[ ${do_color} == "none" ]] ; then c_reset= c_title= c_error= @@ -351,7 +360,7 @@ test_help() { echo -e " ${c_important}github${c_reset} Perform a test meant to be used within Github." echo -e " ${c_important}gitlab${c_reset} Perform a test meant to be used within Gitlab (not yet supported)." echo - echo -e "${c_highlight}Options:${c_reset}" + echo -e "${c_highlight}Available Options:${c_reset}" echo -e " -${c_important}h${c_reset}, --${c_important}help${c_reset} Print this help message." echo -e " +${c_important}C${c_reset}, ++${c_important}copyright${c_reset} Print the copyright." echo -e " +${c_important}d${c_reset}, ++${c_important}dark${c_reset} Output using colors that show up better on dark backgrounds." @@ -366,11 +375,12 @@ test_help() { echo -e " +${c_important}F${c_reset}, ++${c_important}line_first_no${c_reset} Disable printing of first line." echo -e " +${c_important}L${c_reset}, ++${c_important}line_last_no${c_reset} Disable printing of last line." echo - echo -e "${c_highlight}Install Options:${c_reset}" echo -e " -${c_important}c${c_reset}, --${c_important}compiler${c_reset} Specify the compiler, either gcc (default) or clang." echo -e " -${c_important}p${c_reset}, --${c_important}project${c_reset} Designate that the project files must also be built." echo -e " -${c_important}s${c_reset}, --${c_important}path_scripts${c_reset} Specify a custom directory where the build scripts are found." echo -e " -${c_important}t${c_reset}, --${c_important}path_test${c_reset} Specify a custom directory where the test environment is found." + echo -e " -${c_important}T${c_reset}, --${c_important}thread${c_reset} Compile code being tested with threads enabled." + echo -e " -${c_important}L${c_reset}, --${c_important}threadless${c_reset} Compile code being tested with threads disabled." test_print_last } @@ -396,30 +406,30 @@ test_operate() { local libraries_path="${work_path}libraries/shared/" local ci_arguments= - if [[ $PATH != "" ]] ; then + if [[ ${PATH} != "" ]] ; then env_path="${env_path}:${PATH}" fi - if [[ $LD_LIBRARY_PATH != "" ]] ; then + if [[ ${LD_LIBRARY_PATH} != "" ]] ; then env_libs="${env_libs}:${LD_LIBRARY_PATH}" fi - if [[ $test_system == "github" || $test_system == "gitlab" ]] ; then + if [[ ${test_system} == "github" || ${test_system} == "gitlab" ]] ; then ci_arguments="-d -I${includes_path} -d -L${libraries_path}" test_operate_ci_prebuild - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 return 1 fi fi - if [[ $build_project == "yes" ]] ; then + if [[ ${build_project} == "yes" ]] ; then test_operate_build_tools - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 return 1 @@ -428,16 +438,16 @@ test_operate() { test_operate_build_individual - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 return 1 fi - if [[ $test_system == "github" || $test_system == "gitlab" ]] ; then + if [[ ${test_system} == "github" || ${test_system} == "gitlab" ]] ; then test_operate_ci_pretest - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 return 1 @@ -451,9 +461,9 @@ test_operate() { test_operate_build_individual() { local project= - local path_original="$PWD/" + local path_original="${PWD}/" - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always echo -e "${c_highlight}Cleaning and building package.${c_reset}" @@ -461,16 +471,16 @@ test_operate_build_individual() { echo fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "$shell_command ${path_scripts_package} $verbose $context +F -d $path_test_package -i rebuild" + echo "${shell_command} ${path_scripts_package} ${verbose} ${context} +F -d ${path_test_package} -i rebuild" fi - $shell_command ${path_scripts_package} $verbose $context +F -d $path_test_package -i rebuild + ${shell_command} ${path_scripts_package} ${verbose} ${context} +F -d ${path_test_package} -i rebuild - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to clean and build the individual packages.${c_reset}" @@ -479,22 +489,22 @@ test_operate_build_individual() { return 1 fi - for project in $projects ; do + for project in ${projects} ; do - test_operate_build_project "$path_test_package_individual" "$path_test_work" "$project" individual + test_operate_build_project "${path_test_package_individual}" "${path_test_work}" "${project}" individual ${test_thread} ${test_thread_individual} - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 - cd $path_original + cd ${path_original} break; fi - cd $path_original + cd ${path_original} done - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -502,14 +512,28 @@ test_operate_build_individual() { } test_operate_build_project() { - local path_="$1" - local destination="$2" - local project="$3" - local mode="$4" - local bootstrap="$5" + local path_="${1}" + local destination="${2}" + local project="${3}" + local mode="${4}" + local bootstrap="${5}" + local mode_thread_param= + local mode_thread_value= + local mode_thread_individual_param= + local mode_thread_individual_value= + + if [[ ${6} != "" ]] ; then + local mode_thread_param="-m" + local mode_thread_value="${6}" + fi + + if [[ ${7} != "" ]] ; then + local mode_thread_individual_param="-m" + local mode_thread_individual_value="${7}" + fi if [[ ! -d ${path_}${project}-${version}/ ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Package directory '${c_notice}${path_}${project}-${version}${c_error}' is invalid or missing.${c_reset}" @@ -518,7 +542,7 @@ test_operate_build_project() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always echo -e "Running '${c_notice}cd ${path_}${project}-${version}/${c_reset}'." @@ -526,8 +550,8 @@ test_operate_build_project() { cd ${path_}${project}-${version}/ - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to change into directory '${c_notice}${path_}${project}-${version}${c_error}'.${c_reset}" @@ -538,63 +562,63 @@ test_operate_build_project() { return 1 fi - if [[ $bootstrap == "" ]] ; then - if [[ $verbosity == "debug" ]] ; then + if [[ ${bootstrap} == "" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - if [[ $build_compiler == "gcc" ]] ; then - echo "PATH=\"$env_path\" LD_LIBRARY_PATH=\"$env_libs\" fake $verbose $context -w \"$destination\" -m $mode clean build $ci_arguments" + if [[ ${build_compiler} == "gcc" ]] ; then + echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} clean build ${ci_arguments}" else - echo "PATH=\"$env_path\" LD_LIBRARY_PATH=\"$env_libs\" fake $verbose $context -w \"$destination\" -m $mode -m $build_compiler clean make -f testfile $ci_arguments" + echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} -m ${build_compiler} ${mode_thread_individual_param} ${mode_thread_individual_value} clean make -f testfile ${ci_arguments}" fi fi - if [[ $build_compiler == "gcc" ]] ; then - PATH="$env_path" LD_LIBRARY_PATH="$env_libs" fake $verbose $context -w "$destination" -m $mode -m test clean build $ci_arguments + if [[ ${build_compiler} == "gcc" ]] ; then + PATH="${env_path}" LD_LIBRARY_PATH="${env_libs}" fake ${verbose} ${context} -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test clean build ${ci_arguments} else - PATH="$env_path" LD_LIBRARY_PATH="$env_libs" fake $verbose $context -w "$destination" -m $mode -m test -m $build_compiler clean build $ci_arguments + PATH="${env_path}" LD_LIBRARY_PATH="${env_libs}" fake ${verbose} ${context} -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test -m ${build_compiler} clean build ${ci_arguments} fi else - if [[ $SHELL_ENGINE == "zsh" ]] ; then - if [[ $verbosity == "debug" ]] ; then + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - if [[ $build_compiler == "gcc" ]] ; then - echo "zsh ./bootstrap.sh $verbose $context +F -w \"$destination\" -m $mode -m test build" + if [[ ${build_compiler} == "gcc" ]] ; then + echo "zsh ./bootstrap.sh ${verbose} ${context} +F -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test build" else - echo "zsh ./bootstrap.sh $verbose $context +F -w \"$destination\" -m $mode -m test -m $build_compiler build" + echo "zsh ./bootstrap.sh ${verbose} ${context} +F -w \"${destination}\" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test -m ${build_compiler} build" fi fi - if [[ $build_compiler == "gcc" ]] ; then - zsh ./bootstrap.sh $verbose $context +F -w "$destination" -m $mode -m test build + if [[ ${build_compiler} == "gcc" ]] ; then + zsh ./bootstrap.sh ${verbose} ${context} +F -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test build else - zsh ./bootstrap.sh $verbose $context +F -w "$destination" -m $mode -m test -m $build_compiler build + zsh ./bootstrap.sh ${verbose} ${context} +F -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test -m ${build_compiler} build fi else - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - if [[ $build_compiler == "gcc" ]] ; then - echo "./bootstrap.sh $verbose $context +F -w \"$destination\" -m $mode -m test build" + if [[ ${build_compiler} == "gcc" ]] ; then + echo "./bootstrap.sh ${verbose} ${context} +F -w \"${destination}\" -m ${mode} ${mode_thread_individual_param} ${mode_thread_individual_value} ${mode_thread_param} ${mode_thread_value} -m test build" else - echo "./bootstrap.sh $verbose $context +F -w \"$destination\" -m $mode -m test -m $build_compiler build" + echo "./bootstrap.sh ${verbose} ${context} +F -w \"${destination}\" -m ${mode} ${mode_thread_individual_param} ${mode_thread_individual_value} ${mode_thread_param} ${mode_thread_value} -m test -m ${build_compiler} build" fi fi - if [[ $build_compiler == "gcc" ]] ; then - ./bootstrap.sh $verbose $context +F -w "$destination" -m $mode -m test build + if [[ ${build_compiler} == "gcc" ]] ; then + ./bootstrap.sh ${verbose} ${context} +F -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test build else - ./bootstrap.sh $verbose $context +F -w "$destination" -m $mode -m test -m $build_compiler build + ./bootstrap.sh ${verbose} ${context} +F -w "${destination}" -m ${mode} ${mode_thread_param} ${mode_thread_value} ${mode_thread_individual_param} ${mode_thread_individual_value} -m test -m ${build_compiler} build fi fi fi - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to build $mode project '${c_notice}$project${c_reset}${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to build ${mode} project '${c_notice}${project}${c_reset}${c_error}'.${c_reset}" fi let failure=1 @@ -602,22 +626,22 @@ test_operate_build_project() { return 1 fi - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then - echo -e "Installing $mode project '${c_notice}$project${c_reset}'." + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then + echo -e "Installing ${mode} project '${c_notice}${project}${c_reset}'." echo fi - if [[ $SHELL_ENGINE == "zsh" ]] ; then - zsh ./install.sh $verbose $context +F +L -w "$destination" + if [[ ${SHELL_ENGINE} == "zsh" ]] ; then + zsh ./install.sh ${verbose} ${context} +F +L -w "${destination}" else - ./install.sh $verbose $context +F +L -w "$destination" + ./install.sh ${verbose} ${context} +F +L -w "${destination}" fi - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to install $mode project '${c_notice}$project${c_reset}${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to install ${mode} project '${c_notice}${project}${c_reset}${c_error}'.${c_reset}" fi let failure=1 @@ -629,9 +653,9 @@ test_operate_build_project() { } test_operate_build_tools() { - local path_original="$PWD/" + local path_original="${PWD}/" - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always echo -e "${c_highlight}Building project build tools.${c_reset}" @@ -639,16 +663,16 @@ test_operate_build_tools() { echo fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "$shell_command ${path_scripts_package} $verbose $context +F -d $path_test_package -S fake rebuild" + echo "${shell_command} ${path_scripts_package} ${verbose} ${context} +F -d ${path_test_package} -S fake rebuild" fi - $shell_command ${path_scripts_package} $verbose $context +F -d $path_test_package -S fake rebuild + ${shell_command} ${path_scripts_package} ${verbose} ${context} +F -d ${path_test_package} -S fake rebuild - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to clean and build the stand_alone fake package.${c_reset}" @@ -657,15 +681,15 @@ test_operate_build_tools() { return 1 fi - test_operate_build_project "$path_test_package_stand_alone" "$path_test_project" fake stand_alone bootstrap + test_operate_build_project "${path_test_package_stand_alone}" "${path_test_project}" fake stand_alone bootstrap ${build_project_thread} - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 fi - cd $path_original + cd ${path_original} - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -674,14 +698,14 @@ test_operate_build_tools() { test_operate_ci_prebuild() { local clone_quiet= - local path_original="$PWD/" + local path_original="${PWD}/" local result= - if [[ $verbosity == "quiet" ]] ; then + if [[ ${verbosity} == "quiet" ]] ; then clone_quiet="-q" fi - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always echo -e "${c_highlight}Performing Github Specific Pre-Build Operations.${c_reset}" @@ -691,13 +715,13 @@ test_operate_ci_prebuild() { test_operate_ci_prebuild_libcap - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 fi cd ${path_original} - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -706,14 +730,14 @@ test_operate_ci_prebuild() { test_operate_ci_pretest() { local clone_quiet= - local path_original="$PWD/" + local path_original="${PWD}/" local result= - if [[ $verbosity == "quiet" ]] ; then + if [[ ${verbosity} == "quiet" ]] ; then clone_quiet="-q" fi - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always echo -e "${c_highlight}Performing Github Specific Pre-Test Operations.${c_reset}" @@ -723,13 +747,13 @@ test_operate_ci_pretest() { test_operate_ci_pretest_cmocka - if [[ $? -ne 0 ]] ; then + if [[ ${?} -ne 0 ]] ; then let failure=1 fi cd ${path_original} - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -744,29 +768,29 @@ test_operate_ci_pretest_cmocka() { local cmocka_uri="https://github.com/coreboot/cmocka.git" local cmocka_branch="cmocka-1.1.5" - if [[ -d $cmocka_path ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ -d ${cmocka_path} ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always - echo -e "Detected existing cmocka repository at \"${c_notice}$cmocka_path${c_reset}\", skipping the cmocka process." + echo -e "Detected existing cmocka repository at \"${c_notice}${cmocka_path}${c_reset}\", skipping the cmocka process." fi return 0 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "git clone $clone_quiet --single-branch -b $cmocka_branch \"$cmocka_uri\" $cmocka_path" + echo "git clone ${clone_quiet} --single-branch -b ${cmocka_branch} \"${cmocka_uri}\" ${cmocka_path}" fi - git clone $clone_quiet --single-branch -b $cmocka_branch "$cmocka_uri" $cmocka_path + git clone ${clone_quiet} --single-branch -b ${cmocka_branch} "${cmocka_uri}" ${cmocka_path} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to git clone '${c_notice}$cmocka_uri${c_error}' onto '${c_notice}$cmocka_path${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to git clone '${c_notice}${cmocka_uri}${c_error}' onto '${c_notice}${cmocka_path}${c_error}'.${c_reset}" fi let failure=1 @@ -774,19 +798,19 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "mkdir $verbose_common -p $cmocka_data" + echo "mkdir ${verbose_common} -p ${cmocka_data}" fi - mkdir $verbose_common -p $cmocka_data + mkdir ${verbose_common} -p ${cmocka_data} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to create cmocka build data directory '${c_notice}$cmocka_data${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to create cmocka build data directory '${c_notice}${cmocka_data}${c_error}'.${c_reset}" fi let failure=1 @@ -794,19 +818,19 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "cp $verbose_common $cmocka_settings $cmocka_data" + echo "cp ${verbose_common} ${cmocka_settings} ${cmocka_data}" fi - cp $verbose_common $cmocka_settings $cmocka_data + cp ${verbose_common} ${cmocka_settings} ${cmocka_data} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to copy cmocka build settings: '${c_notice}$cmocka_settings${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to copy cmocka build settings: '${c_notice}${cmocka_settings}${c_error}'.${c_reset}" fi let failure=1 @@ -814,19 +838,19 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "cd $cmocka_path" + echo "cd ${cmocka_path}" fi - cd $cmocka_path + cd ${cmocka_path} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to change cmocka source directory '${c_notice}$cmocka_path${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to change cmocka source directory '${c_notice}${cmocka_path}${c_error}'.${c_reset}" fi let failure=1 @@ -834,16 +858,16 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "PATH=\"$env_path\" LD_LIBRARY_PATH=\"$env_libs\" fake $verbose $context -w \"$path_test_work\" -m $build_compiler clean build $ci_arguments" + echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${path_test_work}\" -m ${build_compiler} -m ${test_thread} clean build ${ci_arguments}" fi - PATH="$env_path" LD_LIBRARY_PATH="$env_libs" fake $verbose $context -w "$path_test_work" -m $build_compiler clean build $ci_arguments + PATH="${env_path}" LD_LIBRARY_PATH="${env_libs}" fake ${verbose} ${context} -w "${path_test_work}" -m ${build_compiler} -m ${test_thread} clean build ${ci_arguments} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to build '${c_notice}cmocka${c_error}'.${c_reset}" @@ -854,16 +878,16 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "cp $verbose_common -R ${cmocka_build}includes/* ${work_path}includes/" + echo "cp ${verbose_common} -R ${cmocka_build}includes/* ${work_path}includes/" fi - cp $verbose_common -R ${cmocka_build}includes/* ${work_path}includes/ + cp ${verbose_common} -R ${cmocka_build}includes/* ${work_path}includes/ - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to install cmocka headers to '${c_notice}${work_path}includes/${c_error}'.${c_reset}" @@ -874,16 +898,16 @@ test_operate_ci_pretest_cmocka() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "cp $verbose_common -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/" + echo "cp ${verbose_common} -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/" fi - cp $verbose_common -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/ + cp ${verbose_common} -R ${cmocka_build}libraries/shared/* ${work_path}libraries/shared/ - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to install cmocka libraries to '${c_notice}${work_path}libraries/shared/${c_error}'.${c_reset}" @@ -902,29 +926,29 @@ test_operate_ci_prebuild_libcap() { local libcap_uri="https://github.com/thekevinday/kernel.org-libcap.git" local libcap_branch="master" - if [[ -d $libcap_path ]] ; then - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ -d ${libcap_path} ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always - echo -e "Detected existing libcap repository at \"${c_notice}$libcap_path${c_reset}\", skipping the libcap process." + echo -e "Detected existing libcap repository at \"${c_notice}${libcap_path}${c_reset}\", skipping the libcap process." fi return 0 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "git clone $clone_quiet --single-branch -b $libcap_branch \"$libcap_uri\" $libcap_path" + echo "git clone ${clone_quiet} --single-branch -b ${libcap_branch} \"${libcap_uri}\" ${libcap_path}" fi - git clone $clone_quiet --single-branch -b $libcap_branch "$libcap_uri" $libcap_path + git clone ${clone_quiet} --single-branch -b ${libcap_branch} "${libcap_uri}" ${libcap_path} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to git clone '${c_notice}$libcap_uri${c_error}' onto '${c_notice}$libcap_path${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to git clone '${c_notice}${libcap_uri}${c_error}' onto '${c_notice}${libcap_path}${c_error}'.${c_reset}" fi let failure=1 @@ -932,19 +956,19 @@ test_operate_ci_prebuild_libcap() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo "cd $libcap_path" + echo "cd ${libcap_path}" fi - cd $libcap_path + cd ${libcap_path} - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to change libcap source directory '${c_notice}$libcap_path${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to change libcap source directory '${c_notice}${libcap_path}${c_error}'.${c_reset}" test_print_last fi @@ -954,7 +978,7 @@ test_operate_ci_prebuild_libcap() { return 1 fi - if [[ $verbosity == "debug" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always echo "make MANDIR=${work_path}fake/ SBINDIR=${work_path}fake/ INCDIR=${work_path}includes/ LIBDIR=${work_path}libraries/shared/ PKGCONFIGDIR=${work_path}fake/ install" @@ -962,8 +986,8 @@ test_operate_ci_prebuild_libcap() { make MANDIR=${work_path}fake/ SBINDIR=${work_path}fake/ INCDIR=${work_path}includes/ LIBDIR=${work_path}libraries/shared/ PKGCONFIGDIR=${work_path}fake/ install - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first echo -e "${c_error}ERROR: Failed to build and install libcap into the work directory '${c_notice}${work_path}${c_error}'.${c_reset}" @@ -981,24 +1005,30 @@ test_operate_ci_prebuild_libcap() { test_operate_tests() { local project= - local path_original="$PWD/" - local destination="$path_test_work" + local path_original="${PWD}/" + local destination="${path_test_work}" + local thread_individual_param= + local thread_individual_value="${test_thread_individual}" + + if [[ ${test_thread_individual} != "" ]] ; then + thread_individual_param="-m" + fi - for project in $projects ; do + for project in ${projects} ; do - if [[ $verbosity != "quiet" && $verbosity != "error" ]] ; then + if [[ ${verbosity} != "quiet" && ${verbosity} != "error" ]] ; then test_print_first_or_always - echo -e "${c_highlight}Testing Project $project.${c_reset}" + echo -e "${c_highlight}Testing Project ${project}.${c_reset}" echo -e "${c_title}--------------------------------------${c_reset}" echo fi - if [[ ! -d $path_test_package_individual$project-$version/ ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ! -d ${path_test_package_individual}${project}-${version}/ ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Package directory '${c_notice}$path_test_package_individual$project-$version${c_error}' is invalid or missing.${c_reset}" + echo -e "${c_error}ERROR: Package directory '${c_notice}${path_test_package_individual}${project}-${version}${c_error}' is invalid or missing.${c_reset}" test_print_last fi @@ -1006,38 +1036,38 @@ test_operate_tests() { let failure=1 fi - if [[ $failure == "" ]] ; then - if [[ ! -f $path_test_package_individual$project-$version/data/build/testfile ]] ; then - if [[ $(echo $projects_no_tests | grep -o "\<$project\>") == "" ]] ; then - if [[ $verbosity == "verbose" || $verbosity == "debug" ]] ; then + if [[ ${failure} == "" ]] ; then + if [[ ! -f ${path_test_package_individual}${project}-${version}/data/build/testfile ]] ; then + if [[ $(echo ${projects_no_tests} | grep -o "\<${project}\>") == "" ]] ; then + if [[ ${verbosity} == "verbose" || ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo -e "${c_warning}WARNING: Project '${c_notice}$project${c_warning}' does not have a testfile.${c_reset}" + echo -e "${c_warning}WARNING: Project '${c_notice}${project}${c_warning}' does not have a testfile.${c_reset}" fi else test_print_first_or_always - echo -e "Project '${c_notice}$project${c_reset}' has no tests and is not expected to.${c_reset}" + echo -e "Project '${c_notice}${project}${c_reset}' has no tests and is not expected to.${c_reset}" fi continue fi fi - if [[ $failure == "" ]] ; then - if [[ $verbosity == "debug" ]] ; then + if [[ ${failure} == "" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - echo -e "Running '${c_notice}cd $path_test_package_individual$project-$version/${c_reset}'." + echo -e "Running '${c_notice}cd ${path_test_package_individual}${project}-${version}/${c_reset}'." fi - cd $path_test_package_individual$project-$version/ + cd ${path_test_package_individual}${project}-${version}/ - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failed to change into directory '${c_notice}$path_test_package_individual$project-$version${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failed to change into directory '${c_notice}${path_test_package_individual}${project}-${version}${c_error}'.${c_reset}" test_print_last fi @@ -1046,28 +1076,28 @@ test_operate_tests() { fi fi - if [[ $failure == "" ]] ; then - if [[ $verbosity == "debug" ]] ; then + if [[ ${failure} == "" ]] ; then + if [[ ${verbosity} == "debug" ]] ; then test_print_first_or_always - if [[ $build_compiler == "gcc" ]] ; then - echo "PATH=\"$env_path\" LD_LIBRARY_PATH=\"$env_libs\" fake $verbose $context -w \"$destination\" -m individual -m test clean make -f testfile $ci_arguments" + if [[ ${build_compiler} == "gcc" ]] ; then + echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m individual -m ${test_thread} ${thread_individual_param} ${thread_individual_value} -m test clean make -f testfile ${ci_arguments}" else - echo "PATH=\"$env_path\" LD_LIBRARY_PATH=\"$env_libs\" fake $verbose $context -w \"$destination\" -m individual -m test -m $build_compiler clean make -f testfile $ci_arguments" + echo "PATH=\"${env_path}\" LD_LIBRARY_PATH=\"${env_libs}\" fake ${verbose} ${context} -w \"${destination}\" -m individual -m ${test_thread} ${thread_individual_param} ${thread_individual_value} -m test -m ${build_compiler} clean make -f testfile ${ci_arguments}" fi fi - if [[ $build_compiler == "gcc" ]] ; then - PATH="$env_path" LD_LIBRARY_PATH="$env_libs" fake $verbose $context -w "$destination" -m individual -m test clean make -f testfile $ci_arguments + if [[ ${build_compiler} == "gcc" ]] ; then + PATH="${env_path}" LD_LIBRARY_PATH="${env_libs}" fake ${verbose} ${context} -w "${destination}" -m individual -m ${test_thread} ${thread_individual_param} ${thread_individual_value} -m test clean make -f testfile ${ci_arguments} else - PATH="$env_path" LD_LIBRARY_PATH="$env_libs" fake $verbose $context -w "$destination" -m individual -m test -m $build_compiler clean make -f testfile $ci_arguments + PATH="${env_path}" LD_LIBRARY_PATH="${env_libs}" fake ${verbose} ${context} -w "${destination}" -m individual -m ${test_thread} ${thread_individual_param} ${thread_individual_value} -m test -m ${build_compiler} clean make -f testfile ${ci_arguments} fi - if [[ $? -ne 0 ]] ; then - if [[ $verbosity != "quiet" ]] ; then + if [[ ${?} -ne 0 ]] ; then + if [[ ${verbosity} != "quiet" ]] ; then test_print_first - echo -e "${c_error}ERROR: Failure while testing project '${c_notice}$project${c_reset}${c_error}'.${c_reset}" + echo -e "${c_error}ERROR: Failure while testing project '${c_notice}${project}${c_reset}${c_error}'.${c_reset}" test_print_last fi @@ -1076,14 +1106,14 @@ test_operate_tests() { fi fi - cd $path_original + cd ${path_original} - if [[ $failure != "" ]] ; then + if [[ ${failure} != "" ]] ; then break; fi done - if [[ $failure == "" ]] ; then + if [[ ${failure} == "" ]] ; then return 0 fi @@ -1092,7 +1122,7 @@ test_operate_tests() { test_print_first() { - if [[ $print_line_first == "yes" ]] ; then + if [[ ${print_line_first} == "yes" ]] ; then echo print_line_first= @@ -1101,11 +1131,11 @@ test_print_first() { test_print_first_or_always() { - if [[ $print_line_first == "yes" ]] ; then + if [[ ${print_line_first} == "yes" ]] ; then echo print_line_first= - elif [[ $print_line_first == "no" ]] ; then + elif [[ ${print_line_first} == "no" ]] ; then print_line_first= else echo @@ -1114,7 +1144,7 @@ test_print_first_or_always() { test_print_last() { - if [[ $print_line_last == "yes" ]] ; then + if [[ ${print_line_last} == "yes" ]] ; then echo fi } diff --git a/build/stand_alone/fake.config.h b/build/stand_alone/fake.config.h index f240f7c..c83ec0d 100644 --- a/build/stand_alone/fake.config.h +++ b/build/stand_alone/fake.config.h @@ -1447,7 +1447,7 @@ #define _di_f_signal_set_has_ #define _di_f_signal_suspend_ //#define _di_f_signal_t_ -#define _di_f_signal_wait_ +//#define _di_f_signal_wait_ #define _di_f_signal_wait_until_ #define _di_f_states_adjust_ @@ -1725,7 +1725,7 @@ #define _di_f_thread_attribute_stack_set_ #define _di_f_thread_attribute_stack_size_get_ #define _di_f_thread_attribute_stack_size_set_ -#define _di_f_thread_attribute_t_ +//#define _di_f_thread_attribute_t_ #define _di_f_thread_barrier_attribute_create_ #define _di_f_thread_barrier_attribute_delete_ #define _di_f_thread_barrier_attributes_adjust_ @@ -1752,8 +1752,8 @@ #define _di_f_thread_barrier_t_ #define _di_f_thread_barrier_wait_ #define _di_f_thread_caller_ -#define _di_f_thread_cancel_ -#define _di_f_thread_cancel_state_set_ +//#define _di_f_thread_cancel_ +//#define _di_f_thread_cancel_state_set_ #define _di_f_thread_cancel_test_ #define _di_f_thread_cancel_type_set_ #define _di_f_thread_clock_get_id_ @@ -1788,7 +1788,7 @@ #define _di_f_thread_condition_t_ #define _di_f_thread_condition_wait_ #define _di_f_thread_condition_wait_timed_ -#define _di_f_thread_create_ +//#define _di_f_thread_create_ #define _di_f_thread_detach_ #define _di_f_thread_exit_ #define _di_f_thread_ids_adjust_ @@ -1799,8 +1799,8 @@ #define _di_f_thread_ids_increase_by_ #define _di_f_thread_ids_resize_ #define _di_f_thread_ids_t_ -#define _di_f_thread_id_t_ -#define _di_f_thread_join_ +//#define _di_f_thread_id_t_ +//#define _di_f_thread_join_ #define _di_f_thread_join_timed_ #define _di_f_thread_join_try_ #define _di_f_thread_key_create_ diff --git a/build/stand_alone/fake.settings b/build/stand_alone/fake.settings index c7b225e..c08936d 100644 --- a/build/stand_alone/fake.settings +++ b/build/stand_alone/fake.settings @@ -1,7 +1,15 @@ # fss-0001 # # A custom build for compiling fake as a stand alone binary building in all of the FLL dependencies. -# This will compile a program that does not have a libfake.so library. +# This will compile a program that does not have a libfake.so library and builds all of the FLL dependencies into the resulting program. +# +# Modes: +# - stand_alone: The stand alone build mode, which in general should always be used. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. # build_name fake @@ -12,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes stand_alone clang fanalyzer -modes_default stand_alone +modes stand_alone clang test fanalyzer thread threadless +modes_default stand_alone thread build_compiler gcc build_compiler-clang clang @@ -46,13 +54,14 @@ build_sources_program fll/level_0/rip.c fll/level_0/rip/utf.c fll/level_0/privat build_sources_program fll/level_0/signal.c build_sources_program fll/level_0/string.c fll/level_0/private-string.c fll/level_0/string/common.c fll/level_0/string/private-dynamic.c fll/level_0/string/private-dynamics.c fll/level_0/string/private-dynamicss.c fll/level_0/string/private-maps.c fll/level_0/string/private-mapss.c fll/level_0/string/private-map_multis.c fll/level_0/string/private-map_multiss.c fll/level_0/string/private-quantitys.c fll/level_0/string/private-quantityss.c fll/level_0/string/private-ranges.c fll/level_0/string/private-rangess.c fll/level_0/string/private-triples.c fll/level_0/string/private-tripless.c build_sources_program fll/level_0/string/dynamic.c fll/level_0/string/dynamics.c fll/level_0/string/dynamicss.c fll/level_0/string/map.c fll/level_0/string/maps.c fll/level_0/string/mapss.c fll/level_0/string/map_multi.c fll/level_0/string/map_multis.c fll/level_0/string/map_multiss.c fll/level_0/string/quantity.c fll/level_0/string/quantitys.c fll/level_0/string/quantityss.c fll/level_0/string/range.c fll/level_0/string/ranges.c fll/level_0/string/rangess.c fll/level_0/string/static.c fll/level_0/string/statics.c fll/level_0/string/staticss.c fll/level_0/string/triple.c fll/level_0/string/triples.c fll/level_0/string/tripless.c -build_sources_program fll/level_0/thread.c fll/level_0/private-thread.c fll/level_0/thread/attribute.c fll/level_0/thread/barrier.c fll/level_0/thread/barrier_attribute.c fll/level_0/thread/condition.c fll/level_0/thread/condition_attribute.c fll/level_0/thread/id.c fll/level_0/thread/key.c fll/level_0/thread/lock.c fll/level_0/thread/lock_attribute.c fll/level_0/thread/mutex.c fll/level_0/thread/mutex_attribute.c fll/level_0/thread/once.c fll/level_0/thread/semaphore.c fll/level_0/thread/set.c fll/level_0/thread/spin.c build_sources_program fll/level_0/type_array/array_length.c fll/level_0/type_array/cell.c fll/level_0/type_array/fll_id.c fll/level_0/type_array/int8.c fll/level_0/type_array/int16.c fll/level_0/type_array/int32.c fll/level_0/type_array/int64.c fll/level_0/type_array/int128.c fll/level_0/type_array/state.c fll/level_0/type_array/status.c fll/level_0/type_array/uint8.c fll/level_0/type_array/uint16.c fll/level_0/type_array/uint32.c fll/level_0/type_array/uint64.c fll/level_0/type_array/uint128.c build_sources_program fll/level_0/type_array/private-array_length.c fll/level_0/type_array/private-cell.c fll/level_0/type_array/private-fll_id.c fll/level_0/type_array/private-int8.c fll/level_0/type_array/private-int16.c fll/level_0/type_array/private-int32.c fll/level_0/type_array/private-int64.c fll/level_0/type_array/private-int128.c fll/level_0/type_array/private-state.c fll/level_0/type_array/private-status.c fll/level_0/type_array/private-uint8.c fll/level_0/type_array/private-uint16.c fll/level_0/type_array/private-uint32.c fll/level_0/type_array/private-uint64.c fll/level_0/type_array/private-uint128.c build_sources_program fll/level_0/utf.c fll/level_0/private-utf.c fll/level_0/private-utf_alphabetic.c fll/level_0/private-utf_combining.c fll/level_0/private-utf_control.c fll/level_0/private-utf_digit.c fll/level_0/private-utf_emoji.c fll/level_0/private-utf_numeric.c fll/level_0/private-utf_phonetic.c fll/level_0/private-utf_private.c fll/level_0/private-utf_punctuation.c fll/level_0/private-utf_subscript.c fll/level_0/private-utf_superscript.c fll/level_0/private-utf_symbol.c fll/level_0/private-utf_unassigned.c fll/level_0/private-utf_valid.c fll/level_0/private-utf_whitespace.c fll/level_0/private-utf_wide.c fll/level_0/private-utf_word.c fll/level_0/private-utf_zero_width.c build_sources_program fll/level_0/utf/common.c fll/level_0/utf/convert.c fll/level_0/utf/dynamic.c fll/level_0/utf/dynamics.c fll/level_0/utf/dynamicss.c fll/level_0/utf/is.c fll/level_0/utf/is_character.c fll/level_0/utf/map.c fll/level_0/utf/maps.c fll/level_0/utf/mapss.c fll/level_0/utf/map_multi.c fll/level_0/utf/map_multis.c fll/level_0/utf/map_multiss.c fll/level_0/utf/static.c fll/level_0/utf/statics.c fll/level_0/utf/staticss.c fll/level_0/utf/string.c fll/level_0/utf/triple.c fll/level_0/utf/triples.c fll/level_0/utf/tripless.c build_sources_program fll/level_0/utf/private-dynamic.c fll/level_0/utf/private-dynamics.c fll/level_0/utf/private-dynamicss.c fll/level_0/utf/private-maps.c fll/level_0/utf/private-mapss.c fll/level_0/utf/private-map_multis.c fll/level_0/utf/private-map_multiss.c fll/level_0/utf/private-string.c fll/level_0/utf/private-triples.c fll/level_0/utf/private-tripless.c +build_sources_program-thread fll/level_0/thread.c fll/level_0/private-thread.c fll/level_0/thread/attribute.c fll/level_0/thread/barrier.c fll/level_0/thread/barrier_attribute.c fll/level_0/thread/condition.c fll/level_0/thread/condition_attribute.c fll/level_0/thread/id.c fll/level_0/thread/key.c fll/level_0/thread/lock.c fll/level_0/thread/lock_attribute.c fll/level_0/thread/mutex.c fll/level_0/thread/mutex_attribute.c fll/level_0/thread/once.c fll/level_0/thread/semaphore.c fll/level_0/thread/set.c fll/level_0/thread/spin.c + build_sources_program fll/level_1/control_group.c build_sources_program fll/level_1/conversion.c fll/level_1/private-conversion.c fll/level_1/conversion/common.c build_sources_program fll/level_1/directory.c fll/level_1/private-directory.c @@ -104,15 +113,18 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -#defines -D_f_file_rename_use_renameat2_ defines -include sources/c/config.h -I sources/c/ -#defines -D_libcap_legacy_only_ -D_di_pthread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_f_file_rename_use_renameat2_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ defines-clang -D_clang_not_a_compile_time_constant_workaround_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -flags -O2 -z now -g -pthread -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses +flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer flags_library -fPIC diff --git a/level_0/f_account/data/build/settings b/level_0/f_account/data/build/settings index 89bdc8f..6e14db1 100644 --- a/level_0/f_account/data/build/settings +++ b/level_0/f_account/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_account @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_capability/data/build/settings b/level_0/f_capability/data/build/settings index d10bcf1..1af1f29 100644 --- a/level_0/f_capability/data/build/settings +++ b/level_0/f_capability/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_capability @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_color/data/build/settings b/level_0/f_color/data/build/settings index 7ca6fa7..12dfbc2 100644 --- a/level_0/f_color/data/build/settings +++ b/level_0/f_color/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_color @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_compare/data/build/settings b/level_0/f_compare/data/build/settings index f9c9bff..73b1628 100644 --- a/level_0/f_compare/data/build/settings +++ b/level_0/f_compare/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_compare @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_compare/data/build/settings-tests b/level_0/f_compare/data/build/settings-tests index b2642ba..8e963c2 100644 --- a/level_0/f_compare/data/build/settings-tests +++ b/level_0/f_compare/data/build/settings-tests @@ -4,6 +4,17 @@ # # Memory leaks in the test program can be checked for by running valgrind with this executable. # +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name test-f_compare diff --git a/level_0/f_console/data/build/settings b/level_0/f_console/data/build/settings index 10b0bdf..f1e6bb5 100644 --- a/level_0/f_console/data/build/settings +++ b/level_0/f_console/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_console @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_control_group/data/build/settings b/level_0/f_control_group/data/build/settings index bd041b9..a7608ab 100644 --- a/level_0/f_control_group/data/build/settings +++ b/level_0/f_control_group/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_control_group @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_conversion/data/build/settings b/level_0/f_conversion/data/build/settings index 3fd6f61..9a7edf7 100644 --- a/level_0/f_conversion/data/build/settings +++ b/level_0/f_conversion/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_conversion @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_directory/data/build/settings b/level_0/f_directory/data/build/settings index 9640884..ba1a85a 100644 --- a/level_0/f_directory/data/build/settings +++ b/level_0/f_directory/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_directory @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_environment/data/build/settings b/level_0/f_environment/data/build/settings index e36b303..0857e11 100644 --- a/level_0/f_environment/data/build/settings +++ b/level_0/f_environment/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_environment @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_execute/data/build/settings b/level_0/f_execute/data/build/settings index 196cdc1..81a3f9b 100644 --- a/level_0/f_execute/data/build/settings +++ b/level_0/f_execute/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_execute @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_file/data/build/settings b/level_0/f_file/data/build/settings index 3c86454..d594be0 100644 --- a/level_0/f_file/data/build/settings +++ b/level_0/f_file/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_file @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_fss/data/build/settings b/level_0/f_fss/data/build/settings index 7463b75..a70d27e 100644 --- a/level_0/f_fss/data/build/settings +++ b/level_0/f_fss/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_fss @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_iki/data/build/settings b/level_0/f_iki/data/build/settings index 6030fd2..9cbb7ef 100644 --- a/level_0/f_iki/data/build/settings +++ b/level_0/f_iki/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_iki @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_limit/data/build/settings b/level_0/f_limit/data/build/settings index 31d6935..6783b37 100644 --- a/level_0/f_limit/data/build/settings +++ b/level_0/f_limit/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_limit @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_memory/data/build/settings b/level_0/f_memory/data/build/settings index 8d7daa4..d3030ea 100644 --- a/level_0/f_memory/data/build/settings +++ b/level_0/f_memory/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_memory @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_parse/data/build/settings b/level_0/f_parse/data/build/settings index cc35de0..203bf02 100644 --- a/level_0/f_parse/data/build/settings +++ b/level_0/f_parse/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_parse @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_path/data/build/settings b/level_0/f_path/data/build/settings index 31e7a28..56deccc 100644 --- a/level_0/f_path/data/build/settings +++ b/level_0/f_path/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_path @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_pipe/data/build/settings b/level_0/f_pipe/data/build/settings index 07d8240..3dbd742 100644 --- a/level_0/f_pipe/data/build/settings +++ b/level_0/f_pipe/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_pipe @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_print/data/build/settings b/level_0/f_print/data/build/settings index e7df042..98c4703 100644 --- a/level_0/f_print/data/build/settings +++ b/level_0/f_print/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_print @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_rip/data/build/settings b/level_0/f_rip/data/build/settings index 85fe091..1f14863 100644 --- a/level_0/f_rip/data/build/settings +++ b/level_0/f_rip/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_rip @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_serialize/data/build/settings b/level_0/f_serialize/data/build/settings index 7982c77..a3ea03d 100644 --- a/level_0/f_serialize/data/build/settings +++ b/level_0/f_serialize/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_serialize @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_signal/data/build/settings b/level_0/f_signal/data/build/settings index d6b7c54..8cacb8c 100644 --- a/level_0/f_signal/data/build/settings +++ b/level_0/f_signal/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_signal @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_socket/data/build/settings b/level_0/f_socket/data/build/settings index f84262a..6e9e1fc 100644 --- a/level_0/f_socket/data/build/settings +++ b/level_0/f_socket/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_socket @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_status/data/build/settings b/level_0/f_status/data/build/settings index 100ff87..e7b3f52 100644 --- a/level_0/f_status/data/build/settings +++ b/level_0/f_status/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_status @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_status_string/data/build/settings b/level_0/f_status_string/data/build/settings index 10ce645..55ea400 100644 --- a/level_0/f_status_string/data/build/settings +++ b/level_0/f_status_string/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_status_string @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_string/data/build/settings b/level_0/f_string/data/build/settings index 58a1910..cacfd29 100644 --- a/level_0/f_string/data/build/settings +++ b/level_0/f_string/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_string @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_thread/data/build/settings b/level_0/f_thread/data/build/settings index cf71529..7a58ba0 100644 --- a/level_0/f_thread/data/build/settings +++ b/level_0/f_thread/data/build/settings @@ -1,4 +1,18 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# +# Note: This adds "threadless" and "thread" for consistency reasons. This should never use "threadless" and using "thread" is redundant. +# build_name f_thread @@ -8,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang @@ -17,7 +31,7 @@ build_indexer ar build_indexer_arguments rcs build_language c -build_libraries -pthread -lc +build_libraries -lc build_libraries-individual -lf_memory -lf_string build_sources_library thread.c private-thread.c thread/attribute.c thread/barrier.c thread/barrier_attribute.c thread/condition.c thread/condition_attribute.c thread/id.c thread/key.c thread/lock.c thread/lock_attribute.c thread/mutex.c thread/mutex_attribute.c thread/once.c thread/semaphore.c thread/set.c thread/spin.c @@ -52,6 +66,7 @@ environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY L defines -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_0/f_type/data/build/settings b/level_0/f_type/data/build/settings index eb700b2..cc801ba 100644 --- a/level_0/f_type/data/build/settings +++ b/level_0/f_type/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_type @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_type_array/data/build/settings b/level_0/f_type_array/data/build/settings index cafad5f..50afb44 100644 --- a/level_0/f_type_array/data/build/settings +++ b/level_0/f_type_array/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_type_array @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_0/f_utf/data/build/settings b/level_0/f_utf/data/build/settings index f0d4c7b..202aff5 100644 --- a/level_0/f_utf/data/build/settings +++ b/level_0/f_utf/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name f_utf @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_control_group/data/build/settings b/level_1/fl_control_group/data/build/settings index 77ea4f1..de36fba 100644 --- a/level_1/fl_control_group/data/build/settings +++ b/level_1/fl_control_group/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_control_group @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_conversion/data/build/settings b/level_1/fl_conversion/data/build/settings index 2374c35..32aa0fc 100644 --- a/level_1/fl_conversion/data/build/settings +++ b/level_1/fl_conversion/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_conversion @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_directory/data/build/settings b/level_1/fl_directory/data/build/settings index 99d9e88..7cecb02 100644 --- a/level_1/fl_directory/data/build/settings +++ b/level_1/fl_directory/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_directory @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_environment/data/build/settings b/level_1/fl_environment/data/build/settings index 5ae4823..b7e1040 100644 --- a/level_1/fl_environment/data/build/settings +++ b/level_1/fl_environment/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_environment @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_execute/data/build/settings b/level_1/fl_execute/data/build/settings index fd4b5d8..f179e8d 100644 --- a/level_1/fl_execute/data/build/settings +++ b/level_1/fl_execute/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_execute @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc -lcap build_libraries-individual -lf_capability -lf_execute -lf_limit -lf_memory -lf_signal -lf_string -lf_type_array +build_libraries-individual_thread -lf_thread build_sources_headers execute.h execute/common.h @@ -49,8 +62,11 @@ environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY L #defines -D_di_libcap_ defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_1/fl_fss/data/build/settings b/level_1/fl_fss/data/build/settings index 5fc8b4d..48f9f61 100644 --- a/level_1/fl_fss/data/build/settings +++ b/level_1/fl_fss/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_fss @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_iki/data/build/settings b/level_1/fl_iki/data/build/settings index a411156..b8863fa 100644 --- a/level_1/fl_iki/data/build/settings +++ b/level_1/fl_iki/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_iki @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_path/data/build/settings b/level_1/fl_path/data/build/settings index 1cba3f9..c70331f 100644 --- a/level_1/fl_path/data/build/settings +++ b/level_1/fl_path/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_path @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_print/data/build/settings b/level_1/fl_print/data/build/settings index 817b7c6..0c354eb 100644 --- a/level_1/fl_print/data/build/settings +++ b/level_1/fl_print/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_print @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_signal/data/build/settings b/level_1/fl_signal/data/build/settings index 136888c..a384c62 100644 --- a/level_1/fl_signal/data/build/settings +++ b/level_1/fl_signal/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_signal @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_status_string/data/build/settings b/level_1/fl_status_string/data/build/settings index d585234..4ab0c01 100644 --- a/level_1/fl_status_string/data/build/settings +++ b/level_1/fl_status_string/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_status_string @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_utf/data/build/settings b/level_1/fl_utf/data/build/settings index 6f132c5..91d3620 100644 --- a/level_1/fl_utf/data/build/settings +++ b/level_1/fl_utf/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_utf @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_1/fl_utf_file/data/build/settings b/level_1/fl_utf_file/data/build/settings index 1470c8a..3161e30 100644 --- a/level_1/fl_utf_file/data/build/settings +++ b/level_1/fl_utf_file/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fl_utf_file @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_control_group/data/build/settings b/level_2/fll_control_group/data/build/settings index 19d66b9..7661641 100644 --- a/level_2/fll_control_group/data/build/settings +++ b/level_2/fll_control_group/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_control_group @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_error/data/build/settings b/level_2/fll_error/data/build/settings index 53b4ac2..1c7daa3 100644 --- a/level_2/fll_error/data/build/settings +++ b/level_2/fll_error/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_error @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_execute/data/build/settings b/level_2/fll_execute/data/build/settings index 4e7057a..9320de2 100644 --- a/level_2/fll_execute/data/build/settings +++ b/level_2/fll_execute/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_execute @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual individual_threadless clang test -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang @@ -18,8 +30,8 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lcap -build_libraries-individual -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_execute -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_thread -lf_type_array -lf_utf -build_libraries-individual_threadless -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_execute -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual -lfl_control_group -lfl_environment -lf_account -lf_capability -lf_control_group -lf_environment -lf_execute -lf_file -lf_limit -lf_memory -lf_path -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_sources_library execute.c private-execute.c @@ -51,14 +63,15 @@ environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH #defines -D_di_libcap_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -defines-individual_threadless -D_di_thread_support_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ -flags-individual -pthread flags_library -fPIC flags_object -fPIC diff --git a/level_2/fll_file/data/build/settings b/level_2/fll_file/data/build/settings index 0471734..7366735 100644 --- a/level_2/fll_file/data/build/settings +++ b/level_2/fll_file/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_file @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_fss/data/build/settings b/level_2/fll_fss/data/build/settings index 704ea58..80cf279 100644 --- a/level_2/fll_fss/data/build/settings +++ b/level_2/fll_fss/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_fss @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_fss_status_string/data/build/settings b/level_2/fll_fss_status_string/data/build/settings index 93fe52c..be8bd2b 100644 --- a/level_2/fll_fss_status_string/data/build/settings +++ b/level_2/fll_fss_status_string/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_fss_status_string @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_iki/data/build/settings b/level_2/fll_iki/data/build/settings index 384ddc7..8b9fb0f 100644 --- a/level_2/fll_iki/data/build/settings +++ b/level_2/fll_iki/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_iki @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_print/data/build/settings b/level_2/fll_print/data/build/settings index f00ecda..bce236c 100644 --- a/level_2/fll_print/data/build/settings +++ b/level_2/fll_print/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_print @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_2/fll_program/data/build/settings b/level_2/fll_program/data/build/settings index 859c087..358dc1e 100644 --- a/level_2/fll_program/data/build/settings +++ b/level_2/fll_program/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fll_program @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual clang test coverage -modes_default individual +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default individual individual_thread thread build_compiler gcc build_compiler-clang clang diff --git a/level_3/byte_dump/c/print.h b/level_3/byte_dump/c/print.h index 8526e08..9fc38d1 100644 --- a/level_3/byte_dump/c/print.h +++ b/level_3/byte_dump/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: Byte Dump * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/byte_dump/data/build/defines b/level_3/byte_dump/data/build/defines index c665317..490da41 100644 --- a/level_3/byte_dump/data/build/defines +++ b/level_3/byte_dump/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/byte_dump/data/build/settings b/level_3/byte_dump/data/build/settings index c5d010d..3b3d53b 100644 --- a/level_3/byte_dump/data/build/settings +++ b/level_3/byte_dump/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name byte_dump @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_print -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/control/c/print.h b/level_3/control/c/print.h index 3476d70..e46b5a4 100644 --- a/level_3/control/c/print.h +++ b/level_3/control/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: Control * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/control/data/build/defines b/level_3/control/data/build/defines index d44a0de..822a9b6 100644 --- a/level_3/control/data/build/defines +++ b/level_3/control/data/build/defines @@ -1,5 +1,7 @@ # fss-0000 +_di_thread_support_ Disables thread support. + _controller_as_init_ The controller program is compiled as an init replacement and this control program should treat it as such. _override_controller_name_socket_ Use this as the default custom file name representing the controller program socket. _override_controller_name_socket_length_ The number of bytes representing the string in _override_controller_name_socket_ (not including the terminating NULL). @@ -11,4 +13,6 @@ _override_controller_path_socket_suffix_ Use this as the default custom prefix p _override_controller_path_socket_suffix_length_ The number of bytes representing the string in _override_controller_path_socket_suffix_ (not including the terminating NULL). _override_control_path_settings_ Use this as the default full path to the controlsettings. _override_control_path_settings_length_ The number of bytes representing the string in _override_controller_path_settings_length_ (not including the terminating NULL). + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/control/data/build/settings b/level_3/control/data/build/settings index 0d94979..fbad463 100644 --- a/level_3/control/data/build/settings +++ b/level_3/control/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name control @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/controller/c/print.h b/level_3/controller/c/print.h index c9142f7..caf5f19 100644 --- a/level_3/controller/c/print.h +++ b/level_3/controller/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: Controller * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/controller/data/build/defines b/level_3/controller/data/build/defines index 80818ea..a5c6973 100644 --- a/level_3/controller/data/build/defines +++ b/level_3/controller/data/build/defines @@ -1,6 +1,7 @@ # fss-0000 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap). +_di_thread_support_ Disables thread support. _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). _controller_as_init_ Build the program to run as if it were "init" by default, including displaying the program name as "Init Program" or "Init". This changes the main.c file only, leaving the library shareable between both "controller" and "init". @@ -24,5 +25,6 @@ _override_controller_path_socket_prefix_ Use this as the default custom prefix p _override_controller_path_socket_prefix_length_ The number of bytes representing the string in _override_controller_path_socket_prefix_ (not including the terminating NULL). _override_controller_path_socket_suffix_ Use this as the default custom prefix prepended to the file name of the file representing the controller program socket. _override_controller_path_socket_suffix_length_ The number of bytes representing the string in _override_controller_path_socket_suffix_ (not including the terminating NULL). + _pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/controller/data/build/settings b/level_3/controller/data/build/settings index 021e214..02682a6 100644 --- a/level_3/controller/data/build/settings +++ b/level_3/controller/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name controller @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer as_init -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless as_init +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,8 +31,10 @@ build_language c build_libraries -lc -lcap build_libraries-individual -lfll_control_group -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfll_status_string +build_libraries-individual_thread -lf_thread build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_path -lfl_print -build_libraries-individual -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_thread -lf_type_array -lf_utf +build_libraries-individual -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_socket -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -67,11 +81,14 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ defines-as_init -D_controller_as_init_ -flags -O2 -z now -g -pthread -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fake/c/main/common/define.h b/level_3/fake/c/main/common/define.h index 059ec84..4f2b7d2 100644 --- a/level_3/fake/c/main/common/define.h +++ b/level_3/fake/c/main/common/define.h @@ -17,20 +17,20 @@ extern "C" { #endif /** - * The program defines. + * The program allocation defines. * - * fake_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_pipe: A buffer size used for processing piped data. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. + * fake_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_fake_d_ +#ifndef _di_fake_allocation_d_ #define fake_allocation_console_d 4 #define fake_allocation_large_d 256 #define fake_allocation_pipe_d 16384 #define fake_allocation_small_d 16 -#endif // _di_fake_d_ +#endif // _di_fake_allocation_d_ /** * The program signal defines. diff --git a/level_3/fake/c/main/fake.h b/level_3/fake/c/main/fake.h index 4e5f42f..0e53db2 100644 --- a/level_3/fake/c/main/fake.h +++ b/level_3/fake/c/main/fake.h @@ -78,6 +78,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include diff --git a/level_3/fake/data/build/defines b/level_3/fake/data/build/defines index e998952..82abf48 100644 --- a/level_3/fake/data/build/defines +++ b/level_3/fake/data/build/defines @@ -4,5 +4,6 @@ _di_libcap_ Disable libcap support, allow for compiling and linking without libc _di_thread_support_ Disables thread support. _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). + _pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fake/data/build/settings b/level_3/fake/data/build/settings index b82ecd6..217e6a1 100644 --- a/level_3/fake/data/build/settings +++ b/level_3/fake/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fake @@ -11,8 +23,8 @@ version_target minor process_pre process_pre.sh process_post process_post.sh -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,7 +35,8 @@ build_language c build_libraries -lc -lcap build_libraries-individual -lfll_error -lfll_execute -lfll_file -lfll_fss -lfll_print -lfll_program build_libraries-individual -lfl_control_group -lfl_conversion -lfl_directory -lfl_environment -lfl_fss -lfl_iki -lfl_path -lfl_print -build_libraries-individual -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_thread -lf_type_array -lf_utf +build_libraries-individual -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_iki -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -68,10 +81,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -flags -O2 -z now -g -pthread -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/firewall/c/print.h b/level_3/firewall/c/print.h index 27c01cf..b2f32fe 100644 --- a/level_3/firewall/c/print.h +++ b/level_3/firewall/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: Firewall * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/firewall/data/build/defines b/level_3/firewall/data/build/defines index 546ad61..82abf48 100644 --- a/level_3/firewall/data/build/defines +++ b/level_3/firewall/data/build/defines @@ -1,7 +1,9 @@ # fss-0000 _di_libcap_ Disable libcap support, allow for compiling and linking without libcap (-lcap). +_di_thread_support_ Disables thread support. _libcap_legacy_only_ Disable functionality provided by later versions of libcap (2.43 and later). + _pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. _pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/firewall/data/build/settings b/level_3/firewall/data/build/settings index 7d13812..5948f9e 100644 --- a/level_3/firewall/data/build/settings +++ b/level_3/firewall/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name firewall @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -18,7 +30,8 @@ build_indexer_arguments rcs build_language c build_libraries -lc -lcap -build_libraries-individual -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfl_control_group -lfl_conversion -lfl_environment -lfl_fss -lfl_print -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_thread -lf_type_array -lf_utf +build_libraries-individual -lfll_error -lfll_execute -lfll_fss -lfll_print -lfll_program -lfl_control_group -lfl_conversion -lfl_environment -lfl_fss -lfl_print -lf_account -lf_capability -lf_color -lf_compare -lf_console -lf_control_group -lf_conversion -lf_directory -lf_environment -lf_execute -lf_file -lf_fss -lf_limit -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -57,10 +70,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ -flags -O2 -z now -g -pthread -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_basic_list_read/c/print.h b/level_3/fss_basic_list_read/c/print.h index 7c5dbd1..d325598 100644 --- a/level_3/fss_basic_list_read/c/print.h +++ b/level_3/fss_basic_list_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Basic List Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_basic_list_read/data/build/defines b/level_3/fss_basic_list_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_basic_list_read/data/build/defines +++ b/level_3/fss_basic_list_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_basic_list_read/data/build/settings b/level_3/fss_basic_list_read/data/build/settings index 8ef54e0..ae97d9e 100644 --- a/level_3/fss_basic_list_read/data/build/settings +++ b/level_3/fss_basic_list_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_basic_list_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_basic_read/c/print.h b/level_3/fss_basic_read/c/print.h index ae4dbb7..38c2460 100644 --- a/level_3/fss_basic_read/c/print.h +++ b/level_3/fss_basic_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Basic Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_basic_read/data/build/defines b/level_3/fss_basic_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_basic_read/data/build/defines +++ b/level_3/fss_basic_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_basic_read/data/build/settings b/level_3/fss_basic_read/data/build/settings index 93b37a2..7848db0 100644 --- a/level_3/fss_basic_read/data/build/settings +++ b/level_3/fss_basic_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_basic_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_rip -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_compare -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_embedded_list_read/c/print.h b/level_3/fss_embedded_list_read/c/print.h index cd3d102..fae9547 100644 --- a/level_3/fss_embedded_list_read/c/print.h +++ b/level_3/fss_embedded_list_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Embedded List Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_embedded_list_read/data/build/defines b/level_3/fss_embedded_list_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_embedded_list_read/data/build/defines +++ b/level_3/fss_embedded_list_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_embedded_list_read/data/build/settings b/level_3/fss_embedded_list_read/data/build/settings index 8d2a9d3..e567a6e 100644 --- a/level_3/fss_embedded_list_read/data/build/settings +++ b/level_3/fss_embedded_list_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_embedded_list_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +59,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_extended_list_read/c/print.h b/level_3/fss_extended_list_read/c/print.h index 69d157e..a350c54 100644 --- a/level_3/fss_extended_list_read/c/print.h +++ b/level_3/fss_extended_list_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Embedded List Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_extended_list_read/data/build/defines b/level_3/fss_extended_list_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_extended_list_read/data/build/defines +++ b/level_3/fss_extended_list_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_extended_list_read/data/build/settings b/level_3/fss_extended_list_read/data/build/settings index cbc1498..4c0e7b2 100644 --- a/level_3/fss_extended_list_read/data/build/settings +++ b/level_3/fss_extended_list_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_extended_list_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +59,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_extended_read/c/print.h b/level_3/fss_extended_read/c/print.h index 9309eb6..251fb21 100644 --- a/level_3/fss_extended_read/c/print.h +++ b/level_3/fss_extended_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Extended Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_extended_read/data/build/defines b/level_3/fss_extended_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_extended_read/data/build/defines +++ b/level_3/fss_extended_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_extended_read/data/build/settings b/level_3/fss_extended_read/data/build/settings index 2bc3615..99e48b2 100644 --- a/level_3/fss_extended_read/data/build/settings +++ b/level_3/fss_extended_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_extended_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_identify/c/print.h b/level_3/fss_identify/c/print.h index 837567f..1dbfbef 100644 --- a/level_3/fss_identify/c/print.h +++ b/level_3/fss_identify/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Identify * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_identify/data/build/defines b/level_3/fss_identify/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_identify/data/build/defines +++ b/level_3/fss_identify/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_identify/data/build/settings b/level_3/fss_identify/data/build/settings index 521026c..994bae0 100644 --- a/level_3/fss_identify/data/build/settings +++ b/level_3/fss_identify/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_identify @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_fss -lfl_print -lf_color -lf_console -lf_conversion -lf_file -lf_fss -lf_memory -lf_parse -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_payload_read/c/print.h b/level_3/fss_payload_read/c/print.h index ee7be26..6667a71 100644 --- a/level_3/fss_payload_read/c/print.h +++ b/level_3/fss_payload_read/c/print.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: FSS Payload Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later */ diff --git a/level_3/fss_payload_read/data/build/defines b/level_3/fss_payload_read/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_payload_read/data/build/defines +++ b/level_3/fss_payload_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_payload_read/data/build/settings b/level_3/fss_payload_read/data/build/settings index 6181136..3ace09b 100644 --- a/level_3/fss_payload_read/data/build/settings +++ b/level_3/fss_payload_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_payload_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithi threadc build_compiler gcc build_compiler-clang clang @@ -19,6 +31,7 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_write/c/basic/main.c b/level_3/fss_write/c/basic/main.c index 60ce513..2b8e780 100644 --- a/level_3/fss_write/c/basic/main.c +++ b/level_3/fss_write/c/basic/main.c @@ -37,17 +37,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, 0); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/basic_list/main.c b/level_3/fss_write/c/basic_list/main.c index eae411c..e8d53d2 100644 --- a/level_3/fss_write/c/basic_list/main.c +++ b/level_3/fss_write/c/basic_list/main.c @@ -37,17 +37,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, 0); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/embedded_list/main.c b/level_3/fss_write/c/embedded_list/main.c index 851d9c1..9d6ec4f 100644 --- a/level_3/fss_write/c/embedded_list/main.c +++ b/level_3/fss_write/c/embedded_list/main.c @@ -39,17 +39,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, 0); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/extended/main.c b/level_3/fss_write/c/extended/main.c index cade2d6..c0ee472 100644 --- a/level_3/fss_write/c/extended/main.c +++ b/level_3/fss_write/c/extended/main.c @@ -38,17 +38,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, 0); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/extended_list/main.c b/level_3/fss_write/c/extended_list/main.c index a5786cc..dbd9b8b 100644 --- a/level_3/fss_write/c/extended_list/main.c +++ b/level_3/fss_write/c/extended_list/main.c @@ -38,17 +38,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, 0); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/main/common.c b/level_3/fss_write/c/main/common.c index b7dc1b2..9c4e511 100644 --- a/level_3/fss_write/c/main/common.c +++ b/level_3/fss_write/c/main/common.c @@ -4,24 +4,6 @@ extern "C" { #endif -#ifndef _di_fss_write_setting_delete_ - f_status_t fss_write_setting_delete(fss_write_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - f_string_dynamic_resize(0, &setting->escaped); - f_string_dynamic_resize(0, &setting->block); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->prepend); - - f_string_rangess_resize(0, &setting->ignoress); - f_string_dynamics_resize(0, &setting->objects); - f_string_dynamicss_resize(0, &setting->contentss); - - return F_none; - } -#endif // _di_fss_write_setting_delete_ - #ifndef _di_fss_write_setting_load_ void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, void (*callback)(const f_console_arguments_t arguments, fss_write_main_t * const main)) { @@ -753,17 +735,6 @@ extern "C" { } #endif // _di_fss_write_setting_load_ -#ifndef _di_fss_write_setting_unload_ - f_status_t fss_write_setting_unload(fss_write_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - fss_write_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_fss_write_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_write/c/main/common.h b/level_3/fss_write/c/main/common.h index b4b28bc..f8ef104 100644 --- a/level_3/fss_write/c/main/common.h +++ b/level_3/fss_write/c/main/common.h @@ -17,23 +17,6 @@ extern "C" { #endif /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_fss_write_setting_delete_ - extern f_status_t fss_write_setting_delete(fss_write_setting_t * const setting); -#endif // _di_fss_write_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -73,28 +56,6 @@ extern "C" { extern void fss_write_setting_load(const f_console_arguments_t arguments, fss_write_main_t * const main, void (*callback)(const f_console_arguments_t arguments, fss_write_main_t * const main)); #endif // _di_fss_write_setting_load_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The main program and setting data. - * All buffers are deallocated. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: fss_write_setting_delete(). - * - * @see fss_write_setting_delete() - */ -#ifndef _di_fss_write_setting_unload_ - extern f_status_t fss_write_setting_unload(fss_write_main_t * const main); -#endif // _di_fss_write_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_write/c/main/common/define.h b/level_3/fss_write/c/main/common/define.h index fd06f24..f91dcca 100644 --- a/level_3/fss_write/c/main/common/define.h +++ b/level_3/fss_write/c/main/common/define.h @@ -17,20 +17,36 @@ extern "C" { #endif /** - * The program default defines. + * The program allocation defines. * - * fss_write_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. + * fss_write_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_fss_write_d_ +#ifndef _di_fss_write_allocation_d_ #define fss_write_allocation_console_d 4 #define fss_write_allocation_large_d 2048 + #define fss_write_allocation_pipe_d 16384 #define fss_write_allocation_small_d 128 - #define fss_write_signal_check_d 20000 -#endif // _di_fss_write_d_ +#endif // _di_fss_write_allocation_d_ + +/** + * The program signal defines. + * + * fss_write_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_fss_write_signal_d_ + #define fss_write_signal_check_d 500000 + #define fss_write_signal_check_failsafe_d 20000 + #define fss_write_signal_check_tiny_d 4 + #define fss_write_signal_check_short_d 16 +#endif // _di_fss_write_signal_d_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/fss_write/c/main/common/type.c b/level_3/fss_write/c/main/common/type.c index 0b80a88..e2075a0 100644 --- a/level_3/fss_write/c/main/common/type.c +++ b/level_3/fss_write/c/main/common/type.c @@ -4,6 +4,34 @@ extern "C" { #endif +#ifndef _di_fss_write_main_data_delete_ + void fss_write_main_delete(fss_write_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + fss_write_setting_delete(&main->setting); + } +#endif // _di_fss_write_main_data_delete_ + +#ifndef _di_fss_write_setting_delete_ + f_status_t fss_write_setting_delete(fss_write_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + f_string_dynamic_resize(0, &setting->escaped); + f_string_dynamic_resize(0, &setting->block); + f_string_dynamic_resize(0, &setting->buffer); + f_string_dynamic_resize(0, &setting->prepend); + + f_string_rangess_resize(0, &setting->ignoress); + f_string_dynamics_resize(0, &setting->objects); + f_string_dynamicss_resize(0, &setting->contentss); + + return F_none; + } +#endif // _di_fss_write_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_write/c/main/common/type.h b/level_3/fss_write/c/main/common/type.h index a5e700c..1165c27 100644 --- a/level_3/fss_write/c/main/common/type.h +++ b/level_3/fss_write/c/main/common/type.h @@ -26,7 +26,9 @@ extern "C" { * * flag: Flags passed to the main function. * - * state: The state data used when processing the FSS data. + * status_thread: A status used eclusively by the threaded signal handler. + * state: The state data used when processing the FSS data. + * * range: A range used as a buffer during processing. * * quote: This holds the quote used during processing. @@ -56,7 +58,9 @@ extern "C" { typedef struct { uint16_t flag; + f_status_t status_thread; f_state_t state; + f_string_range_t range; f_string_static_t quote; @@ -87,6 +91,7 @@ extern "C" { #define fss_write_setting_t_initialize \ { \ fss_write_main_flag_none_e, \ + F_none, \ macro_f_state_t_initialize_1(fss_write_allocation_large_d, fss_write_allocation_small_d, F_none, 0, 0, &fll_program_standard_signal_handle, 0, 0, 0), \ f_string_range_t_initialize, \ f_string_static_t_initialize, \ @@ -130,6 +135,35 @@ extern "C" { } #endif // _di_fss_write_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_fss_write_main_data_delete_ + extern void fss_write_main_delete(fss_write_main_t * const main); +#endif // _di_fss_write_main_data_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_fss_write_setting_delete_ + extern f_status_t fss_write_setting_delete(fss_write_setting_t * const setting); +#endif // _di_fss_write_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/fss_write/c/main/fss_write.h b/level_3/fss_write/c/main/fss_write.h index 0dea379..d107650 100644 --- a/level_3/fss_write/c/main/fss_write.h +++ b/level_3/fss_write/c/main/fss_write.h @@ -33,6 +33,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include @@ -53,6 +57,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/fss_write/c/main/main.c b/level_3/fss_write/c/main/main.c index a47d77f..30d3fec 100644 --- a/level_3/fss_write/c/main/main.c +++ b/level_3/fss_write/c/main/main.c @@ -36,17 +36,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, &fss_write_main_setting_load_as); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; - fss_write_main(&data); + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); - fss_write_setting_unload(&data); + fss_write_setting_load(arguments, &data); + } + + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } + + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/c/main/signal.c b/level_3/fss_write/c/main/signal.c new file mode 100644 index 0000000..661b69f --- /dev/null +++ b/level_3/fss_write/c/main/signal.c @@ -0,0 +1,113 @@ +#include "fss_write.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_fss_write_signal_check_) && defined(_di_thread_support_) + f_status_t fss_write_signal_check(fss_write_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (!((++main->program.signal_check) % fss_write_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + main->program.signal_check = 0; + } + + return F_false; + } +#endif // !defined(_di_fss_write_signal_check_) && defined(_di_thread_support_) + +#if !defined(_di_fss_write_signal_check_) && !defined(_di_thread_support_) + f_status_t fss_write_signal_check(fss_write_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (main->program.signal_received) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + return F_false; + } +#endif // !defined(_di_fss_write_signal_check_) && !defined(_di_thread_support_) + +#if !defined(_di_fss_write_signal_handler_) && !defined(_di_thread_support_) + void fss_write_signal_handler(fss_write_main_t * const main) { + + if (!main) return; + + siginfo_t information; + f_array_length_t failsafe = 0; + + memset(&information, 0, sizeof(siginfo_t)); + + main->program.signal_received = 0; + + f_signal_set_empty(&main->program.signal.set); + f_signal_set_add(F_signal_abort, &main->program.signal.set); + f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); + f_signal_set_add(F_signal_hangup, &main->program.signal.set); + f_signal_set_add(F_signal_interrupt, &main->program.signal.set); + f_signal_set_add(F_signal_quit, &main->program.signal.set); + f_signal_set_add(F_signal_termination, &main->program.signal.set); + + if (main->program.signal.id == -1) { + main->setting.status_thread = f_signal_open(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + + return; + } + } + + do { + memset(&information, 0, sizeof(siginfo_t)); + + main->setting.status_thread = f_signal_wait(&main->program.signal.set, &information); + + if (F_status_is_error(main->setting.status_thread) && F_status_set_fine(main->setting.status_thread) != F_interrupt) { + if (++failsafe >= fss_write_signal_check_failsafe_d) break; + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + main->program.signal_received = information.si_signo; + + break; + } + + failsafe = 0; + main->setting.status_thread = F_none; + + } while (!main->program.signal_received); + + f_signal_close(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + } + } +#endif // !defined(_di_fss_write_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_write/c/main/signal.h b/level_3/fss_write/c/main/signal.h new file mode 100644 index 0000000..7e2d888 --- /dev/null +++ b/level_3/fss_write/c/main/signal.h @@ -0,0 +1,86 @@ +/** + * FLL - Level 3 + * + * Project: FSS Write + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides signal functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fss_write_signal_h +#define _fss_write_signal_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check to see if a signal is received. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * There is a threaded and a non-threaded version of this. + * The non-threaded version checks periodically using fss_write_signal_check_d and updates main->signal_check as needed. + * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. + * + * @param main + * The main program and settings data. + * + * This does not alter main.setting.state.status. + * + * @return + * F_true on signal received. + * F_false otherwise. + * + * @see fss_write_signal_handler() + * + * @see fll_program_standard_signal_received() + */ +#ifndef _di_fss_write_signal_check_ + extern f_status_t fss_write_signal_check(fss_write_main_t * const main); +#endif // _di_fss_write_signal_check_ + +/** + * Signal handler for signals/interrupts. + * + * This blocks until an expected signal is recieved. + * When an expected signal is received it then sets the + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The main program and settings data. + * + * This alters main.program.signal_received, setting it to a received signal. + * + * This alters setting.status: + * Errors with (error bit set) from: f_signal_open() + * Errors with (error bit set) from: f_signal_wait() + * + * @see f_signal_close() + * @see f_signal_open() + * @see f_signal_wait() + */ +#if !defined(_di_fss_write_signal_handler_) && !defined(_di_thread_support_) + extern void fss_write_signal_handler(fss_write_main_t * const main); +#endif // !defined(_di_fss_write_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fss_write_signal_h diff --git a/level_3/fss_write/c/main/thread.c b/level_3/fss_write/c/main/thread.c new file mode 100644 index 0000000..8701f2f --- /dev/null +++ b/level_3/fss_write/c/main/thread.c @@ -0,0 +1,26 @@ +#include "fss_write.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_fss_write_thread_signal_) && !defined(_di_thread_support_) + void * fss_write_thread_signal(void * const main) { + + f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); + + if (main) { + fss_write_signal_handler((fss_write_main_t *) main); + } + + return 0; + } +#endif // !defined(_di_fss_write_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/fss_write/c/main/thread.h b/level_3/fss_write/c/main/thread.h new file mode 100644 index 0000000..dabe708 --- /dev/null +++ b/level_3/fss_write/c/main/thread.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 3 + * + * Project: FSS Write + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides thread functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _fss_write_thread_h +#define _fss_write_thread_h + +/** + * Thread handler for signals/interrupts. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The program and settings data. + * + * Must be of type fss_write_main_t. + * + * @return + * 0, always. + * + * @see f_thread_cancel_state_set() + * + * @see fss_write_signal_handler() + */ +#if !defined(_di_fss_write_thread_signal_) && !defined(_di_thread_support_) + extern void * fss_write_thread_signal(void * const main); +#endif // !defined(_di_fss_write_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _fss_write_thread_h diff --git a/level_3/fss_write/c/payload/main.c b/level_3/fss_write/c/payload/main.c index 5f581ce..b1af9ee 100644 --- a/level_3/fss_write/c/payload/main.c +++ b/level_3/fss_write/c/payload/main.c @@ -37,17 +37,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - fss_write_setting_load(arguments, &data, &fss_write_payload_setting_load); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } + + fss_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &fss_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + fss_write_print_error(&data.program.error, macro_fss_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + fss_write_setting_load(arguments, &data); + } - fss_write_main(&data); + if (!fss_write_signal_check(&data)) { + fss_write_main(&data); + } - fss_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + fss_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/fss_write/data/build/defines b/level_3/fss_write/data/build/defines index c665317..490da41 100644 --- a/level_3/fss_write/data/build/defines +++ b/level_3/fss_write/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/fss_write/data/build/settings b/level_3/fss_write/data/build/settings index aa2338a..4c1f0ba 100644 --- a/level_3/fss_write/data/build/settings +++ b/level_3/fss_write/data/build/settings @@ -2,6 +2,17 @@ # # Builds the main library of the project with all parts except "main" program related. # +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_write @@ -11,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -22,10 +33,11 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/fss_write.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/error.c main/print/message.c +build_sources_library main/fss_write.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/error.c main/print/message.c main/signal.c main/thread.c build_sources_library basic/fss_write.c basic/common.c basic/print.c build_sources_library basic_list/fss_write.c basic_list/common.c basic_list/print.c build_sources_library embedded_list/fss_write.c embedded_list/common.c embedded_list/print.c @@ -33,7 +45,7 @@ build_sources_library extended/fss_write.c extended/common.c extended/print.c build_sources_library extended_list/fss_write.c extended_list/common.c extended_list/print.c build_sources_library payload/fss_write.c payload/common.c payload/print.c -build_sources_headers main/fss_write.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h +build_sources_headers main/fss_write.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h main/signal.h main/thread.h build_sources_headers basic/fss_write.h basic/common.h basic/print.h basic/private-common.h build_sources_headers basic_list/fss_write.h basic_list/common.h basic_list/print.h build_sources_headers embedded_list/fss_write.h embedded_list/common.h embedded_list/print.h @@ -57,10 +69,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/fss_write/data/build/settings.basic b/level_3/fss_write/data/build/settings.basic index dca59fa..9317e17 100644 --- a/level_3/fss_write/data/build/settings.basic +++ b/level_3/fss_write/data/build/settings.basic @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.basic_list b/level_3/fss_write/data/build/settings.basic_list index ba5a999..d6eaf0b 100644 --- a/level_3/fss_write/data/build/settings.basic_list +++ b/level_3/fss_write/data/build/settings.basic_list @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.embedded_list b/level_3/fss_write/data/build/settings.embedded_list index 95bc870..54cfadd 100644 --- a/level_3/fss_write/data/build/settings.embedded_list +++ b/level_3/fss_write/data/build/settings.embedded_list @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.extended b/level_3/fss_write/data/build/settings.extended index 3a7c1b3..39596ce 100644 --- a/level_3/fss_write/data/build/settings.extended +++ b/level_3/fss_write/data/build/settings.extended @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.extended_list b/level_3/fss_write/data/build/settings.extended_list index 21d2587..d046242 100644 --- a/level_3/fss_write/data/build/settings.extended_list +++ b/level_3/fss_write/data/build/settings.extended_list @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.main b/level_3/fss_write/data/build/settings.main index 6f889b0..c4e572d 100644 --- a/level_3/fss_write/data/build/settings.main +++ b/level_3/fss_write/data/build/settings.main @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/fss_write/data/build/settings.payload b/level_3/fss_write/data/build/settings.payload index 3df838c..50fe93f 100644 --- a/level_3/fss_write/data/build/settings.payload +++ b/level_3/fss_write/data/build/settings.payload @@ -12,8 +12,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual level monolithic clang test fanalyzer thread individual-thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +23,7 @@ build_language c build_libraries -lc -lfss_write build_libraries-individual -lfll_error -lfll_file -lfll_fss -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_environment -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual-thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -46,10 +47,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +defines -D_libcap_legacy_only_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/iki_read/c/main/common.c b/level_3/iki_read/c/main/common.c index ca21a5d..988f847 100644 --- a/level_3/iki_read/c/main/common.c +++ b/level_3/iki_read/c/main/common.c @@ -4,26 +4,6 @@ extern "C" { #endif -#ifndef _di_iki_read_setting_delete_ - f_status_t iki_read_setting_delete(iki_read_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamics_resize(0, &setting->names); - f_string_dynamics_resize(0, &setting->files); - - f_string_maps_resize(0, &setting->replace); - f_string_triples_resize(0, &setting->reassign); - f_string_triples_resize(0, &setting->substitute); - f_string_triples_resize(0, &setting->wrap); - - f_iki_data_delete(&setting->data); - - return F_none; - } -#endif // _di_iki_read_setting_delete_ - #ifndef _di_iki_read_setting_load_ void iki_read_setting_load(const f_console_arguments_t arguments, iki_read_main_t * const main) { @@ -720,17 +700,6 @@ extern "C" { } #endif // _di_iki_read_setting_load_parameter_substitution_ -#ifndef _di_iki_read_setting_unload_ - f_status_t iki_read_setting_unload(iki_read_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - iki_read_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_iki_read_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/common.h b/level_3/iki_read/c/main/common.h index 9386d8d..62bfa01 100644 --- a/level_3/iki_read/c/main/common.h +++ b/level_3/iki_read/c/main/common.h @@ -17,23 +17,6 @@ extern "C" { #endif /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_iki_read_setting_delete_ - extern f_status_t iki_read_setting_delete(iki_read_setting_t * const setting); -#endif // _di_iki_read_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -100,29 +83,6 @@ extern "C" { extern f_status_t iki_read_setting_load_parameter_substitution(iki_read_main_t * const main, const f_console_parameter_t parameter, const f_string_static_t name, f_string_triples_t *triple); #endif // _di_iki_read_setting_load_parameter_substitution_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The program and settings data. - * - * All buffers are deallocated. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: iki_read_setting_delete(). - * - * @see iki_read_setting_delete() - */ -#ifndef _di_iki_read_setting_unload_ - extern f_status_t iki_read_setting_unload(iki_read_main_t * const main); -#endif // _di_iki_read_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/common/define.h b/level_3/iki_read/c/main/common/define.h index aa8e33e..4619318 100644 --- a/level_3/iki_read/c/main/common/define.h +++ b/level_3/iki_read/c/main/common/define.h @@ -17,27 +17,51 @@ extern "C" { #endif /** - * The program defines. + * The program allocation defines. * - * iki_read_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - block_max: The max block read size before checking for interrupt. - * - block_read_small: The block read size for small files. - * - block_read_large: The block read size for large files. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. + * iki_read_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_iki_read_d_ +#ifndef _di_iki_read_allocation_d_ #define iki_read_allocation_console_d 4 #define iki_read_allocation_large_d 256 + #define iki_read_allocation_pipe_d 16384 #define iki_read_allocation_small_d 16 - #define iki_read_block_max 16777216 - #define iki_read_block_read_small 8192 - #define iki_read_block_read_large 65536 - #define iki_read_signal_check_d 20000 +#endif // _di_iki_read_allocation_d_ + +/** + * The program block defines. + * + * iki_read_block_*_d: + * - max: The max block read size before checking for interrupt. + * - read_small: The block read size for small files. + * - read_large: The block read size for large files. + */ +#ifndef _di_iki_read_d_ + #define iki_read_block_max_d 16777216 + #define iki_read_block_read_small_d 8192 + #define iki_read_block_read_large_d 65536 #endif // _di_iki_read_d_ +/** + * The program signal defines. + * + * iki_read_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_iki_read_signal_d_ + #define iki_read_signal_check_d 500000 + #define iki_read_signal_check_failsafe_d 20000 + #define iki_read_signal_check_tiny_d 4 + #define iki_read_signal_check_short_d 16 +#endif // _di_iki_read_signal_d_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/common/print.c b/level_3/iki_read/c/main/common/print.c index b20020b..e4c0c50 100644 --- a/level_3/iki_read/c/main/common/print.c +++ b/level_3/iki_read/c/main/common/print.c @@ -21,6 +21,7 @@ extern "C" { "f_string_dynamics_resize", "f_string_maps_increase_by", "f_string_triples_increase_by", + "f_thread_create", "fl_iki_read", "fll_program_parameter_process_context", "fll_program_parameter_process_verbosity", diff --git a/level_3/iki_read/c/main/common/print.h b/level_3/iki_read/c/main/common/print.h index 5f3db06..f47d032 100644 --- a/level_3/iki_read/c/main/common/print.h +++ b/level_3/iki_read/c/main/common/print.h @@ -54,6 +54,7 @@ extern "C" { iki_read_f_f_string_dynamics_resize_e, iki_read_f_f_string_maps_increase_by_e, iki_read_f_f_string_triples_increase_by_e, + iki_read_f_f_thread_create_e, iki_read_f_fl_iki_read_e, iki_read_f_fll_program_parameter_process_context_e, iki_read_f_fll_program_parameter_process_verbosity_e, diff --git a/level_3/iki_read/c/main/common/string.h b/level_3/iki_read/c/main/common/string.h index 083a1cb..7c90029 100644 --- a/level_3/iki_read/c/main/common/string.h +++ b/level_3/iki_read/c/main/common/string.h @@ -60,13 +60,6 @@ extern "C" { #endif // _di_iki_read_program_name_s_ /** - * The program defines. - */ -#ifndef _di_iki_read_d_ - #define iki_read_signal_check_d 20000 -#endif // _di_iki_read_d_ - -/** * A collection of static strings associated with IKI Read. */ #ifndef _di_iki_read_s_ diff --git a/level_3/iki_read/c/main/common/type.c b/level_3/iki_read/c/main/common/type.c index de0e2a3..4f5faf0 100644 --- a/level_3/iki_read/c/main/common/type.c +++ b/level_3/iki_read/c/main/common/type.c @@ -4,6 +4,36 @@ extern "C" { #endif +#ifndef _di_iki_read_main_data_delete_ + void iki_read_main_delete(iki_read_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + iki_read_setting_delete(&main->setting); + } +#endif // _di_iki_read_main_data_delete_ + +#ifndef _di_iki_read_setting_delete_ + f_status_t iki_read_setting_delete(iki_read_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + f_string_dynamic_resize(0, &setting->buffer); + f_string_dynamics_resize(0, &setting->names); + f_string_dynamics_resize(0, &setting->files); + + f_string_maps_resize(0, &setting->replace); + f_string_triples_resize(0, &setting->reassign); + f_string_triples_resize(0, &setting->substitute); + f_string_triples_resize(0, &setting->wrap); + + f_iki_data_delete(&setting->data); + + return F_none; + } +#endif // _di_iki_read_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/common/type.h b/level_3/iki_read/c/main/common/type.h index 2764820..51a8bce 100644 --- a/level_3/iki_read/c/main/common/type.h +++ b/level_3/iki_read/c/main/common/type.h @@ -24,7 +24,8 @@ extern "C" { * * flag: Flags passed to the main function. * - * state: The state information. + * status_thread: A status used eclusively by the threaded signal handler. + * state: The state data used when processing the FSS data. * * at: The position representing the "at" index. * line: The position representing the "line" index. @@ -47,6 +48,7 @@ extern "C" { typedef struct { uint16_t flag; + f_status_t status_thread; f_state_t state; f_array_length_t at; @@ -70,6 +72,7 @@ extern "C" { #define iki_read_setting_t_initialize \ { \ iki_read_main_flag_none_e, \ + F_none, \ macro_f_state_t_initialize_1(iki_read_allocation_large_d, iki_read_allocation_small_d, F_none, 0, 0, 0, 0, 0, 0), \ 0, \ 0, \ @@ -105,6 +108,35 @@ extern "C" { } #endif // _di_iki_read_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_iki_read_main_data_delete_ + extern void iki_read_main_delete(iki_read_main_t * const main); +#endif // _di_iki_read_main_data_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_iki_read_setting_delete_ + extern f_status_t iki_read_setting_delete(iki_read_setting_t * const setting); +#endif // _di_iki_read_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_read/c/main/identify.h b/level_3/iki_read/c/main/identify.h index e87f1ce..3eb1f7f 100644 --- a/level_3/iki_read/c/main/identify.h +++ b/level_3/iki_read/c/main/identify.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later * diff --git a/level_3/iki_read/c/main/iki_read.c b/level_3/iki_read/c/main/iki_read.c index 6434205..8c06fda 100644 --- a/level_3/iki_read/c/main/iki_read.c +++ b/level_3/iki_read/c/main/iki_read.c @@ -116,12 +116,12 @@ extern "C" { } // Enforce a max block read size to allow for interrupts to be processed between blocks. - if (size_file > iki_read_block_max) { - file.size_read = iki_read_block_read_large; - size_block = iki_read_block_max; + if (size_file > iki_read_block_max_d) { + file.size_read = iki_read_block_read_large_d; + size_block = iki_read_block_max_d; } else { - file.size_read = iki_read_block_read_small; + file.size_read = iki_read_block_read_small_d; size_block = size_file; } @@ -137,7 +137,7 @@ extern "C" { for (size_read = 0; size_read < size_file; size_read += size_block) { // The signal check is always performed on each pass. - if (size_file > iki_read_block_max && fll_program_standard_signal_received(&main->program)) { + if (size_file > iki_read_block_max_d && fll_program_standard_signal_received(&main->program)) { fll_program_print_signal_received(&main->program.warning, main->program.signal_received); main->setting.state.status = F_status_set_error(F_interrupt); diff --git a/level_3/iki_read/c/main/iki_read.h b/level_3/iki_read/c/main/iki_read.h index c56ae7b..31ce704 100644 --- a/level_3/iki_read/c/main/iki_read.h +++ b/level_3/iki_read/c/main/iki_read.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later * @@ -39,6 +39,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include @@ -63,6 +67,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_read/c/main/main.c b/level_3/iki_read/c/main/main.c index 39ab620..d635556 100644 --- a/level_3/iki_read/c/main/main.c +++ b/level_3/iki_read/c/main/main.c @@ -29,17 +29,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - iki_read_setting_load(arguments, &data); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + iki_read_setting_load(arguments, &data); + } + + iki_read_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &iki_read_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + iki_read_print_error(&data.program.error, macro_iki_read_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + iki_read_setting_load(arguments, &data); + } - iki_read_main(&data); + if (!iki_read_signal_check(&data)) { + iki_read_main(&data); + } - iki_read_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + iki_read_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/iki_read/c/main/print/data.h b/level_3/iki_read/c/main/print/data.h index 6a8d95a..a4d3f98 100644 --- a/level_3/iki_read/c/main/print/data.h +++ b/level_3/iki_read/c/main/print/data.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later * diff --git a/level_3/iki_read/c/main/print/error.h b/level_3/iki_read/c/main/print/error.h index fb7df27..f23bc39 100644 --- a/level_3/iki_read/c/main/print/error.h +++ b/level_3/iki_read/c/main/print/error.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: UTF8 + * Project: IKI Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later * diff --git a/level_3/iki_read/c/main/process.h b/level_3/iki_read/c/main/process.h index c001de3..5e9fda4 100644 --- a/level_3/iki_read/c/main/process.h +++ b/level_3/iki_read/c/main/process.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Read * API Version: 0.7 * Licenses: lgpl-2.1-or-later * diff --git a/level_3/iki_read/c/main/signal.c b/level_3/iki_read/c/main/signal.c new file mode 100644 index 0000000..e79b3cd --- /dev/null +++ b/level_3/iki_read/c/main/signal.c @@ -0,0 +1,113 @@ +#include "iki_read.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_iki_read_signal_check_) && defined(_di_thread_support_) + f_status_t iki_read_signal_check(iki_read_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (!((++main->program.signal_check) % iki_read_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + main->program.signal_check = 0; + } + + return F_false; + } +#endif // !defined(_di_iki_read_signal_check_) && defined(_di_thread_support_) + +#if !defined(_di_iki_read_signal_check_) && !defined(_di_thread_support_) + f_status_t iki_read_signal_check(iki_read_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (main->program.signal_received) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + return F_false; + } +#endif // !defined(_di_iki_read_signal_check_) && !defined(_di_thread_support_) + +#if !defined(_di_iki_read_signal_handler_) && !defined(_di_thread_support_) + void iki_read_signal_handler(iki_read_main_t * const main) { + + if (!main) return; + + siginfo_t information; + f_array_length_t failsafe = 0; + + memset(&information, 0, sizeof(siginfo_t)); + + main->program.signal_received = 0; + + f_signal_set_empty(&main->program.signal.set); + f_signal_set_add(F_signal_abort, &main->program.signal.set); + f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); + f_signal_set_add(F_signal_hangup, &main->program.signal.set); + f_signal_set_add(F_signal_interrupt, &main->program.signal.set); + f_signal_set_add(F_signal_quit, &main->program.signal.set); + f_signal_set_add(F_signal_termination, &main->program.signal.set); + + if (main->program.signal.id == -1) { + main->setting.status_thread = f_signal_open(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + + return; + } + } + + do { + memset(&information, 0, sizeof(siginfo_t)); + + main->setting.status_thread = f_signal_wait(&main->program.signal.set, &information); + + if (F_status_is_error(main->setting.status_thread) && F_status_set_fine(main->setting.status_thread) != F_interrupt) { + if (++failsafe >= iki_read_signal_check_failsafe_d) break; + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + main->program.signal_received = information.si_signo; + + break; + } + + failsafe = 0; + main->setting.status_thread = F_none; + + } while (!main->program.signal_received); + + f_signal_close(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + } + } +#endif // !defined(_di_iki_read_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_read/c/main/signal.h b/level_3/iki_read/c/main/signal.h new file mode 100644 index 0000000..4be58af --- /dev/null +++ b/level_3/iki_read/c/main/signal.h @@ -0,0 +1,86 @@ +/** + * FLL - Level 3 + * + * Project: IKI Read + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides signal functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_read_signal_h +#define _iki_read_signal_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check to see if a signal is received. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * There is a threaded and a non-threaded version of this. + * The non-threaded version checks periodically using iki_read_signal_check_d and updates main->signal_check as needed. + * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. + * + * @param main + * The main program and settings data. + * + * This does not alter main.setting.state.status. + * + * @return + * F_true on signal received. + * F_false otherwise. + * + * @see iki_read_signal_handler() + * + * @see fll_program_standard_signal_received() + */ +#ifndef _di_iki_read_signal_check_ + extern f_status_t iki_read_signal_check(iki_read_main_t * const main); +#endif // _di_iki_read_signal_check_ + +/** + * Signal handler for signals/interrupts. + * + * This blocks until an expected signal is recieved. + * When an expected signal is received it then sets the + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The main program and settings data. + * + * This alters main.program.signal_received, setting it to a received signal. + * + * This alters setting.status: + * Errors with (error bit set) from: f_signal_open() + * Errors with (error bit set) from: f_signal_wait() + * + * @see f_signal_close() + * @see f_signal_open() + * @see f_signal_wait() + */ +#if !defined(_di_iki_read_signal_handler_) && !defined(_di_thread_support_) + extern void iki_read_signal_handler(iki_read_main_t * const main); +#endif // !defined(_di_iki_read_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_read_signal_h diff --git a/level_3/iki_read/c/main/thread.c b/level_3/iki_read/c/main/thread.c new file mode 100644 index 0000000..a71a418 --- /dev/null +++ b/level_3/iki_read/c/main/thread.c @@ -0,0 +1,26 @@ +#include "iki_read.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_iki_read_thread_signal_) && !defined(_di_thread_support_) + void * iki_read_thread_signal(void * const main) { + + f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); + + if (main) { + iki_read_signal_handler((iki_read_main_t *) main); + } + + return 0; + } +#endif // !defined(_di_iki_read_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_read/c/main/thread.h b/level_3/iki_read/c/main/thread.h new file mode 100644 index 0000000..ee93255 --- /dev/null +++ b/level_3/iki_read/c/main/thread.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 3 + * + * Project: IKI Read + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides thread functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_read_thread_h +#define _iki_read_thread_h + +/** + * Thread handler for signals/interrupts. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The program and settings data. + * + * Must be of type iki_read_main_t. + * + * @return + * 0, always. + * + * @see f_thread_cancel_state_set() + * + * @see iki_read_signal_handler() + */ +#if !defined(_di_iki_read_thread_signal_) && !defined(_di_thread_support_) + extern void * iki_read_thread_signal(void * const main); +#endif // !defined(_di_iki_read_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_read_thread_h diff --git a/level_3/iki_read/data/build/defines b/level_3/iki_read/data/build/defines index c665317..490da41 100644 --- a/level_3/iki_read/data/build/defines +++ b/level_3/iki_read/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/iki_read/data/build/settings b/level_3/iki_read/data/build/settings index 2c569c9..7a6873c 100644 --- a/level_3/iki_read/data/build/settings +++ b/level_3/iki_read/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name iki_read @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,14 +31,15 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_iki -lfl_print -lfl_signal -lf_color -lf_compare -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/iki_read.c main/common.c main/identify.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/data.c main/print/error.c main/print/message.c main/process.c +build_sources_library main/iki_read.c main/common.c main/identify.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/data.c main/print/error.c main/print/message.c main/process.c main/signal.c main/thread.c build_sources_program main/main.c -build_sources_headers main/iki_read.h main/common.h main/identify.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/data.h main/print/error.h main/print/message.h main/process.h +build_sources_headers main/iki_read.h main/common.h main/identify.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/data.h main/print/error.h main/print/message.h main/process.h main/signal.h main/thread.h build_sources_documentation man @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/iki_write/c/main/common.c b/level_3/iki_write/c/main/common.c index 2396028..c6d7c03 100644 --- a/level_3/iki_write/c/main/common.c +++ b/level_3/iki_write/c/main/common.c @@ -4,23 +4,6 @@ extern "C" { #endif -#ifndef _di_iki_write_setting_delete_ - f_status_t iki_write_setting_delete(iki_write_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - f_string_dynamic_resize(0, &setting->escaped); - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->object); - f_string_dynamic_resize(0, &setting->content); - - f_string_dynamics_resize(0, &setting->objects); - f_string_dynamics_resize(0, &setting->contents); - - return F_none; - } -#endif // _di_iki_write_setting_delete_ - #ifndef _di_iki_write_setting_load_ void iki_write_setting_load(const f_console_arguments_t arguments, iki_write_main_t * const main) { @@ -307,17 +290,6 @@ extern "C" { } #endif // _di_iki_write_setting_load_ -#ifndef _di_iki_write_setting_unload_ - f_status_t iki_write_setting_unload(iki_write_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - iki_write_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_iki_write_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_write/c/main/common.h b/level_3/iki_write/c/main/common.h index 3993ef7..0347526 100644 --- a/level_3/iki_write/c/main/common.h +++ b/level_3/iki_write/c/main/common.h @@ -17,23 +17,6 @@ extern "C" { #endif /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_iki_write_setting_delete_ - extern f_status_t iki_write_setting_delete(iki_write_setting_t * const setting); -#endif // _di_iki_write_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -64,28 +47,6 @@ extern "C" { extern void iki_write_setting_load(const f_console_arguments_t arguments, iki_write_main_t * const main); #endif // _di_iki_write_setting_load_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The main program and setting data. - * All buffers are deallocated. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: iki_write_setting_delete(). - * - * @see iki_write_setting_delete() - */ -#ifndef _di_iki_write_setting_unload_ - extern f_status_t iki_write_setting_unload(iki_write_main_t * const main); -#endif // _di_iki_write_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_write/c/main/common/define.h b/level_3/iki_write/c/main/common/define.h index 143f350..0714d6c 100644 --- a/level_3/iki_write/c/main/common/define.h +++ b/level_3/iki_write/c/main/common/define.h @@ -17,20 +17,48 @@ extern "C" { #endif /** - * The program defines. + * The program allocation defines. * - * iki_write_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. + * iki_write_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_iki_write_d_ +#ifndef _di_iki_write_allocation_d_ #define iki_write_allocation_console_d 4 #define iki_write_allocation_large_d 256 + #define iki_write_allocation_pipe_d 16384 #define iki_write_allocation_small_d 16 - #define iki_write_signal_check_d 20000 -#endif // _di_iki_write_d_ +#endif // _di_iki_write_allocation_d_ + +/** + * The program signal defines. + * + * iki_write_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_iki_write_signal_d_ + #define iki_write_signal_check_d 500000 + #define iki_write_signal_check_failsafe_d 20000 + #define iki_write_signal_check_tiny_d 4 + #define iki_write_signal_check_short_d 16 +#endif // _di_iki_write_signal_d_ + +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_iki_write_main_data_delete_ + extern void iki_write_main_delete(iki_write_main_t * const main); +#endif // _di_iki_write_main_data_delete_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/iki_write/c/main/common/print.c b/level_3/iki_write/c/main/common/print.c index 0b193cb..48eaf5f 100644 --- a/level_3/iki_write/c/main/common/print.c +++ b/level_3/iki_write/c/main/common/print.c @@ -13,6 +13,7 @@ extern "C" { "f_string_dynamic_partial_append_nulless", "f_string_dynamic_seek_to", "f_string_dynamics_resize", + "f_thread_create", "fll_iki_content_escape", "fll_program_parameter_process_context", "fll_program_parameter_process_verbosity", diff --git a/level_3/iki_write/c/main/common/print.h b/level_3/iki_write/c/main/common/print.h index 55e1773..a240b5c 100644 --- a/level_3/iki_write/c/main/common/print.h +++ b/level_3/iki_write/c/main/common/print.h @@ -46,6 +46,7 @@ extern "C" { iki_write_f_f_string_dynamic_partial_append_nulless_e, iki_write_f_f_string_dynamic_seek_to_e, iki_write_f_f_string_dynamics_resize_e, + iki_write_f_f_thread_create_e, iki_write_f_fll_iki_content_escape_e, iki_write_f_fll_program_parameter_process_context_e, iki_write_f_fll_program_parameter_process_verbosity_e, diff --git a/level_3/iki_write/c/main/common/type.c b/level_3/iki_write/c/main/common/type.c index 192b528..0524181 100644 --- a/level_3/iki_write/c/main/common/type.c +++ b/level_3/iki_write/c/main/common/type.c @@ -4,6 +4,33 @@ extern "C" { #endif +#ifndef _di_iki_write_main_data_delete_ + void iki_write_main_delete(iki_write_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + iki_write_setting_delete(&main->setting); + } +#endif // _di_iki_write_main_data_delete_ + +#ifndef _di_iki_write_setting_delete_ + f_status_t iki_write_setting_delete(iki_write_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + f_string_dynamic_resize(0, &setting->escaped); + f_string_dynamic_resize(0, &setting->buffer); + f_string_dynamic_resize(0, &setting->object); + f_string_dynamic_resize(0, &setting->content); + + f_string_dynamics_resize(0, &setting->objects); + f_string_dynamics_resize(0, &setting->contents); + + return F_none; + } +#endif // _di_iki_write_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_write/c/main/common/type.h b/level_3/iki_write/c/main/common/type.h index 22bbd02..d199ea3 100644 --- a/level_3/iki_write/c/main/common/type.h +++ b/level_3/iki_write/c/main/common/type.h @@ -24,7 +24,8 @@ extern "C" { * * flag: Flags passed to the main function. * - * state: The state information. + * status_thread: A status used eclusively by the threaded signal handler. + * state: The state data used when processing the FSS data. * * quote: This holds the quote used during processing. * @@ -40,6 +41,7 @@ extern "C" { typedef struct { uint16_t flag; + f_status_t status_thread; f_state_t state; f_string_static_t quote; @@ -56,6 +58,7 @@ extern "C" { #define iki_write_setting_t_initialize \ { \ iki_write_main_flag_none_e, \ + F_none, \ f_state_t_initialize, \ f_string_dynamic_t_initialize, \ f_string_dynamic_t_initialize, \ @@ -85,6 +88,35 @@ extern "C" { } #endif // _di_iki_write_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_iki_write_main_data_delete_ + extern void iki_write_main_delete(iki_write_main_t * const main); +#endif // _di_iki_write_main_data_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_iki_write_setting_delete_ + extern f_status_t iki_write_setting_delete(iki_write_setting_t * const setting); +#endif // _di_iki_write_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/iki_write/c/main/iki_write.h b/level_3/iki_write/c/main/iki_write.h index 5bddd48..433ff74 100644 --- a/level_3/iki_write/c/main/iki_write.h +++ b/level_3/iki_write/c/main/iki_write.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Write * API Version: 0.7 * Licenses: lgpl-2.1-or-later * @@ -39,6 +39,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include @@ -61,6 +65,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/iki_write/c/main/main.c b/level_3/iki_write/c/main/main.c index 9ead595..9187eb2 100644 --- a/level_3/iki_write/c/main/main.c +++ b/level_3/iki_write/c/main/main.c @@ -26,17 +26,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - iki_write_setting_load(arguments, &data); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + iki_write_setting_load(arguments, &data); + } + + iki_write_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &iki_write_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + iki_write_print_error(&data.program.error, macro_iki_write_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + iki_write_setting_load(arguments, &data); + } - iki_write_main(&data); + if (!iki_write_signal_check(&data)) { + iki_write_main(&data); + } - iki_write_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + iki_write_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/iki_write/c/main/process.h b/level_3/iki_write/c/main/process.h index f8e2a9e..26888d7 100644 --- a/level_3/iki_write/c/main/process.h +++ b/level_3/iki_write/c/main/process.h @@ -1,7 +1,7 @@ /** * FLL - Level 3 * - * Project: IKI + * Project: IKI Write * API Version: 0.7 * Licenses: lgpl-2.1-or-later * diff --git a/level_3/iki_write/c/main/signal.c b/level_3/iki_write/c/main/signal.c new file mode 100644 index 0000000..f6b4327 --- /dev/null +++ b/level_3/iki_write/c/main/signal.c @@ -0,0 +1,113 @@ +#include "iki_write.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_iki_write_signal_check_) && defined(_di_thread_support_) + f_status_t iki_write_signal_check(iki_write_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (!((++main->program.signal_check) % iki_write_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + main->program.signal_check = 0; + } + + return F_false; + } +#endif // !defined(_di_iki_write_signal_check_) && defined(_di_thread_support_) + +#if !defined(_di_iki_write_signal_check_) && !defined(_di_thread_support_) + f_status_t iki_write_signal_check(iki_write_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (main->program.signal_received) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + return F_false; + } +#endif // !defined(_di_iki_write_signal_check_) && !defined(_di_thread_support_) + +#if !defined(_di_iki_write_signal_handler_) && !defined(_di_thread_support_) + void iki_write_signal_handler(iki_write_main_t * const main) { + + if (!main) return; + + siginfo_t information; + f_array_length_t failsafe = 0; + + memset(&information, 0, sizeof(siginfo_t)); + + main->program.signal_received = 0; + + f_signal_set_empty(&main->program.signal.set); + f_signal_set_add(F_signal_abort, &main->program.signal.set); + f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); + f_signal_set_add(F_signal_hangup, &main->program.signal.set); + f_signal_set_add(F_signal_interrupt, &main->program.signal.set); + f_signal_set_add(F_signal_quit, &main->program.signal.set); + f_signal_set_add(F_signal_termination, &main->program.signal.set); + + if (main->program.signal.id == -1) { + main->setting.status_thread = f_signal_open(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + + return; + } + } + + do { + memset(&information, 0, sizeof(siginfo_t)); + + main->setting.status_thread = f_signal_wait(&main->program.signal.set, &information); + + if (F_status_is_error(main->setting.status_thread) && F_status_set_fine(main->setting.status_thread) != F_interrupt) { + if (++failsafe >= iki_write_signal_check_failsafe_d) break; + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + main->program.signal_received = information.si_signo; + + break; + } + + failsafe = 0; + main->setting.status_thread = F_none; + + } while (!main->program.signal_received); + + f_signal_close(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + } + } +#endif // !defined(_di_iki_write_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_write/c/main/signal.h b/level_3/iki_write/c/main/signal.h new file mode 100644 index 0000000..2301f0b --- /dev/null +++ b/level_3/iki_write/c/main/signal.h @@ -0,0 +1,86 @@ +/** + * FLL - Level 3 + * + * Project: IKI Write + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides signal functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_write_signal_h +#define _iki_write_signal_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check to see if a signal is received. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * There is a threaded and a non-threaded version of this. + * The non-threaded version checks periodically using iki_write_signal_check_d and updates main->signal_check as needed. + * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. + * + * @param main + * The main program and settings data. + * + * This does not alter main.setting.state.status. + * + * @return + * F_true on signal received. + * F_false otherwise. + * + * @see iki_write_signal_handler() + * + * @see fll_program_standard_signal_received() + */ +#ifndef _di_iki_write_signal_check_ + extern f_status_t iki_write_signal_check(iki_write_main_t * const main); +#endif // _di_iki_write_signal_check_ + +/** + * Signal handler for signals/interrupts. + * + * This blocks until an expected signal is recieved. + * When an expected signal is received it then sets the + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The main program and settings data. + * + * This alters main.program.signal_received, setting it to a received signal. + * + * This alters setting.status: + * Errors with (error bit set) from: f_signal_open() + * Errors with (error bit set) from: f_signal_wait() + * + * @see f_signal_close() + * @see f_signal_open() + * @see f_signal_wait() + */ +#if !defined(_di_iki_write_signal_handler_) && !defined(_di_thread_support_) + extern void iki_write_signal_handler(iki_write_main_t * const main); +#endif // !defined(_di_iki_write_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_write_signal_h diff --git a/level_3/iki_write/c/main/thread.c b/level_3/iki_write/c/main/thread.c new file mode 100644 index 0000000..f67796e --- /dev/null +++ b/level_3/iki_write/c/main/thread.c @@ -0,0 +1,26 @@ +#include "iki_write.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_iki_write_thread_signal_) && !defined(_di_thread_support_) + void * iki_write_thread_signal(void * const main) { + + f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); + + if (main) { + iki_write_signal_handler((iki_write_main_t *) main); + } + + return 0; + } +#endif // !defined(_di_iki_write_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/iki_write/c/main/thread.h b/level_3/iki_write/c/main/thread.h new file mode 100644 index 0000000..3e3b5c0 --- /dev/null +++ b/level_3/iki_write/c/main/thread.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 3 + * + * Project: IKI Write + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides thread functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _iki_write_thread_h +#define _iki_write_thread_h + +/** + * Thread handler for signals/interrupts. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The program and settings data. + * + * Must be of type iki_write_main_t. + * + * @return + * 0, always. + * + * @see f_thread_cancel_state_set() + * + * @see iki_write_signal_handler() + */ +#if !defined(_di_iki_write_thread_signal_) && !defined(_di_thread_support_) + extern void * iki_write_thread_signal(void * const main); +#endif // !defined(_di_iki_write_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _iki_write_thread_h diff --git a/level_3/iki_write/data/build/defines b/level_3/iki_write/data/build/defines index c665317..490da41 100644 --- a/level_3/iki_write/data/build/defines +++ b/level_3/iki_write/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/iki_write/data/build/settings b/level_3/iki_write/data/build/settings index fa1bc1d..d33f76f 100644 --- a/level_3/iki_write/data/build/settings +++ b/level_3/iki_write/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name iki_write @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -18,14 +30,15 @@ build_indexer_arguments rcs build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_iki -lfll_print -lfll_program -lfl_iki -lfl_print -lf_color -lf_console -lf_conversion -lf_file -lf_iki -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/iki_write.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/error.c main/print/message.c main/process.c +build_sources_library main/iki_write.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/print/error.c main/print/message.c main/process.c main/signal.c main/thread.c build_sources_program main/main.c -build_sources_headers main/iki_write.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h main/process.h +build_sources_headers main/iki_write.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/print/error.h main/print/message.h main/process.h main/signal.h main/thread.h build_sources_documentation man @@ -54,14 +67,18 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ + flags_library -fPIC flags_object -fPIC flags_program -fPIE diff --git a/level_3/status_code/c/fss/main.c b/level_3/status_code/c/fss/main.c index 22b1187..607f164 100644 --- a/level_3/status_code/c/fss/main.c +++ b/level_3/status_code/c/fss/main.c @@ -35,17 +35,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - status_code_setting_load(arguments, &data); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + status_code_setting_load(arguments, &data); + } + + status_code_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &status_code_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + status_code_print_error(&data.program.error, macro_status_code_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + status_code_setting_load(arguments, &data); + } - status_code_main(&data); + if (!status_code_signal_check(&data)) { + status_code_main(&data); + } - status_code_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + status_code_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/status_code/c/main/common.c b/level_3/status_code/c/main/common.c index 93385bf..c205e09 100644 --- a/level_3/status_code/c/main/common.c +++ b/level_3/status_code/c/main/common.c @@ -4,15 +4,6 @@ extern "C" { #endif -#ifndef _di_status_code_setting_delete_ - f_status_t status_code_setting_delete(status_code_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - return F_none; - } -#endif // _di_status_code_setting_delete_ - #ifndef _di_status_code_setting_load_ void status_code_setting_load(const f_console_arguments_t arguments, status_code_main_t * const main) { @@ -182,17 +173,6 @@ extern "C" { } #endif // _di_status_code_setting_load_ -#ifndef _di_status_code_setting_unload_ - f_status_t status_code_setting_unload(status_code_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - status_code_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_status_code_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/status_code/c/main/common.h b/level_3/status_code/c/main/common.h index 55552fc..62d974a 100644 --- a/level_3/status_code/c/main/common.h +++ b/level_3/status_code/c/main/common.h @@ -17,23 +17,6 @@ extern "C" { #endif /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_status_code_setting_delete_ - extern f_status_t status_code_setting_delete(status_code_setting_t * const setting); -#endif // _di_status_code_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -58,28 +41,6 @@ extern "C" { extern void status_code_setting_load(const f_console_arguments_t arguments, status_code_main_t * const main); #endif // _di_status_code_setting_load_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The main program and setting data. - * All buffers are deallocated. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: status_code_setting_delete(). - * - * @see status_code_setting_delete() - */ -#ifndef _di_status_code_setting_unload_ - extern f_status_t status_code_setting_unload(status_code_main_t * const main); -#endif // _di_status_code_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/status_code/c/main/common/define.h b/level_3/status_code/c/main/common/define.h index 9909e32..b035693 100644 --- a/level_3/status_code/c/main/common/define.h +++ b/level_3/status_code/c/main/common/define.h @@ -17,20 +17,36 @@ extern "C" { #endif /** - * The program defines. + * The program allocation defines. * - * status_code_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. + * status_code_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_status_code_d_ +#ifndef _di_status_code_allocation_d_ #define status_code_allocation_console_d 4 #define status_code_allocation_large_d 256 + #define status_code_allocation_pipe_d 16384 #define status_code_allocation_small_d 16 - #define status_code_signal_check_d 20000 -#endif // _di_status_code_d_ +#endif // _di_status_code_allocation_d_ + +/** + * The program signal defines. + * + * status_code_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_status_code_signal_d_ + #define status_code_signal_check_d 500000 + #define status_code_signal_check_failsafe_d 20000 + #define status_code_signal_check_tiny_d 4 + #define status_code_signal_check_short_d 16 +#endif // _di_status_code_signal_d_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/status_code/c/main/common/print.c b/level_3/status_code/c/main/common/print.c index 4497281..600acc8 100644 --- a/level_3/status_code/c/main/common/print.c +++ b/level_3/status_code/c/main/common/print.c @@ -7,10 +7,11 @@ extern "C" { #ifndef _di_status_code_f_a_ const f_string_t status_code_f_a[] = { "f_console_parameter_process", - "status_string_from", - "status_string_to", + "f_thread_create", "fll_program_parameter_process_context", "fll_program_parameter_process_verbosity", + "status_string_from", + "status_string_to", }; #endif // _di_status_code_f_a_ diff --git a/level_3/status_code/c/main/common/print.h b/level_3/status_code/c/main/common/print.h index bcd71e9..9ded4a5 100644 --- a/level_3/status_code/c/main/common/print.h +++ b/level_3/status_code/c/main/common/print.h @@ -40,10 +40,11 @@ extern "C" { #ifndef _di_status_code_f_e_ enum { status_code_f_f_console_parameter_process_e, - status_code_f_status_string_from_e, - status_code_f_status_string_to_e, + status_code_f_f_thread_create_e, status_code_f_fll_program_parameter_process_context_e, status_code_f_fll_program_parameter_process_verbosity_e, + status_code_f_status_string_from_e, + status_code_f_status_string_to_e, }; // enum #endif // _di_status_code_f_e_ diff --git a/level_3/status_code/c/main/common/type.c b/level_3/status_code/c/main/common/type.c index 4c41666..244c9c9 100644 --- a/level_3/status_code/c/main/common/type.c +++ b/level_3/status_code/c/main/common/type.c @@ -4,6 +4,25 @@ extern "C" { #endif +#ifndef _di_status_code_main_data_delete_ + void status_code_main_delete(status_code_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + status_code_setting_delete(&main->setting); + } +#endif // _di_status_code_main_data_delete_ + +#ifndef _di_status_code_setting_delete_ + f_status_t status_code_setting_delete(status_code_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + return F_none; + } +#endif // _di_status_code_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/status_code/c/main/common/type.h b/level_3/status_code/c/main/common/type.h index 36cdd04..3054df6 100644 --- a/level_3/status_code/c/main/common/type.h +++ b/level_3/status_code/c/main/common/type.h @@ -24,7 +24,8 @@ extern "C" { * * flag: Flags passed to the main function. * - * state: The state information. + * status_thread: A status used eclusively by the threaded signal handler. + * state: The state data used when processing the FSS data. * * status_string_from: A pointer to the status string function (usually either fl_status_string_from() or fll_fss_status_string_from()). * status_string_to: A pointer to the status string function (usually either f_status_string_to() or fll_fss_status_string_to()). @@ -34,6 +35,7 @@ extern "C" { typedef struct { uint16_t flag; + f_status_t status_thread; f_state_t state; const f_string_static_t *program_name; @@ -47,6 +49,7 @@ extern "C" { #define status_code_setting_t_initialize \ { \ status_code_main_flag_none_e, \ + F_none, \ f_state_t_initialize, \ 0, \ 0, \ @@ -75,6 +78,35 @@ extern "C" { } #endif // _di_status_code_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_status_code_main_data_delete_ + extern void status_code_main_delete(status_code_main_t * const main); +#endif // _di_status_code_main_data_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_status_code_setting_delete_ + extern f_status_t status_code_setting_delete(status_code_setting_t * const setting); +#endif // _di_status_code_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/status_code/c/main/main.c b/level_3/status_code/c/main/main.c index f620de6..d3e2860 100644 --- a/level_3/status_code/c/main/main.c +++ b/level_3/status_code/c/main/main.c @@ -33,17 +33,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - status_code_setting_load(arguments, &data); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + status_code_setting_load(arguments, &data); + } + + status_code_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &status_code_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + status_code_print_error(&data.program.error, macro_status_code_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + status_code_setting_load(arguments, &data); + } - status_code_main(&data); + if (!status_code_signal_check(&data)) { + status_code_main(&data); + } - status_code_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + status_code_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/status_code/c/main/signal.c b/level_3/status_code/c/main/signal.c new file mode 100644 index 0000000..419a292 --- /dev/null +++ b/level_3/status_code/c/main/signal.c @@ -0,0 +1,113 @@ +#include "status_code.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_status_code_signal_check_) && defined(_di_thread_support_) + f_status_t status_code_signal_check(status_code_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (!((++main->program.signal_check) % status_code_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + main->program.signal_check = 0; + } + + return F_false; + } +#endif // !defined(_di_status_code_signal_check_) && defined(_di_thread_support_) + +#if !defined(_di_status_code_signal_check_) && !defined(_di_thread_support_) + f_status_t status_code_signal_check(status_code_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (main->program.signal_received) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + return F_false; + } +#endif // !defined(_di_status_code_signal_check_) && !defined(_di_thread_support_) + +#if !defined(_di_status_code_signal_handler_) && !defined(_di_thread_support_) + void status_code_signal_handler(status_code_main_t * const main) { + + if (!main) return; + + siginfo_t information; + f_array_length_t failsafe = 0; + + memset(&information, 0, sizeof(siginfo_t)); + + main->program.signal_received = 0; + + f_signal_set_empty(&main->program.signal.set); + f_signal_set_add(F_signal_abort, &main->program.signal.set); + f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); + f_signal_set_add(F_signal_hangup, &main->program.signal.set); + f_signal_set_add(F_signal_interrupt, &main->program.signal.set); + f_signal_set_add(F_signal_quit, &main->program.signal.set); + f_signal_set_add(F_signal_termination, &main->program.signal.set); + + if (main->program.signal.id == -1) { + main->setting.status_thread = f_signal_open(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + + return; + } + } + + do { + memset(&information, 0, sizeof(siginfo_t)); + + main->setting.status_thread = f_signal_wait(&main->program.signal.set, &information); + + if (F_status_is_error(main->setting.status_thread) && F_status_set_fine(main->setting.status_thread) != F_interrupt) { + if (++failsafe >= status_code_signal_check_failsafe_d) break; + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + main->program.signal_received = information.si_signo; + + break; + } + + failsafe = 0; + main->setting.status_thread = F_none; + + } while (!main->program.signal_received); + + f_signal_close(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + } + } +#endif // !defined(_di_status_code_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/status_code/c/main/signal.h b/level_3/status_code/c/main/signal.h new file mode 100644 index 0000000..905544b --- /dev/null +++ b/level_3/status_code/c/main/signal.h @@ -0,0 +1,86 @@ +/** + * FLL - Level 3 + * + * Project: Status Code + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides signal functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _status_code_signal_h +#define _status_code_signal_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check to see if a signal is received. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * There is a threaded and a non-threaded version of this. + * The non-threaded version checks periodically using status_code_signal_check_d and updates main->signal_check as needed. + * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. + * + * @param main + * The main program and settings data. + * + * This does not alter main.setting.state.status. + * + * @return + * F_true on signal received. + * F_false otherwise. + * + * @see status_code_signal_handler() + * + * @see fll_program_standard_signal_received() + */ +#ifndef _di_status_code_signal_check_ + extern f_status_t status_code_signal_check(status_code_main_t * const main); +#endif // _di_status_code_signal_check_ + +/** + * Signal handler for signals/interrupts. + * + * This blocks until an expected signal is recieved. + * When an expected signal is received it then sets the + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The main program and settings data. + * + * This alters main.program.signal_received, setting it to a received signal. + * + * This alters setting.status: + * Errors with (error bit set) from: f_signal_open() + * Errors with (error bit set) from: f_signal_wait() + * + * @see f_signal_close() + * @see f_signal_open() + * @see f_signal_wait() + */ +#if !defined(_di_status_code_signal_handler_) && !defined(_di_thread_support_) + extern void status_code_signal_handler(status_code_main_t * const main); +#endif // !defined(_di_status_code_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _status_code_signal_h diff --git a/level_3/status_code/c/main/status_code.h b/level_3/status_code/c/main/status_code.h index 6b178e8..df45ad6 100644 --- a/level_3/status_code/c/main/status_code.h +++ b/level_3/status_code/c/main/status_code.h @@ -32,6 +32,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include @@ -54,6 +58,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/status_code/c/main/thread.c b/level_3/status_code/c/main/thread.c new file mode 100644 index 0000000..bb8d999 --- /dev/null +++ b/level_3/status_code/c/main/thread.c @@ -0,0 +1,26 @@ +#include "status_code.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_status_code_thread_signal_) && !defined(_di_thread_support_) + void * status_code_thread_signal(void * const main) { + + f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); + + if (main) { + status_code_signal_handler((status_code_main_t *) main); + } + + return 0; + } +#endif // !defined(_di_status_code_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/status_code/c/main/thread.h b/level_3/status_code/c/main/thread.h new file mode 100644 index 0000000..1dcb19e --- /dev/null +++ b/level_3/status_code/c/main/thread.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 3 + * + * Project: Status Code + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides thread functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _status_code_thread_h +#define _status_code_thread_h + +/** + * Thread handler for signals/interrupts. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The program and settings data. + * + * Must be of type status_code_main_t. + * + * @return + * 0, always. + * + * @see f_thread_cancel_state_set() + * + * @see status_code_signal_handler() + */ +#if !defined(_di_status_code_thread_signal_) && !defined(_di_thread_support_) + extern void * status_code_thread_signal(void * const main); +#endif // !defined(_di_status_code_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _status_code_thread_h diff --git a/level_3/status_code/data/build/defines b/level_3/status_code/data/build/defines index f8ebb04..37246a0 100644 --- a/level_3/status_code/data/build/defines +++ b/level_3/status_code/data/build/defines @@ -3,3 +3,7 @@ # Defines for the "status_code" program. # +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/status_code/data/build/defines.fss b/level_3/status_code/data/build/defines.fss index dd7ed8d..c4872ba 100644 --- a/level_3/status_code/data/build/defines.fss +++ b/level_3/status_code/data/build/defines.fss @@ -2,3 +2,8 @@ # # Defines for the "fss_status_code" program. # + +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/status_code/data/build/settings b/level_3/status_code/data/build/settings index 45c8e9b..152c97d 100644 --- a/level_3/status_code/data/build/settings +++ b/level_3/status_code/data/build/settings @@ -2,6 +2,17 @@ # # Builds the main library of the project with all parts except "main" program related. # +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name status_code @@ -11,8 +22,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -22,13 +33,14 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/status_code.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print/data.c main/print/error.c main/print/message.c main/process.c +build_sources_library main/status_code.c main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/convert.c main/print/data.c main/print/error.c main/print/message.c main/process.c main/signal.c main/thread.c build_sources_library fss/status_code.c fss/common.c -build_sources_headers main/status_code.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print/data.h main/print/error.h main/print/message.h main/process.h +build_sources_headers main/status_code.h main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/convert.h main/print/data.h main/print/error.h main/print/message.h main/process.h main/signal.h main/thread.h build_sources_headers fss/status_code.h fss/common.h build_sources_documentation man @@ -58,10 +70,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer diff --git a/level_3/status_code/data/build/settings.fss b/level_3/status_code/data/build/settings.fss index 657f192..f6402c9 100644 --- a/level_3/status_code/data/build/settings.fss +++ b/level_3/status_code/data/build/settings.fss @@ -3,6 +3,17 @@ # Builds the "fss" program (fss_status_code). # This must be called after the "setting". # +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name fss_status_code @@ -12,8 +23,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +34,7 @@ build_language c build_libraries -lc -lstatus_code build_libraries-individual -lfll_error -lfll_fss_status_string -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_fss -lfl_print -lfl_status_string -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_fss -lf_memory -lf_parse -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +67,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/status_code/data/build/settings.main b/level_3/status_code/data/build/settings.main index d9b5768..bc16a17 100644 --- a/level_3/status_code/data/build/settings.main +++ b/level_3/status_code/data/build/settings.main @@ -3,6 +3,17 @@ # Builds the "main" program (status_code). # This must be called after the "setting". # +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name status_code @@ -12,8 +23,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -23,6 +34,7 @@ build_language c build_libraries -lc -lstatus_code build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_directory -lfl_print -lfl_status_string -lf_color -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_status_string -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll @@ -55,10 +67,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/ diff --git a/level_3/utf8/c/main/codepoint.c b/level_3/utf8/c/main/codepoint.c index c6e4ccd..ecd4822 100644 --- a/level_3/utf8/c/main/codepoint.c +++ b/level_3/utf8/c/main/codepoint.c @@ -15,7 +15,7 @@ extern "C" { if (*mode != utf8_codepoint_mode_end_e) { if (main->setting.text.used + unicode.used >= main->setting.text.size) { - main->setting.state.status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &main->setting.text); + main->setting.state.status = f_string_dynamic_increase_by(utf8_allocation_small_d, &main->setting.text); if (F_status_is_error(main->setting.state.status)) return; } @@ -108,7 +108,7 @@ extern "C" { if (*mode != utf8_codepoint_mode_raw_end_e) { if (main->setting.text.used + hex.used >= main->setting.text.size) { - main->setting.state.status = f_string_dynamic_increase_by(utf8_default_allocation_step_d, &main->setting.text); + main->setting.state.status = f_string_dynamic_increase_by(utf8_allocation_small_d, &main->setting.text); if (F_status_is_error(main->setting.state.status)) return; } diff --git a/level_3/utf8/c/main/common.c b/level_3/utf8/c/main/common.c index 78d64a8..371d799 100644 --- a/level_3/utf8/c/main/common.c +++ b/level_3/utf8/c/main/common.c @@ -4,22 +4,6 @@ extern "C" { #endif -#ifndef _di_utf8_setting_delete_ - f_status_t utf8_setting_delete(utf8_setting_t * const setting) { - - if (!setting) return F_status_set_error(F_parameter); - - f_string_dynamic_resize(0, &setting->buffer); - f_string_dynamic_resize(0, &setting->text); - - f_string_dynamics_resize(0, &setting->path_files_from); - f_string_dynamics_resize(0, &setting->path_files_to); - f_string_dynamics_resize(0, &setting->remaining); - - return F_none; - } -#endif // _di_utf8_setting_delete_ - #ifndef _di_utf8_setting_load_ void utf8_setting_load(const f_console_arguments_t arguments, utf8_main_t * const main) { @@ -457,17 +441,6 @@ extern "C" { } #endif // _di_utf8_setting_load_ -#ifndef _di_utf8_setting_unload_ - f_status_t utf8_setting_unload(utf8_main_t * const main) { - - if (!main) return F_status_set_error(F_parameter); - - utf8_setting_delete(&main->setting); - - return F_none; - } -#endif // _di_utf8_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/utf8/c/main/common.h b/level_3/utf8/c/main/common.h index a08c1cb..669f2c0 100644 --- a/level_3/utf8/c/main/common.h +++ b/level_3/utf8/c/main/common.h @@ -17,23 +17,6 @@ extern "C" { #endif /** - * Delete the program main setting data. - * - * @param setting - * The program main setting data. - * - * This does not alter setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - */ -#ifndef _di_utf8_setting_delete_ - extern f_status_t utf8_setting_delete(utf8_setting_t * const setting); -#endif // _di_utf8_setting_delete_ - -/** * Perform the standard program setting load process. * * This prints error messages as appropriate. @@ -58,28 +41,6 @@ extern "C" { extern void utf8_setting_load(const f_console_arguments_t arguments, utf8_main_t * const main); #endif // _di_utf8_setting_load_ -/** - * Perform the standard program setting unload process. - * - * @param main - * The main program and setting data. - * All buffers are deallocated. - * - * This does not alter main.setting.state.status. - * - * @return - * F_none on success. - * - * F_parameter (with error bit) if a parameter is invalid. - * - * Errors (with error bit) from: utf8_setting_delete(). - * - * @see utf8_setting_delete() - */ -#ifndef _di_utf8_setting_unload_ - extern f_status_t utf8_setting_unload(utf8_main_t * const main); -#endif // _di_utf8_setting_unload_ - #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/utf8/c/main/common/define.h b/level_3/utf8/c/main/common/define.h index dd5b66d..42ac41a 100644 --- a/level_3/utf8/c/main/common/define.h +++ b/level_3/utf8/c/main/common/define.h @@ -17,27 +17,36 @@ extern "C" { #endif /** - * Set to at least 4 to provide a UTF-8 friendly allocation step. - */ -#ifndef _di_utf8_default_d_ - #define utf8_default_allocation_step_d 16 -#endif // _di_utf8_default_d_ - -/** - * The program defines. + * The program allocation defines. * - * utf8_*_d: - * - allocation_console: An allocation step used for small buffers specifically for console parameter. - * - allocation_large: An allocation step used for buffers that are anticipated to have large buffers. - * - allocation_small: An allocation step used for buffers that are anticipated to have small buffers. - * - signal_check: Number of iterations before performing signal check in non-threaded signal handling. + * utf8_allocation_*_d: + * - console: An allocation step used for small buffers specifically for console parameter. + * - large: An allocation step used for buffers that are anticipated to have large buffers. + * - pipe: A buffer size used for processing piped data. + * - small: An allocation step used for buffers that are anticipated to have small buffers. */ -#ifndef _di_utf8_d_ +#ifndef _di_utf8_allocation_d_ #define utf8_allocation_console_d 4 #define utf8_allocation_large_d 256 + #define utf8_allocation_pipe_d 16384 #define utf8_allocation_small_d 16 - #define utf8_signal_check_d 20000 -#endif // _di_utf8_d_ +#endif // _di_utf8_allocation_d_ + +/** + * The program signal defines. + * + * utf8_signal_*_d: + * - check: Number of iterations before performing signal check in non-threaded signal handling. + * - check_failsafe: When using threads, how many consecutive failures to check signal before aborting (as a recursion failsafe). + * - check_tiny: The tiny check. + * - check_short: The short signal check. + */ +#ifndef _di_utf8_signal_d_ + #define utf8_signal_check_d 500000 + #define utf8_signal_check_failsafe_d 20000 + #define utf8_signal_check_tiny_d 4 + #define utf8_signal_check_short_d 16 +#endif // _di_utf8_signal_d_ #ifdef __cplusplus } // extern "C" diff --git a/level_3/utf8/c/main/common/print.c b/level_3/utf8/c/main/common/print.c index 9a49594..7d7ac5b 100644 --- a/level_3/utf8/c/main/common/print.c +++ b/level_3/utf8/c/main/common/print.c @@ -11,6 +11,7 @@ extern "C" { "f_file_stream_open", "f_string_dynamic_append_nulless", "f_string_dynamics_increase_by", + "f_thread_create", "fll_program_parameter_process_context", "fll_program_parameter_process_verbosity", "utf8_detect_codepoint", diff --git a/level_3/utf8/c/main/common/print.h b/level_3/utf8/c/main/common/print.h index aec343d..5f98d2c 100644 --- a/level_3/utf8/c/main/common/print.h +++ b/level_3/utf8/c/main/common/print.h @@ -44,6 +44,7 @@ extern "C" { utf8_f_f_file_stream_open_e, utf8_f_f_string_dynamic_append_nulless_e, utf8_f_f_string_dynamics_increase_by_e, + utf8_f_f_thread_create_e, utf8_f_fll_program_parameter_process_context_e, utf8_f_fll_program_parameter_process_verbosity_e, utf8_f_utf8_detect_codepoint_e, diff --git a/level_3/utf8/c/main/common/type.c b/level_3/utf8/c/main/common/type.c index d0e8414..343dfdd 100644 --- a/level_3/utf8/c/main/common/type.c +++ b/level_3/utf8/c/main/common/type.c @@ -4,6 +4,32 @@ extern "C" { #endif +#ifndef _di_utf8_main_data_delete_ + void utf8_main_delete(utf8_main_t * const main) { + + if (!main) return; + + fll_program_data_delete(&main->program); + utf8_setting_delete(&main->setting); + } +#endif // _di_utf8_main_data_delete_ + +#ifndef _di_utf8_setting_delete_ + f_status_t utf8_setting_delete(utf8_setting_t * const setting) { + + if (!setting) return F_status_set_error(F_parameter); + + f_string_dynamic_resize(0, &setting->buffer); + f_string_dynamic_resize(0, &setting->text); + + f_string_dynamics_resize(0, &setting->path_files_from); + f_string_dynamics_resize(0, &setting->path_files_to); + f_string_dynamics_resize(0, &setting->remaining); + + return F_none; + } +#endif // _di_utf8_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/utf8/c/main/common/type.h b/level_3/utf8/c/main/common/type.h index 25abea3..b4d2166 100644 --- a/level_3/utf8/c/main/common/type.h +++ b/level_3/utf8/c/main/common/type.h @@ -25,7 +25,8 @@ extern "C" { * mode: The input/output mode (see utf8_modes_e). * flag: Flags passed to the main function. * - * state: The state information. + * status_thread: A status used eclusively by the threaded signal handler. + * state: The state data used when processing the FSS data. * * valid: Designate the output context set for valid characters. * valid_not: Designate the output context set for invalid characters. @@ -45,6 +46,7 @@ extern "C" { uint8_t mode; uint16_t flag; + f_status_t status_thread; f_state_t state; f_color_set_t valid; @@ -65,6 +67,7 @@ extern "C" { { \ utf8_mode_from_bytesequence_e | utf8_mode_to_codepoint_e, \ utf8_main_flag_none_e, \ + F_none, \ f_state_t_initialize, \ f_color_set_t_initialize, \ f_color_set_t_initialize, \ @@ -97,6 +100,35 @@ extern "C" { } #endif // _di_utf8_main_t_ +/** + * Deallocate main program data. + * + * @param setting_make + * The make setting data. + * + * This does not alter data_make.main.setting.state.status. + */ +#ifndef _di_utf8_main_data_delete_ + extern void utf8_main_delete(utf8_main_t * const main); +#endif // _di_utf8_main_data_delete_ + +/** + * Delete the program main setting data. + * + * @param setting + * The program main setting data. + * + * This does not alter setting.state.status. + * + * @return + * F_none on success. + * + * F_parameter (with error bit) if a parameter is invalid. + */ +#ifndef _di_utf8_setting_delete_ + extern f_status_t utf8_setting_delete(utf8_setting_t * const setting); +#endif // _di_utf8_setting_delete_ + #ifdef __cplusplus } // extern "C" #endif diff --git a/level_3/utf8/c/main/main.c b/level_3/utf8/c/main/main.c index 7b616db..3146e2a 100644 --- a/level_3/utf8/c/main/main.c +++ b/level_3/utf8/c/main/main.c @@ -27,17 +27,45 @@ int main(const int argc, const f_string_t *argv, const f_string_t *envp) { fll_program_standard_set_up(&data.program); - { - const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + f_file_umask_get(&data.program.umask); - utf8_setting_load(arguments, &data); - } + #ifdef _di_thread_support_ + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + utf8_setting_load(arguments, &data); + } + + utf8_main(&data); + #else + { + f_thread_id_t id_signal; + + memset(&id_signal, 0, sizeof(f_thread_id_t)); + + data.setting.state.status = f_thread_create(0, &id_signal, &utf8_thread_signal, (void *) &data); + + if (F_status_is_error(data.setting.state.status)) { + utf8_print_error(&data.program.error, macro_utf8_f(f_thread_create)); + } + else { + { + const f_console_arguments_t arguments = macro_f_console_arguments_t_initialize(argc, argv, envp); + + utf8_setting_load(arguments, &data); + } - utf8_main(&data); + if (!utf8_signal_check(&data)) { + utf8_main(&data); + } - utf8_setting_unload(&data); + f_thread_cancel(id_signal); + f_thread_join(id_signal, 0); + } + } + #endif // _di_thread_support_ - fll_program_data_delete(&data.program); + utf8_main_delete(&data); fll_program_standard_set_down(&data.program); diff --git a/level_3/utf8/c/main/signal.c b/level_3/utf8/c/main/signal.c new file mode 100644 index 0000000..6635d04 --- /dev/null +++ b/level_3/utf8/c/main/signal.c @@ -0,0 +1,113 @@ +#include "utf8.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_utf8_signal_check_) && defined(_di_thread_support_) + f_status_t utf8_signal_check(utf8_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (!((++main->program.signal_check) % utf8_signal_check_d)) { + if (fll_program_standard_signal_received(&main->program)) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + main->program.signal_check = 0; + } + + return F_false; + } +#endif // !defined(_di_utf8_signal_check_) && defined(_di_thread_support_) + +#if !defined(_di_utf8_signal_check_) && !defined(_di_thread_support_) + f_status_t utf8_signal_check(utf8_main_t * const main) { + + if (!main) return F_false; + if (main->program.signal.id == -1) return F_false; + + if (main->program.signal_received) { + fll_program_print_signal_received(&main->program.warning, main->program.signal_received); + + main->setting.state.status = F_status_set_error(F_interrupt); + + return F_true; + } + + return F_false; + } +#endif // !defined(_di_utf8_signal_check_) && !defined(_di_thread_support_) + +#if !defined(_di_utf8_signal_handler_) && !defined(_di_thread_support_) + void utf8_signal_handler(utf8_main_t * const main) { + + if (!main) return; + + siginfo_t information; + f_array_length_t failsafe = 0; + + memset(&information, 0, sizeof(siginfo_t)); + + main->program.signal_received = 0; + + f_signal_set_empty(&main->program.signal.set); + f_signal_set_add(F_signal_abort, &main->program.signal.set); + f_signal_set_add(F_signal_broken_pipe, &main->program.signal.set); + f_signal_set_add(F_signal_hangup, &main->program.signal.set); + f_signal_set_add(F_signal_interrupt, &main->program.signal.set); + f_signal_set_add(F_signal_quit, &main->program.signal.set); + f_signal_set_add(F_signal_termination, &main->program.signal.set); + + if (main->program.signal.id == -1) { + main->setting.status_thread = f_signal_open(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + + return; + } + } + + do { + memset(&information, 0, sizeof(siginfo_t)); + + main->setting.status_thread = f_signal_wait(&main->program.signal.set, &information); + + if (F_status_is_error(main->setting.status_thread) && F_status_set_fine(main->setting.status_thread) != F_interrupt) { + if (++failsafe >= utf8_signal_check_failsafe_d) break; + } + + switch (information.si_signo) { + case F_signal_abort: + case F_signal_broken_pipe: + case F_signal_hangup: + case F_signal_interrupt: + case F_signal_quit: + case F_signal_termination: + main->program.signal_received = information.si_signo; + + break; + } + + failsafe = 0; + main->setting.status_thread = F_none; + + } while (!main->program.signal_received); + + f_signal_close(&main->program.signal); + + if (F_status_is_error(main->setting.status_thread)) { + main->program.signal_received = F_signal_abort; + } + } +#endif // !defined(_di_utf8_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/utf8/c/main/signal.h b/level_3/utf8/c/main/signal.h new file mode 100644 index 0000000..2a54696 --- /dev/null +++ b/level_3/utf8/c/main/signal.h @@ -0,0 +1,86 @@ +/** + * FLL - Level 3 + * + * Project: UTF8 + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides signal functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _utf8_signal_h +#define _utf8_signal_h + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check to see if a signal is received. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * There is a threaded and a non-threaded version of this. + * The non-threaded version checks periodically using utf8_signal_check_d and updates main->signal_check as needed. + * The threaded version checks the flag state which is set by a separate thread that is blocking until signal is received. + * + * @param main + * The main program and settings data. + * + * This does not alter main.setting.state.status. + * + * @return + * F_true on signal received. + * F_false otherwise. + * + * @see utf8_signal_handler() + * + * @see fll_program_standard_signal_received() + */ +#ifndef _di_utf8_signal_check_ + extern f_status_t utf8_signal_check(utf8_main_t * const main); +#endif // _di_utf8_signal_check_ + +/** + * Signal handler for signals/interrupts. + * + * This blocks until an expected signal is recieved. + * When an expected signal is received it then sets the + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The main program and settings data. + * + * This alters main.program.signal_received, setting it to a received signal. + * + * This alters setting.status: + * Errors with (error bit set) from: f_signal_open() + * Errors with (error bit set) from: f_signal_wait() + * + * @see f_signal_close() + * @see f_signal_open() + * @see f_signal_wait() + */ +#if !defined(_di_utf8_signal_handler_) && !defined(_di_thread_support_) + extern void utf8_signal_handler(utf8_main_t * const main); +#endif // !defined(_di_utf8_signal_handler_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _utf8_signal_h diff --git a/level_3/utf8/c/main/thread.c b/level_3/utf8/c/main/thread.c new file mode 100644 index 0000000..c5449e4 --- /dev/null +++ b/level_3/utf8/c/main/thread.c @@ -0,0 +1,26 @@ +#include "utf8.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined(_di_utf8_thread_signal_) && !defined(_di_thread_support_) + void * utf8_thread_signal(void * const main) { + + f_thread_cancel_state_set(PTHREAD_CANCEL_DEFERRED, 0); + + if (main) { + utf8_signal_handler((utf8_main_t *) main); + } + + return 0; + } +#endif // !defined(_di_utf8_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/level_3/utf8/c/main/thread.h b/level_3/utf8/c/main/thread.h new file mode 100644 index 0000000..63a6a06 --- /dev/null +++ b/level_3/utf8/c/main/thread.h @@ -0,0 +1,46 @@ +/** + * FLL - Level 3 + * + * Project: UTF8 + * API Version: 0.7 + * Licenses: lgpl-2.1-or-later + * + * Provides thread functionality. + * + * This is auto-included and should not need to be explicitly included. + */ +#ifndef _utf8_thread_h +#define _utf8_thread_h + +/** + * Thread handler for signals/interrupts. + * + * If main.signal is non-zero, then this handles the following signals: + * - F_signal_abort + * - F_signal_broken_pipe + * - F_signal_hangup + * - F_signal_interrupt + * - F_signal_quit + * - F_signal_termination + * + * @param main + * The program and settings data. + * + * Must be of type utf8_main_t. + * + * @return + * 0, always. + * + * @see f_thread_cancel_state_set() + * + * @see utf8_signal_handler() + */ +#if !defined(_di_utf8_thread_signal_) && !defined(_di_thread_support_) + extern void * utf8_thread_signal(void * const main); +#endif // !defined(_di_utf8_thread_signal_) && !defined(_di_thread_support_) + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif // _utf8_thread_h diff --git a/level_3/utf8/c/main/utf8.h b/level_3/utf8/c/main/utf8.h index 3cb0fd1..7dc59f0 100644 --- a/level_3/utf8/c/main/utf8.h +++ b/level_3/utf8/c/main/utf8.h @@ -45,6 +45,10 @@ #include #include +#ifndef _di_thread_support_ + #include +#endif // _di_thread_support_ + // FLL-1 includes. #include #include @@ -68,6 +72,8 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { diff --git a/level_3/utf8/data/build/defines b/level_3/utf8/data/build/defines index c665317..490da41 100644 --- a/level_3/utf8/data/build/defines +++ b/level_3/utf8/data/build/defines @@ -1,2 +1,6 @@ # fss-0000 +_di_thread_support_ Disables thread support. + +_pthread_attr_unsupported_ Disable non-portable functionality associated with pthread_attr. +_pthread_sigqueue_unsupported_ Disable GNU specific sigqueue(). diff --git a/level_3/utf8/data/build/settings b/level_3/utf8/data/build/settings index 710372a..64feb96 100644 --- a/level_3/utf8/data/build/settings +++ b/level_3/utf8/data/build/settings @@ -1,4 +1,16 @@ # fss-0001 +# +# Modes: +# - individual: Compile using per project (individual) libraries, does not handle thread or threadless cases. +# - individual_thread: This is required when compiling in individual mode with "thread" mode. +# - level: Compile using per level libraries. +# - monolithic: Compile using per monolithic libraries. +# - clang: Use clang rather than the default, which is generally gcc. +# - test: Compile for a test, such as unit testing. +# - fanalyzer: Compile using GCC's -fanalyzer compile time option. +# - thread: Compile with thread support. +# - threadless: Compile without thread support. +# build_name utf8 @@ -8,8 +20,8 @@ version_micro 0 version_file micro version_target minor -modes individual level monolithic clang test fanalyzer -modes_default monolithic +modes individual individual_thread level monolithic clang test fanalyzer thread threadless +modes_default monolithic thread build_compiler gcc build_compiler-clang clang @@ -19,14 +31,15 @@ build_language c build_libraries -lc build_libraries-individual -lfll_error -lfll_print -lfll_program -lfl_conversion -lfl_print -lf_color -lf_console -lf_conversion -lf_file -lf_memory -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_type_array -lf_utf +build_libraries-individual_thread -lf_thread build_libraries-level -lfll_2 -lfll_1 -lfll_0 build_libraries-monolithic -lfll -build_sources_library main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/bytesequence.c main/codepoint.c main/print/data.c main/print/error.c main/print/message.c main/process.c main/utf8.c +build_sources_library main/common.c main/common/define.c main/common/enumeration.c main/common/print.c main/common/string.c main/common/type.c main/bytesequence.c main/codepoint.c main/print/data.c main/print/error.c main/print/message.c main/process.c main/signal.c main/thread.c main/utf8.c build_sources_program main/main.c -build_sources_headers main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/bytesequence.h main/codepoint.h main/print.h main/print/data.h main/print/error.h main/print/message.h main/process.h main/utf8.h +build_sources_headers main/common.h main/common/define.h main/common/enumeration.h main/common/print.h main/common/string.h main/common/type.h main/bytesequence.h main/codepoint.h main/print.h main/print/data.h main/print/error.h main/print/message.h main/process.h main/signal.h main/thread.h main/utf8.h build_sources_documentation man @@ -55,10 +68,13 @@ search_static yes environment PATH LD_LIBRARY_PATH environment LANG LC_ALL LC_COLLATE LC_CTYPE LC_FASTMSG LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME LOCPATH NLSPATH -#defines -D_di_libcap_ -D_di_thread_support_ -defines -D_libcap_legacy_only_ -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ +#defines -D_di_libcap_ +defines -D_libcap_legacy_only_ +defines-threadless -D_di_thread_support_ +defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_ flags -O2 -z now -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces +flags-thread -pthread flags-clang -Wno-logical-op-parentheses flags-test -O0 -fstack-protector -Wall flags-fanalyzer -fanalyzer