personality: add support for WantDefaultStatic setting
parent
40fe48355b
commit
48dc665ae3
|
@ -1040,7 +1040,7 @@ main(int argc, char *argv[])
|
|||
if ((want_flags & PKG_IGNORE_CONFLICTS) == PKG_IGNORE_CONFLICTS || getenv("PKG_CONFIG_IGNORE_CONFLICTS") != NULL)
|
||||
want_client_flags |= PKGCONF_PKG_PKGF_SKIP_CONFLICTS;
|
||||
|
||||
if ((want_flags & PKG_STATIC) == PKG_STATIC)
|
||||
if ((want_flags & PKG_STATIC) == PKG_STATIC || personality->want_default_static)
|
||||
want_client_flags |= (PKGCONF_PKG_PKGF_SEARCH_PRIVATE | PKGCONF_PKG_PKGF_MERGE_PRIVATE_FRAGMENTS);
|
||||
|
||||
if ((want_flags & PKG_SHARED) == PKG_SHARED)
|
||||
|
|
|
@ -202,6 +202,8 @@ struct pkgconf_cross_personality_ {
|
|||
pkgconf_list_t filter_includedirs;
|
||||
|
||||
char *sysroot_dir;
|
||||
|
||||
bool want_default_static;
|
||||
};
|
||||
|
||||
/* client.c */
|
||||
|
|
|
@ -119,6 +119,16 @@ typedef struct {
|
|||
const ptrdiff_t offset;
|
||||
} personality_keyword_pair_t;
|
||||
|
||||
static void
|
||||
personality_bool_func(pkgconf_cross_personality_t *p, const char *keyword, const size_t lineno, const ptrdiff_t offset, char *value)
|
||||
{
|
||||
(void) keyword;
|
||||
(void) lineno;
|
||||
|
||||
bool *dest = (bool *)((char *) p + offset);
|
||||
*dest = strcasecmp(value, "true") || strcasecmp(value, "yes") || *value == '1';
|
||||
}
|
||||
|
||||
static void
|
||||
personality_copy_func(pkgconf_cross_personality_t *p, const char *keyword, const size_t lineno, const ptrdiff_t offset, char *value)
|
||||
{
|
||||
|
@ -146,6 +156,7 @@ static const personality_keyword_pair_t personality_keyword_pairs[] = {
|
|||
{"SystemIncludePaths", personality_fragment_func, offsetof(pkgconf_cross_personality_t, filter_includedirs)},
|
||||
{"SystemLibraryPaths", personality_fragment_func, offsetof(pkgconf_cross_personality_t, filter_libdirs)},
|
||||
{"Triplet", personality_copy_func, offsetof(pkgconf_cross_personality_t, name)},
|
||||
{"WantDefaultStatic", personality_bool_func, offsetof(pkgconf_cross_personality_t, want_default_static)},
|
||||
};
|
||||
|
||||
static int
|
||||
|
|
|
@ -49,6 +49,10 @@ The input text must be in a format that is suitable for passing to a POSIX
|
|||
shell without any shell expansions after variable substitution has been done.
|
||||
Elements are delimited with a colon.
|
||||
.\"
|
||||
.It Boolean
|
||||
The property will be set to true if the value is one of: true, yes or 1.
|
||||
Otherwise it will be set to false.
|
||||
.\"
|
||||
.El
|
||||
.Ss PROPERTY KEYWORDS
|
||||
.Bl -tag -width indent
|
||||
|
@ -72,6 +76,9 @@ include files.
|
|||
A list of directories that are included by default in the search path for
|
||||
libraries.
|
||||
(mandatory; fragment list)
|
||||
.It WantDefaultStatic
|
||||
If true, pkgconf will default to operating in static linking mode.
|
||||
(optional; boolean; default is false)
|
||||
.\"
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
|
|
Loading…
Reference in New Issue