From 771899443dce44974234093859111570560ebddc Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 14 Feb 2024 02:25:39 +0000 Subject: driver: rlibtool mode: also derive from the located libtool script. --- src/driver/slbt_driver_ctx.c | 7 +++++++ src/driver/slbt_host_params.c | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src/driver') diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index 15c2cf5..52aa0af 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -338,6 +338,7 @@ int slbt_get_driver_ctx( const char * program; const char * lconf; uint64_t lflags; + const char * cfgmeta_host; const char * cfgmeta_ar; const char * cfgmeta_as; const char * cfgmeta_ranlib; @@ -395,6 +396,7 @@ int slbt_get_driver_ctx( cmdnostatic = 0; cmdnoshared = 0; + cfgmeta_host = 0; cfgmeta_ar = 0; cfgmeta_as = 0; cfgmeta_ranlib = 0; @@ -584,6 +586,7 @@ int slbt_get_driver_ctx( case TAG_HOST: cctx.host.host = entry->arg; + cfgmeta_host = cfgexplicit; break; case TAG_FLAVOR: @@ -816,6 +819,9 @@ int slbt_get_driver_ctx( if (slbt_get_lconf_flags(&ctx->ctx,lconf,&lflags) < 0) return slbt_get_driver_ctx_fail(&ctx->ctx,0); + if (ctx->cctx.host.host && !cfgmeta_host) + cfgmeta_host = cfglconf; + if (ctx->cctx.host.ar && !cfgmeta_ar) cfgmeta_ar = cfglconf; @@ -867,6 +873,7 @@ int slbt_get_driver_ctx( &ctx->host, &ctx->cctx.host, &ctx->cctx.cfgmeta, + cfgmeta_host, cfgmeta_ar, cfgmeta_as, cfgmeta_ranlib, diff --git a/src/driver/slbt_host_params.c b/src/driver/slbt_host_params.c index 58e0612..690ca30 100644 --- a/src/driver/slbt_host_params.c +++ b/src/driver/slbt_host_params.c @@ -136,6 +136,7 @@ int slbt_init_host_params( struct slbt_host_strs * drvhost, struct slbt_host_params * host, struct slbt_host_params * cfgmeta, + const char * cfgmeta_host, const char * cfgmeta_ar, const char * cfgmeta_as, const char * cfgmeta_ranlib, @@ -185,7 +186,7 @@ int slbt_init_host_params( /* host */ if (host->host) { - cfgmeta->host = cfgexplicit; + cfgmeta->host = cfgmeta_host ? cfgmeta_host : cfgexplicit; fhost = true; } else if (cctx->target) { @@ -645,7 +646,7 @@ int slbt_set_alternate_host( &ictx->ctx.ahost, &ictx->ctx.cctx.ahost, &ictx->ctx.cctx.acfgmeta, - 0,0,0,0)) { + 0,0,0,0,0)) { slbt_free_host_params(&ictx->ctx.ahost); return SLBT_CUSTOM_ERROR(ctx,SLBT_ERR_HOST_INIT); } -- cgit v1.2.3