summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-02-14 01:35:44 +0000
committermidipix <writeonce@midipix.org>2024-02-14 01:57:26 +0000
commit6bc1706e77c607947ac30f96ec0bce3e056b3026 (patch)
treefed9c75b2c866c8300213733699c76a282649717
parent68760b855037f8f5d03c99db3e5b646674d9cfe6 (diff)
downloadslibtool-6bc1706e77c607947ac30f96ec0bce3e056b3026.tar.bz2
slibtool-6bc1706e77c607947ac30f96ec0bce3e056b3026.tar.xz
driver: added the --as switch (assembler argument to pass through to dlltool).
-rw-r--r--include/slibtool/slibtool.h1
-rw-r--r--src/driver/slbt_driver_ctx.c4
-rw-r--r--src/driver/slbt_host_params.c21
-rw-r--r--src/internal/slibtool_driver_impl.h2
-rw-r--r--src/output/slbt_output_info.c6
-rw-r--r--src/skin/slbt_skin_default.c3
6 files changed, 37 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index 6d29303..e31e3c0 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -249,6 +249,7 @@ struct slbt_host_params {
const char * host;
const char * flavor;
const char * ar;
+ const char * as;
const char * ranlib;
const char * windres;
const char * dlltool;
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 6f96e42..deb8cdc 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -593,6 +593,10 @@ int slbt_get_driver_ctx(
cfgmeta_ar = cfgexplicit;
break;
+ case TAG_AS:
+ cctx.host.as = entry->arg;
+ break;
+
case TAG_RANLIB:
cctx.host.ranlib = entry->arg;
cfgmeta_ranlib = cfgexplicit;
diff --git a/src/driver/slbt_host_params.c b/src/driver/slbt_host_params.c
index f63f9b3..6414ec1 100644
--- a/src/driver/slbt_host_params.c
+++ b/src/driver/slbt_host_params.c
@@ -369,6 +369,24 @@ int slbt_init_host_params(
host->ar = drvhost->ar;
}
+ /* as */
+ if (host->as)
+ cfgmeta->as = cfgexplicit;
+ else {
+ if (!(drvhost->as = calloc(1,toollen)))
+ return -1;
+
+ if (fnative) {
+ strcpy(drvhost->as,"as");
+ cfgmeta->as = cfgnative;
+ } else {
+ sprintf(drvhost->as,"%s-as",host->host);
+ cfgmeta->as = cfghost;
+ }
+
+ host->as = drvhost->as;
+ }
+
/* ranlib */
if (host->ranlib)
cfgmeta->ranlib = cfgmeta_ranlib ? cfgmeta_ranlib : cfgexplicit;
@@ -480,6 +498,9 @@ void slbt_free_host_params(struct slbt_host_strs * host)
if (host->ar)
free(host->ar);
+ if (host->as)
+ free(host->as);
+
if (host->ranlib)
free(host->ranlib);
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index 2644e27..34ab775 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -45,6 +45,7 @@ enum app_tags {
TAG_HOST,
TAG_FLAVOR,
TAG_AR,
+ TAG_AS,
TAG_RANLIB,
TAG_WINDRES,
TAG_DLLTOOL,
@@ -106,6 +107,7 @@ struct slbt_host_strs {
char * host;
char * flavor;
char * ar;
+ char * as;
char * ranlib;
char * windres;
char * dlltool;
diff --git a/src/output/slbt_output_info.c b/src/output/slbt_output_info.c
index 7498cb8..92106a7 100644
--- a/src/output/slbt_output_info.c
+++ b/src/output/slbt_output_info.c
@@ -62,6 +62,9 @@ int slbt_output_info(const struct slbt_driver_ctx * dctx)
if ((len = strlen(cctx->host.ar)) > midwidth)
midwidth = len;
+ if ((len = strlen(cctx->host.as)) > midwidth)
+ midwidth = len;
+
if ((len = strlen(cctx->host.ranlib)) > midwidth)
midwidth = len;
@@ -98,6 +101,9 @@ int slbt_output_info(const struct slbt_driver_ctx * dctx)
if (slbt_output_info_line(fdout,"ar",cctx->host.ar,cctx->cfgmeta.ar,midwidth))
return SLBT_SYSTEM_ERROR(dctx,0);
+ if (slbt_output_info_line(fdout,"as",cctx->host.as,cctx->cfgmeta.as,midwidth))
+ return SLBT_SYSTEM_ERROR(dctx,0);
+
if (slbt_output_info_line(fdout,"ranlib",cctx->host.ranlib,cctx->cfgmeta.ranlib,midwidth))
return SLBT_SYSTEM_ERROR(dctx,0);
diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c
index 43222ce..458611c 100644
--- a/src/skin/slbt_skin_default.c
+++ b/src/skin/slbt_skin_default.c
@@ -113,6 +113,9 @@ const struct argv_option slbt_default_options[] = {
{"ar", 0,TAG_AR,ARGV_OPTARG_REQUIRED,0,0,"<ar>",
"explicitly specify the archiver to be used"},
+ {"as", 0,TAG_AS,ARGV_OPTARG_REQUIRED,0,0,"<as>",
+ "explicitly specify the assembler to be used (with dlltool)"},
+
{"ranlib", 0,TAG_RANLIB,ARGV_OPTARG_REQUIRED,0,0,"<ranlib>",
"explicitly specify the librarian to be used"},