From 663ef212c7bfaeb19d329af0195a26a48f30b4c9 Mon Sep 17 00:00:00 2001 From: midipix Date: Apr 24 2016 02:06:41 +0000 Subject: driver: slbt_init_host_params(): integrated slbt_dump_machine(). --- 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;