Use the -l:lib syntax when pkg-config is called with --static

Signed-off-by: Nicolas Caramelli <caramelli.devel@gmail.com>
This commit is contained in:
Nicolas Caramelli 2022-10-30 11:18:13 +01:00
parent d97db4fae4
commit efc2ea54fa
2 changed files with 8 additions and 2 deletions

2
main.c
View file

@ -43,7 +43,7 @@ static gboolean want_my_version = FALSE;
static gboolean want_version = FALSE;
static FlagType pkg_flags = 0;
static gboolean want_list = FALSE;
static gboolean want_static_lib_list = ENABLE_INDIRECT_DEPS;
gboolean want_static_lib_list = ENABLE_INDIRECT_DEPS;
static gboolean want_short_errors = FALSE;
static gboolean want_uninstalled = FALSE;
static char *variable_name = NULL;

View file

@ -38,6 +38,8 @@ gboolean parse_strict = TRUE;
gboolean define_prefix = ENABLE_DEFINE_PREFIX;
char *prefix_variable = "prefix";
extern gboolean want_static_lib_list;
#ifdef G_OS_WIN32
gboolean msvc_syntax = FALSE;
#endif
@ -651,7 +653,11 @@ static void _do_parse_libs (Package *pkg, int argc, char **argv)
++p;
flag->type = LIBS_l;
flag->arg = g_strconcat (l_flag, p, lib_suffix, NULL);
if (want_static_lib_list && *p != ':')
flag->arg = g_strconcat (l_flag, ":lib", p, lib_suffix, ".a", NULL);
else
flag->arg = g_strconcat (l_flag, p, lib_suffix, NULL);
pkg->libs = g_list_prepend (pkg->libs, flag);
}
else if (p[0] == '-' &&