"version_major") echo -n 37;;
"version_micro") echo -n 38;;
"version_minor") echo -n 39;;
-
- "build_libraries-$mode") echo -n 40;;
- "build_sources_headers-$mode") echo -n 41;;
- "build_sources_library-$mode") echo -n 42;;
- "build_sources_program-$mode") echo -n 43;;
- "build_sources_setting-$mode") echo -n 44;;
- "build_sources_script-$mode") echo -n 45;;
- "defines_all-$mode") echo -n 46;;
- "defines_shared-$mode") echo -n 47;;
- "defines_static-$mode") echo -n 48;;
- "environment-$mode") echo -n 49;;
- "flags_all-$mode") echo -n 50;;
- "flags_library-$mode") echo -n 51;;
- "flags_program-$mode") echo -n 52;;
- "flags_shared-$mode") echo -n 53;;
- "flags_static-$mode") echo -n 54;;
+ "version_target") echo -n 40;;
+
+ "build_libraries-$mode") echo -n 41;;
+ "build_sources_headers-$mode") echo -n 42;;
+ "build_sources_library-$mode") echo -n 43;;
+ "build_sources_program-$mode") echo -n 44;;
+ "build_sources_setting-$mode") echo -n 45;;
+ "build_sources_script-$mode") echo -n 46;;
+ "defines_all-$mode") echo -n 47;;
+ "defines_shared-$mode") echo -n 48;;
+ "defines_static-$mode") echo -n 49;;
+ "environment-$mode") echo -n 50;;
+ "flags_all-$mode") echo -n 51;;
+ "flags_library-$mode") echo -n 52;;
+ "flags_program-$mode") echo -n 53;;
+ "flags_shared-$mode") echo -n 54;;
+ "flags_static-$mode") echo -n 55;;
esac
}
local major=${variables[$(generate_id version_major)]}
local minor=${variables[$(generate_id version_minor)]}
local micro=${variables[$(generate_id version_micro)]}
+ local target=${variables[$(generate_id version_target)]}
local compiler=${variables[$(generate_id build_compiler)]}
local linker=${variables[$(generate_id build_linker)]}
local arguments_include="-I${path_build}includes"
local flags_program=${variables[$(generate_id flags_program)]}
local i=
local n=
+ local version=
local alt=$1
local directory=
local path_headers=${variables[$(generate_id path_headers)]}
+ if [[ $target == "" ]] ; then
+ target="major"
+ fi
+
+ if [[ $target == "major" ]] ; then
+ version="$major"
+ elif [[ $target == "minor" ]] ; then
+ version="${major}.$minor"
+ elif [[ $target == "micro" ]] ; then
+ version="${major}.${minor}.$micro"
+ fi
+
if [[ $sources_library == "" ]] ; then
sources_library=${variables[$(generate_id build_sources_library-$mode)]}
else
sources="$sources$path_c$i "
done
- echo $compiler $sources -shared -Wl,-soname,lib$name.so.$major -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library
- $compiler $sources -shared -Wl,-soname,lib$name.so.$major -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library || failure=1
+ echo $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library
+ $compiler $sources -shared -Wl,-soname,lib$name.so.$version -o ${path_build}libraries/shared/lib$name.so.$major.$minor.$micro $arguments_shared $arguments_include $libraries $flags_all $flags_shared $flags_library || failure=1
if [[ $failure == "" ]] ; then
ln -vsf lib$name.so.$major.$minor.$micro ${path_build}libraries/shared/lib$name.so.$major || failure=1
parameter_file_path[parameter_file_path_length] = 0;
- f_string_length parameter_linker_length = fake_build_parameter_library_shared_prefix_length + parameter_file_name_micro_length;
+ f_string_length parameter_linker_length = fake_build_parameter_library_shared_prefix_length;
+
+ if (data_build.setting.version_target == fake_build_version_type_major) {
+ parameter_linker_length += parameter_file_name_major_length;
+ }
+ else if (data_build.setting.version_target == fake_build_version_type_minor) {
+ parameter_linker_length += parameter_file_name_minor_length;
+ }
+ else if (data_build.setting.version_target == fake_build_version_type_micro) {
+ parameter_linker_length += parameter_file_name_micro_length;
+ }
char parameter_linker[parameter_linker_length + 1];
memcpy(parameter_linker, fake_build_parameter_library_shared_prefix, fake_build_parameter_library_shared_prefix_length);
- memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_micro, parameter_file_name_micro_length);
+ if (data_build.setting.version_target == fake_build_version_type_major) {
+ memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_major, parameter_file_name_major_length);
+ }
+ else if (data_build.setting.version_target == fake_build_version_type_minor) {
+ memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_minor, parameter_file_name_minor_length);
+ }
+ else if (data_build.setting.version_target == fake_build_version_type_micro) {
+ memcpy(parameter_linker + fake_build_parameter_library_shared_prefix_length, parameter_file_name_micro, parameter_file_name_micro_length);
+ }
parameter_linker[parameter_linker_length] = 0;
fake_build_setting_name_version_major,
fake_build_setting_name_version_micro,
fake_build_setting_name_version_minor,
+ fake_build_setting_name_version_target,
};
const f_string_length settings_length[] = {
fake_build_setting_name_version_major_length,
fake_build_setting_name_version_micro_length,
fake_build_setting_name_version_minor_length,
+ fake_build_setting_name_version_target_length,
};
f_string_dynamics build_compiler = f_string_dynamics_initialize;
f_string_dynamics version_major = f_string_dynamics_initialize;
f_string_dynamics version_micro = f_string_dynamics_initialize;
f_string_dynamics version_minor = f_string_dynamics_initialize;
+ f_string_dynamics version_target = f_string_dynamics_initialize;
f_string_dynamics *settings_value[] = {
&build_compiler,
&version_major,
&version_micro,
&version_minor,
+ &version_target,
};
f_string function = "fll_fss_snatch_apart";
}
else {
const f_string settings_single_name[] = {
+ fake_build_setting_name_build_compiler,
fake_build_setting_name_build_language,
+ fake_build_setting_name_build_linker,
fake_build_setting_name_build_script,
fake_build_setting_name_build_shared,
fake_build_setting_name_build_static,
fake_build_setting_name_version_major,
fake_build_setting_name_version_micro,
fake_build_setting_name_version_minor,
+ fake_build_setting_name_version_target,
};
const f_string_statics *settings_single_source[] = {
&version_major,
&version_micro,
&version_minor,
- };
-
- uint8_t *settings_single_language[] = {
- 0,
- &setting->build_language,
+ &version_target,
};
bool *settings_single_bool[] = {
&setting->version_minor,
};
- // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++".
+ uint8_t *settings_single_language[] = {
+ 0,
+ &setting->build_language,
+ };
+
+ uint8_t *settings_single_version[] = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ &setting->version_target,
+ };
+
+ // 1 = "yes" or "no", 2 = path/, 3 = literal, 4 = "bash", "c", or "c++", 5 = "major", "minor", or "micro".
uint8_t settings_single_type[] = {
3,
4,
3,
3,
3,
+ 5,
};
- for (f_array_length i = 0; i < 24; i++) {
+ for (f_array_length i = 0; i < 25; i++) {
if (settings_single_source[i]->used == 0) continue;
if (settings_single_source[i]->used > 1) {
}
}
}
+ else if (settings_single_type[i] == 5) {
+ if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_major, settings_single_source[i]->array[0].used, fake_build_version_major_length) == F_equal_to) {
+ *settings_single_version[i] = fake_build_version_type_major;
+ }
+ else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_micro, settings_single_source[i]->array[0].used, fake_build_version_micro_length) == F_equal_to) {
+ *settings_single_version[i] = fake_build_version_type_micro;
+ }
+ else if (fl_string_compare_trim(settings_single_source[i]->array[0].string, fake_build_version_minor, settings_single_source[i]->array[0].used, fake_build_version_minor_length) == F_equal_to) {
+ *settings_single_version[i] = fake_build_version_type_minor;
+ }
+ else {
+ *settings_single_version[i] = fake_build_version_type_major;
+
+ if (data.verbosity != fake_verbosity_quiet) {
+ fprintf(f_type_warning, "%c", f_string_eol[0]);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "WARNING: the setting '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", settings_single_name[i]);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' in the file '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", data.file_data_build_settings.string);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "' may only be one of '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_major);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_minor);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', or '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_micro);
+ fl_color_print(f_type_warning, data.context.warning, data.context.reset, "', defaulting to '");
+ fl_color_print(f_type_warning, data.context.notable, data.context.reset, "%s", fake_build_version_major);
+ fl_color_print_line(f_type_warning, data.context.warning, data.context.reset, "'.");
+ }
+ }
+ }
else {
*status = fl_string_dynamic_append_nulless(settings_single_source[i]->array[0], settings_single_destination[i]);
if (F_status_is_error(*status)) {
f_macro_string_dynamics_delete_simple(version_major);
f_macro_string_dynamics_delete_simple(version_micro);
f_macro_string_dynamics_delete_simple(version_minor);
+ f_macro_string_dynamics_delete_simple(version_target);
}
f_macro_fss_objects_delete_simple(objects);