# fss-0001
#
# Builds the remove library of the project.
#
# Modes:
#   - android:           Compile on an android system (using Termux; may need modification depending on the android system).
#   - clang:             Use CLang rather than the default, which is generally GCC.
#   - coverage:          Compile for building coverage.
#   - debug:             Enable debugging, such as compile time debug options.
#   - fanalyzer:         Compile using GCC's -fanalyzer compile time option.
#   - flex_arrays:       Use GCC strict flex arrays (supported by GCC version 13 or greater).
#   - gcc:               Use GCC specific settings.
#   - 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.
#   - pinephone:         Compile on a pinephone system.
#   - test:              Compile for a test, such as unit testing.
#   - thread:            Compile with thread support.
#   - threadless:        Compile without thread support.
#

build_name remove
stage remove

version_major 0
version_minor 7
version_micro 4
version_file micro
version_target minor

modes android clang coverage debug fanalyzer flex_arrays gcc individual individual_thread level monolithic pinephone test thread threadless
modes_default debug gcc monolithic thread

build_compiler gcc
build_compiler-clang clang
build_indexer ar
build_indexer_arguments rcs
build_language c

build_libraries_shared -lc
build_libraries_shared-individual -lfll_error -lfll_print -lfll_program
build_libraries_shared-individual -lfl_conversion -lfl_directory -lfl_path -lfl_print
build_libraries_shared-individual -lf_account -lf_color -lf_compare -lf_console -lf_conversion -lf_directory -lf_file -lf_memory -lf_path -lf_pipe -lf_print -lf_rip -lf_signal -lf_string -lf_time -lf_type_array -lf_utf
build_libraries_shared-individual_thread -lf_thread
build_libraries_shared-level -lfll_2 -lfll_1 -lfll_0
build_libraries_shared-monolithic -lfll

build_libraries_static -l:libc.a
build_libraries_static-individual -l:libfll_error.a -l:libfll_print.a -l:libfll_program.a
build_libraries_static-individual -l:libfl_conversion.a -l:libfl_directory.a -l:libfl_path.a -l:libfl_print.a
build_libraries_static-individual -l:libf_account.a -l:libf_color.a -l:libf_compare.a -l:libf_console.a -l:libf_conversion.a -l:libf_directory.a -l:libf_file.a -l:libf_memory.a -l:libf_path.a -l:libf_pipe.a -l:libf_print.a -l:libf_rip.a -l:libf_signal.a -l:libf_string.a -l:libf_time.a -l:libf_type_array.a -l:libf_utf.a
build_libraries_static-individual_thread -l:libf_thread.a
build_libraries_static-level -l:libfll_2.a -l:libfll_1.a -l:libfll_0.a
build_libraries_static-monolithic -l:libfll.a

build_sources_headers common.h common/define.h common/enumeration.h common/string.h common/type.h convert.h operate.h preprocess.h print/debug.h print/error.h print/message.h print/simulate.h print/verbose.h print/warning.h remove.h signal.h thread.h

build_sources_library common.c common/define.c common/enumeration.c common/string.c common/type.c convert.c operate.c preprocess.c print/debug.c print/error.c print/message.c print/simulate.c print/verbose.c print/warning.c remove.c signal.c thread.c

build_sources_documentation man

build_script yes
build_shared yes
build_static no

path_headers program/kevux/tools/remove/main
path_sources sources/c/program/kevux/tools/remove/main

has_path_standard no
preserve_path_headers yes

search_exclusive yes
search_shared yes
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_libcap_legacy_only_
defines -D_use_timegm_
defines-android -D_di_f_thread_attribute_affinity_get_ -D_di_f_thread_attribute_affinity_set_ -D_di_f_thread_attribute_concurrency_get_ -D_di_f_thread_attribute_concurrency_set_ -D_di_f_thread_attribute_default_get_ -D_di_f_thread_attribute_default_set_ -D_di_f_thread_cancel_test_ -D_di_f_thread_join_try_ -D_di_f_thread_join_timed_ -D_pthread_mutex_prioceiling_unsupported_ -D_di_f_thread_semaphore_file_close_ -D_di_f_thread_semaphore_file_open_ -D_di_f_thread_semaphore_file_delete_ -D_di_f_thread_cancel_type_set_  -D_di_f_thread_mutex_consistent_ -D_di_f_thread_mutex_attribute_robust_get_ -D_di_f_thread_mutex_attribute_robust_set_ -D_pthread_kill_as_pthread_cancel_
defines-clang -D_clang_not_a_compile_time_constant_workaround_
defines-pinephone -D_di_f_thread_mutex_priority_ceiling_get_ -D_di_f_thread_mutex_priority_ceiling_set_ -D_di_f_thread_mutex_attribute_priority_ceiling_get_ -D_di_f_thread_mutex_attribute_priority_ceiling_set_
defines-threadless -D_di_thread_support_
defines-thread -D_pthread_attr_unsupported_ -D_pthread_sigqueue_unsupported_

# This is needed for glibc and strptime() usage.
defines -D_GNU_SOURCE=1

flags -O2 -g -fdiagnostics-color=always -Wno-logical-not-parentheses -Wno-parentheses -Wno-missing-braces
flags -fstack-clash-protection -fno-delete-null-pointer-checks
flags -Wl,-z,nodlopen -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now
flags-android -Wno-implicit-function-declaration -Wl,-z,norelro
flags-clang -Wno-logical-op-parentheses
flags-coverage -O0 --coverage -fprofile-abs-path -fprofile-dir=build/coverage/
flags-fanalyzer -fanalyzer
flags-flex_arrays -fstrict-flex-arrays=3
flags-test -O0 -fstack-protector-strong -Wall
flags-thread -pthread

flags_library -fPIC
flags_object -fPIC
flags_program -fPIE
flags_program-android -fPIE -Wl,-z,relro
