From 8056668eebf28eec3101cf567b63a0600e40f36d Mon Sep 17 00:00:00 2001 From: midipix Date: Mon, 1 Apr 2024 04:14:04 +0000 Subject: driver: added -print-aux-dir and -print-m4-dir (for slibtool.m4 integration). --- src/driver/slbt_amain.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/driver/slbt_amain.c') diff --git a/src/driver/slbt_amain.c b/src/driver/slbt_amain.c index 73d1462..e0f4241 100644 --- a/src/driver/slbt_amain.c +++ b/src/driver/slbt_amain.c @@ -57,6 +57,16 @@ static ssize_t slbt_version(struct slbt_driver_ctx * dctx, int fdout) verclr[5],gitver ? "]" : ""); } +static ssize_t slbt_print_aux_dir(int fdout) +{ + return slbt_dprintf(fdout,"%s\n",SLBT_PACKAGE_DATADIR); +} + +static ssize_t slbt_print_m4_dir(int fdout) +{ + return slbt_dprintf(fdout,"%s\n",SLBT_PACKAGE_DATADIR); +} + static void slbt_perform_driver_actions(struct slbt_driver_ctx * dctx) { if (dctx->cctx->drvflags & SLBT_DRIVER_INFO) @@ -197,6 +207,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-aux-dir must be the first (and only) action */ + if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_AUX_DIR) + return (slbt_print_aux_dir(fdout) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); + + /* -print-m4-dir must be the first (and only) action */ + if (dctx->cctx->drvflags & SLBT_DRIVER_OUTPUT_M4_DIR) + return (slbt_print_m4_dir(fdout) < 0) + ? slbt_exit(dctx,SLBT_ERROR) + : slbt_exit(dctx,SLBT_OK); + /* perform all other actions */ slbt_perform_driver_actions(dctx); -- cgit v1.2.3