diff options
author | midipix <writeonce@midipix.org> | 2016-04-22 11:50:07 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-04-23 09:25:19 -0400 |
commit | a21ac16a21223b03b38808d0d43d9cf204f4deb7 (patch) | |
tree | 6df2892286121093e76de06f4625082ce7e2e05c /src/driver/slbt_driver_ctx.c | |
parent | a07c9b90955d1297020039d4dcb7670cb747f905 (diff) | |
download | slibtool-a21ac16a21223b03b38808d0d43d9cf204f4deb7.tar.bz2 slibtool-a21ac16a21223b03b38808d0d43d9cf204f4deb7.tar.xz |
driver: slbt_init_host_params(): fix host heuristics.
Diffstat (limited to 'src/driver/slbt_driver_ctx.c')
-rw-r--r-- | src/driver/slbt_driver_ctx.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index 5013ad0..f44abfa 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -289,12 +289,19 @@ static int slbt_init_host_params( { size_t toollen; char * dash; + char * base; const char * machine; bool ftarget = false; bool fhost = false; bool fcompiler = false; bool fnative = false; + /* base */ + if ((base = strrchr(cctx->cargv[0],'/'))) + base++; + else + base = cctx->cargv[0]; + /* host */ if (host->host) { cfgmeta->host = cfgexplicit; @@ -303,7 +310,7 @@ static int slbt_init_host_params( host->host = cctx->target; cfgmeta->host = cfgtarget; ftarget = true; - } else if (strrchr(cctx->cargv[0],'-')) { + } else if (strrchr(base,'-')) { if (!(drvhost->host = strdup(cctx->cargv[0]))) return -1; |