summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/driver/slbt_driver_ctx.c44
-rw-r--r--src/internal/slibtool_driver_impl.h3
-rw-r--r--src/output/slbt_output_config.c6
-rw-r--r--src/skin/slbt_skin_default.c11
4 files changed, 64 insertions, 0 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 8100e0a..8d2fa6e 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -532,6 +532,31 @@ static int slbt_init_host_params(
host->dlltool = drvhost->dlltool;
}
+ /* mdso */
+ if (host->mdso)
+ cfgmeta->mdso = cfgexplicit;
+
+ else if (strcmp(host->flavor,"cygwin")
+ && strcmp(host->flavor,"midipix")
+ && strcmp(host->flavor,"mingw")) {
+ host->mdso = "";
+ cfgmeta->mdso = "not applicable";
+
+ } else {
+ if (!(drvhost->mdso = calloc(1,toollen)))
+ return -1;
+
+ if (fnative) {
+ strcpy(drvhost->mdso,"mdso");
+ cfgmeta->mdso = cfgnative;
+ } else {
+ sprintf(drvhost->mdso,"%s-mdso",host->host);
+ cfgmeta->mdso = cfghost;
+ }
+
+ host->mdso = drvhost->mdso;
+ }
+
return 0;
}
@@ -555,6 +580,9 @@ static void slbt_free_host_params(struct slbt_host_strs * host)
if (host->dlltool)
free(host->dlltool);
+ if (host->mdso)
+ free(host->mdso);
+
memset(host,0,sizeof(*host));
}
@@ -902,6 +930,18 @@ int slbt_get_driver_ctx(
break;
+ case TAG_IMPLIB:
+ if (!strcmp("idata",entry->arg)) {
+ cctx.drvflags |= SLBT_DRIVER_IMPLIB_IDATA;
+ cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_IMPLIB_DSOMETA;
+
+ } else if (!strcmp("never",entry->arg)) {
+ cctx.drvflags |= SLBT_DRIVER_IMPLIB_DSOMETA;
+ cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_IMPLIB_IDATA;
+ }
+
+ break;
+
case TAG_WARNINGS:
if (!strcmp("all",entry->arg))
cctx.warnings = SLBT_WARNING_LEVEL_ALL;
@@ -963,6 +1003,10 @@ int slbt_get_driver_ctx(
cctx.host.dlltool = entry->arg;
break;
+ case TAG_MDSO:
+ cctx.host.mdso = entry->arg;
+ break;
+
case TAG_OUTPUT:
cctx.output = entry->arg;
break;
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index b630126..b255042 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -35,6 +35,8 @@ enum app_tags {
TAG_AR,
TAG_RANLIB,
TAG_DLLTOOL,
+ TAG_MDSO,
+ TAG_IMPLIB,
TAG_OUTPUT,
TAG_BINDIR,
TAG_LDRPATH,
@@ -71,6 +73,7 @@ struct slbt_host_strs {
char * ar;
char * ranlib;
char * dlltool;
+ char * mdso;
};
struct slbt_driver_ctx_impl {
diff --git a/src/output/slbt_output_config.c b/src/output/slbt_output_config.c
index d1d9712..800c6c3 100644
--- a/src/output/slbt_output_config.c
+++ b/src/output/slbt_output_config.c
@@ -63,6 +63,9 @@ int slbt_output_config(const struct slbt_driver_ctx * dctx)
if ((len = strlen(cctx->host.dlltool)) > midwidth)
midwidth = len;
+ if ((len = strlen(cctx->host.mdso)) > midwidth)
+ midwidth = len;
+
midwidth += SLBT_TAB_WIDTH;
midwidth &= (~(SLBT_TAB_WIDTH-1));
@@ -93,6 +96,9 @@ int slbt_output_config(const struct slbt_driver_ctx * dctx)
if (slbt_output_config_line("dlltool",cctx->host.dlltool,cctx->cfgmeta.dlltool,midwidth))
return SLBT_SYSTEM_ERROR(dctx);
+ if (slbt_output_config_line("mdso",cctx->host.mdso,cctx->cfgmeta.mdso,midwidth))
+ return SLBT_SYSTEM_ERROR(dctx);
+
return fflush(stdout)
? SLBT_SYSTEM_ERROR(dctx)
: 0;
diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c
index 40eb189..ceb4d30 100644
--- a/src/skin/slbt_skin_default.c
+++ b/src/skin/slbt_skin_default.c
@@ -91,6 +91,17 @@ const struct argv_option slbt_default_options[] = {
"explicitly specify the PE import library generator "
"to be used"},
+ {"mdso", 0,TAG_MDSO,ARGV_OPTARG_REQUIRED,0,0,"<mdso>",
+ "explicitly specify the PE custom import library "
+ "generator to be used"},
+
+ {"implib", 0,TAG_IMPLIB,ARGV_OPTARG_REQUIRED,0,
+ "idata|dsometa",0,
+ "PE import libraries should either use the legacy "
+ "format (.idata section) and be generated by dlltool, "
+ "or the custom format (.dsometa section) and be "
+ "generated by mdso"},
+
{"warnings", 0,TAG_WARNINGS,ARGV_OPTARG_REQUIRED,0,
"all|none|error",0,
"set the warning reporting level; "