diff options
author | midipix <writeonce@midipix.org> | 2024-03-29 03:24:07 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-03-29 03:24:07 +0000 |
commit | 2f0fd7a8edda316d64ccfccb721bff6bda216392 (patch) | |
tree | 08235a121bafbeed01695ae44093ed2c70739bbb /src/host | |
parent | 00c58e371d3e1b4cfd260d4af083c8ece20a537f (diff) | |
download | slibtool-2f0fd7a8edda316d64ccfccb721bff6bda216392.tar.bz2 slibtool-2f0fd7a8edda316d64ccfccb721bff6bda216392.tar.xz |
slbt_init_host_params(): derive windres and dlltool from ranlib as needed.
Diffstat (limited to 'src/host')
-rw-r--r-- | src/host/slbt_host_params.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/host/slbt_host_params.c b/src/host/slbt_host_params.c index cd9ad87..f9ef88c 100644 --- a/src/host/slbt_host_params.c +++ b/src/host/slbt_host_params.c @@ -251,6 +251,7 @@ slbt_hidden int slbt_init_host_params( /* toollen */ toollen = fnative ? 0 : strlen(host->host); toollen += strlen("-utility-name"); + toollen += host->ranlib ? strlen(host->ranlib) : 0; /* ar */ if (host->ar) @@ -406,6 +407,18 @@ slbt_hidden int slbt_init_host_params( cfgmeta->windres = cfghost; } + if ((mark = strrchr(host->ranlib,'/'))) { + if (strcmp(++mark,"ranlib")) + if ((mark = strrchr(mark,'-'))) + if (strcmp(++mark,"ranlib")) + mark = 0; + + if (mark) { + strcpy(drvhost->windres,host->ranlib); + strcpy(&drvhost->windres[mark-host->ranlib],"windres"); + } + } + host->windres = drvhost->windres; } @@ -432,6 +445,18 @@ slbt_hidden int slbt_init_host_params( cfgmeta->dlltool = cfghost; } + if ((mark = strrchr(host->ranlib,'/'))) { + if (strcmp(++mark,"ranlib")) + if ((mark = strrchr(mark,'-'))) + if (strcmp(++mark,"ranlib")) + mark = 0; + + if (mark) { + strcpy(drvhost->dlltool,host->ranlib); + strcpy(&drvhost->dlltool[mark-host->ranlib],"dlltool"); + } + } + host->dlltool = drvhost->dlltool; } |