summaryrefslogtreecommitdiff
path: root/src/driver
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-23 19:58:31 -0400
committermidipix <writeonce@midipix.org>2016-04-23 22:06:41 -0400
commit663ef212c7bfaeb19d329af0195a26a48f30b4c9 (patch)
treefdbebce7ca3825d250552ab4a897c714526a9f28 /src/driver
parent575cdb74719dee612d7e7cf063a6c82cd7be1757 (diff)
downloadslibtool-663ef212c7bfaeb19d329af0195a26a48f30b4c9.tar.bz2
slibtool-663ef212c7bfaeb19d329af0195a26a48f30b4c9.tar.xz
driver: slbt_init_host_params(): integrated slbt_dump_machine().
Diffstat (limited to 'src/driver')
-rw-r--r--src/driver/slbt_driver_ctx.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index f44abfa..f65c633 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -295,6 +295,8 @@ static int slbt_init_host_params(
bool fhost = false;
bool fcompiler = false;
bool fnative = false;
+ bool fdumpmachine = false;
+ char buf[256];
/* base */
if ((base = strrchr(cctx->cargv[0],'/')))
@@ -302,6 +304,9 @@ static int slbt_init_host_params(
else
base = cctx->cargv[0];
+ if ((cctx->mode == SLBT_MODE_COMPILE) || (cctx->mode == SLBT_MODE_LINK))
+ fdumpmachine = true;
+
/* host */
if (host->host) {
cfgmeta->host = cfgexplicit;
@@ -319,6 +324,16 @@ static int slbt_init_host_params(
host->host = drvhost->host;
cfgmeta->host = cfgcompiler;
fcompiler = true;
+ } else if (fdumpmachine && !(slbt_dump_machine(
+ cctx->cargv[0],
+ buf,sizeof(buf)))) {
+ if (!(drvhost->host = strdup(buf)))
+ return -1;
+
+ host->host = drvhost->host;
+ cfgmeta->host = cfgmachine;
+ fcompiler = true;
+ fnative = (!(strcmp(host->host,SLBT_MACHINE)));
} else {
host->host = SLBT_MACHINE;
cfgmeta->host = cfgmachine;