Index: kernel/configure.in =================================================================== RCS file: /home/cvs/soar/kernel/configure.in,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- kernel/configure.in 2002/10/21 23:20:42 1.1 +++ kernel/configure.in 2002/10/21 23:30:31 1.1.2.1 @@ -8,7 +8,9 @@ # The autoconf documentation leads me to believe this has to be here # (rather than in Makefile.in), or AC_PROG_CC will change it. -CFLAGS="-O -w" +if test -z "${CFLAGS}"; then + CFLAGS="-O -w" +fi AC_PROG_CC AC_PROG_RANLIB Index: library/pkgIndex.tcl =================================================================== RCS file: /home/cvs/soar/library/pkgIndex.tcl,v retrieving revision 1.1 diff -u -r1.1 pkgIndex.tcl --- library/pkgIndex.tcl 2002/10/21 23:23:07 1.1 +++ library/pkgIndex.tcl 2002/11/01 18:08:09 @@ -8,7 +8,11 @@ # script is sourced, the variable $dir must contain the # full path name of this file's directory. -puts "dir = $dir" +set soar_library [lindex [array get env SOAR_LIBRARY] 1] +if {[string compare "$soar_library" ""] == 0} { + set soar_library $dir +} + package ifneeded Soar 8.4 [list # First, check to see if Soar is already loaded into the # current interpreter. If so, then don't load it again. @@ -28,6 +32,9 @@ if {"$name" == "Soar"} { load $file $name + if [file exists [file join $soar_library soar.tcl]] { + source [file join $soar_library soar.tcl] + } return } } @@ -35,4 +42,8 @@ # Otherwise, issue the platform-specific "load" command set lib "libsoar8.4[info sharedlibext]" load [file join $dir $lib] + + if [file exists [file join $soar_library soar.tcl]] { + source [file join $soar_library soar.tcl] + } ] Index: tcl-interface/configure.in =================================================================== RCS file: /home/cvs/soar/tcl-interface/configure.in,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- tcl-interface/configure.in 2002/10/21 23:22:35 1.1 +++ tcl-interface/configure.in 2002/10/21 23:38:59 1.1.2.1 @@ -21,7 +21,10 @@ # smart enough to understand function prototypes. #-------------------------------------------------------------------- -CFLAGS="-O -w" +if test -z "${CFLAGS}"; then + CFLAGS="-O -w" +fi + AC_PROG_CC AC_PROG_INSTALL AC_PROG_RANLIB Index: tcl-interface/Makefile.in =================================================================== RCS file: /home/cvs/soar/tcl-interface/Makefile.in,v retrieving revision 1.1 retrieving revision 1.1.2.2 diff -u -r1.1 -r1.1.2.2 --- tcl-interface/Makefile.in 2002/10/21 23:22:35 1.1 +++ tcl-interface/Makefile.in 2002/11/01 18:07:08 1.1.2.2 @@ -146,7 +146,7 @@ lib: libsoartk.a $(SHLIB_TARGET): $(OBJS) - $(SHLIB_LD) -o $(SHLIB_TARGET) $(OBJS) $(KERNEL_LIB_SPEC) $(SHLIB_LD_LIBS) + $(SHLIB_LD) -o $(SHLIB_TARGET) $(OBJS) $(KERNEL_LIB_SPEC) $(SHLIB_LD_LIBS) $(TCL_LIB_SPEC) soar: tclAppInit.c $(OBJS) Index: tcl-interface/soarInterp.c =================================================================== RCS file: /home/cvs/soar/tcl-interface/soarInterp.c,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -u -r1.1 -r1.1.2.1 --- tcl-interface/soarInterp.c 2002/10/21 23:22:35 1.1 +++ tcl-interface/soarInterp.c 2002/10/21 23:39:28 1.1.2.1 @@ -54,96 +54,9 @@ soar_agent = theAgent; } - /* *-------------------------------------------------------------- * - * Soar_SetSoarLibrary - * - * This procedure is called to set the "soar_library" - * Tcl variable. - * - * Results: - * TCL_OK if successful. - * - * Side effects: - * The soar_library global variable will exist and be - * set to the appropriate location. - * - *-------------------------------------------------------------- - */ - -/* This little Tcl code fragment tries to use the SOAR_LIBRARY - environment variable first, then searches each directory in the - tcl_pkgPath and auto_path variables for a "soar" subdirectory. The - first one it finds (if any) is made into soar_library. */ - -static char* setSoarLibraryCommand = -"set soar_library {}\n\ -if {[info exists env(SOAR_LIBRARY)]} {\n\ - set soar_library $env(SOAR_LIBRARY)\n\ -} else {\n\ - foreach dir [concat $tcl_pkgPath $auto_path] {\n\ - if {[file exists [file join $dir soar]]} {\n\ - set soar_library [file join $dir soar]\n\ - break\n\ - }\n\ - }\n\ -}"; - - -static int -Soar_SetSoarLibrary(Tcl_Interp *interp) -{ - return Tcl_GlobalEval(interp, setSoarLibraryCommand); -} - - - - -/* - *-------------------------------------------------------------- - * - * Soar_ReadInitScript - * - * Sources the Soar init script, $soar_library/soar.tcl. - * - * Results: - * TCL_OK if successful. - * - * Side effects: - * Arbitrary, depending on the contents of soar.tcl. - * - *-------------------------------------------------------------- - */ - -/* This code fragment tries to find "soar.tcl" using the $soar_library - environment variable. For some inane reason, I had to use [set - soar_library] rather than simple $soar_library to avoid getting - segfaults. Don't ask me why. I just work here. */ - -static char* readInitScriptCommand = -"if [file exists [file join [set soar_library] soar.tcl]] {\n\ - source [file join $soar_library soar.tcl]\n\ -} else {\n\ - puts \"Warning! can't find [file join $soar_library soar.tcl]; perhaps you need to\"\n\ - puts \"re-install Soar or set your SOAR_LIBRARY environment variable?\"\n\ -}"; - - -static int -Soar_ReadInitScript(Tcl_Interp *interp) -{ - return Tcl_GlobalEval(interp, readInitScriptCommand); -} - - - - - -/* - *-------------------------------------------------------------- - * * Soar_MakeRegisterEntry -- * * This procedure is called to create a new register @@ -442,6 +355,10 @@ } #endif +#ifdef USE_TCL_STUBS + if (! Tcl_InitStubs(interp, TCL_VERSION, 1)) + return TCL_ERROR; +#endif /* Tcl_Eval(interp, szBuffer); */ /* Export the Soar package */ @@ -478,12 +395,6 @@ Soar_MakeRegisterEntry(interp, new_agent); Tcl_CallWhenDeleted(interp, Soar_InterpDeleteProc, NULL); - - if (Soar_SetSoarLibrary(interp) != TCL_OK) - return TCL_ERROR; - - if (Soar_ReadInitScript(interp) != TCL_OK) - return TCL_ERROR; return TCL_OK; }