summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/slibtool/slibtool.h8
-rw-r--r--src/host/slbt_host_flavor.c31
2 files changed, 39 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index fbeaf3e..2a43fad 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -384,6 +384,14 @@ slbt_api int slbt_host_set_althost (const struct slbt_driver_ctx *, const c
slbt_api void slbt_host_reset_althost (const struct slbt_driver_ctx *);
+slbt_api int slbt_host_objfmt_is_coff (const struct slbt_driver_ctx *);
+
+slbt_api int slbt_host_objfmt_is_macho (const struct slbt_driver_ctx *);
+
+slbt_api int slbt_host_group_is_winnt (const struct slbt_driver_ctx *);
+
+slbt_api int slbt_host_group_is_darwin (const struct slbt_driver_ctx *);
+
slbt_api int slbt_host_flavor_settings (const char *, const struct slbt_flavor_settings **);
/* utility helper interfaces */
diff --git a/src/host/slbt_host_flavor.c b/src/host/slbt_host_flavor.c
index b5f6f45..a0b3a3b 100644
--- a/src/host/slbt_host_flavor.c
+++ b/src/host/slbt_host_flavor.c
@@ -173,3 +173,34 @@ int slbt_host_flavor_settings(
return *settings ? 0 : -1;
}
+
+
+int slbt_host_objfmt_is_coff(const struct slbt_driver_ctx * dctx)
+{
+ const char * flavor = dctx->cctx->host.flavor;
+
+ return !strcmp(flavor,"midipix")
+ || !strcmp(flavor,"mingw")
+ || !strcmp(flavor,"cygwin")
+ || !strcmp(flavor,"msys");
+}
+
+
+int slbt_host_objfmt_is_macho(const struct slbt_driver_ctx * dctx)
+{
+ const char * flavor = dctx->cctx->host.flavor;
+
+ return !strcmp(flavor,"darwin");
+}
+
+
+int slbt_host_group_is_winnt(const struct slbt_driver_ctx * dctx)
+{
+ return slbt_host_objfmt_is_coff(dctx);
+}
+
+
+int slbt_host_group_is_darwin(const struct slbt_driver_ctx * dctx)
+{
+ return slbt_host_objfmt_is_macho(dctx);
+}