From d6078771a56b1f38f420d302e1530efcc1b45590 Mon Sep 17 00:00:00 2001
From: Steve Bennett <steveb@workware.net.au>
Date: Sat, 4 Mar 2023 13:42:12 +1000
Subject: Add support for ./configure --disable-introspection

Sometimes it can be useful to provide an embedded interpreter
where introspection is not permitted.
This includes:

- info commands, procs, channels: only allow exact match, not glob pattern
- info frame: don't include cmd and proc in the returned dict
- info level: only return the command name, not the command arguments
- info body, args, statics: do not allow these to be called

Signed-off-by: Steve Bennett <steveb@workware.net.au>
---
 auto.def | 5 +++++
 1 file changed, 5 insertions(+)

(limited to 'auto.def')

diff --git a/auto.def b/auto.def
index 3fcf884..dc31fab 100644
--- a/auto.def
+++ b/auto.def
@@ -35,6 +35,7 @@ options {
     docdir:path     => "Path to install docs (if built)"
     random-hash     => "Randomise hash tables. more secure but hash table results are not predicable"
     coverage        => "Build with code coverage support"
+    introspection=1 => "Disable introspection"
     with-jim-ext: {with-ext:"ext1,ext2,..."} => {
         Specify additional Jim extensions to include.
         Use --extinfo to show information about available extensions.
@@ -475,6 +476,10 @@ if {[opt-bool compat]} {
     msg-result "Enabling compatibility mode"
     define JIM_COMPAT
 }
+if {![opt-bool introspection]} {
+    msg-result "Disabling introspection"
+    define JIM_NO_INTROSPECTION
+}
 if {[opt-bool shared with-jim-shared]} {
     msg-result "Building shared library"
 } else {
-- 
cgit v1.1

