summaryrefslogtreecommitdiff
path: root/src/driver/slbt_amain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/driver/slbt_amain.c')
-rw-r--r--src/driver/slbt_amain.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c
index e0f4241..a9cc118 100644
--- a/src/driver/slbt_amain.c
+++ b/src/driver/slbt_amain.c
@@ -67,6 +67,16 @@ static ssize_t slbt_print_m4_dir(int fdout)
return slbt_dprintf(fdout,"%s\n",SLBT_PACKAGE_DATADIR);
}
+static ssize_t slbt_print_shared_ext(int fdout, struct slbt_driver_ctx * dctx)
+{
+ return slbt_dprintf(fdout,"%s\n",dctx->cctx->settings.dsosuffix);
+}
+
+static ssize_t slbt_print_static_ext(int fdout, struct slbt_driver_ctx * dctx)
+{
+ return slbt_dprintf(fdout,"%s\n",dctx->cctx->settings.arsuffix);
+}
+
static void slbt_perform_driver_actions(struct slbt_driver_ctx * dctx)
{
if (dctx->cctx->drvflags & SLBT_DRIVER_INFO)
@@ -219,6 +229,18 @@ int slbt_main(char ** argv, char ** envp, const struct slbt_fd_ctx * fdctx)
? slbt_exit(dctx,SLBT_ERROR)
: slbt_exit(dctx,SLBT_OK);
+ /* -print-shared-ext must be the first (and only) action */
+ if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_SHARED_EXT)
+ return (slbt_print_shared_ext(fdout,dctx) < 0)
+ ? slbt_exit(dctx,SLBT_ERROR)
+ : slbt_exit(dctx,SLBT_OK);
+
+ /* -print-static-ext must be the first (and only) action */
+ if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_STATIC_EXT)
+ return (slbt_print_static_ext(fdout,dctx) < 0)
+ ? slbt_exit(dctx,SLBT_ERROR)
+ : slbt_exit(dctx,SLBT_OK);
+
/* perform all other actions */
slbt_perform_driver_actions(dctx);