From 341c87f49428983b953dc88c2b64648cfd10c319 Mon Sep 17 00:00:00 2001
From: midipix <writeonce@midipix.org>
Date: Fri, 11 Mar 2016 03:17:30 -0500
Subject: compatible semantics (must see with your own eyes) of -shared and
 -static.

---
 src/driver/slbt_driver_ctx.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index 74fbd9a..bb9343a 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -242,6 +242,9 @@ int slbt_get_driver_ctx(
 	program = argv_program_name(argv[0]);
 	memset(&cctx,0,sizeof(cctx));
 
+	/* shared and static objects: enable by default, disable by ~switch */
+	cctx.drvflags = SLBT_DRIVER_SHARED | SLBT_DRIVER_STATIC;
+
 	/* get options, count units */
 	for (entry=meta->entries; entry->fopt || entry->arg; entry++) {
 		if (entry->fopt) {
@@ -338,11 +341,11 @@ int slbt_get_driver_ctx(
 					break;
 
 				case TAG_SHARED:
-					cctx.drvflags |= SLBT_DRIVER_SHARED;
+					cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_STATIC;
 					break;
 
 				case TAG_STATIC:
-					cctx.drvflags |= SLBT_DRIVER_STATIC;
+					cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_SHARED;
 					break;
 			}
 		} else
-- 
cgit v1.2.3