mirror of
https://github.com/pkgconf/pkgconf.git
synced 2026-01-26 16:09:27 +00:00
cli: core: move dump_personality back
Signed-off-by: Ariadne Conill <ariadne@ariadne.space>
This commit is contained in:
parent
ff07f6b7eb
commit
dfd20e49fc
38
cli/core.c
38
cli/core.c
@ -927,6 +927,34 @@ error:
|
||||
pkgconf_buffer_finalize(&pc_system_includedirs_buf);
|
||||
}
|
||||
|
||||
#ifndef PKGCONF_LITE
|
||||
static void
|
||||
dump_personality(const pkgconf_cross_personality_t *p)
|
||||
{
|
||||
pkgconf_buffer_t pc_path_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->dir_list, &pc_path_buf, ':');
|
||||
|
||||
pkgconf_buffer_t pc_system_libdirs_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->filter_libdirs, &pc_system_libdirs_buf, ':');
|
||||
|
||||
pkgconf_buffer_t pc_system_includedirs_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->filter_includedirs, &pc_system_includedirs_buf, ':');
|
||||
|
||||
printf("Triplet: %s\n", p->name);
|
||||
|
||||
if (p->sysroot_dir)
|
||||
printf("SysrootDir: %s\n", p->sysroot_dir);
|
||||
|
||||
printf("DefaultSearchPaths: %s\n", pc_path_buf.base);
|
||||
printf("SystemIncludePaths: %s\n", pc_system_includedirs_buf.base);
|
||||
printf("SystemLibraryPaths: %s\n", pc_system_libdirs_buf.base);
|
||||
|
||||
pkgconf_buffer_finalize(&pc_path_buf);
|
||||
pkgconf_buffer_finalize(&pc_system_libdirs_buf);
|
||||
pkgconf_buffer_finalize(&pc_system_includedirs_buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
pkgconf_cli_run(pkgconf_cli_state_t *state, int argc, char *argv[], int last_argc)
|
||||
{
|
||||
@ -946,6 +974,16 @@ pkgconf_cli_run(pkgconf_cli_state_t *state, int argc, char *argv[], int last_arg
|
||||
.flags = PKGCONF_PKG_PROPF_STATIC | PKGCONF_PKG_PROPF_VIRTUAL,
|
||||
};
|
||||
|
||||
#ifndef PKGCONF_LITE
|
||||
if ((state->want_flags & PKG_DUMP_PERSONALITY) == PKG_DUMP_PERSONALITY)
|
||||
{
|
||||
dump_personality(state->pkg_client.personality);
|
||||
|
||||
ret = EXIT_SUCCESS;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef PKGCONF_LITE
|
||||
if ((state->want_flags & PKG_MSVC_SYNTAX) == PKG_MSVC_SYNTAX)
|
||||
state->want_render_ops = msvc_renderer_get();
|
||||
|
||||
36
cli/main.c
36
cli/main.c
@ -49,32 +49,6 @@ relocate_path(const char *path)
|
||||
}
|
||||
|
||||
#ifndef PKGCONF_LITE
|
||||
static void
|
||||
dump_personality(const pkgconf_cross_personality_t *p)
|
||||
{
|
||||
pkgconf_buffer_t pc_path_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->dir_list, &pc_path_buf, ':');
|
||||
|
||||
pkgconf_buffer_t pc_system_libdirs_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->filter_libdirs, &pc_system_libdirs_buf, ':');
|
||||
|
||||
pkgconf_buffer_t pc_system_includedirs_buf = PKGCONF_BUFFER_INITIALIZER;
|
||||
path_list_to_buffer(&p->filter_includedirs, &pc_system_includedirs_buf, ':');
|
||||
|
||||
printf("Triplet: %s\n", p->name);
|
||||
|
||||
if (p->sysroot_dir)
|
||||
printf("SysrootDir: %s\n", p->sysroot_dir);
|
||||
|
||||
printf("DefaultSearchPaths: %s\n", pc_path_buf.base);
|
||||
printf("SystemIncludePaths: %s\n", pc_system_includedirs_buf.base);
|
||||
printf("SystemLibraryPaths: %s\n", pc_system_libdirs_buf.base);
|
||||
|
||||
pkgconf_buffer_finalize(&pc_path_buf);
|
||||
pkgconf_buffer_finalize(&pc_system_libdirs_buf);
|
||||
pkgconf_buffer_finalize(&pc_system_includedirs_buf);
|
||||
}
|
||||
|
||||
static pkgconf_cross_personality_t *
|
||||
deduce_personality(char *argv[])
|
||||
{
|
||||
@ -409,16 +383,6 @@ main(int argc, char *argv[])
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef PKGCONF_LITE
|
||||
if ((state.want_flags & PKG_DUMP_PERSONALITY) == PKG_DUMP_PERSONALITY)
|
||||
{
|
||||
dump_personality(personality);
|
||||
|
||||
ret = EXIT_SUCCESS;
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* now, bring up the client. settings are preserved since the client is prealloced */
|
||||
pkgconf_client_init(&state.pkg_client, error_handler, &state, personality, &state, environ_lookup_handler);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user