diff options
author | midipix <writeonce@midipix.org> | 2024-02-26 04:56:18 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-02-26 05:11:57 +0000 |
commit | b5e10411a1c764c7b7f82b8b1ff093df7546d028 (patch) | |
tree | 4bf144d1119ce78f5a045bfe8ba6aa0ed77f6077 /src/host | |
parent | 489101c7b5e84298eba80777b0ec22cb39ad11a7 (diff) | |
download | slibtool-b5e10411a1c764c7b7f82b8b1ff093df7546d028.tar.bz2 slibtool-b5e10411a1c764c7b7f82b8b1ff093df7546d028.tar.xz |
driver: added the --nm switch.
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/slbt_host_params.c | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/host/slbt_host_params.c b/src/host/slbt_host_params.c index e140885..5c862a4 100644 --- a/src/host/slbt_host_params.c +++ b/src/host/slbt_host_params.c @@ -88,6 +88,7 @@ slbt_hidden int slbt_init_host_params( const char * cfgmeta_host, const char * cfgmeta_ar, const char * cfgmeta_as, + const char * cfgmeta_nm, const char * cfgmeta_ranlib, const char * cfgmeta_dlltool) { @@ -340,6 +341,24 @@ slbt_hidden int slbt_init_host_params( host->as = drvhost->as; } + /* nm */ + if (host->nm) + cfgmeta->nm = cfgmeta_nm ? cfgmeta_nm : cfgexplicit; + else { + if (!(drvhost->nm = calloc(1,toollen))) + return -1; + + if (fnative) { + strcpy(drvhost->nm,"nm"); + cfgmeta->nm = cfgnative; + } else { + sprintf(drvhost->nm,"%s-nm",host->host); + cfgmeta->nm = cfghost; + } + + host->nm = drvhost->nm; + } + /* ranlib */ if (host->ranlib) cfgmeta->ranlib = cfgmeta_ranlib ? cfgmeta_ranlib : cfgexplicit; @@ -469,6 +488,9 @@ slbt_hidden void slbt_free_host_params(struct slbt_host_strs * host) if (host->as) free(host->as); + if (host->nm) + free(host->nm); + if (host->ranlib) free(host->ranlib); @@ -483,6 +505,7 @@ slbt_hidden void slbt_free_host_params(struct slbt_host_strs * host) slbt_free_host_tool_argv(host->ar_argv); slbt_free_host_tool_argv(host->as_argv); + slbt_free_host_tool_argv(host->nm_argv); slbt_free_host_tool_argv(host->ranlib_argv); slbt_free_host_tool_argv(host->windres_argv); slbt_free_host_tool_argv(host->dlltool_argv); @@ -534,7 +557,7 @@ int slbt_host_set_althost( &ictx->ctx.ahost, &ictx->ctx.cctx.ahost, &ictx->ctx.cctx.acfgmeta, - 0,0,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); } |