diff options
author | midipix <writeonce@midipix.org> | 2024-07-19 01:03:37 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-07-19 01:03:37 +0000 |
commit | 979507dfb71780d8ac2bd393d4e914e5578900f9 (patch) | |
tree | 4134f7ad4c3b4c0808ef6b715ce984bf36337c7a /src/driver/slbt_amain.c | |
parent | 64383cc119375fe535f7c5acd5bf93c74fe4e988 (diff) | |
download | slibtool-979507dfb71780d8ac2bd393d4e914e5578900f9.tar.bz2 slibtool-979507dfb71780d8ac2bd393d4e914e5578900f9.tar.xz |
driver: added the -print-shared-ext and -print-static-ext output commands.
Diffstat (limited to 'src/driver/slbt_amain.c')
-rw-r--r-- | src/driver/slbt_amain.c | 22 |
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); |