You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by mx...@apache.org on 2014/08/06 00:58:48 UTC
svn commit: r1616041 [1/2] - in /tcl/rivet/trunk: ./ src/ src/apache-2/
src/experimental/ tclconfig/
Author: mxmanghi
Date: Tue Aug 5 22:58:47 2014
New Revision: 1616041
URL: http://svn.apache.org/r1616041
Log:
* src/apache-2/Makefile.am: build of mod_rivet moved again into the directory containing the code
* configure.ac: new symbol RIVET_SOURCE_BASE pointing to <rivet-root>/src/, various fixes,
generation of Makefile.in in both src/apache-2 and src/experimental
* src/Makefile.am: still keeping here the magic symbols triggering build of librivetparser and librivet
build of mod_rivet moved in src/apache-2 and experimental
* src/experimental/mod_rivet.c: dynamic object load implemented for rivet_mpm_worker. Code handling
Tcl threads moved to this new shared lib
* src/experimental/rivet_worker_mpm.c: this file keeps the whole mechanics of handling APR threads
running Tcl interpreters
* src/experimental/mod_rivet.h: new fields added to module globals for function pointers to
rivet_worker_mpm.so
* tclconfig/: new version of scripts
Added:
tcl/rivet/trunk/src/experimental/Makefile.am
tcl/rivet/trunk/src/experimental/rivet_worker_mpm.c
Modified:
tcl/rivet/trunk/ChangeLog
tcl/rivet/trunk/Makefile.in
tcl/rivet/trunk/configure.ac
tcl/rivet/trunk/src/Makefile.am
tcl/rivet/trunk/src/apache-2/Makefile.am
tcl/rivet/trunk/src/experimental/mod_rivet.c
tcl/rivet/trunk/src/experimental/mod_rivet.h
tcl/rivet/trunk/tclconfig/compile
tcl/rivet/trunk/tclconfig/config.guess
tcl/rivet/trunk/tclconfig/config.sub
tcl/rivet/trunk/tclconfig/depcomp
tcl/rivet/trunk/tclconfig/install-sh
tcl/rivet/trunk/tclconfig/ltmain.sh
tcl/rivet/trunk/tclconfig/missing
Modified: tcl/rivet/trunk/ChangeLog
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/ChangeLog?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/ChangeLog (original)
+++ tcl/rivet/trunk/ChangeLog Tue Aug 5 22:58:47 2014
@@ -1,3 +1,17 @@
+2014-08-05: Massimo Manghi <mx...@apache.org>
+ * src/apache-2/Makefile.am: build of mod_rivet moved again into the directory containing the code
+ * configure.ac: new symbol RIVET_SOURCE_BASE pointing to <rivet-root>/src/, various fixes,
+ generation of Makefile.in in both src/apache-2 and src/experimental
+ * src/Makefile.am: still keeping here the magic symbols triggering build of librivetparser and librivet
+ build of mod_rivet moved in src/apache-2 and experimental
+ * src/experimental/mod_rivet.c: dynamic object load implemented for rivet_mpm_worker. Code handling
+ Tcl threads moved to this new shared lib
+ * src/experimental/rivet_worker_mpm.c: this file keeps the whole mechanics of handling APR threads
+ running Tcl interpreters
+ * src/experimental/mod_rivet.h: new fields added to module globals for function pointers to
+ rivet_worker_mpm.so
+ * tclconfig/: new version of scripts
+
2014-08-04: Massimo Manghi <mx...@apache.org>
* src/common: renaming src/config to a more specific name
Modified: tcl/rivet/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/Makefile.in?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/Makefile.in (original)
+++ tcl/rivet/trunk/Makefile.in Tue Aug 5 22:58:47 2014
@@ -90,11 +90,12 @@ host_triplet = @host@
subdir = .
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
$(top_srcdir)/configure $(am__configure_deps) \
- $(srcdir)/config.h.in $(top_srcdir)/rivet/init.tcl.in \
- ChangeLog tclconfig/ChangeLog INSTALL README TODO \
- tclconfig/compile tclconfig/config.guess tclconfig/config.sub \
- tclconfig/depcomp tclconfig/install-sh tclconfig/missing \
- tclconfig/ltmain.sh $(top_srcdir)/tclconfig/compile \
+ $(srcdir)/config.h.in $(top_srcdir)/${rivet_core}/Makefile.in \
+ $(top_srcdir)/rivet/init.tcl.in ChangeLog tclconfig/ChangeLog \
+ INSTALL README TODO tclconfig/compile tclconfig/config.guess \
+ tclconfig/config.sub tclconfig/depcomp tclconfig/install-sh \
+ tclconfig/missing tclconfig/ltmain.sh \
+ $(top_srcdir)/tclconfig/compile \
$(top_srcdir)/tclconfig/config.guess \
$(top_srcdir)/tclconfig/config.sub \
$(top_srcdir)/tclconfig/install-sh \
@@ -113,7 +114,7 @@ am__CONFIG_DISTCLEAN_FILES = config.stat
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = rivet/init.tcl
+CONFIG_CLEAN_FILES = ${rivet_core}/Makefile rivet/init.tcl
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -311,6 +312,7 @@ PKG_TCL_SOURCES = @PKG_TCL_SOURCES@
RANLIB = @RANLIB@
RANLIB_STUB = @RANLIB_STUB@
RIVET_BASE_INCLUDE = @RIVET_BASE_INCLUDE@
+RIVET_SOURCE_BASE = @RIVET_SOURCE_BASE@
RIVET_TCL_TARGET = @RIVET_TCL_TARGET@
RIVET_UPLOAD_DIR = @RIVET_UPLOAD_DIR@
SED = @SED@
@@ -467,6 +469,8 @@ $(srcdir)/config.h.in: $(am__configure_
distclean-hdr:
-rm -f config.h stamp-h1
+${rivet_core}/Makefile: $(top_builddir)/config.status $(top_srcdir)/${rivet_core}/Makefile.in
+ cd $(top_builddir) && $(SHELL) ./config.status $@
rivet/init.tcl: $(top_builddir)/config.status $(top_srcdir)/rivet/init.tcl.in
cd $(top_builddir) && $(SHELL) ./config.status $@
Modified: tcl/rivet/trunk/configure.ac
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/configure.ac?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/configure.ac (original)
+++ tcl/rivet/trunk/configure.ac Tue Aug 5 22:58:47 2014
@@ -424,6 +424,8 @@ AC_DEFUN([APACHE_VERSION],[
# MOD_RIVET_CORE
#
+# Determining the path to the mod_rivet.* source files
+#
AC_DEFUN([MOD_RIVET_CORE],[
AC_ARG_WITH(
@@ -432,10 +434,16 @@ AC_DEFUN([MOD_RIVET_CORE],[
[with_rivet_core="apache-2"]
)
- rivet_core=${with_rivet_core}
AC_MSG_CHECKING(mod_rivet core)
+
+ if [[ -d "src/${with_rivet_core}" ]]; then
+ rivet_core=$(pwd)/src/${with_rivet_core}
+ else
+ rivet_core=${with_rivet_core}
+ fi
+ AC_CONFIG_FILES([${rivet_core}/Makefile])
AC_SUBST(rivet_core)
- AC_MSG_RESULT([$with_rivet_core])
+ AC_MSG_RESULT([$rivet_core])
])
#
@@ -462,6 +470,8 @@ AC_DEFUN([HANDLE_TCL_PACKAGE_PATH],[
AC_DEFUN([GET_RIVET_BASE], [
RIVET_BASE_INCLUDE=`pwd`/src
AC_SUBST(RIVET_BASE_INCLUDE)
+ RIVET_SOURCE_BASE=`pwd`/src
+ AC_SUBST(RIVET_SOURCE_BASE)
])
# APACHE_REQUEST
@@ -472,14 +482,14 @@ AC_DEFUN([GET_RIVET_BASE], [
AC_DEFUN([APACHE_REQUEST],[
AC_ARG_WITH(
apache_request,
- [ --with-apache-request[=dir] choose subdirectory for Apache request handling code],,
+ [ --with-apache-request[=dir] path to Apache request handling code],,
[with_apache_request="request"]
)
AC_MSG_CHECKING(code for request handling)
apache_request=${with_apache_request}
AC_SUBST(apache_request)
- AC_MSG_RESULT([$with_apache_request])
+ AC_MSG_RESULT([$apache_request])
])
# RIVET_CORE_CMDS
@@ -490,14 +500,14 @@ AC_DEFUN([APACHE_REQUEST],[
AC_DEFUN([RIVET_CORE_CMDS],[
AC_ARG_WITH(
rivet_core_cmds,
- [ --with-rivet-core-cmds[=dir] select directory for Rivet core commands core],,
+ [ --with-rivet-core-cmds[=dir] path to Rivet core commands code],,
[with_rivet_core_cmds="rivetcmds"]
)
AC_MSG_CHECKING(for Rivet core commands code)
rivet_core_cmds=${with_rivet_core_cmds}
AC_SUBST(rivet_core_cmds)
- AC_MSG_RESULT([$with_rivet_core_cmds])
+ AC_MSG_RESULT([$rivet_core_cmds])
])
@@ -514,18 +524,22 @@ AC_DEFUN([RIVET_CHANNEL],[
AC_MSG_CHECKING(for Rivet channel code path)
rivet_channel=${with_rivet_channel}
+
AC_SUBST(rivet_channel)
- AC_MSG_RESULT([$with_rivet_channel])
+ AC_MSG_RESULT([$rivet_channel])
])
+# RIVET_TCL_LIB
+#
+#
AC_DEFUN([RIVET_TCL_LIB],[
AC_ARG_WITH(
rivet_target_dir,
- [ --with-rivet-target-dir=DIR Rivet tcl library target dir ],,
+ [ --with-rivet-target-dir=DIR Rivet tcl and binary libraries target dir ],,
with_rivet_target_dir="${apache_base}/lib/rivet${PACKAGE_VERSION}"
)
- AC_MSG_CHECKING(for Rivet tcl library target)
+ AC_MSG_CHECKING(for Rivet libraries target)
RIVET_TCL_TARGET=${with_rivet_target_dir}
AC_SUBST(RIVET_TCL_TARGET)
AC_MSG_RESULT([$with_rivet_target_dir])
@@ -774,7 +788,7 @@ AC_SUBST(TCL_PACKAGE_PATH)
# You may alternatively have a special pkgIndex.tcl.in or other files
# which require substituting the AC variables in. Include these here.
#--------------------------------------------------------------------
-AC_CONFIG_FILES([Makefile src/Makefile rivet/init.tcl src/parser/Makefile doc/Makefile doc/convert_examples.tcl])
+AC_CONFIG_FILES([Makefile src/apache-2/Makefile src/experimental/Makefile src/Makefile rivet/init.tcl src/parser/Makefile doc/Makefile doc/convert_examples.tcl])
#case $apache_version_dir in
# apache-1) AC_CONFIG_FILES([Makefile src/Makefile src/apache-1/Makefile doc/Makefile]) ;;
Modified: tcl/rivet/trunk/src/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/Makefile.am?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/src/Makefile.am (original)
+++ tcl/rivet/trunk/src/Makefile.am Tue Aug 5 22:58:47 2014
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#SUBDIRS = librivet parser @apache_version_dir@
+SUBDIRS = @rivet_core@
lib_libexecdir = @RIVET_TCL_TARGET@
lib_libexec_LTLIBRARIES = librivetparser.la librivetlib.la
@@ -35,27 +35,6 @@ librivetlib_la_LDFLAGS = @TCL_STUB_LIB_S
librivetlib_la_LIBADD = @APXS_LIBS@
librivetlib_la_CPPFLAGS = -I@rivet_core@ -I@apache_request@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"' -DUSE_TCL_STUBS
-#
-# mod_rivet
-#
-apxs_libexecdir = @APXS_LIBEXECDIR@
-apxs_libexec_LTLIBRARIES = mod_rivet.la
-
-mod_rivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
-mod_rivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
-mod_rivet_la_CPPFLAGS = -I@rivet_core@ -I@rivet_channel@ -Icommon -Iparser -I@apache_request@ @apache_include@ -I@RIVET_BASE_INCLUDE@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
-
-mod_rivet_la_SOURCES = @apache_request@/apache_multipart_buffer.c \
- @apache_request@/apache_request.c \
- @rivet_core@/mod_rivet.c \
- @rivet_core_cmds@/rivetCore.c \
- @rivet_core_cmds@/rivetInspect.c \
- @rivet_channel@/rivetChannel.c \
- common/TclWebapache.c \
- common/apache_config.c \
- common/mod_rivet_common.c \
- parser/rivetParser.c
-
# Removing libtool .la files from installation
install-data-hook:
Modified: tcl/rivet/trunk/src/apache-2/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/apache-2/Makefile.am?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/src/apache-2/Makefile.am (original)
+++ tcl/rivet/trunk/src/apache-2/Makefile.am Tue Aug 5 22:58:47 2014
@@ -14,44 +14,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-#AUTOMAKE_OPTIONS = subdir-objects
-
-## AM_CFLAGS = @TCL_INCLUDES@ @GM_CPPFLAGS@
-
-## The weird and wild magic of auto* associates these two.
-#apxs_libexecdir = @APXS_LIBEXECDIR@
-#apxs_libexec_LTLIBRARIES = mod_rivet.la
-
-#AM_CPPFLAGS =
-
-## ... and these two. We want to put the libs in the package path,
-## rather than the standard library location for the system.
-###lib_libexecdir = @TCL_PACKAGE_PATH@/rivet
-###lib_libexec_LTLIBRARIES = librivet.la librivetparser.la
-
-##
-## Apache Rivet Module, mod_rivet.so / mod_rivet.dll
-##
-#mod_rivet_la_SOURCES = \
-# apache_multipart_buffer.c \
-# apache_request.c \
-# mod_rivet.c \
-# TclWebapache.c \
-# ../rivetcmds/rivetCore.c \
-# ../rivetcmds/rivetInspect.c \
-# ../rivetChannel.c \
-# ../parser/rivetParser.c
-
-###mod_rivet_la_SOURCES = mod_rivet.c mod_rivet.h
-
-#mod_rivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
-#mod_rivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
-#mod_rivet_la_CPPFLAGS = @apache_include@ -I@RIVET_BASE_INCLUDE@ -I../parser @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
-
-# APXS_CPPFLAGS_SHLIB
-
-## Removing libtool .la files from installation
#
-#install-data-hook:
-# echo 'removing unwanted libtool .la files'
-# rm -f $(DESTDIR)/$(apxs_libexecdir)/*.la
+# mod_rivet
+#
+apxs_libexecdir = @APXS_LIBEXECDIR@
+apxs_libexec_LTLIBRARIES = mod_rivet.la
+
+mod_rivet_la_SOURCES = mod_rivet.c \
+ ../@apache_request@/apache_multipart_buffer.c \
+ ../@apache_request@/apache_request.c \
+ ../@rivet_core_cmds@/rivetCore.c \
+ ../@rivet_core_cmds@/rivetInspect.c \
+ ../@rivet_channel@/rivetChannel.c \
+ ../common/TclWebapache.c \
+ ../common/apache_config.c \
+ ../common/mod_rivet_common.c \
+ ../parser/rivetParser.c
+
+mod_rivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
+mod_rivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
+mod_rivet_la_CPPFLAGS = -I@rivet_core@ -I@rivet_channel@ -I@RIVET_BASE_INCLUDE@/common -I@RIVET_BASE_INCLUDE@/parser -I@apache_request@ @apache_include@ -I@RIVET_BASE_INCLUDE@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
Added: tcl/rivet/trunk/src/experimental/Makefile.am
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/experimental/Makefile.am?rev=1616041&view=auto
==============================================================================
--- tcl/rivet/trunk/src/experimental/Makefile.am (added)
+++ tcl/rivet/trunk/src/experimental/Makefile.am Tue Aug 5 22:58:47 2014
@@ -0,0 +1,32 @@
+#
+# mod_rivet
+#
+
+# The weird and wild magic of auto* associates these two.
+
+apxs_libexecdir = @APXS_LIBEXECDIR@
+apxs_libexec_LTLIBRARIES = mod_rivet.la
+
+mod_rivet_la_SOURCES = mod_rivet.c \
+ ../@apache_request@/apache_multipart_buffer.c \
+ ../@apache_request@/apache_request.c \
+ ../@rivet_core_cmds@/rivetCore.c \
+ ../@rivet_core_cmds@/rivetInspect.c \
+ ../@rivet_channel@/rivetChannel.c \
+ ../common/TclWebapache.c \
+ ../common/apache_config.c \
+ ../common/mod_rivet_common.c \
+ ../parser/rivetParser.c
+
+mod_rivet_la_LDFLAGS = @TCL_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version
+mod_rivet_la_LIBADD = @TCL_LIBS@ @APXS_LIBS@
+mod_rivet_la_CPPFLAGS = -I@rivet_core@ -I@rivet_channel@ -I@RIVET_BASE_INCLUDE@/common -I@RIVET_BASE_INCLUDE@/parser -I../@apache_request@ @apache_include@ -I@RIVET_BASE_INCLUDE@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -DSTART_TAG='"<?"' -DEND_TAG='"?>"'
+
+lib_libexecdir = @RIVET_TCL_TARGET@
+lib_libexec_LTLIBRARIES = rivet_worker_mpm.la
+
+rivet_worker_mpm_la_SOURCES = rivet_worker_mpm.c
+rivet_worker_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version
+rivet_worker_mpm_la_LIBADD = @APXS_LIBS@
+rivet_worker_mpm_la_CPPFLAGS = @apache_include@ -I@rivet_core@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -I../@apache_request@ -I@RIVET_BASE_INCLUDE@/common -I@RIVET_BASE_INCLUDE@
+
Modified: tcl/rivet/trunk/src/experimental/mod_rivet.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/experimental/mod_rivet.c?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/src/experimental/mod_rivet.c (original)
+++ tcl/rivet/trunk/src/experimental/mod_rivet.c Tue Aug 5 22:58:47 2014
@@ -1,3 +1,21 @@
+/* mod_rivet.c -- The apache module itself, for Apache 2.4. */
+
+/* Copyright 2000-2005 The Apache Software Foundation
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+
+/* $Id: mod_rivet.h 1609472 2014-07-10 15:08:52Z mxmanghi $ */
#include "httpd.h"
#include "http_config.h"
@@ -18,12 +36,6 @@
#include "mod_rivet.h"
#include "rivetChannel.h"
-#define RIVET_TEMPLATE_CTYPE "application/x-httpd-rivet"
-#define RIVET_TCLFILE_CTYPE "application/x-rivet-tcl"
-#define MODNAME "mod_rivet"
-#define MOD_RIVET_QUEUE_SIZE 100
-#define TCL_MAX_CHANNEL_BUFFER_SIZE (1024*1024)
-
mod_rivet_globals module_globals;
rivet_server_conf rsc;
rivet_interp_globals interp_globals;
@@ -32,14 +44,62 @@ extern Tcl_ChannelType RivetChan;
apr_threadkey_t* rivet_thread_key;
apr_threadkey_t* handler_thread_key;
+#define ERRORBUF_SZ 256
+
static int
RivetServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s)
{
+ apr_status_t aprrv;
+ char errorbuf[ERRORBUF_SZ];
+
ap_add_version_component(pPool, "Rivet/Experimental/"__DATE__"/"__TIME__"/");
+
+ aprrv = apr_dso_load(&module_globals.dso_handle,"/home/manghi/Projects/rivet/src/experimental/.libs/rivet_worker_mpm.so",pPool);
+ if (aprrv == APR_SUCCESS)
+ {
+ apr_status_t rv;
+ apr_dso_handle_sym_t func = NULL;
+
+ rv = apr_dso_sym(&func,module_globals.dso_handle,"Rivet_MPM_Init");
+ if (rv == APR_SUCCESS)
+ {
+ module_globals.mpm_init = (int (*)(apr_pool_t*,server_rec*)) func;
+ }
+ else
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
+ MODNAME " Error loading symbol Rivet_MPM_Init: %s",
+ apr_dso_error(module_globals.dso_handle,errorbuf,ERRORBUF_SZ));
+ }
+
+ rv = apr_dso_sym(&func,module_globals.dso_handle,"Rivet_MPM_Request");
+ if (rv == APR_SUCCESS)
+ {
+ module_globals.mpm_request = (int (*)(request_rec*)) func;
+ }
+ else
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
+ MODNAME " Error loading symbol Rivet_MPM_Request: %s",
+ apr_dso_error(module_globals.dso_handle,errorbuf,ERRORBUF_SZ));
+ }
+
+
+ }
+ else
+ {
+
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
+ MODNAME " Error loading MPM manager: %s",
+ apr_dso_error(module_globals.dso_handle,errorbuf,1024));
+
+ return 1;
+ }
+
return OK;
}
-static int RivetContent (rivet_thread_private* private)
+int RivetContent (rivet_thread_private* private)
{
Tcl_Interp* interp = private->interp;
request_rec* r = private->r;
@@ -70,8 +130,7 @@ static int RivetContent (rivet_thread_pr
if (apr_stat(fileinfo, r->filename, APR_FINFO_SIZE | APR_FINFO_CSIZE ,r->pool) != APR_SUCCESS)
{
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_EGENERAL, r->server,
- MODNAME ": couldn't get info on %s",
- r->filename);
+ MODNAME ": couldn't get info on %s", r->filename);
return HTTP_INTERNAL_SERVER_ERROR;
}
@@ -90,7 +149,11 @@ static int RivetContent (rivet_thread_pr
if (r->header_only) return OK;
//if (r->args == 0) return OK;
- /* */
+ /*
+ * I take this call from the current mod_rivet code, but I'm not sure if it's
+ * necessary in this context
+ */
+
Tcl_Preserve(interp);
script = Tcl_NewStringObj(script_buf,bytes_read);
@@ -107,364 +170,19 @@ static int RivetContent (rivet_thread_pr
TclWeb_PrintHeaders(private->req);
Tcl_Flush(*(private->channel));
Tcl_Release(interp);
-
- // Tcl_DecrRefCount(script);
+ Tcl_DecrRefCount(script);
return OK;
}
-void tcl_exit_handler (ClientData data)
-{
- apr_threadkey_t* thread_key = (apr_threadkey_t *) data;
- rivet_thread_private* private;
-
- if (apr_threadkey_private_get ((void **)&private,thread_key) != APR_SUCCESS)
- {
- return;
- }
-
- private->keep_going = 0;
- apr_threadkey_private_set (private,rivet_thread_key);
-
-}
-
-static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data)
-{
- Tcl_Interp* interp;
- rivet_thread_private* private;
- Tcl_Channel *outchannel; /* stuff for buffering output */
- apr_threadkey_t* thread_key = (apr_threadkey_t *) data;
-
- if (apr_threadkey_private_get ((void **)&private,thread_key) != APR_SUCCESS)
- {
- return NULL;
- }
- else
- {
-
- if (private == NULL)
- {
- apr_thread_mutex_lock(module_globals.pool_mutex);
-
- private = apr_palloc (module_globals.pool,sizeof(*private));
- private->channel = apr_pcalloc (module_globals.pool, sizeof(Tcl_Channel));
- private->req_cnt = 0;
- private->keep_going = 2;
- apr_thread_mutex_unlock(module_globals.pool_mutex);
- }
-
- }
-
- interp = Tcl_CreateInterp();
- if (Tcl_Init(interp) == TCL_ERROR)
- {
- return NULL;
- }
- private->interp = interp;
-
- outchannel = private->channel;
- *outchannel = Tcl_CreateChannel(&RivetChan, "apacheout", rivet_thread_key, TCL_WRITABLE);
-
- /* The channel we have just created replaces Tcl's stdout */
-
- Tcl_SetStdChannel (*outchannel, TCL_STDOUT);
-
- /* Set the output buffer size to the largest allowed value, so that we
- * won't send any result packets to the browser unless the Rivet
- * programmer does a "flush stdout" or the page is completed.
- */
-
- Tcl_SetChannelBufferSize (*outchannel, TCL_MAX_CHANNEL_BUFFER_SIZE);
- private->status = idle;
- apr_threadkey_private_set (private,rivet_thread_key);
- do
- {
- apr_status_t rv;
- void* v;
- apr_queue_t* q = module_globals.queue;
- handler_private* request_obj;
-
- do {
-
- rv = apr_queue_pop(q, &v);
-
- } while (rv == APR_EINTR);
-
- if (rv != APR_SUCCESS) {
-
- if (rv == APR_EOF) {
- fprintf(stderr, "request_processor: queue terminated APR_EOF\n");
- rv=APR_SUCCESS;
- }
- else
- {
- fprintf(stderr, "consumer thread exit rv %d\n", rv);
- }
- apr_thread_exit(thd, rv);
- return NULL;
-
- }
-
- request_obj = (handler_private *) v;
- if (request_obj->job_type == orderly_exit)
- {
- ap_log_error(APLOG_MARK, APLOG_INFO, APR_EGENERAL, module_globals.server, "consumer thread exit");
- apr_thread_exit(thd, rv);
- return NULL;
- }
-
- TclWeb_InitRequest(request_obj->req, private->interp, request_obj->r);
-
- private->r = request_obj->r;
- private->req = request_obj->req;
-
- request_obj->code = RivetContent (private);
-
- apr_thread_mutex_lock(request_obj->mutex);
- request_obj->status = done;
- apr_thread_cond_signal(request_obj->cond);
- apr_thread_mutex_unlock(request_obj->mutex);
-
- apr_threadkey_private_set (private,rivet_thread_key);
- private->req_cnt++;
- } while (private->keep_going-- > 0);
-
- apr_thread_mutex_lock(module_globals.job_mutex);
- *(apr_thread_t **) apr_array_push(module_globals.exiting) = thd;
- apr_thread_cond_signal(module_globals.job_cond);
- apr_thread_mutex_unlock(module_globals.job_mutex);
-
- //ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, s, MODNAME ": thread %lp exits", thd);
- return NULL;
-}
-
-static apr_status_t create_worker_thread (apr_thread_t** thd)
+static void RivetChildInit (apr_pool_t *pChild, server_rec *s)
{
- return apr_thread_create(thd, NULL, request_processor, module_globals.queue, module_globals.pool);
-
-}
-
-static void start_thread_pool (int nthreads)
-{
- int i;
-
- for (i = 0; i < nthreads; i++)
- {
- apr_status_t rv;
-
- rv = create_worker_thread( &module_globals.workers[i]);
-
- if (rv != APR_SUCCESS) {
- char errorbuf[512];
-
- apr_strerror(rv, errorbuf,200);
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals.server,
- "Error starting request_processor thread (%d) rv=%d:%s\n",i,rv,errorbuf);
- exit(1);
-
- }
- }
-}
-
-static void* APR_THREAD_FUNC supervisor_thread(apr_thread_t *thd, void *data)
-{
- server_rec* s = (server_rec *)data;
- //handler_private* private;
- //apr_status_t rv;
-
- start_thread_pool(TCL_INTERPS);
- while (1)
- {
- apr_thread_t* p;
-
- apr_thread_mutex_lock(module_globals.job_mutex);
- while (apr_is_empty_array(module_globals.exiting))
- {
- apr_thread_cond_wait(module_globals.job_cond,module_globals.job_mutex);
- }
-
- while (!apr_is_empty_array(module_globals.exiting))
- {
- int i;
- p = *(apr_thread_t **)apr_array_pop(module_globals.exiting);
-
- for (i = 0; i < TCL_INTERPS; i++)
- {
- if (p == module_globals.workers[i])
- {
- apr_status_t rv;
-
- ap_log_error(APLOG_MARK,APLOG_INFO,0,s,"thread %d notifies orderly exit",i);
-
- /* terminated thread restart */
-
- rv = create_worker_thread (&module_globals.workers[i]);
- if (rv != APR_SUCCESS) {
- char errorbuf[512];
-
- apr_strerror(rv, errorbuf,200);
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals.server,
- "Error starting request_processor thread (%d) rv=%d:%s\n",i,rv,errorbuf);
- exit(1);
-
- }
-
- break;
- }
- }
- }
- apr_thread_mutex_unlock(module_globals.job_mutex);
- }
-
- /*
- apr_thread_mutex_lock(module_globals.pool_mutex);
- private = apr_palloc(module_globals.pool,sizeof(handler_private));
- private->job_type=orderly_exit;
- apr_thread_mutex_unlock(module_globals.pool_mutex);
- while (1)
- {
-
- int i;
- apr_sleep(10000000);
-
- ap_log_error(APLOG_MARK, APLOG_INFO, APR_EGENERAL, s, "restarting worker threads");
-
- for (i = 0; i < TCL_INTERPS; i++)
- {
- rv = apr_queue_push(module_globals.queue,private);
- if (rv != APR_SUCCESS)
- {
- apr_sleep(100000);
- }
- }
-
- for (i = 0; i < TCL_INTERPS; i++)
- {
- apr_status_t rv;
-
- rv = create_worker_thread (&module_globals.workers[i]);
- if (rv != APR_SUCCESS) {
- char errorbuf[512];
-
- apr_strerror(rv, errorbuf,200);
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
- "Error starting request_processor thread (%d) rv=%d:%s\n",i,rv,errorbuf);
- exit(1);
-
- }
- }
-
- }
-
- */
- return NULL;
-}
-
-static void processor_cleanup (void *data)
-{
- rivet_thread_private* private = (rivet_thread_private *) data;
-
- Tcl_UnregisterChannel(private->interp,*private->channel);
- Tcl_DeleteInterp(private->interp);
-
- ap_log_error(APLOG_MARK, APLOG_INFO, 0, module_globals.server,
- "Thread exiting after %d requests served", private->req_cnt);
-}
-
-static void
-RivetChildInit (apr_pool_t *pChild, server_rec *s)
-{
- apr_status_t rv;
-
- apr_thread_mutex_create(&module_globals.job_mutex, APR_THREAD_MUTEX_UNNESTED, pChild);
- apr_thread_cond_create(&module_globals.job_cond, pChild);
- module_globals.exiting = apr_array_make(pChild,100,sizeof(apr_thread_t*));
-
- apr_thread_mutex_create(&module_globals.pool_mutex, APR_THREAD_MUTEX_UNNESTED, pChild);
- apr_threadkey_private_create (&rivet_thread_key, processor_cleanup, pChild);
- apr_threadkey_private_create (&handler_thread_key, NULL, pChild);
- module_globals.server = s;
-
- apr_thread_mutex_lock(module_globals.pool_mutex);
- if (apr_pool_create(&module_globals.pool, NULL) != APR_SUCCESS)
- {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
- MODNAME ": could not initialize mod_rivet private pool");
- exit(1);
- }
- apr_thread_mutex_unlock(module_globals.pool_mutex);
-
- if (apr_queue_create(&module_globals.queue, MOD_RIVET_QUEUE_SIZE, module_globals.pool) != APR_SUCCESS)
- {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s,
- MODNAME ": could not initialize mod_rivet request queue");
- exit(1);
- }
-
- rv = apr_thread_create( &module_globals.supervisor, NULL,
- supervisor_thread, s, module_globals.pool);
-
- if (rv != APR_SUCCESS) {
- char errorbuf[512];
-
- apr_strerror(rv, errorbuf,200);
- fprintf(stderr, "Error starting supervisor thread rv=%d:%s\n",rv,errorbuf);
- exit(1);
-
- }
-
- Tcl_CreateExitHandler(tcl_exit_handler,(ClientData)rivet_thread_key);
+ (*module_globals.mpm_init)(pChild,s);
+// Tcl_CreateExitHandler(tcl_exit_handler,(ClientData)rivet_thread_key);
}
static int RivetHandler(request_rec *r)
{
- handler_private* private;
- apr_status_t rv;
-
- if (apr_threadkey_private_get ((void **)&private,handler_thread_key) != APR_SUCCESS)
- {
- ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server,
- MODNAME ": cannot get private data for processor thread");
- exit(1);
-
- } else {
-
- if (private == NULL)
- {
- apr_thread_mutex_lock(module_globals.pool_mutex);
- private = apr_palloc(module_globals.pool,sizeof(handler_private));
- private->req = TclWeb_NewRequestObject (module_globals.pool);
- apr_thread_cond_create(&(private->cond), module_globals.pool);
- apr_thread_mutex_create(&(private->mutex), APR_THREAD_MUTEX_UNNESTED, module_globals.pool);
- apr_thread_mutex_unlock(module_globals.pool_mutex);
- private->job_type = request;
- }
-
- }
-
- private->r = r;
- private->code = OK;
- private->status = init;
- apr_threadkey_private_set (private,handler_thread_key);
-
- do
- {
-
- rv = apr_queue_push(module_globals.queue,private);
- if (rv != APR_SUCCESS)
- {
- apr_sleep(100000);
- }
-
- } while (rv != APR_SUCCESS);
-
- apr_thread_mutex_lock(private->mutex);
- while (private->status != done)
- {
- apr_thread_cond_wait(private->cond,private->mutex);
- }
- apr_thread_mutex_unlock(private->mutex);
-
- return private->code;
+ return (*module_globals.mpm_request)(r);
}
static void rivet_register_hooks(apr_pool_t *p)
Modified: tcl/rivet/trunk/src/experimental/mod_rivet.h
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/experimental/mod_rivet.h?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/src/experimental/mod_rivet.h (original)
+++ tcl/rivet/trunk/src/experimental/mod_rivet.h Tue Aug 5 22:58:47 2014
@@ -1,4 +1,4 @@
-/* mod_rivet.h -- The apache module itself, for Apache 2.x. */
+/* mod_rivet.h -- The apache module itself, for Apache 2.4. */
/* Copyright 2000-2005 The Apache Software Foundation
@@ -100,9 +100,9 @@ typedef struct _rivet_server_conf {
apr_table_t* rivet_server_vars;
apr_table_t* rivet_dir_vars;
apr_table_t* rivet_user_vars;
- char** objCacheList; /* Array of cached objects (for priority handling) */
- Tcl_HashTable* objCache; /* Objects cache - the key is the script name */
- Tcl_Channel* outchannel; /* stuff for buffering output */
+ char** objCacheList; /* Array of cached objects (for priority handling) */
+ Tcl_HashTable* objCache; /* Objects cache - the key is the script name */
+ Tcl_Channel* outchannel; /* stuff for buffering output */
} rivet_server_conf;
/* eventually we will transfer 'global' variables in here and 'de-globalize' them */
@@ -112,43 +112,57 @@ typedef struct _rivet_interp_globals {
TclWebRequest *req; /* TclWeb API request */
Tcl_Namespace *rivet_ns; /* Rivet commands namespace */
int page_aborting; /* set by abort_page. */
- Tcl_Obj* abort_code; /* To be reset by Rivet_SendContent */
+ Tcl_Obj* abort_code; /* To be reset by Rivet_SendContent */
server_rec* srec; /* pointer to the current server rec obj */
} rivet_interp_globals;
-/*
- * we need also a place where to store module wide globals
- */
-
#define TCL_INTERPS 4
typedef int rivet_thr_status;
+enum
+{
+ init,
+ idle,
+ request_processing,
+ done
+};
+
+/* Job types a worker thread is supposed to respond to */
+
typedef int rivet_job_t;
+enum {
+ request,
+ orderly_exit
+};
+
+/* we need also a place where to store module wide globals */
typedef struct _mod_rivet_globals {
+ apr_dso_handle_t* dso_handle;
+ apr_thread_t* supervisor;
apr_thread_cond_t* job_cond;
apr_thread_mutex_t* job_mutex;
- apr_array_header_t* exiting;
- apr_thread_mutex_t* pool_mutex;
- apr_queue_t* queue;
- apr_pool_t* pool;
- int busy_cnt;
- apr_thread_t* workers[TCL_INTERPS];
- apr_thread_t* supervisor;
- server_rec* server;
+ apr_array_header_t* exiting; /* */
+ apr_thread_mutex_t* pool_mutex; /* threads commmon pool mutex */
+ apr_pool_t* pool; /* threads common memory pool */
+ apr_queue_t* queue; /* jobs queue */
+ apr_thread_t* workers[TCL_INTERPS]; /* thread pool ids */
+ server_rec* server; /* default host server_rec obj */
+ int (*mpm_init)(apr_pool_t* pPool,server_rec* s);
+ int (*mpm_request)(request_rec*);
+ void (*mpm_finalize)(void);
} mod_rivet_globals;
typedef struct _thread_worker_private {
Tcl_Interp* interp;
Tcl_Channel* channel;
- rivet_thr_status status;
/* the request_rec and TclWebRequest
are copied here to be passed to a
channel */
- request_rec* r; /* request rec */
+ request_rec* r;
TclWebRequest* req;
- int req_cnt;
- int keep_going;
+ int req_cnt; /* requests served by thread */
+ int keep_going; /* thread loop controlling variable */
} rivet_thread_private;
@@ -156,28 +170,15 @@ typedef struct _thread_worker_private {
typedef struct _handler_private
{
+ rivet_job_t job_type;
apr_thread_cond_t* cond;
apr_thread_mutex_t* mutex;
request_rec* r; /* request rec */
TclWebRequest* req;
int code;
int status;
- rivet_job_t job_type;
} handler_private;
-enum {
- request,
- orderly_exit
-};
-
-enum
-{
- init,
- idle,
- request_processing,
- done
-};
-
rivet_server_conf *Rivet_GetConf(request_rec *r);
#ifdef ap_get_module_config
@@ -217,8 +218,14 @@ EXTERN int Rivet_ExecuteAndCheck (Tcl_In
EXTERN int Rivet_ParseExecFile (TclWebRequest *req, char *filename, int toplevel);
EXTERN int Rivet_ParseExecString (TclWebRequest* req, Tcl_Obj* inbuf);
+EXTERN int RivetContent (rivet_thread_private* private);
/* error code set by command 'abort_page' */
#define ABORTPAGE_CODE "ABORTPAGE"
+#define MOD_RIVET_QUEUE_SIZE 100
+#define TCL_MAX_CHANNEL_BUFFER_SIZE (1024*1024)
+
+#define MODNAME "mod_rivet"
+
#endif /* MOD_RIVET_H */
Added: tcl/rivet/trunk/src/experimental/rivet_worker_mpm.c
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/src/experimental/rivet_worker_mpm.c?rev=1616041&view=auto
==============================================================================
--- tcl/rivet/trunk/src/experimental/rivet_worker_mpm.c (added)
+++ tcl/rivet/trunk/src/experimental/rivet_worker_mpm.c Tue Aug 5 22:58:47 2014
@@ -0,0 +1,309 @@
+
+#include "mod_rivet.h"
+#include "httpd.h"
+#include "rivetChannel.h"
+
+extern mod_rivet_globals module_globals;
+extern apr_threadkey_t* rivet_thread_key;
+extern apr_threadkey_t* handler_thread_key;
+
+static void processor_cleanup (void *data)
+{
+ rivet_thread_private* private = (rivet_thread_private *) data;
+
+ Tcl_UnregisterChannel(private->interp,*private->channel);
+ Tcl_DeleteInterp(private->interp);
+
+ ap_log_error(APLOG_MARK, APLOG_INFO, 0, module_globals.server,
+ "Thread exiting after %d requests served", private->req_cnt);
+}
+
+static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data)
+{
+ Tcl_Interp* interp;
+ rivet_thread_private* private;
+ Tcl_Channel *outchannel; /* stuff for buffering output */
+ apr_threadkey_t* thread_key = (apr_threadkey_t *) data;
+
+ if (apr_threadkey_private_get ((void **)&private,thread_key) != APR_SUCCESS)
+ {
+ return NULL;
+ }
+ else
+ {
+
+ if (private == NULL)
+ {
+ apr_thread_mutex_lock(module_globals.pool_mutex);
+
+ private = apr_palloc (module_globals.pool,sizeof(*private));
+ private->channel = apr_pcalloc (module_globals.pool, sizeof(Tcl_Channel));
+ private->req_cnt = 0;
+ private->keep_going = 2;
+ apr_thread_mutex_unlock(module_globals.pool_mutex);
+ }
+
+ }
+
+ interp = Tcl_CreateInterp();
+ if (Tcl_Init(interp) == TCL_ERROR)
+ {
+ return NULL;
+ }
+ private->interp = interp;
+
+ outchannel = private->channel;
+ *outchannel = Tcl_CreateChannel(&RivetChan, "apacheout", rivet_thread_key, TCL_WRITABLE);
+
+ /* The channel we have just created replaces Tcl's stdout */
+
+ Tcl_SetStdChannel (*outchannel, TCL_STDOUT);
+
+ /* Set the output buffer size to the largest allowed value, so that we
+ * won't send any result packets to the browser unless the Rivet
+ * programmer does a "flush stdout" or the page is completed.
+ */
+
+ Tcl_SetChannelBufferSize (*outchannel, TCL_MAX_CHANNEL_BUFFER_SIZE);
+ apr_threadkey_private_set (private,rivet_thread_key);
+ do
+ {
+ apr_status_t rv;
+ void* v;
+ apr_queue_t* q = module_globals.queue;
+ handler_private* request_obj;
+
+ do {
+
+ rv = apr_queue_pop(q, &v);
+
+ } while (rv == APR_EINTR);
+
+ if (rv != APR_SUCCESS) {
+
+ if (rv == APR_EOF) {
+ fprintf(stderr, "request_processor: queue terminated APR_EOF\n");
+ rv=APR_SUCCESS;
+ }
+ else
+ {
+ fprintf(stderr, "consumer thread exit rv %d\n", rv);
+ }
+ apr_thread_exit(thd, rv);
+ return NULL;
+
+ }
+
+ request_obj = (handler_private *) v;
+ if (request_obj->job_type == orderly_exit)
+ {
+ ap_log_error(APLOG_MARK, APLOG_INFO, APR_EGENERAL, module_globals.server, "consumer thread exit");
+ apr_thread_exit(thd, rv);
+ return NULL;
+ }
+
+ TclWeb_InitRequest(request_obj->req, private->interp, request_obj->r);
+
+ private->r = request_obj->r;
+ private->req = request_obj->req;
+
+ request_obj->code = RivetContent (private);
+
+ apr_thread_mutex_lock(request_obj->mutex);
+ request_obj->status = done;
+ apr_thread_cond_signal(request_obj->cond);
+ apr_thread_mutex_unlock(request_obj->mutex);
+
+ apr_threadkey_private_set (private,rivet_thread_key);
+ private->req_cnt++;
+
+ } while (private->keep_going-- > 0);
+
+ apr_thread_mutex_lock(module_globals.job_mutex);
+ *(apr_thread_t **) apr_array_push(module_globals.exiting) = thd;
+ apr_thread_cond_signal(module_globals.job_cond);
+ apr_thread_mutex_unlock(module_globals.job_mutex);
+
+ //ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_EGENERAL, s, MODNAME ": thread %lp exits", thd);
+
+ apr_thread_exit(thd,APR_SUCCESS);
+ return NULL;
+}
+
+static apr_status_t create_worker_thread (apr_thread_t** thd)
+{
+ return apr_thread_create(thd, NULL, request_processor, module_globals.queue, module_globals.pool);
+}
+
+static void start_thread_pool (int nthreads)
+{
+ int i;
+
+ for (i = 0; i < nthreads; i++)
+ {
+ apr_status_t rv;
+
+ rv = create_worker_thread( &module_globals.workers[i]);
+
+ if (rv != APR_SUCCESS) {
+ char errorbuf[512];
+
+ apr_strerror(rv, errorbuf,200);
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals.server,
+ "Error starting request_processor thread (%d) rv=%d:%s\n",i,rv,errorbuf);
+ exit(1);
+
+ }
+ }
+}
+
+static void* APR_THREAD_FUNC supervisor_thread(apr_thread_t *thd, void *data)
+{
+ server_rec* s = (server_rec *)data;
+
+ start_thread_pool(TCL_INTERPS);
+ while (1)
+ {
+ apr_thread_t* p;
+
+ apr_thread_mutex_lock(module_globals.job_mutex);
+ while (apr_is_empty_array(module_globals.exiting))
+ {
+ apr_thread_cond_wait(module_globals.job_cond,module_globals.job_mutex);
+ }
+
+ while (!apr_is_empty_array(module_globals.exiting))
+ {
+ int i;
+ p = *(apr_thread_t **)apr_array_pop(module_globals.exiting);
+
+ for (i = 0; i < TCL_INTERPS; i++)
+ {
+ if (p == module_globals.workers[i])
+ {
+ apr_status_t rv;
+
+ ap_log_error(APLOG_MARK,APLOG_INFO,0,s,"thread %d notifies orderly exit",i);
+
+ /* terminated thread restart */
+
+ rv = create_worker_thread (&module_globals.workers[i]);
+ if (rv != APR_SUCCESS) {
+ char errorbuf[512];
+
+ apr_strerror(rv,errorbuf,200);
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals.server,
+ "Error starting request_processor thread (%d) rv=%d:%s",i,rv,errorbuf);
+ exit(1);
+
+ }
+
+ break;
+ }
+ }
+ }
+ apr_thread_mutex_unlock(module_globals.job_mutex);
+ }
+
+ return NULL;
+}
+
+void Rivet_MPM_Init (apr_pool_t* pool, server_rec* server)
+{
+ apr_status_t rv;
+
+ apr_thread_mutex_create(&module_globals.job_mutex, APR_THREAD_MUTEX_UNNESTED, pool);
+ apr_thread_cond_create(&module_globals.job_cond, pool);
+ module_globals.exiting = apr_array_make(pool,100,sizeof(apr_thread_t*));
+
+ apr_thread_mutex_create(&module_globals.pool_mutex, APR_THREAD_MUTEX_UNNESTED, pool);
+ apr_threadkey_private_create (&rivet_thread_key, processor_cleanup, pool);
+ apr_threadkey_private_create (&handler_thread_key, NULL, pool);
+ module_globals.server = server;
+
+ apr_thread_mutex_lock(module_globals.pool_mutex);
+ if (apr_pool_create(&module_globals.pool, NULL) != APR_SUCCESS)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
+ MODNAME ": could not initialize mod_rivet private pool");
+ exit(1);
+ }
+ apr_thread_mutex_unlock(module_globals.pool_mutex);
+
+ if (apr_queue_create(&module_globals.queue, MOD_RIVET_QUEUE_SIZE, module_globals.pool) != APR_SUCCESS)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
+ MODNAME ": could not initialize mod_rivet request queue");
+ exit(1);
+ }
+
+ rv = apr_thread_create( &module_globals.supervisor, NULL,
+ supervisor_thread, server, module_globals.pool);
+
+ if (rv != APR_SUCCESS) {
+ char errorbuf[512];
+
+ apr_strerror(rv, errorbuf,200);
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server,
+ MODNAME "Error starting supervisor thread rv=%d:%s\n",rv,errorbuf);
+ exit(1);
+ }
+
+}
+
+int Rivet_MPM_Request (request_rec* r)
+{
+ handler_private* private;
+ apr_status_t rv;
+
+ if (apr_threadkey_private_get ((void **)&private,handler_thread_key) != APR_SUCCESS)
+ {
+ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r->server,
+ MODNAME ": cannot get private data for processor thread");
+ exit(1);
+
+ } else {
+
+ if (private == NULL)
+ {
+ apr_thread_mutex_lock(module_globals.pool_mutex);
+ private = apr_palloc(module_globals.pool,sizeof(handler_private));
+ private->req = TclWeb_NewRequestObject (module_globals.pool);
+ apr_thread_cond_create(&(private->cond), module_globals.pool);
+ apr_thread_mutex_create(&(private->mutex), APR_THREAD_MUTEX_UNNESTED, module_globals.pool);
+ apr_thread_mutex_unlock(module_globals.pool_mutex);
+ private->job_type = request;
+ }
+
+ }
+
+ private->r = r;
+ private->code = OK;
+ private->status = init;
+ apr_threadkey_private_set (private,handler_thread_key);
+
+ do
+ {
+
+ rv = apr_queue_push(module_globals.queue,private);
+ if (rv != APR_SUCCESS)
+ {
+ apr_sleep(100000);
+ }
+
+ } while (rv != APR_SUCCESS);
+
+ apr_thread_mutex_lock(private->mutex);
+ while (private->status != done)
+ {
+ apr_thread_cond_wait(private->cond,private->mutex);
+ }
+ apr_thread_mutex_unlock(private->mutex);
+
+ return private->code;
+}
+
+void Rivet_MPM_Finalize (void)
+{
+
+}
Modified: tcl/rivet/trunk/tclconfig/compile
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tclconfig/compile?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/tclconfig/compile (original)
+++ tcl/rivet/trunk/tclconfig/compile Tue Aug 5 22:58:47 2014
@@ -1,10 +1,9 @@
#! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
-scriptversion=2012-03-05.13; # UTC
+scriptversion=2012-10-14.11; # UTC
-# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009, 2010, 2012 Free
-# Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# Written by Tom Tromey <tr...@cygnus.com>.
#
# This program is free software; you can redistribute it and/or modify
@@ -113,6 +112,11 @@ func_cl_dashl ()
lib=$dir/$lib.lib
break
fi
+ if test -f "$dir/lib$lib.a"; then
+ found=yes
+ lib=$dir/lib$lib.a
+ break
+ fi
done
IFS=$save_IFS
Modified: tcl/rivet/trunk/tclconfig/config.guess
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tclconfig/config.guess?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/tclconfig/config.guess (original)
+++ tcl/rivet/trunk/tclconfig/config.guess Tue Aug 5 22:58:47 2014
@@ -1,14 +1,12 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2013 Free Software Foundation, Inc.
-timestamp='2012-02-10'
+timestamp='2013-06-10'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -22,19 +20,17 @@ timestamp='2012-02-10'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to <co...@gnu.org> and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
+
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -54,9 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -138,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` |
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ LIBC=gnu
+
+ eval $set_cc_for_build
+ cat <<-EOF > $dummy.c
+ #include <features.h>
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #else
+ LIBC=gnu
+ #endif
+ EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -200,6 +215,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+ exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
@@ -302,7 +321,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:$
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
@@ -801,6 +820,9 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW64*:*)
+ echo ${UNAME_MACHINE}-pc-mingw64
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
@@ -852,21 +874,21 @@ EOF
exit ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -879,59 +901,54 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+ if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
+ arc:Linux:*:* | arceb:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
+ echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
@@ -950,54 +967,63 @@ EOF
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ or1k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
+ echo sparc-unknown-linux-${LIBC}
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
+ echo hppa64-unknown-linux-${LIBC}
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+ PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+ *) echo hppa-unknown-linux-${LIBC} ;;
esac
exit ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
+ echo powerpc64-unknown-linux-${LIBC}
exit ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
+ echo powerpc-unknown-linux-${LIBC}
+ exit ;;
+ ppc64le:Linux:*:*)
+ echo powerpc64le-unknown-linux-${LIBC}
+ exit ;;
+ ppcle:Linux:*:*)
+ echo powerpcle-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
+ echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
+ echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1201,6 +1227,9 @@ EOF
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
+ x86_64:Haiku:*:*)
+ echo x86_64-unknown-haiku
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
@@ -1227,19 +1256,21 @@ EOF
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
- case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
- unknown) UNAME_PROCESSOR=powerpc ;;
- esac
+ eval $set_cc_for_build
+ if test "$UNAME_PROCESSOR" = unknown ; then
+ UNAME_PROCESSOR=powerpc
+ fi
+ if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ fi
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1256,7 +1287,7 @@ EOF
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSE-?:NONSTOP_KERNEL:*:*)
+ NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
@@ -1330,9 +1361,6 @@ EOF
exit ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
-
eval $set_cc_for_build
cat >$dummy.c <<EOF
#ifdef _SEQUENT_
Modified: tcl/rivet/trunk/tclconfig/config.sub
URL: http://svn.apache.org/viewvc/tcl/rivet/trunk/tclconfig/config.sub?rev=1616041&r1=1616040&r2=1616041&view=diff
==============================================================================
--- tcl/rivet/trunk/tclconfig/config.sub (original)
+++ tcl/rivet/trunk/tclconfig/config.sub Tue Aug 5 22:58:47 2014
@@ -1,24 +1,18 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
-
-timestamp='2012-04-18'
-
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# Copyright 1992-2013 Free Software Foundation, Inc.
+
+timestamp='2013-08-10'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
@@ -26,11 +20,12 @@ timestamp='2012-04-18'
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to <co...@gnu.org>. Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -73,9 +68,7 @@ Report bugs and patches to <config-patch
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -123,7 +116,7 @@ esac
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*)
@@ -156,7 +149,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis | -knuth | -cray | -microblaze)
+ -apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
@@ -259,10 +252,12 @@ case $basic_machine in
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \
+ | arc | arceb \
+ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+ | avr | avr32 \
+ | be32 | be64 \
| bfin \
- | c4x | clipper \
+ | c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
@@ -273,7 +268,7 @@ case $basic_machine in
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
+ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
@@ -291,16 +286,17 @@ case $basic_machine in
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
+ | mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
- | nios | nios2 \
+ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
- | or32 \
+ | or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
@@ -370,13 +366,13 @@ case $basic_machine in
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
+ | c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -389,7 +385,8 @@ case $basic_machine in
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+ | microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
@@ -407,12 +404,13 @@ case $basic_machine in
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
+ | nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
@@ -788,11 +786,15 @@ case $basic_machine in
basic_machine=ns32k-utek
os=-sysv
;;
- microblaze)
+ microblaze*)
basic_machine=microblaze-xilinx
;;
+ mingw64)
+ basic_machine=x86_64-pc
+ os=-mingw64
+ ;;
mingw32)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
@@ -828,7 +830,7 @@ case $basic_machine in
basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;;
msys)
- basic_machine=i386-pc
+ basic_machine=i686-pc
os=-msys
;;
mvs)
@@ -1019,7 +1021,11 @@ case $basic_machine in
basic_machine=i586-unknown
os=-pw32
;;
- rdos)
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ os=-rdos
+ ;;
+ rdos32)
basic_machine=i386-pc
os=-rdos
;;
@@ -1346,21 +1352,21 @@ case $os in
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
- | -sym* | -kopensolaris* \
+ | -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -linux-android* \
- | -linux-newlib* | -linux-uclibc* \
+ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
@@ -1492,9 +1498,6 @@ case $os in
-aros*)
os=-aros
;;
- -kaos*)
- os=-kaos
- ;;
-zvmoe)
os=-zvmoe
;;
@@ -1543,6 +1546,9 @@ case $basic_machine in
c4x-* | tic4x-*)
os=-coff
;;
+ c8051-*)
+ os=-elf
+ ;;
hexagon-*)
os=-elf
;;
@@ -1586,6 +1592,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
+ or1k-*)
+ os=-elf
+ ;;
or32-*)
os=-coff
;;
---------------------------------------------------------------------
To unsubscribe, e-mail: site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: site-cvs-help@tcl.apache.org