summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-04-25 19:30:05 -0400
committermidipix <writeonce@midipix.org>2016-04-25 20:36:38 -0400
commit2bc17534f0bba1de06210535c20311db70c417c4 (patch)
tree270554600540d64b9433b9396942708a2384828f
parentdac9cd4bdd4da581279f2ad7a65a17b5d0ba7f87 (diff)
downloadslibtool-2bc17534f0bba1de06210535c20311db70c417c4.tar.bz2
slibtool-2bc17534f0bba1de06210535c20311db70c417c4.tar.xz
driver: added --annotate support.
-rw-r--r--include/slibtool/slibtool.h4
-rw-r--r--src/driver/slbt_driver_ctx.c21
-rw-r--r--src/internal/slibtool_driver_impl.h1
-rw-r--r--src/skin/slbt_skin_default.c7
4 files changed, 33 insertions, 0 deletions
diff --git a/include/slibtool/slibtool.h b/include/slibtool/slibtool.h
index a2529f7..cd61300 100644
--- a/include/slibtool/slibtool.h
+++ b/include/slibtool/slibtool.h
@@ -61,6 +61,10 @@ extern "C" {
#define SLBT_DRIVER_DISABLE_STATIC 0x02000000
#define SLBT_DRIVER_DISABLE_SHARED 0x04000000
+#define SLBT_DRIVER_ANNOTATE_ALWAYS 0x10000000
+#define SLBT_DRIVER_ANNOTATE_NEVER 0x20000000
+#define SLBT_DRIVER_ANNOTATE_FULL 0x40000000
+
/* execution modes */
enum slbt_mode {
SLBT_MODE_UNKNOWN,
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index f65460a..f3c13ca 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -695,6 +695,9 @@ int slbt_get_driver_ctx(
/* shared and static objects: enable by default, disable by ~switch */
cctx.drvflags = flags | SLBT_DRIVER_SHARED | SLBT_DRIVER_STATIC;
+ /* full annotation when annotation is on; */
+ cctx.drvflags |= SLBT_DRIVER_ANNOTATE_FULL;
+
/* get options, count units */
for (entry=meta->entries; entry->fopt || entry->arg; entry++) {
if (entry->fopt) {
@@ -775,6 +778,24 @@ int slbt_get_driver_ctx(
cctx.warnings = SLBT_WARNING_LEVEL_NONE;
break;
+ case TAG_ANNOTATE:
+ if (!strcmp("always",entry->arg)) {
+ cctx.drvflags |= SLBT_DRIVER_ANNOTATE_ALWAYS;
+ cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_ANNOTATE_NEVER;
+
+ } else if (!strcmp("never",entry->arg)) {
+ cctx.drvflags |= SLBT_DRIVER_ANNOTATE_NEVER;
+ cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_ANNOTATE_ALWAYS;
+
+ } else if (!strcmp("minimal",entry->arg)) {
+ cctx.drvflags &= ~(uint64_t)SLBT_DRIVER_ANNOTATE_FULL;
+
+ } else if (!strcmp("full",entry->arg)) {
+ cctx.drvflags |= SLBT_DRIVER_ANNOTATE_FULL;
+ }
+
+ break;
+
case TAG_DEPS:
cctx.drvflags |= SLBT_DRIVER_DEPS;
break;
diff --git a/src/internal/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index 8ffb611..1bd7ce7 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -21,6 +21,7 @@ enum app_tags {
TAG_FEATURES,
TAG_MODE,
TAG_WARNINGS,
+ TAG_ANNOTATE,
TAG_DEPS,
TAG_SILENT,
TAG_TAG,
diff --git a/src/skin/slbt_skin_default.c b/src/skin/slbt_skin_default.c
index a223ae8..e0c4886 100644
--- a/src/skin/slbt_skin_default.c
+++ b/src/skin/slbt_skin_default.c
@@ -38,6 +38,13 @@ const struct argv_option slbt_default_options[] = {
{"preserve-dup-deps", 0,TAG_DEPS,ARGV_OPTARG_NONE,0,0,0,
"leave the dependency list alone"},
+ {"annotate", 0,TAG_ANNOTATE,ARGV_OPTARG_REQUIRED,0,
+ "always|never|minimal|full",0,
+ "modify default annotation options; "
+ "the defautls are full annotation when "
+ "stdout is a tty, and no annotation "
+ "at all otherwise"},
+
{"quiet", 0,TAG_SILENT,ARGV_OPTARG_NONE,0,0,0,
"do not say anything"},