diff options
author | midipix <writeonce@midipix.org> | 2018-07-11 08:46:55 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-07-11 09:35:43 -0400 |
commit | 9a02e2b279c811545fbbaed99041b3171d64bb84 (patch) | |
tree | 8dc75224dc239bc7817a89c4a033fc0d357c6f50 /src | |
parent | 0bfff4a80d596810a1798a3710a0e9ff96a9f925 (diff) | |
download | slibtool-9a02e2b279c811545fbbaed99041b3171d64bb84.tar.bz2 slibtool-9a02e2b279c811545fbbaed99041b3171d64bb84.tar.xz |
driver: added --windres support.
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/slbt_driver_ctx.c | 32 | ||||
-rw-r--r-- | src/internal/slibtool_driver_impl.h | 2 | ||||
-rw-r--r-- | src/output/slbt_output_config.c | 6 | ||||
-rw-r--r-- | src/skin/slbt_skin_default.c | 4 |
4 files changed, 44 insertions, 0 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c index 6675adb..44cdd81 100644 --- a/src/driver/slbt_driver_ctx.c +++ b/src/driver/slbt_driver_ctx.c @@ -617,6 +617,31 @@ static int slbt_init_host_params( host->ranlib = drvhost->ranlib; } + /* windres */ + if (host->windres) + cfgmeta->windres = cfgexplicit; + + else if (strcmp(host->flavor,"cygwin") + && strcmp(host->flavor,"midipix") + && strcmp(host->flavor,"mingw")) { + host->windres = ""; + cfgmeta->windres = "not applicable"; + + } else { + if (!(drvhost->windres = calloc(1,toollen))) + return -1; + + if (fnative) { + strcpy(drvhost->windres,"windres"); + cfgmeta->windres = cfgnative; + } else { + sprintf(drvhost->windres,"%s-windres",host->host); + cfgmeta->windres = cfghost; + } + + host->windres = drvhost->windres; + } + /* dlltool */ if (host->dlltool) cfgmeta->dlltool = cfgexplicit; @@ -687,6 +712,9 @@ static void slbt_free_host_params(struct slbt_host_strs * host) if (host->ranlib) free(host->ranlib); + if (host->windres) + free(host->windres); + if (host->dlltool) free(host->dlltool); @@ -1130,6 +1158,10 @@ int slbt_get_driver_ctx( cctx.host.ranlib = entry->arg; break; + case TAG_WINDRES: + cctx.host.windres = entry->arg; + break; + case TAG_DLLTOOL: cctx.host.dlltool = entry->arg; break; diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h index 02345f8..ab4ace1 100644 --- a/src/internal/slibtool_driver_impl.h +++ b/src/internal/slibtool_driver_impl.h @@ -41,6 +41,7 @@ enum app_tags { TAG_FLAVOR, TAG_AR, TAG_RANLIB, + TAG_WINDRES, TAG_DLLTOOL, TAG_MDSO, TAG_IMPLIB, @@ -80,6 +81,7 @@ struct slbt_host_strs { char * flavor; char * ar; char * ranlib; + char * windres; char * dlltool; char * mdso; }; diff --git a/src/output/slbt_output_config.c b/src/output/slbt_output_config.c index 2d29ce9..934da61 100644 --- a/src/output/slbt_output_config.c +++ b/src/output/slbt_output_config.c @@ -65,6 +65,9 @@ int slbt_output_config(const struct slbt_driver_ctx * dctx) if ((len = strlen(cctx->host.ranlib)) > midwidth) midwidth = len; + if ((len = strlen(cctx->host.windres)) > midwidth) + midwidth = len; + if ((len = strlen(cctx->host.dlltool)) > midwidth) midwidth = len; @@ -98,6 +101,9 @@ int slbt_output_config(const struct slbt_driver_ctx * dctx) if (slbt_output_config_line(fdout,"ranlib",cctx->host.ranlib,cctx->cfgmeta.ranlib,midwidth)) return SLBT_SYSTEM_ERROR(dctx); + if (slbt_output_config_line(fdout,"windres",cctx->host.windres,cctx->cfgmeta.windres,midwidth)) + return SLBT_SYSTEM_ERROR(dctx); + if (slbt_output_config_line(fdout,"dlltool",cctx->host.dlltool,cctx->cfgmeta.dlltool,midwidth)) return SLBT_SYSTEM_ERROR(dctx); diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c index f691731..d8ad0dd 100644 --- a/src/skin/slbt_skin_default.c +++ b/src/skin/slbt_skin_default.c @@ -95,6 +95,10 @@ const struct argv_option slbt_default_options[] = { "explicitly specify the PE custom import library " "generator to be used"}, + {"windres", 0,TAG_WINDRES,ARGV_OPTARG_REQUIRED,0,0,"<windres>", + "explicitly specify the PE resource compiler " + "to be used"}, + {"implib", 0,TAG_IMPLIB,ARGV_OPTARG_REQUIRED,0, "idata|dsometa",0, "PE import libraries should either use the legacy " |