summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-17 15:26:04 -0400
committermidipix <writeonce@midipix.org>2016-04-17 17:33:21 -0400
commitbcd5af9ca57f03e0a63966ca3be6429e2e659605 (patch)
tree2c2780f5a6ecea9d5862c3f8f614e62777456e0a /src
parent3be47d3719ae8cc39c5a966cefdf5ef87f6393e0 (diff)
downloadslibtool-bcd5af9ca57f03e0a63966ca3be6429e2e659605.tar.bz2
slibtool-bcd5af9ca57f03e0a63966ca3be6429e2e659605.tar.xz
driver: added image format support.
Diffstat (limited to 'src')
-rw-r--r--src/driver/slbt_driver_ctx.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 919e823..36f1466 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -16,15 +16,15 @@
/* flavor settings */
-#define SLBT_FLAVOR_SETTINGS(flavor,arp,ars,dsop,dsos,exep,exes,impp,imps,ldenv) \
+#define SLBT_FLAVOR_SETTINGS(flavor,bfmt,arp,ars,dsop,dsos,exep,exes,impp,imps,ldenv) \
static const struct slbt_flavor_settings flavor = { \
- arp,ars,dsop,dsos,exep,exes,impp,imps,ldenv}
+ bfmt,arp,ars,dsop,dsos,exep,exes,impp,imps,ldenv}
-SLBT_FLAVOR_SETTINGS(host_flavor_default, "lib",".a", "lib",".so", "","", "", "", "LD_LIBRARY_PATH");
-SLBT_FLAVOR_SETTINGS(host_flavor_midipix, "lib",".a", "lib",".so", "","", "lib",".lib.a", "PATH");
-SLBT_FLAVOR_SETTINGS(host_flavor_mingw, "lib",".a", "lib",".dll", "",".exe", "lib",".dll.a", "PATH");
-SLBT_FLAVOR_SETTINGS(host_flavor_cygwin, "lib",".a", "lib",".dll", "",".exe", "lib",".dll.a", "PATH");
-SLBT_FLAVOR_SETTINGS(host_flavor_darwin, "lib",".a", "lib",".dylib", "","", "", "", "DYLD_LIBRARY_PATH");
+SLBT_FLAVOR_SETTINGS(host_flavor_default, "elf", "lib",".a", "lib",".so", "","", "", "", "LD_LIBRARY_PATH");
+SLBT_FLAVOR_SETTINGS(host_flavor_midipix, "pe", "lib",".a", "lib",".so", "","", "lib",".lib.a", "PATH");
+SLBT_FLAVOR_SETTINGS(host_flavor_mingw, "pe", "lib",".a", "lib",".dll", "",".exe", "lib",".dll.a", "PATH");
+SLBT_FLAVOR_SETTINGS(host_flavor_cygwin, "pe", "lib",".a", "lib",".dll", "",".exe", "lib",".dll.a", "PATH");
+SLBT_FLAVOR_SETTINGS(host_flavor_darwin, "macho","lib",".a", "lib",".dylib", "","", "", "", "DYLD_LIBRARY_PATH");
/* annotation strings */
@@ -440,6 +440,13 @@ static void slbt_init_flavor_settings(struct slbt_common_ctx * cctx)
else
settings = &host_flavor_default;
+ if (!strcmp(settings->imagefmt,"elf"))
+ cctx->drvflags |= SLBT_DRIVER_IMAGE_ELF;
+ else if (!strcmp(settings->imagefmt,"pe"))
+ cctx->drvflags |= SLBT_DRIVER_IMAGE_PE;
+ else if (!strcmp(settings->imagefmt,"macho"))
+ cctx->drvflags |= SLBT_DRIVER_IMAGE_PE;
+
memcpy(&cctx->settings,settings,sizeof(*settings));
}