From 9804917e9810873736ef22a25d841b05dee2830a Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 18 Mar 2016 19:09:56 -0400 Subject: utility: slibtool_perform_driver_actions(): initial implementation. --- src/slibtool.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/slibtool.c b/src/slibtool.c index 6fb3422..dfc57e2 100644 --- a/src/slibtool.c +++ b/src/slibtool.c @@ -22,6 +22,15 @@ static ssize_t slibtool_version(struct slbt_driver_ctx * dctx) return fprintf(stdout,vermsg,dctx->program,SLIBTOOL_GIT_VERSION); } +static void slibtool_perform_driver_actions(struct slbt_driver_ctx * dctx) +{ + if (dctx->cctx->drvflags & SLBT_DRIVER_CONFIG) + dctx->nerrors += (slbt_output_config(dctx) < 0); + + if (dctx->cctx->mode == SLBT_MODE_COMPILE) + dctx->nerrors += (slbt_exec_compile(dctx,0) < 0); +} + static void slibtool_perform_unit_actions(struct slbt_unit_ctx * uctx) { } @@ -46,6 +55,9 @@ int slibtool_main(int argc, char ** argv, char ** envp) if ((slibtool_version(dctx)) < 0) return slibtool_exit(dctx,2); + slibtool_perform_driver_actions(dctx); + ret += dctx->nerrors; + for (unit=dctx->units; *unit; unit++) { if (!(slbt_get_unit_ctx(dctx,*unit,&uctx))) { slibtool_perform_unit_actions(uctx); -- cgit v1.2.3