Index: configure.in
===================================================================
diff -u -r2111020b49da8ce57758e51accf0b6073037f0d2 -rf3b7952aabc9e4f9079febd1f5b7f5fb833fd50c
--- configure.in	(.../configure.in)	(revision 2111020b49da8ce57758e51accf0b6073037f0d2)
+++ configure.in	(.../configure.in)	(revision f3b7952aabc9e4f9079febd1f5b7f5fb833fd50c)
@@ -11,15 +11,15 @@
 # for this package, and can be a relative path, such as:
 #
 #--------------------------------------------------------------------
-define(XOTclVersion, 1.6.3)
-AC_INIT([xotcl], [XOTclVersion])
+define(NxVersion, 2.0.0)
+AC_INIT([nx], [NxVersion])
 
 #--------------------------------------------------------------------
 # Call TEA_INIT as the first TEA_ macro to set up initial vars.
 # This will define a ${TEA_PLATFORM} variable == "unix" or "windows".
 #--------------------------------------------------------------------
 
-TEA_INIT([3.5])
+TEA_INIT([3.7])
 AC_CONFIG_AUX_DIR(config)
 
 #--------------------------------------------------------------------
@@ -39,10 +39,10 @@
         [  --with-actiweb=yes|no,
            --without-actiweb disables actiweb components],
         [with_actiweb=$withval], [with_actiweb=no])
-AC_ARG_WITH(xotclsh,
-        [  --with-xotclsh=yes|no,
-	   --without-xotclsh disables built of xotclsh],
-        [with_xotclsh=$withval], [with_xotclsh=no])
+AC_ARG_WITH(nxsh,
+        [  --with-nxsh=yes|no,
+	   --without-nxsh disables built of nxsh],
+        [with_nxsh=$withval], [with_nxsh=no])
 AC_ARG_WITH(xowish,
         [  --with-xowish=yes|no,
 	   --without-xowish disables built of xowish],
@@ -51,19 +51,20 @@
         [  --with-all=yes|no,
 	   --without-all disables built of all],
         [with_all=$withval], [with_all=no])
-AC_ARG_WITH(all,
-        [  --with-all=yes|no,
-	   --without-all disables built of all],
-        [with_all=$withval], [with_all=no])
 AC_ARG_WITH(tclinclude, 
         [  --with-tclinclude       directory containing the public Tcl  header files.], 
          with_tclinclude=${withval})
+AC_ARG_WITH(expat,
+        [  --with-expat=sys assumes a system-wide expat installation, 
+           --with-expat=<INC_DIR,LIB_DIR> point to a custom expat installation,
+           --without-expat falls back to the bundled expat installation],
+        [with_expat=$withval],[with_expat=bundle])
 
 subdirs=""
 
 if test "$with_all" = yes; then
    with_actiweb=yes
-   with_xotclsh=yes
+   with_nxsh=yes
    with_xowish=yes
    with_gdbm=yes
 fi
@@ -73,23 +74,24 @@
    libdirs_actiweb="actiweb rdf registry store xml patterns"
    apps_actiweb="actiweb persistence"
    subdirs="$subdirs library/store/XOTclSdbm/"
-dnl    AC_CONFIG_SUBDIRS(library/store/XOTclSdbm/)
    if ! test "$with_gdbm" = no; then
        subdirs="$subdirs library/store/XOTclGdbm/"
-dnl       AC_CONFIG_SUBDIRS(library/store/XOTclGdbm/)
    fi
    subdirs="$subdirs library/xml/TclExpat-1.1/"
-dnl    AC_CONFIG_SUBDIRS(library/xml/TclExpat-1.1/)
 else
    test_actiweb=""
    libdirs_actiweb=""
    apps_actiweb=""
+   if ! test "${with_expat}" = bundle ; then
+      AC_MSG_RESULT([WARNING: expat configuration ${with_expat} ignored])
+      with_expat="bundle"
+   fi
 fi
 
 AC_SUBST(subdirs)
 
 if test "$with_tk" = no; then with_xowish="" ; fi
-if test "$with_xotclsh" = yes; then XOTCLSH="xotclsh" ; else XOTCLSH=""; fi
+if test "$with_nxsh" = yes; then NXSH="nxsh" ; else NXSH=""; fi
 if test "$with_xowish" = yes;  then XOWISH="xowish"   ; else XOWISH=""; fi
 
 
@@ -101,20 +103,21 @@
 # other systems.
 #--------------------------------------------------------------------
 
-# do not modify the following lines manually, they are generated with changeXOTclVersion
-XOTCL_MAJOR_VERSION=1
-XOTCL_MINOR_VERSION=6
-XOTCL_RELEASE_LEVEL=.3
+# do not modify the following lines manually, they are generated with 
+# the script changeXOTclVersion
+NX_MAJOR_VERSION=2
+NX_MINOR_VERSION=0
+NX_RELEASE_LEVEL=.0
 
-XOTCL_VERSION=${XOTCL_MAJOR_VERSION}.${XOTCL_MINOR_VERSION}
-NODOT_VERSION=${XOTCL_MAJOR_VERSION}${XOTCL_MINOR_VERSION}
+NX_VERSION=${NX_MAJOR_VERSION}.${NX_MINOR_VERSION}
+NODOT_VERSION=${NX_MAJOR_VERSION}${NX_MINOR_VERSION}
 
-AC_SUBST(XOTCL_VERSION)
-AC_SUBST(XOTCL_MAJOR_VERSION)
-AC_SUBST(XOTCL_MINOR_VERSION)
-AC_SUBST(XOTCL_RELEASE_LEVEL)
+AC_SUBST(NX_VERSION)
+AC_SUBST(NX_MAJOR_VERSION)
+AC_SUBST(NX_MINOR_VERSION)
+AC_SUBST(NX_RELEASE_LEVEL)
 
-echo "Configuring XOTcl Version $PACKAGE_VERSION"
+echo "Configuring next Version $PACKAGE_VERSION"
 
 #--------------------------------------------------------------------
 # Load the tclConfig.sh file
@@ -187,13 +190,13 @@
 
 
 TEA_ADD_SOURCES([xotcl.c xotclError.c xotclMetaData.c xotclObjectData.c xotclProfile.c \
-	xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c xotclStubInit.c])
-TEA_ADD_HEADERS([generic/xotcl.h generic/xotclInt.h generic/xotclDecls.h generic/xotclIntDecls.h])
+	xotclTrace.c xotclUtil.c xotclShadow.c xotclCompile.c aolstub.c nxStubInit.c])
+TEA_ADD_HEADERS([generic/xotcl.h generic/xotclInt.h generic/nxDecls.h generic/nxIntDecls.h])
 TEA_ADD_INCLUDES([])
 TEA_ADD_LIBS([])
-TEA_ADD_CFLAGS([-DXOTCLVERSION=\\\"$XOTCL_VERSION\\\" -DXOTCLPATCHLEVEL=\\\"$XOTCL_RELEASE_LEVEL\\\" \
+TEA_ADD_CFLAGS([-DNXVERSION=\\\"$NX_VERSION\\\" -DNXPATCHLEVEL=\\\"$NX_RELEASE_LEVEL\\\" \
 	$AOL_DEFINES $HAVE_TCL_COMPILE_H])
-TEA_ADD_STUB_SOURCES([xotclStubLib.c])
+TEA_ADD_STUB_SOURCES([nxStubLib.c])
 TEA_ADD_TCL_SOURCES([])
 
 
@@ -276,17 +279,17 @@
 
 TEA_CONFIG_CFLAGS
 
-# Without the following two eval statements, XOTCL_SHARED_LIB_SUFFIX 
+# Without the following two eval statements, NX_SHARED_LIB_SUFFIX 
 # in xotclConfig.sh has $PACKAGE_VERSION unresolved. When another
 # app links against xotcl, the PACKAGE_VERSIONs are confused.
 #
 # Without the first eval, we get
-#   XOTCL_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX}
-#   XOTCL_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a
+#   NX_SHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}${SHLIB_SUFFIX}
+#   NX_UNSHARED_LIB_SUFFIX=${PACKAGE_VERSION}\$\{DBGX\}.a
 #
 # after the first eval, we get
-#   XOTCL_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so
-#   XOTCL_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a
+#   NX_SHARED_LIB_SUFFIX=1.2.1${DBGX}.so
+#   NX_UNSHARED_LIB_SUFFIX=1.2.1${DBGX}.a
 # after the second eval, all variables are resolved.
 
 
@@ -338,8 +341,8 @@
 TEA_PROG_TCLSH
 
 # make this available, for such as xotclConfig.sh
-XOTCL_COMPATIBLE_TCLSH=${TCLSH_PROG}
-AC_SUBST(XOTCL_COMPATIBLE_TCLSH)
+NX_COMPATIBLE_TCLSH=${TCLSH_PROG}
+AC_SUBST(NX_COMPATIBLE_TCLSH)
 
 # resolve the variables
 eval "libdir=${libdir}"
@@ -363,65 +366,52 @@
 
 if test "${TEA_PLATFORM}" != "windows" ; then
 
-if test "${TEA_PLATFORM}" != "windows" ; then
+NX_BUILD_LIB_SPEC="-L`pwd` -lnext${PACKAGE_VERSION}"
+NX_LIB_SPEC="-L${pkglibdir} -lnext${PACKAGE_VERSION}"
 
-XOTCL_BUILD_LIB_SPEC="-L`pwd` -lxotcl${PACKAGE_VERSION}"
-XOTCL_LIB_SPEC="-L${pkglibdir} -lxotcl${PACKAGE_VERSION}"
-
 # stub libs are not build for 8.0
 if test "${TCL_MAJOR_VERSION}" = "8" -a "${TCL_MINOR_VERSION}" = "0"; then
-	XOTCL_BUILD_STUB_LIB_PATH=""
-	XOTCL_STUB_LIB_PATH=""
-	XOTCL_BUILD_STUB_LIB_SPEC=""
-	XOTCL_STUB_LIB_SPEC=""
+	NX_BUILD_STUB_LIB_PATH=""
+	NX_STUB_LIB_PATH=""
+	NX_BUILD_STUB_LIB_SPEC=""
+	NX_STUB_LIB_SPEC=""
 else
-	XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}"
-	XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}"
-	XOTCL_BUILD_STUB_LIB_SPEC="-L`pwd` -lxotclstub${PACKAGE_VERSION}"
-	XOTCL_STUB_LIB_SPEC="-L${pkglibdir} -lxotclstub${PACKAGE_VERSION}"
-	AC_DEFINE(COMPILE_XOTCL_STUBS)
+	NX_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}"
+	NX_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}"
+	NX_BUILD_STUB_LIB_SPEC="-L`pwd` -lnextstub${PACKAGE_VERSION}"
+	NX_STUB_LIB_SPEC="-L${pkglibdir} -lnextstub${PACKAGE_VERSION}"
+	AC_DEFINE(COMPILE_NX_STUBS)
 fi 
 
 else
 
-XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}"
-XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}"
-XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}"
-XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}"
-XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}"
-XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}"
+NX_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}"
+NX_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}"
+NX_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}"
+NX_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}"
+NX_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}"
+NX_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}"
 
 fi
 
-else
-
-XOTCL_BUILD_LIB_SPEC="`pwd`/${PKG_LIB_FILE}"
-XOTCL_LIB_SPEC="${pkglibdir}/${PKG_LIB_FILE}"
-XOTCL_BUILD_STUB_LIB_PATH="`pwd`/${PKG_STUB_LIB_FILE}"
-XOTCL_STUB_LIB_PATH="${pkglibdir}/${PKG_STUB_LIB_FILE}"
-XOTCL_BUILD_STUB_LIB_SPEC="`pwd`/${PKG_STUB_LIB_FILE}"
-XOTCL_STUB_LIB_SPEC="${pkglibdir}/${PKG_STUB_LIB_FILE}"
-
-fi
-
 AC_SUBST(SHARED_LIB_SUFFIX)
 AC_SUBST(UNSHARED_LIB_SUFFIX)
-AC_SUBST(XOTCL_BUILD_LIB_SPEC)
-AC_SUBST(XOTCL_LIB_SPEC)
-AC_SUBST(XOTCL_BUILD_STUB_LIB_SPEC)
-AC_SUBST(XOTCL_STUB_LIB_SPEC)
-AC_SUBST(XOTCL_BUILD_STUB_LIB_PATH)
-AC_SUBST(XOTCL_STUB_LIB_PATH)
-XOTCL_SRC_DIR=$srcdir
-AC_SUBST(XOTCL_SRC_DIR)
-AC_SUBST(XOTCLSH)
+AC_SUBST(NX_BUILD_LIB_SPEC)
+AC_SUBST(NX_LIB_SPEC)
+AC_SUBST(NX_BUILD_STUB_LIB_SPEC)
+AC_SUBST(NX_STUB_LIB_SPEC)
+AC_SUBST(NX_BUILD_STUB_LIB_PATH)
+AC_SUBST(NX_STUB_LIB_PATH)
+NX_SRC_DIR=$srcdir
+AC_SUBST(NX_SRC_DIR)
+AC_SUBST(NXSH)
 AC_SUBST(XOWISH)
 
 # include dir of xotcl during build process (i.e., does not assume installed)
-XOTCL_BUILD_INCLUDE_DIR="${XOTCL_SRC_DIR}/generic"
-XOTCL_BUILD_INCLUDE_SPEC="-I${XOTCL_BUILD_INCLUDE_DIR}"
-AC_SUBST(XOTCL_BUILD_INCLUDE_DIR)
-AC_SUBST(XOTCL_BUILD_INCLUDE_SPEC)
+NX_BUILD_INCLUDE_DIR="${NX_SRC_DIR}/generic"
+NX_BUILD_INCLUDE_SPEC="-I${NX_BUILD_INCLUDE_DIR}"
+AC_SUBST(NX_BUILD_INCLUDE_DIR)
+AC_SUBST(NX_BUILD_INCLUDE_SPEC)
 
 AC_SUBST(test_actiweb)
 AC_SUBST(libdirs_actiweb)
@@ -435,7 +425,7 @@
 dnl Change the value of -this- macro if you want to add or remove
 dnl such files.
 
-AC_DEFUN(CONFIG_OUTPUT_FILES, [[Makefile xotclConfig.sh apps/utils/xotclsh apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix]])
+AC_DEFUN(CONFIG_OUTPUT_FILES, [[Makefile xotclConfig.sh library/xotcl/apps/utils/xotclsh library/xotcl/apps/utils/xowish unix/xotcl.spec unix/pkgIndex.unix]])
 
 #--------------------------------------------------------------------
 # the value of this variable is set to the files which are to be
@@ -460,18 +450,22 @@
 
 AC_OUTPUT
 
+echo "==================== building genstubs (needed for Tcl 8.6)"
+make genstubs
+echo "==================== genstubs built"
+
 here=${PWD}
 
 for subdir in ${subdirs}
 do
-	echo "==================== configure $subdir ====================="
+	echo "==================== configure $subdir"
 	if test x"${srcdir}" = x. ; then
 		confdir=.
 	else
    		mkdir -p $subdir
 		confdir=${srcdir}/$subdir
 	fi
-    (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --with-xotcl=${here})
+    (cd $subdir; echo $SHELL ${confdir}/configure ${ac_configure_args} --prefix=${prefix} --with-xotcl=${here}; eval $SHELL ${confdir}/configure ${ac_configure_args} --prefix=${prefix} --with-xotcl=${here})
 done
 
 
@@ -518,3 +512,19 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+