From ffc8d7da0103a081f97ae2f4f3acfb64d50be12e Mon Sep 17 00:00:00 2001
From: Robert Ricci <ricci@cs.utah.edu>
Date: Wed, 3 Jul 2002 19:50:07 +0000
Subject: [PATCH] New configure vairable: DISABLE_NSE . If set, the pareser
 won't call nse to syntax check simulated portions of the NS file. Note that
 this only disables NSE syntax checking, not use of NSE on nodes.

It's safe to leave this variable out of a defs file.
---
 configure                  | 4 +++-
 configure.in               | 1 +
 defs-wide                  | 1 +
 tbsetup/ns2ir/parse.tcl.in | 9 ++++++---
 4 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/configure b/configure
index b8b10680b0..c06d93cd71 100755
--- a/configure
+++ b/configure
@@ -834,6 +834,7 @@ fi
 
 
 
+
 
 
 #
@@ -1124,7 +1125,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1128: checking for a BSD compatible install" >&5
+echo "configure:1129: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1425,6 +1426,7 @@ s%@FSDIR_USERS@%$FSDIR_USERS%g
 s%@TRACK_INTERSWITCH_BANDWIDTH@%$TRACK_INTERSWITCH_BANDWIDTH%g
 s%@TIMESTAMPS@%$TIMESTAMPS%g
 s%@UNIFIED_BOSS_AND_OPS@%$UNIFIED_BOSS_AND_OPS%g
+s%@DISABLE_NSE@%$DISABLE_NSE%g
 s%@LEDA@%$LEDA%g
 s%@ASSIGN@%$ASSIGN%g
 s%@SSH_ARGS@%$SSH_ARGS%g
diff --git a/configure.in b/configure.in
index 7b47375979..971cc953bc 100755
--- a/configure.in
+++ b/configure.in
@@ -40,6 +40,7 @@ AC_SUBST(FSDIR_USERS)
 AC_SUBST(TRACK_INTERSWITCH_BANDWIDTH)
 AC_SUBST(TIMESTAMPS)
 AC_SUBST(UNIFIED_BOSS_AND_OPS)
+AC_SUBST(DISABLE_NSE)
 
 #
 # Defaults for for above variables.
diff --git a/defs-wide b/defs-wide
index 91ee854adc..0d316e6c34 100644
--- a/defs-wide
+++ b/defs-wide
@@ -23,3 +23,4 @@ FSDIR_GROUPS=/z/groups
 FSDIR_PROJ=/z/proj
 FSDIR_USERS=/z/users
 UNIFIED_BOSS_AND_OPS=1
+DISABLE_NSE=1
diff --git a/tbsetup/ns2ir/parse.tcl.in b/tbsetup/ns2ir/parse.tcl.in
index d0e84ac0fa..dfa9dea853 100644
--- a/tbsetup/ns2ir/parse.tcl.in
+++ b/tbsetup/ns2ir/parse.tcl.in
@@ -160,6 +160,7 @@ namespace eval GLOBALS {
     # Some settings taken from configure.
     variable tbroot @prefix@
     variable libdir @prefix@/lib/ns2ir
+    variable disablense {@DISABLE_NSE@}
 
     # This is the location of the tb_compat.tcl file.  It is copied
     # into the same directory is the ns file so that the initial
@@ -409,9 +410,11 @@ proc parse_delay {dspec} {
 # the NS file.
 
 # We first run the script through NSE to check syntax errors
-file copy -force ${GLOBALS::nstbcompat} tb_compat.tcl
-if { [catch {exec nse ${GLOBALS::nsfile}} errMsg] == 1 } {
-    perror "Syntax check with NS failed\nerrorcode: $errorCode\n error msg: $errMsg"
+if { ${GLOBALS::disablense} != 1 } {
+    file copy -force ${GLOBALS::nstbcompat} tb_compat.tcl
+    if { [catch {exec nse ${GLOBALS::nsfile}} errMsg] == 1 } {
+	perror "Syntax check with NS failed\nerrorcode: $errorCode\n error msg: $errMsg"
+    }
 }
 
 if { ${GLOBALS::errors} != 1 } {
-- 
GitLab