Revision: 42327
          http://brlcad.svn.sourceforge.net/brlcad/?rev=42327&view=rev
Author:   starseeker
Date:     2011-01-16 19:32:56 +0000 (Sun, 16 Jan 2011)

Log Message:
-----------
Sync tclcadAutoPath.c with trunk's version - trying to get a version both can 
live with/use.

Modified Paths:
--------------
    brlcad/branches/cmake/src/libtclcad/tclcadAutoPath.c

Modified: brlcad/branches/cmake/src/libtclcad/tclcadAutoPath.c
===================================================================
--- brlcad/branches/cmake/src/libtclcad/tclcadAutoPath.c        2011-01-16 
19:31:13 UTC (rev 42326)
+++ brlcad/branches/cmake/src/libtclcad/tclcadAutoPath.c        2011-01-16 
19:32:56 UTC (rev 42327)
@@ -36,18 +36,129 @@
 #  include "tk.h"
 #endif
 
+#include "brlcad_config.h"
+
+#ifndef ITCL_VERSION
+#  include "itcl.h"
+#endif
+
+#ifdef HAVE_DK
+# ifndef ITK_VERSION
+#  include "itk.h"
+# endif
+#endif
+
 /* incrTcl prior to 3.3 doesn't provide ITK_VERSION */
 #ifndef ITK_VERSION
 #  define ITK_VERSION ITCL_VERSION
 #endif
 
 #include "bu.h"
-#include "brlcad_version.h"
 #include "tclcad.h"
 
 #define MAX_BUF 2048
 
+/* FIXME: we utilize this Tcl internal in here */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+extern Tcl_Obj *TclGetLibraryPath (void);
+#endif
+
+
+/* helper routine to determine whether the full 'path' includes a
+ * directory named 'src'.  this is used to determine whether a
+ * particular invocation is being run from the BRL-CAD source
+ * directories or from some install directory.
+ *
+ * returns a pointer to the subpath that contains the 'src' directory.
+ * e.g. provided /some/path/to/src/dir/blah will return /some/path/to
+ */
+static const char *
+path_to_src(const char *path)
+{
+    static char buffer[MAX_BUF] = {0};
+    char *match = NULL;
+
+    if (!path) {
+       return NULL;
+    }
+    if (strlen(path)+2 > MAX_BUF) {
+       /* path won't fit */
+       return NULL;
+    }
+
+    snprintf(buffer, MAX_BUF, "%s%c", path, BU_DIR_SEPARATOR);
+
+    match = strstr(buffer, "/src/");
+    if (match) {
+       *(match) = '\0';
+       return buffer;
+    }
+    return NULL;
+}
+
+
 /**
+ * debug printing routine for printing out the tcl_library value(s)
+ */
+void
+tclcad_tcl_library(Tcl_Interp *interp)
+{
+    int cnt = 0;
+    int pathcount = 0;
+    Tcl_Obj *dir = NULL;
+    Tcl_Obj *tclpath = NULL;
+    char buffer[MAX_BUF] = {0};
+
+    /* FIXME: this is a private internal call */
+    tclpath = TclGetLibraryPath();
+    if (!tclpath) {
+       bu_log("WARNING: Unable to get the library path\n");
+       return;
+    }
+
+    Tcl_IncrRefCount(tclpath);
+    Tcl_ListObjLength(NULL, tclpath, &pathcount);
+    if (pathcount > 1) {
+       bu_log("WARNING: tcl_library is set to multiple paths?\n");
+    } else if (pathcount <= 0) {
+       if (interp) {
+           const char *setting;
+           snprintf(buffer, MAX_BUF, "set tcl_library");
+           Tcl_Eval(interp, buffer);
+           setting = Tcl_GetStringResult(interp);
+           if (setting && (strlen(setting) > 0)) {
+               Tcl_Obj *tcllib = Tcl_NewStringObj(setting, -1);
+               Tcl_Obj *listtl = Tcl_NewListObj(1, &tcllib);
+               TclSetLibraryPath(listtl);
+           }
+       }
+
+       Tcl_DecrRefCount(tclpath);
+       /* FIXME: this is a private internal call */
+       tclpath = TclGetLibraryPath();
+       Tcl_IncrRefCount(tclpath);
+
+       Tcl_ListObjLength(NULL, tclpath, &pathcount);
+       if (pathcount <= 0) {
+           bu_log("WARNING: tcl_library is unset (unexpected)\n");
+       }
+    }
+
+    for (cnt=0; cnt < pathcount; cnt++) {
+       Tcl_ListObjIndex(NULL, tclpath, cnt, &dir);
+       Tcl_IncrRefCount(dir);
+       if (dir) {
+#ifdef DEBUG
+           bu_log("Using Tcl library at %s\n", Tcl_GetString(dir));
+#endif
+       }
+       Tcl_DecrRefCount(dir);
+    }
+    Tcl_DecrRefCount(tclpath);
+}
+
+
+/**
  * Set up the Tcl auto_path for locating various necessary BRL-CAD
  * scripting resources. Detect whether the current invocation is from
  * an installed binary or not and append to the auto_path accordingly
@@ -82,13 +193,7 @@
 tclcad_auto_path(Tcl_Interp *interp)
 {
     struct bu_vls auto_path;
-    struct bu_vls tcl_library;
-    struct bu_vls system_tcl_library;
     struct bu_vls lappend;
-    struct bu_vls tclcmd;
-    struct bu_vls invocation_full_path;
-    struct bu_vls root_full_path;
-    struct bu_vls data_path;
     const char *library_path = NULL;
 
     const char *root = NULL;
@@ -98,21 +203,12 @@
     const char *which_argv = NULL;
     const char *srcpath = NULL;
     int from_installed = 0;
-    int from_built = 0;
 
     int found_init_tcl = 0;
     int found_tk_tcl = 0;
     int found_itcl_tcl = 0;
     int found_itk_tcl = 0;
 
-    Tcl_Obj *invocationPathPtr;
-    Tcl_Obj *rootPathPtr;
-    Tcl_Obj *buildPathPtr;
-
-    char *resolvedargv0;
-    char *resolvedrootdir;
-    char *resolvedbuilddir;
-
     char pathsep[2] = { BU_PATH_SEPARATOR, '\0' };
 
     if (!interp) {
@@ -120,26 +216,12 @@
        return;
     }
 
+    root = bu_brlcad_root("", 1);
+    data = bu_brlcad_data("", 1);
+
     bu_vls_init(&auto_path);
-    bu_vls_init(&tcl_library);
-    bu_vls_init(&system_tcl_library);
     bu_vls_init(&lappend);
-    bu_vls_init(&tclcmd);
-    bu_vls_init(&invocation_full_path);
-    bu_vls_init(&root_full_path);
-    bu_vls_init(&data_path);
 
-    bu_vls_sprintf(&data_path, "share/brlcad/%s", brlcad_version());
-    root = bu_brlcad_root(bu_vls_addr(&data_path), 1);
-
-    /* If we have a system init.tcl path passed in, put it in tcl_library */
-    bu_vls_sprintf(&system_tcl_library, "%s", TCL_SYSTEM_INITTCL_PATH);
-    if(bu_vls_strlen(&system_tcl_library) > 0) {
-      bu_vls_sprintf(&tcl_library, "set tcl_library %s", 
bu_vls_addr(&system_tcl_library));
-      Tcl_Eval(interp, bu_vls_addr(&tcl_library));
-      found_init_tcl = 1;
-    }
- 
     /* determine if TCLCAD_LIBRARY_PATH is set */
     library_path = getenv("TCLCAD_LIBRARY_PATH");
     if (library_path) {
@@ -158,22 +240,12 @@
        which_argv = bu_argv0_full_path();
     }
 
-    bu_vls_sprintf(&tclcmd, "file normalize %s", which_argv); 
-    Tcl_Eval(interp, bu_vls_addr(&tclcmd));
-    bu_vls_sprintf(&invocation_full_path, "%s", 
Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL));
-
-    bu_vls_sprintf(&tclcmd, "file normalize %s", root); 
-    Tcl_Eval(interp, bu_vls_addr(&tclcmd));
-    bu_vls_sprintf(&root_full_path, "%s", 
Tcl_GetStringFromObj(Tcl_GetObjResult(interp), NULL));
-
-    bu_vls_free(&tclcmd);
-    bu_vls_free(&invocation_full_path);
-    bu_vls_free(&root_full_path);
- 
     /* get name of installation binary */
     snprintf(buffer, MAX_BUF, "%s%cbin%c%s", root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, bu_getprogname());
 
-    /* add paths based on bu_brlcad_root and the brlcad data dir */
+    /* are we running from an installed binary? if so add to path */
+    if (bu_file_exists(buffer) && bu_same_file(buffer, which_argv)) {
+       from_installed = 1;
        bu_vls_printf(&auto_path, "%c%s%clib",
                      BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%clib%ctcl%s",
@@ -191,22 +263,132 @@
        bu_vls_printf(&auto_path, "%c%s%clib%ciwidgets%s",
                      BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, IWIDGETS_VERSION);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%clib",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%cutil",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%cmged",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%cgeometree",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%crtwizard",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
        bu_vls_printf(&auto_path, "%c%s%ctclscripts%carcher",
-                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+    }
 
-    /*printf("AUTO_PATH IS %s\n", bu_vls_addr(&auto_path)); */
+    /* are we running uninstalled? */
+    srcpath = path_to_src(which_argv);
 
+    /* add search paths for source invocation */
+    if (srcpath) {
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%ctcl%cunix",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%ctcl%clibrary",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%ctk%cunix",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%ctk%clibrary",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%cincrTcl",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%cincrTcl%citcl%clibrary",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%cincrTcl%citk%clibrary",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%cother%ciwidgets",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%clib",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%cutil",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%cmged",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%cgeometree",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%crtwizard",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%csrc%ctclscripts%carcher",
+                     BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+    }
+
+    /* add search paths for dist invocation */
+    if (srcpath) {
+       snprintf(buffer, MAX_BUF, "%s%c..%csrc%cother%ctcl%cunix",
+                srcpath, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       if (bu_file_exists(buffer)) {
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%ctcl%cunix",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%ctcl%clibrary",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%ctk%cunix",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%ctk%clibrary",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%cincrTcl",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, 
"%c%s%c..%csrc%cother%cincrTcl%citcl%clibrary",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, 
"%c%s%c..%csrc%cother%cincrTcl%citk%clibrary",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%cother%ciwidgets",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%clib",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%cutil",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%cmged",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%cgeometree",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%crtwizard",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+           bu_vls_printf(&auto_path, "%c%s%c..%csrc%ctclscripts%carcher",
+                         BU_PATH_SEPARATOR, srcpath, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, BU_DIR_SEPARATOR, BU_DIR_SEPARATOR);
+       }
+    }
+
+    /* be sure to check installation paths even if we aren't running from 
there */
+    if (!from_installed) {
+       bu_vls_printf(&auto_path, "%c%s%clib",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%clib%ctcl%s",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, TCL_VERSION);
+#ifdef HAVE_TK
+       bu_vls_printf(&auto_path, "%c%s%clib%ctk%s",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, TK_VERSION);
+#endif
+       bu_vls_printf(&auto_path, "%c%s%clib%citcl%s",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, ITCL_VERSION);
+#ifdef HAVE_TK
+       bu_vls_printf(&auto_path, "%c%s%clib%citk%s",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, ITK_VERSION);
+#endif
+       bu_vls_printf(&auto_path, "%c%s%clib%ciwidgets%s",
+                     BU_PATH_SEPARATOR, root, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR, IWIDGETS_VERSION);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%clib",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%cutil",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%cmged",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%cgeometree",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%crtwizard",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+       bu_vls_printf(&auto_path, "%c%s%ctclscripts%carcher",
+                     BU_PATH_SEPARATOR, data, BU_DIR_SEPARATOR, 
BU_DIR_SEPARATOR);
+    }
+
+    /*    printf("AUTO_PATH IS %s\n", bu_vls_addr(&auto_path)); */
+
     /* see if user already set ITCL_LIBRARY override */
     library_path = getenv("ITCL_LIBRARY");
     if (!found_itcl_tcl && library_path) {
@@ -232,11 +414,11 @@
 
        /* make sure it exists before appending */
        if (bu_file_exists(srcpath)) {
-                       printf("APPENDING: %s\n", srcpath); 
+           /*          printf("APPENDING: %s\n", srcpath); */
            bu_vls_sprintf(&lappend, "lappend auto_path {%s}", srcpath);
            (void)Tcl_Eval(interp, bu_vls_addr(&lappend));
        } else {
-                       printf("NOT APPENDING: %s\n", srcpath); 
+           /*          printf("NOT APPENDING: %s\n", srcpath); */
            continue;
        }
 
@@ -319,10 +501,7 @@
 
     which_argv = NULL;
     bu_vls_free(&auto_path);
-    bu_vls_free(&system_tcl_library);
-    bu_vls_free(&tcl_library);
     bu_vls_free(&lappend);
-    bu_vls_free(&data_path);
 
     return;
 }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Protect Your Site and Customers from Malware Attacks
Learn about various malware tactics and how to avoid them. Understand 
malware threats, the impact they can have on your business, and how you 
can protect your company and customers by using code signing.
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to