CI updates and cleanups

This commit is contained in:
Markus F.X.J. Oberhumer
2023-11-03 17:52:46 +01:00
parent 2c4b1d8a8c
commit 4f0f977f04
25 changed files with 209 additions and 127 deletions
+39 -9
View File
@@ -25,6 +25,7 @@
<markus@oberhumer.com> <ezerotven+github@gmail.com>
*/
#define WANT_WINDOWS_LEAN_H 1 // _WIN32_WINNT
#include "conf.h"
#include "compress/compress.h" // upx_ucl_version_string()
// for list_all_packers():
@@ -449,19 +450,51 @@ void show_sysinfo(const char *options_var) {
con_fprintf(f, "UPX version: ");
fflush(f);
show_version(true);
con_fprintf(f, "UPX version internal: 0x%06x %s\n", UPX_VERSION_HEX, UPX_VERSION_STRING);
}
fflush(stdout);
// Compilation Flags
if (opt->verbose >= 2) {
{
size_t cf_count = 0;
auto cf_print = [f, &cf_count](const char *name, const char *fmt, upx_int64_t v) noexcept {
auto cf_print = [f, &cf_count](const char *name, const char *fmt, upx_int64_t v,
int need_verbose = 2) noexcept {
if (opt->verbose < need_verbose)
return;
if (cf_count++ == 0)
con_fprintf(f, "\nCompilation flags:\n");
con_fprintf(f, " %s = ", name);
con_fprintf(f, fmt, v);
con_fprintf(f, "\n");
};
// compiler
#if defined(ACC_CC_CLANG)
cf_print("ACC_CC_CLANG", "0x%06llx", ACC_CC_CLANG + 0, 3);
#endif
#if defined(ACC_CC_GNUC)
cf_print("ACC_CC_GNUC", "0x%06llx", ACC_CC_GNUC + 0, 3);
#endif
#if defined(ACC_CC_MSC)
cf_print("ACC_CC_MSC", "%lld", ACC_CC_MSC + 0, 3);
#endif
#if defined(__clang__)
cf_print("__clang__", "%lld", __clang__ + 0);
#endif
#if defined(__clang_major__)
cf_print("__clang_major__", "%lld", __clang_major__ + 0);
#endif
#if defined(__GNUC__)
cf_print("__GNUC__", "%lld", __GNUC__ + 0);
#endif
#if defined(__GNUC_MINOR__)
cf_print("__GNUC_MINOR__", "%lld", __GNUC_MINOR__ + 0);
#endif
#if defined(_MSC_VER)
cf_print("_MSC_VER", "%lld", _MSC_VER + 0);
#endif
#if defined(_MSC_FULL_VER)
cf_print("_MSC_FULL_VER", "%lld", _MSC_FULL_VER + 0);
#endif
// OS and libc
#if defined(WINVER)
cf_print("WINVER", "0x%04llx", WINVER + 0);
@@ -473,21 +506,16 @@ void show_sysinfo(const char *options_var) {
cf_print("__MSVCRT_VERSION__", "0x%04llx", __MSVCRT_VERSION__ + 0);
#endif
#if defined(_USE_MINGW_ANSI_STDIO)
cf_print("_USE_MINGW_ANSI_STDIO", "%lld", _USE_MINGW_ANSI_STDIO + 0);
cf_print("_USE_MINGW_ANSI_STDIO", "%lld", _USE_MINGW_ANSI_STDIO + 0, 3);
#endif
#if defined(__USE_MINGW_ANSI_STDIO)
cf_print("__USE_MINGW_ANSI_STDIO", "%lld", __USE_MINGW_ANSI_STDIO + 0);
cf_print("__USE_MINGW_ANSI_STDIO", "%lld", __USE_MINGW_ANSI_STDIO + 0, 3);
#endif
#if defined(__GLIBC__)
cf_print("__GLIBC__", "%lld", __GLIBC__ + 0);
#endif
#if defined(__GLIBC_MINOR__)
cf_print("__GLIBC_MINOR__", "%lld", __GLIBC_MINOR__ + 0);
#endif
// compiler
#if defined(_MSC_VER) && defined(_MSC_FULL_VER)
cf_print("_MSC_VER", "%lld", _MSC_VER + 0);
cf_print("_MSC_FULL_VER", "%lld", _MSC_FULL_VER + 0);
#endif
UNUSED(cf_count);
UNUSED(cf_print);
@@ -517,6 +545,8 @@ void show_sysinfo(const char *options_var) {
con_fprintf(f, "\n");
if (e && e[0])
con_fprintf(f, "Contents of environment variable %s: '%s'\n\n", options_var, e);
else if (e)
con_fprintf(f, "Environment variable '%s' is set but empty.\n\n", options_var);
else
con_fprintf(f, "Environment variable '%s' is not set.\n\n", options_var);
}