rivet-3.0.0/rivet/rivet-tcl/putsnnl.tcl000664 001750 001750 00000004713 15224454746 020710 0ustar00manghimanghi000000 000000 ## ## putsnnl ?-sgml? ## ## Shorthand for 'puts -nonewline' with the extra feature ## of being able to print a string padded with spaces. ## The ouput has a fixed width and string in ## is left (width > 0) or right (width < 0) aligned. ## ## When the switch -sgml is passed in as first argument ## the padding is done with   SGML entities. ## ## $Id$ ## namespace eval ::rivet { proc putsnnl {args } { set nargs [llength $args] if {$nargs == 1} { set width undefined set output_string [lindex $args 0] } elseif {$nargs == 2} { if {[string match "-sgml" [lindex $args 0]]} { set output_string [lindex $args 1] set padding " " set width undefined } else { set output_string [lindex $args 0] set width [lindex $args 1] set padding " " } } elseif {$nargs == 3} { if {![string match "-sgml" [lindex $args 0]]} { return -code error -error_code wrong_param \ -error_info "Expected -sgml switch" \ "Expected -sgml switch" } set output_string [lindex $args 1] set width [lindex $args 2] set padding " " } else { return -code error -error_code wrong_num_param \ -error_info "Expected at most 3 args, got $nargs ($args)" \ "Expected at most 3 args, got $nargs ($args)" } if {[string is integer $width]} { if {$width == 0} { set final_string "" } else { set string_l [string length $output_string] if { $string_l > abs($width)} { set final_string [string range $output_string 0 [expr abs($width)-1]] } else { set padding [string repeat $padding [expr abs($width) - $string_l]] if {$width > 0} { set final_string [format "%s%s" $padding $output_string] } else { set final_string [format "%s%s" $output_string $padding] } } } } else { set final_string $output_string } puts -nonewline $final_string } } ## rivet-3.0.0/000775 001750 001750 00000000000 15224455044 013422 5ustar00manghimanghi000000 000000 rivet-3.0.0/doc/html/cookie.html000664 001750 001750 00000013000 15224455137 017267 0ustar00manghimanghi000000 000000 cookie

Name

cookie — get, set and delete cookies.

Synopsis

::rivet::cookie ?set? ?cookieName? ??cookiValue?? ?-days expireInDays? ?-hours expireInHours? ?-minutes expireInMinutes? ?-expires Wdy, DD-Mon-YYYY HH:MM:SS GMT? ?-path uriPathCookieAppliesTo? ?-secure 1/0? ?-HttpOnly 1/0?
::rivet::cookie ?get? ?cookieName?
::rivet::cookie ?delete? ?cookieName?
::rivet::cookie ?unset? ?cookieName?

Description

cookie gets, sets, unsets or deletes a cookie. When you get a cookie, the command returns the value of the cookie, or an empty string if no cookie exists.

cookie delete will set the timeout value to -1 minutes - deleting the cookie in the browser.

cookie unset will remove the defined cookie in the server (perhaps preparatory to checking/resetting the cookie).

The command has a number of switches setting a cookie attributes

rivet-3.0.0/tests/upload.test000664 001750 001750 00000002421 15224454746 016760 0ustar00manghimanghi000000 000000 set testfilename1 upload.rvt ::tcltest::test upload-1.1 {multipart/form-data} { set bound "-----NEXT_PART_[clock seconds].[pid]" set fl [open AngeloFish.jpg r] fconfigure $fl -translation binary set data [read $fl] close $fl set outputData "--$bound\r\nContent-Disposition: form-data; name=\"uploadtest\"; filename=\"AngeloFish.jpg\"\r\n\r\n$data\n--${bound}--" set page [::http::geturl "${urlbase}$testfilename1" -type "multipart/form-data; boundary=$bound" -query $outputData] set ret [string trim [::http::data $page]] ::http::cleanup $page set ret } {uploadtest|1|42747||AngeloFish.jpg} set testfilename1 uploadsave.rvt ::tcltest::test upload-1.2 {upload save} { file delete uploadedjpeg.jpg set bound "-----NEXT_PART_[clock seconds].[pid]" set fl [open AngeloFish.jpg r] fconfigure $fl -translation binary set data [read $fl] close $fl set outputData "--$bound\r\nContent-Disposition: form-data; name=\"uploadtest\"; filename=\"AngeloFish.jpg\"\r\n\r\n$data\n--${bound}--" set page [::http::geturl "${urlbase}$testfilename1" \ -type "multipart/form-data; boundary=$bound" -query $outputData] set ret [string trim [::http::data $page]] ::http::cleanup $page file size uploadedjpeg.jpg } {42747} rivet-3.0.0/doc/html/html_calendar.html000664 001750 001750 00000007356 15224455137 020634 0ustar00manghimanghi000000 000000 HtmlCalendar

Name

HtmlCalendar — Concrete class derived from XmlCalendar

Synopsis

HtmlCalendar calendar_name ?-option1 option_list? ?-option2 option_list? ?...?

Concrete XmlCalendar class for printing html calendar tables. The markup of the class is xhtml compliant and prints a code fragment for inclusion in a webpage. The following is the class definition.

::itcl::class HtmlCalendar {
    inherit XmlCalendar
    
    constructor {args} {XmlCalendar::constructor $args} {
    $this configure -container    table \
                    -header       thead \
                    -body         tbody \
                    -banner       tr    \
                    -banner_month {th colspan 3 style "text-align: right;"} \
                    -banner_year  {th colspan 4 style "text-align: left;"}  \
                    -weekdays     tr    \
                    -weekday_cell th    \
                    -days_row     tr    \
                    -days_cell    td 
    }
}

A sample output from HtmlCalendar (with some styling)

rivet-3.0.0/doc/examples/upload.html000664 001750 001750 00000000253 15224454746 020167 0ustar00manghimanghi000000 000000
rivet-3.0.0/rivet/000775 001750 001750 00000000000 15224454746 014563 5ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/packages/session/session-demo.rvt000664 001750 001750 00000001455 15224454746 023173 0ustar00manghimanghi000000 000000

Session Demo

Here's some stuff about your session:

  • Your session ID is [SESSION id]
  • SESSION is_new_session -> [SESSION is_new_session]
  • SESSION new_session_reason -> [SESSION new_session_reason]

Fetching key 'foo' from package 'dummy': " if {$data == ""} { puts "No data. Storing data 'bar' with key 'foo' package 'dummy'.

" SESSION store dummy foo bar } else { puts "$data" } ?>

rivet-3.0.0/doc/examples-sgml/table.rvt000664 001750 001750 00000000635 15224454746 020605 0ustar00manghimanghi000000 000000 <? puts "<table>\n" for {set i 1} { $i <= 8 } {incr i} { puts "<tr>\n" for {set j 1} {$j <= 8} {incr j} { set num [ expr $i * $j * 4 - 1] puts [ format "<td bgcolor=\"%02x%02x%02x\" > $num $num $num </td>\n" \ $num $num $num ] } puts "</tr>\n" } puts "</table>\n" ?> rivet-3.0.0/rivet/packages/form/pkgIndex.tcl000664 001750 001750 00000000102 15224454746 021552 0ustar00manghimanghi000000 000000 package ifneeded form 1.0 [list source [file join $dir form.tcl]] rivet-3.0.0/doc/html/load_cookies.html000664 001750 001750 00000005064 15224455137 020464 0ustar00manghimanghi000000 000000 load_cookies

Name

load_cookies — get any cookie variables sent by the client.

Synopsis

::rivet::load_cookies ?array_name?

Description

Load the array of cookie variables into the specified array name. Uses array <repleceable>cookies</repleceable> by default.

rivet-3.0.0/doc/Makefile.in000664 001750 001750 00000043743 15224455032 016244 0ustar00manghimanghi000000 000000 # Makefile.in generated by automake 1.18.1 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2025 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Makefile for Rivet documentation # Copyright 2004-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. VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) am__rm_f = rm -f $(am__rm_f_notfound) am__rm_rf = rm -rf $(am__rm_f_notfound) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ $(top_srcdir)/m4/ax_split_version.m4 \ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ $(top_srcdir)/acinclude.m4 $(top_srcdir)/tclconfig/tcl.m4 \ $(top_srcdir)/tclconfig/libtool.m4 \ $(top_srcdir)/m4/ax_prefix_config_h.m4 \ $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = convert_examples.tcl rivet.xml CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(srcdir)/convert_examples.tcl.in $(srcdir)/rivet.xml.in \ README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ APR_CPPFLAGS = @APR_CPPFLAGS@ APR_INCLUDES = @APR_INCLUDES@ APR_LDFLAGS = @APR_LDFLAGS@ APU_INCLUDES = @APU_INCLUDES@ APU_LDFLAGS = @APU_LDFLAGS@ APXS_CPPFLAGS = @APXS_CPPFLAGS@ APXS_CPPFLAGS_SHLIB = @APXS_CPPFLAGS_SHLIB@ APXS_INCLUDES = @APXS_INCLUDES@ APXS_LDFLAGS = @APXS_LDFLAGS@ APXS_LD_SHLIB = @APXS_LD_SHLIB@ APXS_LIBEXECDIR = @APXS_LIBEXECDIR@ APXS_LIBS = @APXS_LIBS@ APXS_PREFIX = @APXS_PREFIX@ APXS_SYSCONFDIR = @APXS_SYSCONFDIR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CFLAGS_DEBUG = @CFLAGS_DEBUG@ CFLAGS_DEFAULT = @CFLAGS_DEFAULT@ CFLAGS_OPTIMIZE = @CFLAGS_OPTIMIZE@ CFLAGS_WARNING = @CFLAGS_WARNING@ CLEANFILES = @CLEANFILES@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CSCOPE = @CSCOPE@ CTAGS = @CTAGS@ CYGPATH = @CYGPATH@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ ETAGS = @ETAGS@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GREP = @GREP@ INIT_VERSION = @INIT_VERSION@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_DATA_DIR = @INSTALL_DATA_DIR@ INSTALL_LIBRARY = @INSTALL_LIBRARY@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LDFLAGS_DEBUG = @LDFLAGS_DEBUG@ LDFLAGS_DEFAULT = @LDFLAGS_DEFAULT@ LDFLAGS_OPTIMIZE = @LDFLAGS_OPTIMIZE@ LD_LIBRARY_PATH_VAR = @LD_LIBRARY_PATH_VAR@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIBTOOL_DEPS = @LIBTOOL_DEPS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ MAKEINFO = @MAKEINFO@ MAKE_LIB = @MAKE_LIB@ MAKE_SHARED_LIB = @MAKE_SHARED_LIB@ MAKE_STATIC_LIB = @MAKE_STATIC_LIB@ MAKE_STUB_LIB = @MAKE_STUB_LIB@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAX_POST = @MAX_POST@ MKDIR_P = @MKDIR_P@ MOD_RIVET_INCLUDES = @MOD_RIVET_INCLUDES@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CFLAGS = @PKG_CFLAGS@ PKG_HEADERS = @PKG_HEADERS@ PKG_INCLUDES = @PKG_INCLUDES@ PKG_LIBS = @PKG_LIBS@ PKG_LIB_FILE = @PKG_LIB_FILE@ PKG_LIB_FILE8 = @PKG_LIB_FILE8@ PKG_LIB_FILE9 = @PKG_LIB_FILE9@ PKG_STUB_LIB_FILE = @PKG_STUB_LIB_FILE@ PKG_STUB_OBJECTS = @PKG_STUB_OBJECTS@ PKG_STUB_SOURCES = @PKG_STUB_SOURCES@ PKG_TCL_SOURCES = @PKG_TCL_SOURCES@ RANLIB = @RANLIB@ RANLIB_STUB = @RANLIB_STUB@ RC = @RC@ RIVETLIB_PACKAGE = @RIVETLIB_PACKAGE@ RIVETLIB_PACKAGE_VERSION = @RIVETLIB_PACKAGE_VERSION@ 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@ SET_MAKE = @SET_MAKE@ SHARED_BUILD = @SHARED_BUILD@ SHELL = @SHELL@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LD = @SHLIB_LD@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ STLIB_LD = @STLIB_LD@ STRIP = @STRIP@ STUBS_BUILD = @STUBS_BUILD@ TCLSH_PROG = @TCLSH_PROG@ TCL_BIN_DIR = @TCL_BIN_DIR@ TCL_DEFS = @TCL_DEFS@ TCL_EXTRA_CFLAGS = @TCL_EXTRA_CFLAGS@ TCL_INCLUDES = @TCL_INCLUDES@ TCL_LD_FLAGS = @TCL_LD_FLAGS@ TCL_LIBS = @TCL_LIBS@ TCL_LIB_FILE = @TCL_LIB_FILE@ TCL_LIB_FLAG = @TCL_LIB_FLAG@ TCL_LIB_SPEC = @TCL_LIB_SPEC@ TCL_PACKAGE_PATH = @TCL_PACKAGE_PATH@ TCL_PATCH_LEVEL = @TCL_PATCH_LEVEL@ TCL_SHLIB_LD_LIBS = @TCL_SHLIB_LD_LIBS@ TCL_SRC_DIR = @TCL_SRC_DIR@ TCL_STUB_LIB_FILE = @TCL_STUB_LIB_FILE@ TCL_STUB_LIB_FLAG = @TCL_STUB_LIB_FLAG@ TCL_STUB_LIB_SPEC = @TCL_STUB_LIB_SPEC@ TCL_THREADS = @TCL_THREADS@ TCL_VERSION = @TCL_VERSION@ VC_MANIFEST_EMBED_DLL = @VC_MANIFEST_EMBED_DLL@ VC_MANIFEST_EMBED_EXE = @VC_MANIFEST_EMBED_EXE@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__rm_f_notfound = @am__rm_f_notfound@ am__tar = @am__tar@ am__untar = @am__untar@ am__xargs_n = @am__xargs_n@ apache_include = @apache_include@ apache_request = @apache_request@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ rivet_channel = @rivet_channel@ rivet_commands = @rivet_commands@ rivet_core = @rivet_core@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ with_apr_config = @with_apr_config@ with_apu_config = @with_apu_config@ with_apxs = @with_apxs@ MANDIRS = $(srcdir)/html/ $(srcdir)/html/images PICTURES := $(wildcard images/*.png) EXAMPLES_SGML := $(wildcard examples-sgml/*.*) EXAMPLES := $(wildcard examples/*.*) all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign doc/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): convert_examples.tcl: $(top_builddir)/config.status $(srcdir)/convert_examples.tcl.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ rivet.xml: $(top_builddir)/config.status $(srcdir)/rivet.xml.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) distdir-am distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -$(am__rm_f) $(CLEANFILES) distclean-generic: -$(am__rm_f) $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || $(am__rm_f) $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-local .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ cscopelist-am ctags-am distclean distclean-generic \ distclean-libtool distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags-am uninstall uninstall-am uninstall-local .PRECIOUS: Makefile .PHONY: clean # English, multiple files. $(buildir)/html/index.html: $(srcdir)/rivet.xml $(srcdir)/rivet-chunk.xsl $(srcdir)/rivet.xsl $(srcdir)/xml/*.xml xsltproc --stringparam html.stylesheet rivet.css \ --stringparam html.ext ".html" \ --stringparam chunker.output.encoding UTF-8 \ --nonet -o $(builddir)/html/ $(srcdir)/rivet-chunk.xsl $(srcdir)/rivet.xml # English, one big file. $(buildir)/html/rivet.html: $(srcdir)/rivet.xml $(srcdir)/rivet-nochunk.xsl $(srcdir)/rivet.xsl $(srcdir)/xml/*.xml xsltproc --stringparam html.stylesheet rivet.css \ --stringparam html.ext ".html" \ --stringparam chunker.output.encoding UTF-8 \ --nonet -o $(builddir)/html/rivet.html $(srcdir)/rivet-nochunk.xsl \ $(srcdir)/rivet.xml # This means these are not build automatically, but at least # people aren't forced to build them either. docs: $(buildir)/html/rivet.css $(buildir)/html/index.html picts docs-nochunk: html/rivet.css html/rivet.html picts $(buildir)/html/rivet.css: rivet.css $(mkinstalldirs) $(builddir)/html $(install_sh) -C -m 644 $(srcdir)/rivet.css $(builddir)/html/ # target picts checks the directory tree exists, then lets target 'graphics' copy new # or updated files to the target tree. picts: graphics graphics: $(PICTURES) $(mkinstalldirs) $(builddir)/html/images @for gfile in $?; do \ $(install_sh) -C -m 644 $(srcdir)/$$gfile $(builddir)/html/images/ ; \ done touch graphics examples: ( echo 'set source_examples { $(EXAMPLES) }; source ./convert_examples.tcl' | @TCLSH_PROG@ ; ) # target that builds the essential directory tree that will get the html and # graphic files of the manual mandirs: $(MANDIRS) $(MANDIRS): mkdir $@ #install-data-local: docs # this target cleans everything up in the html directory distclean: -rm -fr $(builddir)/html/ -rm -f $(builddir)/graphics -rm Makefile uninstall-local: rm -fr $(builddir)/convert_examples.tcl .PHONY: examples # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Tell GNU make to disable its built-in pattern rules. %:: %,v %:: RCS/%,v %:: RCS/% %:: s.% %:: SCCS/s.% rivet-3.0.0/m4/ltversion.m4000664 001750 001750 00000001273 15224454746 016244 0ustar00manghimanghi000000 000000 # ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 4179 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.6]) m4_define([LT_PACKAGE_REVISION], [2.4.6]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.6' macro_revision='2.4.6' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) rivet-3.0.0/rivet/packages/dio/dio_Oracle.tcl000664 001750 001750 00000013574 15224454746 021672 0ustar00manghimanghi000000 000000 # dio_Oracle.tcl -- Oracle (odbc) backend. # Copyright 2006-2024 The Apache Software Foundation # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. package require DIO 1.2 package provide dio_Oracle 1.2 namespace eval DIO { ::itcl::class Oracle { inherit Database constructor {args} {eval configure -interface Oracle $args} { if {[catch {package require Oratcl}]} { return -code error "No Oracle Tcl package available" } eval configure $args if {[::rivet::lempty $db]} { if {[::rivet::lempty $user]} {:b set user $::env(USER) } set db $user } } destructor { close } method open {} { set command "::oralogon" if {![::rivet::lempty $user]} { append command " $user" } if {![::rivet::lempty $pass]} { append command "/$pass" } if {![::rivet::lempty $host]} { append command "@$host" } if {![::rivet::lempty $port]} { append command -port $port } if {[catch $command error]} { return -code error $error } set conn $error if {![::rivet::lempty $db]} { # ??? mysqluse $conn $db } } method close {} { if {![info exists conn]} { return } catch {::oraclose $conn} unset conn } method exec {req} { if {![info exists conn]} { open } set _cur [::oraopen $conn] set cmd ::orasql set is_select 0 if {[::string tolower [lindex $req 0]] == "select"} { set cmd ::orasql set is_select 1 } set errorinfo "" #puts "ORA:$is_select:$req:
" if {[catch {$cmd $_cur $req} error]} { #puts "ORA:error:$error:
" set errorinfo $error catch {::oraclose $_cur} set obj [result $interface -error 1 -errorinfo [::list $error]] return $obj } if {[catch {::oracols $_cur name} fields]} { set fields "" } ::oracommit $conn set my_fields $fields set fields [::list] foreach field $my_fields { set field [::string tolower $field] lappend fields $field } set error [::oramsg $_cur rows] set res_cmd "result" lappend res_cmd $interface -resultid $_cur lappend res_cmd -numrows [::list $error] -fields [::list $fields] lappend res_cmd -fetch_first_row $is_select set obj [eval $res_cmd] if {!$is_select} { ::oraclose $_cur } return $obj } method lastkey {} { if {![info exists conn]} { return } return [mysqlinsertid $conn] } method quote {string} { regsub -all {'} $string {\'} string return $string } method sql_limit_syntax {limit {offset ""}} { # temporary return "" if {[::rivet::lempty $offset]} { return " LIMIT $limit" } return " LIMIT [expr $offset - 1],$limit" } method handle {} { if {![info exists conn]} { open } return $conn } public variable db "" { if {[info exists conn]} { mysqluse $conn $db } } #public variable interface "Oracle" private variable conn private variable _cur } ; ## ::itcl::class Mysql ::itcl::class OracleResult { inherit Result public variable fetch_first_row 0 private variable _data "" private variable _have_first_row 0 constructor {args} { eval configure $args if {$fetch_first_row} { if {[llength [nextrow]] == 0} { set _have_first_row 0 numrows 0 } else { set _have_first_row 1 numrows 1 } } set fetch_first_row 0 } destructor { if {[string length $resultid] > 0} { catch {::oraclose $resultid} } } method nextrow {} { if {[string length $resultid] == 0} { return [::list] } if {$_have_first_row} { set _have_first_row 0 return $_data } set ret [::orafetch $resultid -datavariable _data] switch $ret { 0 { return $_data } 1403 { ::oraclose $resultid set resultid "" return [::list] } default { # FIXME!! have to handle error here !! return [::list] } } } } ; ## ::itcl::class OracleResult } rivet-3.0.0/doc/html/lmatch.html000664 001750 001750 00000006203 15224455137 017275 0ustar00manghimanghi000000 000000 lmatch

Name

lmatch — Look for elements in <list> that match <pattern>

Synopsis

::rivet::lmatch (-exact | -glob | -regexp) list pattern

Description

Look for elements in <list> that match <pattern>. This command is a decent replacement for TclX lmatch command when TclX is not available

In the following example a regular expression is matched against each element in the input list and a list containing the matching elements is returned

::rivet::lmatch -regexp { aaxa bxxb ccxxxxcc } {.+[x]{2}.+}
bxxb ccxxxxcc

rivet-3.0.0/src/mod_rivet_ng/mod_rivet_common.c000664 001750 001750 00000054731 15224454746 022413 0ustar00manghimanghi000000 000000 /* -- mod_rivet_common.c - functions likely to be shared among different * components of mod_rivet.c */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include #include #include #include "mod_rivet.h" #include "rivetChannel.h" #include "TclWeb.h" #include "rivetParser.h" #include "rivet.h" #include "apache_config.h" /* as long as we need to emulate ap_chdir_file we need to include unistd.h */ #ifdef RIVET_HAVE_UNISTD_H #include #endif /* RIVET_HAVE_UNISTD_H */ #ifdef WIN32 #include // provides POSIX _chdir #endif /* WIN32 */ /* Function prototypes are defined with EXTERN. Since we are in the same DLL, * no need to keep this extern... */ #ifdef EXTERN # undef EXTERN # define EXTERN DLLEXPORT #endif /* EXTERN */ #include "rivetCore.h" #include "mod_rivet_common.h" #include "mod_rivet_cache.h" extern apr_threadkey_t* rivet_thread_key; extern mod_rivet_globals* module_globals; extern module rivet_module; /* * -- Rivet_ReadFile * */ int Rivet_ReadFile (apr_pool_t* pool,char* filename, char** buffer,int* nbytes) { apr_finfo_t* file_info; apr_file_t* apr_fp; apr_size_t buffer_size; *nbytes = 0; file_info = (apr_finfo_t*) apr_palloc(pool,sizeof(apr_finfo_t)); if (apr_stat(file_info,filename,APR_FINFO_SIZE,pool) != APR_SUCCESS) { return 1; } if (apr_file_open(&apr_fp,filename,APR_FOPEN_READ, APR_FPROT_OS_DEFAULT, pool) != APR_SUCCESS) { return 1; } buffer_size = file_info->size; *buffer = (char*) apr_palloc(pool,buffer_size); if (apr_file_read(apr_fp,*buffer,&buffer_size) != APR_SUCCESS) { return 2; } apr_file_close(apr_fp); *nbytes = (int)buffer_size; return 0; } /*----------------------------------------------------------------------------- * Rivet_CreateTclInterp -- * * Arguments: * server_rec* s: pointer to a server_rec structure * * Results: * pointer to a Tcl_Interp structure * * Side Effects: * *----------------------------------------------------------------------------- */ static Tcl_Interp* Rivet_CreateTclInterp (apr_pool_t* pool) { Tcl_Interp* interp; /* Initialize TCL stuff */ Tcl_FindExecutable(RIVET_NAMEOFEXECUTABLE); interp = Tcl_CreateInterp(); if (interp == NULL) { ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, pool, MODNAME ": Error in Tcl_CreateInterp, aborting\n"); exit(1); } if (Tcl_Init(interp) == TCL_ERROR) { ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, pool, MODNAME ": Error in Tcl_Init: %s, aborting\n", Tcl_GetStringResult(interp)); exit(1); } return interp; } /* * -- Rivet_RunningScripts * * * */ running_scripts* Rivet_RunningScripts ( apr_pool_t* pool, running_scripts* scripts, rivet_server_conf* rivet_conf ) { RIVET_SCRIPT_INIT(pool,scripts,rivet_conf,rivet_before_script); RIVET_SCRIPT_INIT(pool,scripts,rivet_conf,rivet_after_script); RIVET_SCRIPT_INIT(pool,scripts,rivet_conf,rivet_error_script); RIVET_SCRIPT_INIT(pool,scripts,rivet_conf,rivet_abort_script); RIVET_SCRIPT_INIT(pool,scripts,rivet_conf,after_every_script); if (rivet_conf->request_handler != NULL) { char* request_handler; int handler_size; ap_assert(Rivet_ReadFile(pool,rivet_conf->request_handler, &request_handler,&handler_size) == 0); scripts->request_processing = Tcl_NewStringObj(request_handler,handler_size); } else { scripts->request_processing = Tcl_NewStringObj(module_globals->default_handler, module_globals->default_handler_size); } Tcl_IncrRefCount(scripts->request_processing); return scripts; } /* * -- Rivet_ReleaseRunningScripts * */ void Rivet_ReleaseRunningScripts (running_scripts* scripts) { RIVET_SCRIPT_DISPOSE(scripts,rivet_before_script); RIVET_SCRIPT_DISPOSE(scripts,rivet_after_script); RIVET_SCRIPT_DISPOSE(scripts,rivet_error_script); RIVET_SCRIPT_DISPOSE(scripts,rivet_abort_script); RIVET_SCRIPT_DISPOSE(scripts,after_every_script); RIVET_SCRIPT_DISPOSE(scripts,request_processing); } /* * -- Rivet_ReleasePerDirScripts * */ void Rivet_ReleasePerDirScripts(rivet_thread_interp* rivet_interp) { apr_hash_t* ht = rivet_interp->per_dir_scripts; apr_hash_index_t* hi; Tcl_Obj* script; apr_pool_t* p = rivet_interp->pool; for (hi = apr_hash_first(p,ht); hi; hi = apr_hash_next(hi)) { apr_hash_this(hi, NULL, NULL, (void*)(&script)); Tcl_DecrRefCount(script); } apr_hash_clear(ht); } /* *--------------------------------------------------------------------- * * Rivet_PerInterpInit -- * * Do the interpreter environment creation and initialization. * * Results: * None. * * Side Effects: * None. * *--------------------------------------------------------------------- */ void Rivet_PerInterpInit(rivet_thread_interp* interp_obj, rivet_thread_private* private, server_rec *s, apr_pool_t *p) { rivet_interp_globals* globals = NULL; Tcl_Obj* auto_path = NULL; Tcl_Obj* rivet_tcl = NULL; Tcl_Interp* interp = interp_obj->interp; ap_assert (interp != (Tcl_Interp *)NULL); Tcl_Preserve (interp); /* Set up interpreter associated data */ globals = ckalloc(sizeof(rivet_interp_globals)); /* * we assign a default server_rec value into the globals * even though some mpm bridge may override it */ globals->server = s; /* * we store in the globals some information relevant to * the embedded interpreter work */ /* the ::rivet namespace is created */ globals->rivet_ns = Tcl_CreateNamespace (interp,RIVET_NS,NULL, (Tcl_NamespaceDeleteProc *)NULL); /* this is interp specific global data */ Tcl_SetAssocData (interp,"rivet",NULL,globals); /* We put in front the auto_path list the path to the directory where * init.tcl is located (provides package Rivet, previously RivetTcl) */ auto_path = Tcl_GetVar2Ex(interp,"auto_path",NULL,TCL_GLOBAL_ONLY); rivet_tcl = Tcl_NewStringObj(RIVET_DIR,-1); Tcl_IncrRefCount(rivet_tcl); if (Tcl_IsShared(auto_path)) { auto_path = Tcl_DuplicateObj(auto_path); } if (Tcl_ListObjReplace(interp,auto_path,0,0,1,&rivet_tcl) == TCL_ERROR) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, MODNAME ": error setting auto_path: %s", Tcl_GetStringFromObj(auto_path,NULL)); } else { Tcl_SetVar2Ex(interp,"auto_path",NULL,auto_path,TCL_GLOBAL_ONLY); } Tcl_DecrRefCount(rivet_tcl); /* If the thread has private data we stuff the server conf * pointer in the 'running_conf' field. * Commands running ouside a request processing must figure out * themselves how get a pointer to the configuration from the * context (e.g. ::rivet::inspect) */ if (private != NULL) private->running_conf = RIVET_SERVER_CONF (s->module_config); /* Initialize the interpreter with Rivet's Tcl commands. */ Rivet_InitCore(interp,private); /* Create a global array with information about the server. */ Rivet_InitServerVariables(interp,p); /* Eval Rivet's init.tcl file to load in the Tcl-level commands. */ /* Watch out! Calling Tcl_PkgRequire with a version number binds this module to * the Rivet package revision number in rivet/init.tcl * * RIVET_TCL_PACKAGE_VERSION is defined by configure.ac as the combination * "MAJOR_VERSION.MINOR_VERSION". We don't expect to change rivet/init.tcl * across patchlevel releases */ if (Tcl_PkgRequire(interp, "Rivet", RIVET_INIT_VERSION, 1) == NULL) { ap_log_error (APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, MODNAME ": init.tcl must be installed correctly for Apache Rivet to function: %s (%s)", Tcl_GetStringResult(interp), RIVET_DIR ); exit(1); } Tcl_Release(interp); interp_obj->flags |= RIVET_INTERP_INITIALIZED; } /* *----------------------------------------------------------------------------- * * -- Rivet_NewVHostInterp * * Returns a new rivet_thread_interp object with a new Tcl interpreter * configuration scripts and cache. The pool passed to Rivet_NewVHostInterp * * Arguments: * apr_pool_t* pool: a memory pool, it must be the private pool of a * rivet_thread_private object (thread private) * * Returned value: * a rivet_thread_interp* record object * *----------------------------------------------------------------------------- */ rivet_thread_interp* Rivet_NewVHostInterp(apr_pool_t *pool,int default_cache_size) { rivet_thread_interp* interp_obj = apr_pcalloc(pool,sizeof(rivet_thread_interp)); /* This calls needs the root server_rec just for logging purposes */ interp_obj->interp = Rivet_CreateTclInterp(pool); /* we now create memory from the cache pool as subpool of the thread private pool */ if (apr_pool_create(&interp_obj->pool, pool) != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, pool, MODNAME ": could not initialize cache private pool"); return NULL; } /* * Determining the default cache size of the Rivet interpreter object * In case the argument default_cache_size == 0 the cache is disabled */ if (default_cache_size < 0) { interp_obj->cache_size = RivetCache_DefaultSize(); } else if (default_cache_size > 0) { interp_obj->cache_size = default_cache_size; } interp_obj->cache_free = interp_obj->cache_size; // Initialize cache structures if (interp_obj->cache_size) { RivetCache_Create(pool,interp_obj); } interp_obj->flags = 0; interp_obj->scripts = (running_scripts *) apr_pcalloc(pool,sizeof(running_scripts)); interp_obj->per_dir_scripts = apr_hash_make(pool); return interp_obj; } /* *----------------------------------------------------------------------------- * * -- Rivet_CreateRivetChannel * * Creates a channel and registers with to the interpreter * * Arguments: * * - apr_pool_t* pPool: a pointer to an APR memory pool * * Returned value: * * the pointer to the Tcl_Channel object * * Side Effects: * * a Tcl channel is created allocating memory from the pool * *----------------------------------------------------------------------------- */ Tcl_Channel* Rivet_CreateRivetChannel(apr_pool_t* pPool, apr_threadkey_t* rivet_thread_key) { Tcl_Channel* outchannel; outchannel = apr_pcalloc (pPool, sizeof(Tcl_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); return outchannel; } /*----------------------------------------------------------------------------- * * -- Rivet_ReleaseRivetChannel * * Tcl_UnregisterChannel wrapper with the purpose of introducing a control * variables that might help debugging * * Arguments: * * - Tcl_Interp* interp * - Tcl_Channel* channel * * Returned value * * none * * Side Effects: * * channel debug counter decremented (TODO) * *----------------------------------------------------------------------------- */ void Rivet_ReleaseRivetChannel (Tcl_Interp* interp, Tcl_Channel* channel) { Tcl_UnregisterChannel(interp,*channel); } /*----------------------------------------------------------------------------- * * -- Rivet_CreatePrivateData * * Creates a thread private data object * * Arguments: * * - apr_threadkey_t* rivet_thread_key * * Returned value: * * - rivet_thread_private* private data object * *----------------------------------------------------------------------------- */ rivet_thread_private* Rivet_CreatePrivateData (void) { rivet_thread_private* private; ap_assert (apr_threadkey_private_get ((void **)&private,rivet_thread_key) == APR_SUCCESS); apr_thread_mutex_lock(module_globals->pool_mutex); private = apr_pcalloc (module_globals->pool,sizeof(*private)); apr_thread_mutex_unlock(module_globals->pool_mutex); if (apr_pool_create (&private->pool, NULL) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals->server, MODNAME ": could not create thread private pool"); return NULL; } private->req_cnt = 0; private->r = NULL; private->req = TclWeb_NewRequestObject(private->pool); private->page_aborting = 0; private->thread_exit = 0; private->exit_status = 0; private->abort_code = NULL; apr_threadkey_private_set (private,rivet_thread_key); return private; } /* * -- Rivet_ExecutionThreadInit * * We keep here the basic initilization each execution thread should undergo * * - create the thread private data * - create a Tcl channel * - set up the Panic procedure */ rivet_thread_private* Rivet_ExecutionThreadInit (void) { rivet_thread_private* private = Rivet_CreatePrivateData(); ap_assert(private != NULL); private->channel = Rivet_CreateRivetChannel(private->pool,rivet_thread_key); Rivet_SetupTclPanicProc(); return private; } /* *----------------------------------------------------------------------------- * * -- Rivet_SetupTclPanicProc * * initialize Tcl panic procedure data in a rivet_thread_private object * * Arguments: * * - none * * Returned value: * * - initialized rivet_thread_private* data record * *----------------------------------------------------------------------------- */ rivet_thread_private* Rivet_SetupTclPanicProc (void) { rivet_thread_private* private; ap_assert (apr_threadkey_private_get ((void **)&private,rivet_thread_key) == APR_SUCCESS); private->rivet_panic_pool = private->pool; private->rivet_panic_server_rec = module_globals->server; private->rivet_panic_request_rec = NULL; return private; } /* *----------------------------------------------------------------------------- * * Rivet_PanicProc -- * * Called when Tcl panics, usually because of memory problems. * We log the request, in order to be able to determine what went * wrong later. * * Results: * None. * * Side Effects: * Calls abort(), which does not return - the child exits. * *----------------------------------------------------------------------------- */ void Rivet_Panic(const char* arg1, ...) { va_list argList; char* buf; char* format; rivet_thread_private* private; ap_assert (apr_threadkey_private_get ((void **)&private,rivet_thread_key) == APR_SUCCESS); // format = (char *) TCL_VARARGS_START(char *,arg1,argList); format = (char *) (va_start(argList,arg1),arg1); buf = (char *) apr_pvsprintf(private->rivet_panic_pool, format, argList); if (private->rivet_panic_request_rec != NULL) { ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, private->rivet_panic_server_rec, MODNAME ": Critical error in request: %s", private->rivet_panic_request_rec->unparsed_uri); } ap_log_error(APLOG_MARK, APLOG_CRIT, APR_EGENERAL, private->rivet_panic_server_rec, "%s", buf); abort(); } /* * -- Rivet_CleanupRequest * * This function is meant to release memory and resorces * owned by a thread. * The handler in general is not guaranteed to be called * within the same thread that created the resources to + release. As such it's useless to release any Tcl * related resorces (e.g. a Tcl_Interp* object) as * any threaded build of Tcl uses its own thread private * data. We leave the function as a placeholder * in case we want to stuff into it something else to do. * * Arguments: * * request_rec* request object pointer * * Returned value: * * None */ void Rivet_CleanupRequest( request_rec *r ) { } /* * -- Rivet_InitServerVariables * * Setup an array in each interpreter to tell us things about Apache. * This saves us from having to do any real call to load an entire * environment. This routine only gets called once, when the child process * is created. * * Arguments: * * Tcl_Interp* interp: pointer to the Tcl interpreter * apr_pool_t* pool: pool used for calling Apache framework functions * * Returned value: * none * * Side effects: * * within the global scope of the interpreter passed as first * argument a 'server' array is created and the variable associated * to the following keys are defined * * SERVER_ROOT - Apache's root location * SERVER_CONF - Apache's configuration file * RIVET_DIR - Rivet's Tcl source directory * RIVET_INIT - Rivet's init.tcl file * RIVET_VERSION - Rivet version (only when RIVET_DISPLAY_VERSION is 1) * MPM_THREADED - It should contain the string 'unsupported' for a prefork MPM * MPM_FORKED - String describing the forking model of the MPM * RIVET_MPM_BRIDGE - Filename of the running MPM bridge * */ void Rivet_InitServerVariables (Tcl_Interp *interp, apr_pool_t *pool) { int ap_mpm_result; Tcl_Obj *obj; obj = Tcl_NewStringObj(ap_server_root, -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","SERVER_ROOT",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); obj = Tcl_NewStringObj(ap_server_root_relative(pool,SERVER_CONFIG_FILE), -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","SERVER_CONF",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); obj = Tcl_NewStringObj(ap_server_root_relative(pool, RIVET_DIR), -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","RIVET_DIR",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); obj = Tcl_NewStringObj(ap_server_root_relative(pool, RIVET_INIT), -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","RIVET_INIT",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); #if RIVET_DISPLAY_VERSION obj = Tcl_NewStringObj(RIVET_VERSION, -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","RIVET_VERSION",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); #endif if (ap_mpm_query(AP_MPMQ_IS_THREADED,&ap_mpm_result) == APR_SUCCESS) { switch (ap_mpm_result) { case AP_MPMQ_STATIC: obj = Tcl_NewStringObj("static", -1); break; case AP_MPMQ_NOT_SUPPORTED: obj = Tcl_NewStringObj("unsupported", -1); break; default: obj = Tcl_NewStringObj("undefined", -1); break; } Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","MPM_THREADED",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); } if (ap_mpm_query(AP_MPMQ_IS_FORKED,&ap_mpm_result) == APR_SUCCESS) { switch (ap_mpm_result) { case AP_MPMQ_STATIC: obj = Tcl_NewStringObj("static", -1); break; case AP_MPMQ_DYNAMIC: obj = Tcl_NewStringObj("dynamic", -1); break; default: obj = Tcl_NewStringObj("undefined", -1); break; } Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","MPM_FORKED",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); } obj = Tcl_NewStringObj(module_globals->rivet_mpm_bridge, -1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","RIVET_MPM_BRIDGE",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); obj = Tcl_NewStringObj(RIVET_CONFIGURE_CMD,-1); Tcl_IncrRefCount(obj); Tcl_SetVar2Ex(interp,"::server","RIVET_CONFIGURE_CMD",obj,TCL_GLOBAL_ONLY); Tcl_DecrRefCount(obj); } /* * -- Rivet_chdir_file (const char* filename) * * Determines the directory name from the filename argument * and sets it as current working directory * * Argument: * * const char* filename: file name to be used for determining * the current directory (URI style path) * the directory name is everything comes * before the last '/' (slash) character * * This snippet of code came from the mod_ruby project, * which is under a BSD license. */ int Rivet_chdir_file (const char *file) { const char *x; int chdir_retval = 0; char chdir_buf[HUGE_STRING_LEN]; x = strrchr(file, '/'); if (x == NULL) { #ifdef WIN32 chdir_retval = _chdir(file); #else chdir_retval = chdir(file); #endif } else if (x - file < sizeof(chdir_buf) - 1) { memcpy(chdir_buf, file, x - file); chdir_buf[x - file] = '\0'; #ifdef WIN32 chdir_retval = _chdir(chdir_buf); #else chdir_retval = chdir(chdir_buf); #endif } return chdir_retval; } rivet-3.0.0/src/mod_rivet_ng/Makefile.am000664 001750 001750 00000006657 15224454746 020747 0ustar00manghimanghi000000 000000 # Makefile.am - # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # 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_commands@/rivetCore.c \ # ../@rivet_commands@/rivetInspect.c \ # ../@rivet_channel@/rivetChannel.c \ # ../parser/rivetParser.c \ # TclWebapache.c \ # apache_config.c \ # mod_rivet_common.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@/parser -I../@apache_request@ @apache_include@ -I@RIVET_BASE_INCLUDE@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_CPPFLAGS@ @APR_INCLUDES@ -DSTART_TAG='""' # #lib_libexecdir = @RIVET_TCL_TARGET@/mpm #lib_libexec_LTLIBRARIES = rivet_worker_mpm.la rivet_prefork_mpm.la rivet_aprthread_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@ # #rivet_prefork_mpm_la_SOURCES = rivet_prefork_mpm.c #rivet_prefork_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version #rivet_prefork_mpm_la_LIBADD = @APXS_LIBS@ #rivet_prefork_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@ # #rivet_aprthread_mpm_la_SOURCES = rivet_aprthread_mpm.c #rivet_aprthread_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version #rivet_aprthread_mpm_la_LIBADD = @APXS_LIBS@ #rivet_aprthread_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@ # rivet-3.0.0/doc/examples/color-table.tcl000664 001750 001750 00000001766 15224454746 020736 0ustar00manghimanghi000000 000000 puts "" puts "" puts "" puts "" # we create a 9x9 table selecting a different background for each cell for {set i 0} { $i < 9 } {incr i} { puts "" for {set j 0} {$j < 9} {incr j} { set r [expr int(255 * ($i + $j) / 16)] set g [expr int(255 * (8 - $i + $j) / 16)] set b [expr int(255 * ($i + 8 - $j) / 16)] # determining the background luminosity (YIQ space of NTSC) and choosing # the foreground color accordingly in order maintain maximum contrast if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 128.0} { set cssclass "dark" } else { set cssclass "bright" } puts [format "" $r $g $b $cssclass] } puts "" } puts "
$r $g $b
" puts "" rivet-3.0.0/doc/html/images/prev.png000644 001750 001750 00000001461 15224455140 020057 0ustar00manghimanghi000000 000000 PNG  IHDR ꂣAsBIT|d pHYsGGGtEXtSoftwarewww.inkscape.org<IDATHK@K6-ݔTed>A'ފ1pc!mL|3j\7 Z2O.ra@J$ɠSH8Ù\pS8CalG`၄ !QDy?]QU .?Y0;~T\^2بϖpxTC5Kjur><vpx{:Z Z;_i O H3Yn4?Z]RK։?<GEY^MK҄U3OE"Q\?'tѺ8~e$ҟ8ִ:}1 R!dn?vmzEqUuw'P3ch|_q.W8oQ6+Uqne7ǝ^*!1R.rY 0^jy;. 7 K1!) lĬvX,vn;oy-Axmk`8,[h=x+D%f+,[lӴ@ F~.Sv969D4Um!ʶ|.QA0{5]ilcyt1W./tJsnw KXR': C9EYD@\ nU0^38KIENDB`rivet-3.0.0/doc/html/images/tip.png000644 001750 001750 00000000701 15224455140 017673 0ustar00manghimanghi000000 000000 PNG  IHDR* bKGD#2IDATxu @!+x6KR+hJTaK >߁Rh~j?g0qF@!eH,0܆x0&p ^J5y=J % P<*ğ{j #7^L~!=&Ṳ; &rgߊFmͩP; ot6BJqC Xdui]}OL4+|) -CtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignatureee9d877396ce267aeb0179d35f81b2ac3'tEXtPage25x24+0+0 IENDB`rivet-3.0.0/src/mod_rivet_ng/rivet_prefork_mpm.c000664 001750 001750 00000017527 15224454746 022607 0ustar00manghimanghi000000 000000 /* rivet_prefork_mpm.c: dynamically loaded MPM aware functions for prefork module */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #include #include "mod_rivet.h" #include "mod_rivet_common.h" #include "mod_rivet_generator.h" #include "mod_rivet_cache.h" #include "httpd.h" #include "rivetChannel.h" #include "apache_config.h" #include "rivet.h" #include "rivetCore.h" #include "worker_prefork_common.h" extern DLLIMPORT mod_rivet_globals* module_globals; extern DLLIMPORT apr_threadkey_t* rivet_thread_key; extern module rivet_module; rivet_thread_private* Rivet_VirtualHostsInterps (rivet_thread_private* private); void Rivet_RunChildScripts (rivet_thread_private* private,bool init); /* -- PreforkBridge_Finalize */ apr_status_t PreforkBridge_Finalize (void* data) { rivet_thread_private* private; server_rec* s = (server_rec*) data; RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key,private) ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, s, "Running prefork bridge finalize method"); // No, we don't do any clean up anymore as we are just shutting this process down // Rivet_ProcessorCleanup(private); return OK; } /* -- PreforkBridge_ChildInit: bridge child process initialization * */ void PreforkBridge_ChildInit (apr_pool_t* pool, server_rec* server) { rivet_server_conf* rsc = RIVET_SERVER_CONF (module_globals->server->module_config); rivet_thread_private* private; ap_assert (apr_threadkey_private_create (&rivet_thread_key, NULL, pool) == APR_SUCCESS); /* * This is the only execution thread in this process so we create * the Tcl thread private data here. In a fork capable OS * private data should have been created by the httpd parent process */ private = Rivet_ExecutionThreadInit(); private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific)); private->ext->interps = apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp)); /* we now establish the full rivet core command set for the root interpreter */ Rivet_InitCore (module_globals->server_interp->interp,private); /* The root interpreter is created without a rivet cache (that wouldn't make sense * in that context. We create the cache now */ module_globals->server_interp->cache_size = rsc->default_cache_size; if (module_globals->server_interp->cache_size < 0) { module_globals->server_interp->cache_size = RivetCache_DefaultSize(); } module_globals->server_interp->cache_free = module_globals->server_interp->cache_size; ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,server,"root interpreter cache size: %d (free: %d)", module_globals->server_interp->cache_size, module_globals->server_interp->cache_free); RivetCache_Create(module_globals->pool,module_globals->server_interp); #ifdef RIVET_NAMESPACE_IMPORT { char* tcl_import_cmd = "namespace eval :: { namespace import -force ::rivet::* }\n"; Tcl_Eval (module_globals->server_interp->interp,tcl_import_cmd); } #endif /* * We proceed creating the vhost interpreters database */ if (Rivet_VirtualHostsInterps(private) == NULL) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME ": Tcl Interpreters creation fails"); exit(1); } } /* * -- PreforkBridge_Request * * The prefork implementation of this function is basically a wrapper of * Rivet_SendContent. The real job is fetching the thread private data * * Arguments: * * request_rec* rec * * Returned value: * * HTTP status code (see the Apache HTTP web server documentation) */ int PreforkBridge_Request (request_rec* r,rivet_req_ctype ctype) { rivet_thread_private* private; /* fetching the thread private data to be passed to Rivet_SendContent */ RIVET_PRIVATE_DATA_NOT_NULL (rivet_thread_key, private); private->ctype = ctype; private->req_cnt++; private->r = r; return Rivet_SendContent(private); } /* * -- MPM_MasterInterp * * * */ rivet_thread_interp* MPM_MasterInterp(server_rec* server) { rivet_thread_private* private; int tcl_status; RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key, private); module_globals->server_interp->channel = private->channel; /* * We are returning the interpreter inherited from * the parent process. The fork preserves the internal status * of the process, math engine status included. This fact implies * the random number generator has the same seed and every * child process for which SeparateVirtualInterps would generate * the same random number sequence. We therefore reseed the RNG * calling a Tcl script fragment */ tcl_status = Tcl_Eval(module_globals->server_interp->interp,"expr {srand([clock clicks] + [pid])}"); if (tcl_status != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME ": Tcl interpreter random number generation reseeding failed"); } return module_globals->server_interp; } /* * -- PreforkBridge_ExitHandler * * Just calling Tcl_Exit * * Arguments: * int code * * Side Effects: * * the thread running the Tcl script will exit */ int PreforkBridge_ExitHandler(rivet_thread_private* private) { Rivet_RunChildScripts(private,false); Tcl_Exit(private->exit_status); /* actually we'll never get here but we return * the Tcl return code anyway to silence the * compilation warning */ return TCL_OK; } rivet_thread_interp* PreforkBridge_Interp (rivet_thread_private* private, rivet_server_conf* conf, rivet_thread_interp* interp) { if (interp != NULL) { private->ext->interps[conf->idx] = interp; } return private->ext->interps[conf->idx]; } /* * -- PreforkBridge_ServerInit * * Bridge server wide inizialization: * */ int PreforkBridge_ServerInit (apr_pool_t* pPool,apr_pool_t* pLog,apr_pool_t* pTemp,server_rec* s) { /* Whether single_thread_exit is 1 or 0 doesn't make any difference for * the prefork bridge, we set the default value anyway in case it hadn't been * set already in the configuration */ if (module_globals->single_thread_exit == SINGLE_THREAD_EXIT_UNDEF) { module_globals->single_thread_exit = 0; } /* The root interpreter is created without a rivet cache (that wouldn't make sense * in that context. We create the cache now */ if (module_globals->server_interp->cache_size) { RivetCache_Create(pPool,module_globals->server_interp); } return OK; } /* Table of bridge control functions */ DLLEXPORT RIVET_MPM_BRIDGE { .server_init = PreforkBridge_ServerInit, .thread_init = PreforkBridge_ChildInit, .request_processor = PreforkBridge_Request, .child_finalize = PreforkBridge_Finalize, .exit_handler = PreforkBridge_ExitHandler, .thread_interp = PreforkBridge_Interp }; rivet-3.0.0/tests/tclfile.test000664 001750 001750 00000000332 15224454746 017115 0ustar00manghimanghi000000 000000 # $Id$ ::tcltest::test tclfile-1.1 {Plain .tcl file} { set page [ ::http::geturl "${urlbase}tclfile.tcl" ] set pgdata [string trim [ ::http::data $page ] ] } "¡ À È Ì Ò Ù - El Burro Sabe Más Que Tú!" rivet-3.0.0/rivet/packages/tclrivet/tclrivetparser.tcl000664 001750 001750 00000011653 15224454746 023760 0ustar00manghimanghi000000 000000 # tclrivetparser.tcl -- parse Rivet files in pure Tcl. # Copyright 2003-2004 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. package provide tclrivetparser 0.1 namespace eval tclrivetparser { set starttag set outputcmd {puts -nonewline} namespace export parserivetdata } # tclrivetparser::setoutputcmd -- # # Set the output command used. In regular Rivet scripts, we use # puts, but that might not be ideal if you want to parse Rivet # pages in a Tcl script. # # Arguments: # newcmd - if empty, return the current command, if not, set the # command. # # Side Effects: # May set the output command used. # # Results: # The current output command. proc tclrivetparser::setoutputcmd { {newcmd ""} } { variable outputcmd if { $outputcmd == "" } { return $outputcmd } set outputcmd $newcmd } # tclrivetparser::parse -- # # Parse a buffer, transforming into the appropriate # Tcl strings. Note that initial 'puts "' is not performed # here. # # Arguments: # data - data to scan. # outbufvar - name of the output buffer. # # Side Effects: # None. # # Results: # Returns the $inside variable - 1 if we are inside a # section, 0 if we outside. proc tclrivetparser::parse { data outbufvar } { variable outputcmd variable starttag variable endtag set inside 0 set shorthand 0 upvar $outbufvar outbuf set i 0 set p 0 set len [expr {[string length $data] + 1}] set next [string index $data 0] while {$i < $len} { incr i set cur $next set next [string index $data $i] if { $inside == 0 } { # Outside the delimiting tags. if { $cur == [string index $starttag $p] } { incr p if { $p == [string length $starttag] } { if {$next == "="} { # puts stderr "shorthand begin detected" append outbuf "\"\n $outputcmd " set shorthand 1 incr i set next [string index $data $i] } else { append outbuf "\"\n" } set inside 1 set p 0 continue } } else { if { $p > 0 } { append outbuf [string range $starttag 0 [expr {$p - 1}]] set p 0 } switch -exact -- $cur { "\{" { append outbuf \ $cur } "\}" { append outbuf \ $cur } "\$" { append outbuf "\\$" } "\[" { append outbuf "\\[" } "\]" { append outbuf "\\]" } "\"" { append outbuf "\\\"" } "\\" { append outbuf "\\\\" } default { append outbuf $cur } } continue } } else { # Inside the delimiting tags. if { $cur == [string index $endtag $p] } { incr p if { $p == [string length $endtag] } { if {$shorthand} { # puts stderr "shorthand end detected" set shorthand 0 } append outbuf "\n$outputcmd \"" set inside 0 set p 0 } } else { if { $p > 0 } { append outbuf [string range $endtag 0 $p] set p 0 } append outbuf $cur } } } return $inside } # tclrivetparser::parserivetdata -- # # Parse a rivet script, and add the relavant opening and closing # bits. # # Arguments: # data - data to parse. # # Side Effects: # None. # # Results: # Returns the parsed script. proc tclrivetparser::parserivetdata { data } { variable outputcmd set outbuf {} append outbuf "$outputcmd \"" if { [parse $data outbuf] == 0 } { append outbuf "\"\n" } return $outbuf } rivet-3.0.0/src/parser/Makefile.am000664 001750 001750 00000002377 15224454746 017562 0ustar00manghimanghi000000 000000 # Makefile for Rivet # Copyright 2004-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. # ... and these two. We want to put the libs in the package path, # rather than the standard library location for the system. lib_libexecdir = @RIVET_TCL_TARGET@ lib_libexec_LTLIBRARIES = librivetparser.la # # Rivet Parser Library # librivetparser_la_SOURCES = rivetParser.c parserPkgInit.c librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version librivetparser_la_LIBADD = @APXS_LIBS@ librivetparser_la_CPPFLAGS = @apache_include@ -I@RIVET_BASE_INCLUDE@/@apache_version_dir@ -I@RIVET_BASE_INCLUDE@ -I../@apache_version_dir@ -I.. @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ -DSTART_TAG='""' -DUSE_TCL_STUBS rivet-3.0.0/tests/tclfile.tcl000664 001750 001750 00000000131 15224454746 016715 0ustar00manghimanghi000000 000000 # test file for plain .tcl files puts "¡ À È Ì Ò Ù - El Burro Sabe Más Que Tú!" rivet-3.0.0/tests/docroot2/basic2.rvt000664 001750 001750 00000000024 15224454746 020223 0ustar00manghimanghi000000 000000 Virtual Host2 Test rivet-3.0.0/doc/html/images/important.png000644 001750 001750 00000001322 15224455140 021114 0ustar00manghimanghi000000 000000 PNG  IHDRשPLTE)))999BB1ZZ)ccBBBRRRkkBccRssRccckkk{{{9!9Z{c{JRZck{!19)11!ZRsckBc{bKGDCg bIDATxm S0 3E1KPTF'ǮQ]_iKB&F(6rc/Ѵ\Nh* 2p=:Jv?6| @}`^>s PvBɨ@d6"o;g`Ps+s%ǯ%@S{4ܾU-s"1ч?j<`g eZ* +æ2_Yv*lv~g Z[sY[Ða; =/oJĘ!fclRmRCtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignaturec3ecc1fc5135d1e959695e569d213122riIENDB`rivet-3.0.0/rivet/rivet-tcl/html.tcl000664 001750 001750 00000001212 15224454746 020140 0ustar00manghimanghi000000 000000 ### ## html ?arg.. arg.. arg..? ## Print text with the added ability to pass HTML tags following the string. ## Example: ## html "Test" b i ## ## Will produce: ## Test ## ## string - A text string to be displayed. ## args - A list of HTML tags (without <>) to surround in. ## ## $Id$ ## ### namespace eval ::rivet { proc html {string args} { foreach arg $args { append output <$arg> } append output $string for {set i [expr {[llength $args] - 1} ]} {$i >= 0} {incr i -1} { append output } puts $output } } rivet-3.0.0/doc/html/dio.html000664 001750 001750 00000003376 15224455137 016610 0ustar00manghimanghi000000 000000 DIO - Database Interface Objects

DIO - Database Interface Objects

rivet-3.0.0/doc/html/catch.html000664 001750 001750 00000012061 15224455137 017106 0ustar00manghimanghi000000 000000 catch

Name

catch — wraps core command catch

Synopsis

::rivet::catch ?script? ?error_code_var_name? ?options_var_name?

Description

::rivet::catch wraps the core language catch command adding some extra error handling needed by mod_rivet design. The rationale for Rivet to have its own ::rivet::catch reads as follows: within mod_rivet a script execution can be interrupted by either calling ::rivet::exit (not recommended) or ::rivet::abort_page. These commands implement a simple internal exception mechanism by returning a special error code so that execution is in turn handed down to the AbortScript and eventually to AfterEveryScript (if any of them is defined). Any code calling one of these commands which runs under control of the ::catch command would need to do this chore itself, checking the error info and in case throw the error again if it had been originated by one of mod_rivet's exceptions calls. This is what ::rivet::catch does by hiding the implementation details and providing a better and more compatibile way to handle this condition.

[Note]Note
This command is not meant to replace the core command, thus it's not exported from the ::rivet namespace and therefore has to be fully qualified.
rivet-3.0.0/doc/html/exit.html000664 001750 001750 00000013626 15224455137 017005 0ustar00manghimanghi000000 000000 exit

Name

exit — terminate execution and child process

Synopsis

::rivet::exit ?code?

Description

Replaces Tcl's exit core command. ::rivet::exit interrupts execution of the current script and passes execution to AbortScript if such script is set. After AbortScript has finished and request processing completed the child process is forced to exit by eventually calling Tcl_Exit producing the same final effect of the core command. During an AbortScript execution the exit condition can be detected

if {[::rivet::abort_page -exiting]} {
...handle exit condition
}

::rivet::exit has a single optional argument ?code?. This value must be a positive integer number to be passed to Tcl_Exit. If any other value is given ?code? is set to 0. The exit code can be obtained from the dictionary returned by ::rivet::abort_code

[::rivet::abort_code]
<== return_code  ?code? error_code exit

Rivet's specific implementation prevents any abrupt process termination that otherwise the exit command would bring about deferring the call to Tcl_Exit to a later stage when the request processing has finished. This is always true if the mod_rivet runs the prefork bridge. The behavior with the worker bridge depends on the SingleThreadExit configuration directive. By default all the threads of a single process are requested to exit before the child process exits. Starting with version 3.2 by setting the SingleThreadExit option directive calling ::rivet::exit causes a single thread termination. Though always accepted this directive is meaningful only if used with the worker or lazy bridges.

[Note]Note
Nonetheless we discourage the programmer to use such command, and suggest to focus on proper application design and avoid such a drastic way to bail out. If you need to restart the child processes from time to time we recommend to check the MaxRequests parameter in the prefork MPM documentation or the MaxRequestsPerChild configuration parameter
rivet-3.0.0/doc/html/lazybridge.html000664 001750 001750 00000056351 15224455140 020164 0ustar00manghimanghi000000 000000 Example: the “Lazy” bridge

Example: the Lazy bridge

The rationale of threaded bridges

The 'bridge' concept was introduced to cope with the ability of the Apache HTTP web server to adopt different multiprocessing models by loading one of the available MPMs (Multi Processing Modules). A bridge's task is to let mod_rivet fit the selected multiprocessing model in the first place. Still separating mod_rivet core functions from the MPM machinery provided also a solution for implementing a flexible and extensible design that enables a programmer to develop alternative approaches to workload and resource management.

The Apache HTTP web server demands its modules to run with any MPM irrespective of its internal architecture and its a general design constrain to make no assumptions about the MPM. This clashes with some requirements of threaded builds of Tcl. First of all Tcl is itself threaded (unless threads are disabled at compile time) and many of the basic Tcl data structures (namely Tcl_Obj) cannot be safely shared among threads. This demands a Tcl interpreters be run on separated threads communicating with the HTTP web server through suitable methods.

Lazy bridge data structures

The lazy bridge was initially developed to outline the basic tasks carried out by each function making a rivet MPM bridge. The lazy bridge attempts to be minimalist but it's nearly fully functional, only a few configuration directives (SeparateVirtualInterps and SeparateChannel) are ignored because fundamentally incompatible. The bridge is experimental but perfectly fit for many applications, for example it's good on development machines where server restarts are frequent.

This is the lazy bridge jump table, as such it defines the functions implemented by the bridge.

RIVET_MPM_BRIDGE {
    LazyBridge_ServerInit,
    LazyBridge_ChildInit,
    LazyBridge_Request,
    LazyBridge_Finalize,
    LazyBridge_ExitHandler,
    LazyBridge_Interp
};

After the server initialization stage, child processes read the configuration and modules build their own configuration representation. MPM bridges hooks into this stage to store and/or build data structures relevant to their design. A fundamental information built during this stage is the database of virtual hosts. The lazy bridge keeps an array of virtual host descriptor pointers each of them referencing an instance of the following structure.

/* virtual host thread queue descriptor */

typedef struct vhost_iface {
    int                 threads_count;      /* total number of running and idle threads */
    apr_thread_mutex_t* mutex;              /* mutex protecting 'array'                 */
    apr_array_header_t* array;              /* LIFO array of lazy_tcl_worker pointers   */
} vhost;

A pointer to this data structure array is stored in the bridge status which is a basic structure that every bridge has to create.

/* Lazy bridge internal status data */

typedef struct mpm_bridge_status {
    apr_thread_mutex_t* mutex;
    int                 exit_command;
    int                 exit_command_status;
    int                 server_shutdown;    /* the child process is shutting down  */
    vhost*              vhosts;             /* array of vhost descriptors          */
} mpm_bridge_status;

The lazy bridge also extends the thread private data structure with the data concerning the Tcl intepreter

/* lazy bridge thread private data extension */

typedef struct mpm_bridge_specific {
    rivet_thread_interp*  interp;           /* thread Tcl interpreter object        */
    int                   keep_going;       /* thread loop controlling variable     */
} mpm_bridge_specific;

By design the bridge must create exactly one instance of mpm_bridge_status and store its pointer in module_globals->mpm. This is usually done at the very beginning of the child init script function pointed by mpm_child_init in the rivet_bridge_table structure. For the lazy bridge this field points to Lazy_MPM_ChildInit function

/*
 * -- LazyBridge_ChildInit
 * 
 * child process initialization. This function prepares the process
 * data structures for virtual hosts and threads management
 *
 */

void LazyBridge_ChildInit (apr_pool_t* pool, server_rec* server)
{
    apr_status_t    rv;
    server_rec*     s;
    server_rec*     root_server = module_globals->server;

    module_globals->mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status));

    /* This mutex is only used to consistently carry out these 
     * two tasks
     *
     *  - set the exit status of a child process (hopefully will be 
     *    unnecessary when Tcl is able again of calling 
     *    Tcl_DeleteInterp safely) 
     *  - control the server_shutdown flag. Actually this is
     *    not entirely needed because once set this flag 
     *    is never reset to 0
     *
     */

    rv = apr_thread_mutex_create(&module_globals->mpm->mutex,
                                  APR_THREAD_MUTEX_UNNESTED,pool);
    ap_assert(rv == APR_SUCCESS);

    /* the mpm->vhosts array is created with as many entries as the number of
     * configured virtual hosts */

    module_globals->mpm->vhosts = 
        (vhost *) apr_pcalloc(pool,module_globals->vhosts_count*sizeof(vhost));
    ap_assert(module_globals->mpm->vhosts != NULL);

    /*
     * Each virtual host descriptor has its own mutex controlling
     * the queue of available threads
     */
     
    for (s = root_server; s != NULL; s = s->next)
    {
        int                 idx;
        apr_array_header_t* array;
        rivet_server_conf*  rsc = RIVET_SERVER_CONF(s->module_config);

        idx = rsc->idx;
        rv  = apr_thread_mutex_create(&module_globals->mpm->vhosts[idx].mutex,
                                      APR_THREAD_MUTEX_UNNESTED,pool);
        ap_assert(rv == APR_SUCCESS);
        array = apr_array_make(pool,0,sizeof(void*));
        ap_assert(array != NULL);
        module_globals->mpm->vhosts[idx].array = array;
        module_globals->mpm->vhosts[idx].threads_count = 0;
    }
    module_globals->mpm->server_shutdown = 0;
}

Handling Tcl's exit core command

Most fields in the mpm_bridge_status are meant to deal with the child exit process. Rivet supersedes the Tcl core's exit function with ::rivet::exit command and it does so in order to curb the side effects of the core function Tcl_Exit that would force a whole child process to exit immediately. This could have unwanted consequences in any environment, like missing the execution of code dedicated to release locks or remove files. For threaded MPMs the abrupt child process termination could be even more disruptive as all threads will be deleted right away.

The ::rivet::exit implementation calls the function pointed by mpm_exit_handler which is bridge specific. Its main duty is to take the proper action in order to release resources and force the bridge controlled threads to exit.

[Note]Note
Nonetheless the exit command should be avoided in ordinary mod_rivet programming. We cannot stress this point enough. If your application must bail out for some reason focus your attention on the design to find the most appropriate route to exit and whenever possible avoid calling exit (which basically wraps a C call to Tcl_Exit) at all. Anyway the Rivet implementation partially transforms exit in a sort of special ::rivet::abort_page implementation whose eventual action is to call the Tcl_Exit library call. See the exit command code for further explanations.

Both the worker bridge and lazy bridge implementations of mpm_exit_handler call the function pointed by mpm_finalize which is also the function called by the framework when the web server shuts down. See these functions' code for further details, they are very easy to read and understand

HTTP request processing with the lazy bridge

Requests processing with the lazy bridge is done by determining for which virtual host a request was created. The rivet_server_conf structure keeps a numerical index for each virtual host. This index is used to reference the virtual host descriptor and from it the request handler tries to gain lock on the mutex protecting the array of lazy_tcl_worker structure pointers. Each instance of this structure is a descriptor of a thread created for a specific virtual host; threads available for processing have their descriptor on that array and the handler callback will pop the first lazy_tcl_worker pointer to signal the thread there is work to do for it. This is the lazy_tcl_worker structure

/* lazy bridge Tcl thread status and communication variables */

typedef struct lazy_tcl_worker {
    apr_thread_mutex_t* mutex;
    apr_thread_cond_t*  condition;
    int                 status;
    apr_thread_t*       thread_id;
    server_rec*         server;
    request_rec*        r;
    int                 ctype;
    int                 ap_sts;
    rivet_server_conf*  conf;               /* rivet_server_conf* record */
} lazy_tcl_worker;

The server field is initialized with the virtual host server record. Whereas the conf field keeps the pointer to a run time computed rivet_server_conf. This structure may change from request to request because the request configuration changes when the URL may refer to directory specific configuration in <Directory ...>...</Directory> blocks

The Lazy bridge will not start any Tcl worker thread at server startup, but it will wait for requests to come in and then if worker threads are sitting on a virtual host queue a thread's lazy_tcl_worker structure pointer is popped and the request handed to it. If no available thread is on the queue a new worker thread is created. The code in the Lazy_MPM_Request easy to understand and shows how this is working

/* -- LazyBridge_Request
 *
 * The lazy bridge HTTP request function. This function
 * stores the request_rec pointer into the lazy_tcl_worker
 * structure which is used to communicate with a worker thread.
 * Then the array of idle threads is checked and if empty
 * a new thread is created by calling create_worker
 */

int LazyBridge_Request (request_rec* r,rivet_req_ctype ctype)
{
    lazy_tcl_worker*    w;
    int                 ap_sts;
    rivet_server_conf*  conf = RIVET_SERVER_CONF(r->server->module_config);
    apr_array_header_t* array;
    apr_thread_mutex_t* mutex;

    mutex = module_globals->mpm->vhosts[conf->idx].mutex;
    array = module_globals->mpm->vhosts[conf->idx].array;
    apr_thread_mutex_lock(mutex);

    /* This request may have come while the child process was
     * shutting down. We cannot run the risk that incoming requests
     * may hang the child process by keeping its threads busy,
     * so we simply return an HTTP_INTERNAL_SERVER_ERROR.
     * This is hideous and explains why the 'exit' commands must
     * be avoided at any costs when programming with mod_rivet
     */

    if (module_globals->mpm->server_shutdown == 1)
    {
        ap_log_rerror(APLOG_MARK,APLOG_ERR,APR_EGENERAL,r,
                      MODNAME ": http request aborted during child process shutdown");
        apr_thread_mutex_unlock(mutex);
        return HTTP_INTERNAL_SERVER_ERROR;
    }

    /* If the array is empty we create a new worker thread */

    if (apr_is_empty_array(array))
    {
        w = create_worker(module_globals->pool,r->server);
    }
    else
    {
        w = *(lazy_tcl_worker**) apr_array_pop(array);
    }

    apr_thread_mutex_unlock(mutex);

    /* Locking the thread descriptor structure mutex */

    apr_thread_mutex_lock(w->mutex);
    w->r        = r;
    w->ctype    = ctype;
    w->status   = init;
    w->conf     = conf;
    apr_thread_cond_signal(w->condition);

    /* we wait for the Tcl worker thread to finish its job */

    while (w->status != done) {
        apr_thread_cond_wait(w->condition,w->mutex);
    }
    ap_sts = w->ap_sts;

    w->status = idle;
    w->r      = NULL;
    apr_thread_cond_signal(w->condition);
    apr_thread_mutex_unlock(w->mutex);

    return ap_sts;
}

After a request is processed the worker thread returns its own lazy_tcl_worker descriptor to the array and then waits on the condition variable used to control and synchronize the bridge threads with the Apache worker threads. The worker thread code is the request_processor function

/*
 * -- request_processor
 *
 * The lazy bridge worker thread. This thread initializes its control data and
 * prepares to serve requests addressed to the virtual host which is meant to work
 * as a content generator. Virtual host server data are stored in the
 * lazy_tcl_worker structure stored in the generic pointer argument 'data'
 *
 */

static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data)
{
    lazy_tcl_worker*        w = (lazy_tcl_worker*) data;
    rivet_thread_private*   private;
    int                     idx;
    rivet_server_conf*      rsc;

    /* The server configuration */

    rsc = RIVET_SERVER_CONF(w->server->module_config);

    /* Rivet_ExecutionThreadInit creates and returns the thread private data. */

    private = Rivet_ExecutionThreadInit();

    /* A bridge creates and stores in private->ext its own thread private
     * data. The lazy bridge is no exception. We just need a flag controlling
     * the execution and an intepreter control structure */

    private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific));
    private->ext->keep_going = true;
    RIVET_POKE_INTERP(private,rsc,Rivet_NewVHostInterp(private->pool,rsc->default_cache_size));
    private->ext->interp->channel = private->channel;

    /* The worker thread can respond to a single request at a time therefore
       must handle and register its own Rivet channel */

    Tcl_RegisterChannel(private->ext->interp->interp,*private->channel);

    /* From the rivet_server_conf structure we determine what scripts we
     * are using to serve requests */

    private->ext->interp->scripts =
            Rivet_RunningScripts (private->pool,private->ext->interp->scripts,rsc);

    /* This is the standard Tcl interpreter initialization */

    Rivet_PerInterpInit(private->ext->interp,private,w->server,private->pool);

    /* The child initialization is fired. Beware the terminological
     * trap: we inherited from fork capable systems the term 'child'
     * meaning 'child process'. In this case the child init actually
     * is a worker thread initialization, because in a threaded module
     * this is the agent playing the same role a child process plays
     * with the prefork bridge */

    Lazy_RunConfScript(private,w,child_init);

    idx = w->conf->idx;

    /* After the thread has run the configuration script we
       increment the threads counter */

    apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex);
    (module_globals->mpm->vhosts[idx].threads_count)++;
    apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);

    /* The thread is now set up to serve request within the the
     * do...while loop controlled by private->keep_going  */

    apr_thread_mutex_lock(w->mutex);
    do
    {
        while ((w->status != init) && (w->status != thread_exit)) {
            apr_thread_cond_wait(w->condition,w->mutex);
        }
        if (w->status == thread_exit) {
            private->ext->keep_going = false;
            continue;
        }

        w->status = processing;

        /* Content generation */

        private->req_cnt++;
        private->ctype = w->ctype;
        private->r = w->r;

        w->ap_sts = Rivet_SendContent(private);

        w->status = done;
        apr_thread_cond_signal(w->condition);
        while (w->status == done) {
            apr_thread_cond_wait(w->condition,w->mutex);
        }

        /* rescheduling itself in the array of idle threads */

        apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex);
        *(lazy_tcl_worker **) apr_array_push(module_globals->mpm->vhosts[idx].array) = w;
        apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);

    } while (private->ext->keep_going);
    apr_thread_mutex_unlock(w->mutex);

    Lazy_RunConfScript(private,w,child_exit);
    ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,w->server,"processor thread orderly exit");

    apr_thread_mutex_lock(module_globals->mpm->vhosts[idx].mutex);
    (module_globals->mpm->vhosts[idx].threads_count)--;
    apr_thread_mutex_unlock(module_globals->mpm->vhosts[idx].mutex);

    apr_thread_exit(thd,APR_SUCCESS);
    return NULL;
}

The lazy bridge module_globals->bridge_jump_table->mpm_thread_interp, which is supposed to return the rivet_thread_interp structure pointer relevant to a given request, has a straightforward task to do since by design each thread has one interpreter

rivet_thread_interp* LazyBridge_Interp (rivet_thread_private* private,
                                      rivet_server_conf*    conf,
                                      rivet_thread_interp*  interp)
{
    if (interp != NULL) { private->ext->interp = interp; }

    return private->ext->interp;
}

As already pointed out running this bridge you get separate virtual interpreters and separate channels by default and since by design each threads gets its own Tcl interpreter and Rivet channel you will not be able to revert this behavior in the configuration with

SeparateVirtualInterps Off
SeparateChannels       Off

which are simply ignored

rivet-3.0.0/doc/xml/000775 001750 001750 00000000000 15224454746 014777 5ustar00manghimanghi000000 000000 rivet-3.0.0/tclconfig/README.txt000664 001750 001750 00000001454 15224454746 017104 0ustar00manghimanghi000000 000000 These files comprise the basic building blocks for a Tcl Extension Architecture (TEA) extension. For more information on TEA see: http://www.tcl.tk/doc/tea/ This package is part of the Tcl project at SourceForge, and latest sources should be available there: http://tcl.sourceforge.net/ This package is a freely available open source package. You can do virtually anything you like with it, such as modifying it, redistributing it, and selling it either in whole or in part. CONTENTS ======== The following is a short description of the files you will find in the sample extension. README.txt This file install-sh Program used for copying binaries and script files to their install locations. tcl.m4 Collection of Tcl autoconf macros. Included by a package's aclocal.m4 to define TEA_* macros. rivet-3.0.0/rivet/rivet-tcl/http_accept.tcl000664 001750 001750 00000005574 15224454746 021511 0ustar00manghimanghi000000 000000 # -- http_accept # # function for parsing Accept-* HTTP headers lines. # # http_accept parses an HTTP header line (as in the case # for language or media type negoziation) and returns a dictionary # where fields are associated to their precedence # # Output can be controlled with the following switches # # -zeroweight: appends also fiels with 0 precedence # -default: set default weight value to unset fields # -list: returns a list of the fields in the header line # in descending order of precedence # # This function was contributed by Harald Oehlmann # # $Id$ # namespace eval ::rivet { proc ::rivet::http_accept {args} { set lqValues {} set lItems {} # parameter while { [llength $args] > 1 } { set args [lassign $args argCur] switch -exact -- $argCur { -zeroweight { set fZeroWeight 1 } -list {set oList 1} -default { set fDefault 1 } -- {} default { return -code error "Unknown argument '$argCur'" } } } # loop over comma-separated items foreach itemCur [split [lindex $args 0] ,] { # Find q value as last element separated by ; set qCur 1 if {[regexp {^(.*); *q=([^;]*)$} $itemCur match itemCur qString]} { if { 1 == [scan $qString %f qVal] && $qVal >= 0 && $qVal <= 1 } { set qCur $qVal } } set itemCur [string trim $itemCur] if { $itemCur in {"*" "*/*" "*-*"} } { unset -nocomplain fDefault } if { [info exists fZeroWeight] || $qCur > 0 } { lappend lqValues $qCur lappend lItems $itemCur } } # build output dict in decreasing q order set dOut {} # we are going to keep a list of keys in order of decresing precedence, # in case the list has to be returned. # we return a list if oList was set otherwise a dictionary is build # and returned if {[info exists oList]} { set sorted_keys {} foreach indexCur [lsort -real -decreasing -indices $lqValues] { lappend sorted_keys [lindex $lItems $indexCur] } return $sorted_keys } else { foreach indexCur [lsort -real -decreasing -indices $lqValues] { set qCur [lindex $lqValues $indexCur] if {$qCur == 0 && [info exists fDefault]} { dict set dOut * 0.01 unset fDefault } set item_key [lindex $lItems $indexCur] dict set dOut $item_key $qCur } if { [info exists fDefault] } { dict set dOut * 0.01 } return $dOut } } } rivet-3.0.0/tests/docroot2/vhost2.rvt000664 001750 001750 00000000370 15224454746 020311 0ustar00manghimanghi000000 000000 " puts "::childinit2 exists
" } elseif {[info exists ::beforescript2]} { ?>Virtual Host2 Test" } ?> rivet-3.0.0/tests/shorthand.rvt000664 001750 001750 00000000102 15224454746 017314 0ustar00manghimanghi000000 000000
rivet-3.0.0/doc/html/dio_package.html000664 001750 001750 00000144055 15224455137 020263 0ustar00manghimanghi000000 000000 DIO

Name

DIO — Database Interface Objects

Synopsis

::DIO::handle interface ?objectName? (-option | option | -option | option | ...)
::DIO::handle Tdbc interface ?objectName? (-option | option | -option | option | ...)

Description

DIO is designed to be a generic, object-oriented interface to SQL databases. Its main goal is to be as generic as possible, but since not all SQL databases support the exact same syntaxes, keeping code generic between databases is left to the abilities of the programmer. DIO simply provides a way to keep the Tcl interface generic.

interface - The name of the database interface. Currently supported direct interfaces are Postgresql, Mysql, Oracle and Sqlite. Starting with version 1.2 DIO supports also the TDBC DBMS driver series through the Tdbc interface. In this form the command requires a further argument for one of the TDBC drivers. Avaliable TDBC drivers are: mysql (supports also MariaDB), odbc (provides also support for Oracle), postgresql and sqlite

If objectName is specified, DIO creates an object of that name. If there is no objectName given, DIO will automatically generate a unique object ID

Options

-host ?hostname?
The hostname of the computer to connect to. If none is given, DIO assumes the local host.
-port ?portNumber?
The port number to connect to on hostname.
-user ?username?
The username you wish to login to the server as.
-pass ?password?
The password to login to the server with.
-db ?database?
The name of the database to connect to.
-table ?tableName?
The default table to use when using built-in commands for storing and fetching.
-keyfield ?keyFieldname?
The default field to use as the primary key when using built-in commands for storing and fetching.
-autokey (1 | 0)
If this option is set to 1, DIO will attempt to determine an automatic key for keyField when storing and fetching. In most databases, this requires that the sequence also be specified. In the case of MySQL, where sequences do not exist, autokey must be used in conjunction with a table which has a field specified as AUTO.
-sequence ?sequenceName?
If DIO is automatically generating keys, it will use this sequence as a means to gain a unique number for the stored key.

DIO Object Commands

objectName ?array? ?request?
Execute request as a SQL query and create an array from the first record found. The array is set with the fields of the table and the values of the record found.
objectName ?autokey? (value | boolean)
Return the current autokey value. If value is specified, it sets a new value for the autokey option.
objectName ?close?
Close the current database connection. This command is automatically called when the DIO object is destroyed.
objectName ?count?
Return a count of the number of rows in the specified (or current) table.
objectName ?db? ?value?
Return the current database. If value is specified, it sets a new value for the database. In most cases, the DIO object will automatically connect to the new database when this option is changed.
objectName ?delete? ?key? (-option | option | ...)
Delete a record from the database where the primary key matches key.
objectName ?destroy?
Destroy the DIO object.
objectName ?errorinfo? ?value?
errorinfo contains the value of the last error, if any, to occur while executing a request. When a request fails for any reason, this variable is filled with the error message from the SQL interface package.
objectName ?exec? ?request?
Execute request as an SQL query. When the exec command is called, the query is executed, and a DIO result object is returned. From there, the result object can be used to obtain information about the query status and records in a generic way. See Result Object Commands
objectName ?fetch? ?key? ?arrayName? (-option | option | ...)
Fetch a record from the database where the primary key matches key and store the result in an array called arrayName.
objectName ?forall? ?request? ?arrayName? ?body?
Execute an SQL select request and iteratively fill the array named arrayName with elements named with the matching field names, and values containing the matching values, repeatedly executing the specified code body for each row returned.
objectName ?host? ?value?
Return the current host value. If value is specified, it sets a new value for the host.
objectName ?insert? ?table? ?arrayName? (-option | option | ...)
Insert fields from arrayName into the specified table in the database.
objectName ?interface?
Return the database interface type, such as Postgresql or Mysql.
objectName ?keyfield? ?value?
Return the current keyfield. If value is specified, it sets a new value for the keyfield. Value can contain multiple key fields as a Tcl list, if the table has multiple key fields.
objectName ?keys? ?pattern? (-option | option | ...)
Return a list of keys in the database. If pattern is specified, only the keys matching will be returned.
objectName ?lastkey?
Return the last key that was used from sequence. If sequence has not been specified, this command returns an empty string.
objectName ?list? ?request?
Execute request as a SQL query and return a list of the first column of each record found.
objectName ?makekey? ?arrayName? ?keyfield?
Given an array containing key-value pairs and an optional list of key fields (we use the object's keyfield if none is specified), if we're doing auto keys, create and return a new key, otherwise if it's a single key, just return its value from the array, else if there are multiple keys, return all the keys' values from the array as a list.
objectName ?nextkey?
Increment sequence and return the next key to be used. If sequence has not been specified, this command returns an empty string.
objectName ?open?
Open the connection to the current database. This command is automatically called from any command which accesses the database.
objectName ?pass? ?value?
Return the current pass value. If value is specified, it sets a new value for the password.
objectName ?port? ?value?
Return the current port value. If value is specified, it sets a new value for the port.
objectName ?quote? ?string?
Return the specified string quoted in a way that makes it acceptable as a value in a SQL statement.
objectName ?search? (-option | option | ...)
Search the current table, or the specified table if -table tableName is specified, for rows matching one or more fields as key-value pairs, and return a query result handle. See Result Object Commands
For example,
set res [DIO search -table people -firstname Bob]
objectName ?sequence? ?value?
Return the current sequence value. If value is specified, it sets a new value for the sequence.
objectName ?store? ?arrayName? (-option | option | ...)
Store the contents of arrayName in the database, where the keys are the field names and the array's values are the corresponding values. Do an SQL insert if the corresponding row doesn't exist, or an update if it does.
The table name must have been previously set or specified with ?-table?, and the key field(s) must have been previously set or specified with ?-keyfield?.
Please note that the store method has significantly higher overhead than the update or insert methods, so if you know you are inserting a row rather than updating one, it is advisable to use the insert method and, likewise, if you know you are updating rather than inserting, to use the update method.
objectName ?string? ?request?
Execute request as a SQL query and return a string containing the first record found.
objectName ?table? ?value?
Return the current table. If value is specified, it sets a new value for the table.
objectName ?update? ?arrayName? (-option | option | ...)
Updates the row matching the contents of arrayName in the database. The matching row must already exist. The table can have already been set or can be specified with ?-table?, and the key field(s) must either have been set or specified with ?-keyfield?.
objectName ?user? ?value?
Return the current user value. If value is specified, it sets a new value for the user.

Result Object Commands

resultObj ?autocache? ?value?
Return the current autocache value. If value is specified, it sets a new value for autocache.
If autocache is true, the result object will automatically cache rows as you use them. This means that the first time you execute a forall command, each row is being cached in the result object itself and will no longer need to access the SQL result. Default is true.
resultObj ?cache?
Cache the results of the current SQL result in the result object itself. This means that even if the database connection is closed and all the results of the DIO object are lost, this result object will still maintain a cached copy of its records.
resultObj ?errorcode? ?value?
Return the current errorcode value. If value is specified, it sets a new value for errorcode.
errorcode contains the current code from the SQL database which specifies the result of the query statement which created this object. This variable can be used to determine the success or failure of a query.
resultObj ?errorinfo? ?value?
Return the current errorinfo value. If value is specified, it sets a new value for errorinfo.
If an error occurred during the SQL query, DIO attempts to set the value of errorinfo to the resulting error message.
resultObj ?fields? ?value?
Return the current fields value. If value is specified, it sets a new value for fields.
fields contains the list of fields used in this query. The fields are in order of the fields retrieved for each row.
resultObj ?forall? ?-type? ?varName? ?body?
Execute body over each record in the result object.
Types:
-array
Create varName as an array where the indexes are the names of the fields in the table and the values are the values of the current row.
-keyvalue
Set varName to a list containing key-value pairs of fields and values from the current row. (-field value -field value)
-list
Set varName to a list that contains the values of the current row.
resultObj ?next? ?-type? ?varName?
Retrieve the next record in the result object.
Types:
-array
Create varName as an array where the indexes are the names of the fields in the table and the values are the values of the current row.
-dict
Set varName to a list containing ordinary key-value pairs of fields and values from the current row. This form is naturally intepreted as dictionary where each key corresponds to a column. The result representation produced by this option is naturally equivalent to the -keyvalue
-keyvalue
Set varName to a list containing key-value pairs of fields and values from the current row (-field value -field value). This form is handy to build query arguments for the search method of a DIO object
-list
Set varName to a list that contains the values of the current row.
resultObj ?numrows? ?value?
Return the current numrows value. If value is specified, it sets a new value for numrows.
numrows is the number of rows in this result.
resultObj ?resultid? ?value?
Return the current resultid value. If value is specified, it sets a new value for resultid.
resultid in most databases is the result pointer which was given us by the database. This variable is not generic and should not really be used, but it's there if you want it.
resultObj ?rowid? ?value?
Return the current rowid value. If value is specified, it sets a new value for rowid.
rowid contains the number of the current result record in the result object. This variable should not really be accessed outside of the result object, but it's there if you want it.
rivet-3.0.0/doc/xml/diodisplay.xml000664 001750 001750 00000070426 15224454746 017673 0ustar00manghimanghi000000 000000
DIODisplay - Database Interface Objects Display Class DIODisplay Database Interface Objects Display Class DIODisplay objectName #auto -option option -option option ... Description DIODisplay is an HTML display class that uses a DIO object to do the database work and a form object to do the displaying. Options -DIO dioObject The DIO object to be used in conjunction with this display object. This is a required field. -cleanup 1 0 If cleanup is true, when the display object is shown, it will automatically destroy the DIO object, the form object and itself. Default is true. -confirmdelete 1 0 If confirmdelete is true, attempting to delete a record from the database first requires that the user confirm that they wish to delete it. If it is false, deletion occurs without prompting the user. Defaults to true. -errorhandler procName The name of a procedure to handle errors when they occur. During the processing of requests and pages, sometimes unexpected errors can occur. This procedure will handle any errors. It is called with a single argument, the error string. Use of the Tcl errorInfo and errorCode variables is also recommended though. If no errorhandler is specified, the handle_error method within the Display object will handle the error. -fields fieldList Specify a list of fields to be used in this object. The fields list is actually created by using the field command to add fields to the display, but this option can be useful to sometimes over-set the list of fields created. -form formObject A Rivet form object to use when displaying a form. If one is not specified, the display object will automatically create one when it is necessary. -functions functionList A list of functions to be displayed in the main menu. This is a list of functions the user is allowed to execute. -pagesize pageSize How many records to show per page on a search or list. Default is 25. -rowfields fieldList A list of fields to display in each row of a search or list. When a search or list is conducted and the resulting rows are displayed, this list will limit which fields are displayed. Default is all fields. -rowfunctions functionList A list of functions to display in each row of a search or list. -searchfields fieldList A list of fields to allow a user to search by. This list will appear in the main screen as a drop-down box of fields the user can search on. -title title The title of the display object. This will be output as the title of the HTML document. DIO Display Object Commands objectName cleanup value Return the current cleanup value. If is specified, it sets a new value for the cleanup option. objectName delete key Delete the specified from the database. The default action of this method is to call the DIO object's delete command. This method can be overridden. objectName destroy Destroy the diodisplay object. objectName DIO value Return the current DIO value. If is specified, it sets a new value for DIO. objectName errorhandler value Return the current errorhandler value. If is specified, it sets a new value for errorhandler. objectName fetch key arrayName Fetch the specified from the database and store it as an array in arrayName. The default of this method is to call the DIO object's fetch command. This method can be overridden. objectName field fieldName -arg arg Create a new field object and add it to the display. When a field is added to the display, a new object of the DIODisplayField class is created with its values. See [FIXME - LINK] DIO Display Fields for options and values. objectName fields value Return the current fields value. If is specified, it sets a new value for fields. objectName form value Return the current form value. If is specified, it sets a new value for form. objectName function functionName Add a new function to the list of possible functions. The display object will only execute methods and procs which are defined as functions by the object. This is to protect the program from executing a different procedure other than what is allowed. The function command adds a new function to the list of allowable functions. objectName functions value Return the current functions value. If is specified, it sets a new value for functions. See [FIXME - LINK DIO Display Functions] for a list of default functions. objectName pagesize value Return the current form pagesize. If is specified, it sets a new value for pagesize. objectName rowfields value Return the current form rowfields. If is specified, it sets a new value for rowfields. objectName rowfooter Output the footer of a list of rows to the web page. This method can be overridden. objectName rowfunctions value Return the current rowfunctions value. If is specified, it sets a new value for rowfunctions. objectName rowheader Output the header of a list of rows to the web page. By default, this is an HTML table with a top row listing the fields in the table. This method can be overridden. objectName searchfields value Return the current searchfields value. If is specified, it sets a new value for searchfields. objectName show Show the display object. This is the main method of the display class. It looks for a variable called mode to be passed in through a form response and uses that mode to execute the appropriate function. If mode is not given, the Main function is called. This function should be called for every page. objectName showform Display the form of the object. This method displays the form for this display object. It is used in the Add and Edit methods but can be called separately if needed. This method can be overridden if the default look of a form needs to be changed. By default, the form displayed is simply the fields in a table, in order. objectName showrow arrayName Display a single row of a resulting list or search. This method is used to display a single row while displaying the result of a list or search. is a fetched array of the record. This method can be overriden if the default look of a row needs to be changed. By default, each row is output as a table row with each field as a table data cell. objectName showview Display the view of the object. This method displays the view for this display object. It is used in the Details methods but can be called separately if needed. This method can be overridden if the default look of a view needs to be changed. By default, the view displayed is simply the fields in a table, in order. objectName store arrayName Store the specified in the database. The default of this method is to call the DIO object's store command. This method can be overridden. objectName text value Return the current text value. If is specified, it sets a new value for text. objectName title value Return the current title value. If is specified, it sets a new value for title. objectName type value Return the current type value. If is specified, it sets a new value for type. objectName value value Return the current value value. If is specified, it sets a new value for value. DIO Display Functions These functions are called from the show method when a form response variable called mode is set. If no mode has been set, the default mode is Main. The show method will handle the necessary switching of functions. The show method also handles checking to make sure the function given is a true function. If not, an error message is displayed. New functions can be added as methods or by use of the function command, and any of the default functions can be overridden with new methods to create an entirely new class. These are the default functions provided. Add Show a form that allows the user to add a new entry to the database. This function calls showform to display the form for adding the entry. Cancel The Cancel function does nothing but redirect back to the Main function. This is handy for forms which have a cancel button to point to. Delete If confirmdelete is true (the default), the Delete function will ask the user if they're sure they want to delete the record from the database. If confirmdelete is false, or if the user confirms they wish to delete, this function calls the DoDelete function to do the actual deletion of a record. Details Display the view of a single record from the database. This function calls the showview method to display a single record from the database. DoDelete This function actually deletes a record from the database. Once it has deleted the record, it redirects the user back to the Main function. Edit Show a form that allows the user to edit an existing entry to the database. This function calls showform to display the form for editing the entry and fills in the fields with the values retrieved from the database. List This function lists the entires contents of the database. Each record is output in a row using the showrow method. Main This function is the main function of the display object. If there is no mode, or once most commands complete, the user will be redirected to this function. The default Main function displays a list of functions the user can execute, a list of searchfields the user can search on, and a query field. This query field is used by all of the other functions to determine what the user is trying to find. In the case of a search, query specifies what string the user is looking for in the specified search field. In the case of delete, details or edit, the query specifies the database key to access. Save This function saves any data passed to using the store method. This is primarily used by the add and edit commands to store the results of the form the user has filled out. Search This function searches the database for any row whose searchBy field matches query. Once any number of records are found, Search displays the results in rows. DIO Display Fields Display fields are created with the field command of the DIODisplay object. Each field is created as a new DIODisplayField object or as a subclass of DIODisplayField. The standard form fields use the standard field class, while specialized field types use a class with different options but still supports all of the same commands and values a generic field does. displayObject field fieldname -option option These are the standard options supported by field types: -formargs arguments When a field is created, any argument which is not a standard option is assumed to be an argument passed to the form object when the field is shown in a form. These arguments are all appended to the formargs variable. You can use this option to override or add options after the initial creation of an object -readonly 1 0 If readonly is set to true, the field will not display a form entry when displaying in a form. -text text The text displayed next to the form or view field. By default, DIODisplay tries to figure out a pretty way to display the field name. This text will override that default and display whatever is specified. -type fieldType The type of field this is. This type is used when creating the field in the form object. can be any of the accepted form field types. See [FIXME - LINK DIO Field Types] for a list of types available. All other arguments, unless specified in an individual field type, are passed directly to the form object when the field is created. So, you can pass or to specify the length and maximum length of the field entry. Or, if type were textarea, you could define and to specify its row and column count. DIO Display Field Types The following is a list of recognized field types by DIODisplay. Some are standard HTML form fields, and others are DIODisplay fields which execute special actions and functions.
rivet-3.0.0/doc/examples-sgml/rivet_web_service.tcl000664 001750 001750 00000006730 15224454746 023175 0ustar00manghimanghi000000 000000 # # Ajax query servelet: a pseudo database is built into the dictionary 'composers' with the # purpose of emulating the role of a real data source. # The script answers with 2 types of responses: a catalog of the record ids and a database # entry matching a given rec_id. The script obviously misses the error handling and the # likes. Just an example to see rivet sending xml data to a browser. The full Tcl, JavaScript # and HTML code are available from http://people.apache.org/~mxmanghi/rivet-ajax.tar.gz # This example requires Tcl8.5 or Tcl8.4 with package 'dict' # (http://pascal.scheffers.net/software/tclDict-8.5.2.tar.gz) # # A pseudo database. rec_id matches a record in the db set composers [dict create \ 1 {first_name Claudio middle_name "" last_name Monteverdi \ lifespan 1567-1643 era Renaissance/Baroque} \ 2 {first_name Johann middle_name Sebastian last_name Bach \ lifespan 1685-1750 era Baroque } \ 3 {first_name Ludwig middle_name "" last_name "van Beethoven" \ lifespan 1770-1827 era Classical/Romantic} \ 4 {first_name Wolfgang middle_name Amadeus last_name Mozart \ lifespan 1756-1791 era Classical } \ 5 {first_name Robert middle_name "" last_name Schumann \ lifespan 1810-1856 era Romantic} ] # we use the 'load' argument in order to determine the type of query # # load=catalog: we have to return a list of the names in the database # load=composer&amp;res_id=<id>: the script is supposed to return the record # having <id> as record id if {[::rivet::var exists load]} { # the xml declaration is common to every message (error messages included) set xml "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n" switch [::rivet::var get load] { catalog { append xml "<catalog>\n" foreach nm [dict keys $composers] { set first_name [dict get $composers $nm first_name] set middle_name [dict get $composers $nm middle_name] set last_name [dict get $composers $nm last_name] append xml " <composer key=\"$nm\">$first_name " if {[string length [string trim $middle_name]] > 0} { append xml "$middle_name " } append xml "$last_name</composer>\n" } append xml "</catalog>\n" } composer { append xml "<composer>\n" if {[::rivet::var exists rec_id]} { set rec_id [::rivet::var get rec_id] if {[dict exists $composers $rec_id]} { foreach {k v} [dict get $composers $rec_id] { append xml "<$k>$v</$k>\n" } } } append xml "</composer>\n" } } # we have to tell the client this is an XML message. Failing to do so # would result in an XMLResponse property set to null ::rivet::headers type "text/xml" ::rivet::headers add Content-Length [string length $xml] puts $xml } rivet-3.0.0/doc/xml/commands.xml000664 001750 001750 00000220747 15224454746 017336 0ustar00manghimanghi000000 000000
Rivet Tcl Commands and Variables
Starting with version 2.1.0 the Rivet command set moved into the ::rivet namespace. In order to preserve out of the box compatibility with existing scripts, Rivet exports commands by default and makes them available for import into any namespace (global namespace included). Rivet's build system can be told not to export the command set by passing the switch --disable-rivet-commands-export to 'configure'. In the future we may change this option's default. Commands must be imported into another namespace with the command: namespace import -force ::rivet::* Whenever a new application is being developed and compatibility issues can be confined within specific files, it is recommended that commands be specified with their fully qualified names.
<?= ... ?> Shorthand construct for single strings output <?= $string ?> Description This construct is a simplified form to print a single string wherever needed in a .rvt template. The contruct is equivalent to writing the following line of Tcl code puts -nonewline $string The string argument to the shorthand construct can be any Tcl command returning a value See Hello World or Variable Access abort_code Returns the code passed to abort_page earlier during the request processing ::rivet::abort_code Description Usage of this command is meaningful only in a script set as AbortScript or AfterEveryScript. abort_code returns the value of the optional parameter passed to abort_page earlier in the same request processing. abort_page Stops outputting data to web page, similar in purpose to PHP's die command. ::rivet::abort_page abort code -aborting Description This command flushes the output buffer and stops the Tcl script from sending any more data to the client. A normal Tcl script might use the exit command, but that cannot be used in Rivet without actually exiting the apache child process! abort_page triggers the execution of an optional AbortScript that has to be specified in the configuration. The value of the argument abort code can be retrieved with the abort_code command during the execution of AbortScript or AfterEveryScript, allowing the script to take appropriate actions in order to deal with the cause of the abort. The argument causes to return 1 when the current execution is the outcome of an abort condition. In other words this query is meaningful in code specified as AfterEveryScript to understand if an abort condition took place beforehand. apache_log_error log messages to the Apache error log ::rivet::apache_log_error priority message Description The apache_log_error command logs a message to the Apache error log, whose name and location have been set by the directive. Priority must be one of , , , , , , , or . apache_table access and manipulate Apache tables in the request structure. ::rivet::apache_table get set exists unset names array_get clear Description The apache_table command is for accessing and manipulating Apache tables in the request structure. The table name must be one of , , , , or . ::rivet::apache_table get tablename key When given the name of an Apache table and the name of a key , returns the value of the key in the table, or an empty string. ::rivet::apache_table set tablename key value ::rivet::apache_table set tablename list Stores the in the table under the key . For the list form, contains a list of zero or more pairs of key-value pairs to be set into the table . ::rivet::apache_table exists tablename key Returns 1 if the specified key, , exists in table , else 0. ::rivet::apache_table unset tablename key Removes the key-value pair referenced by from the table . ::rivet::apache_table names tablename Returns a list of all of the keys present in the table . ::rivet::apache_table array_get tablename Returns a list of key-value pairs from the table . ::rivet::apache_table clear tablename Clears the contents of the specified table. catch wraps core command catch ::rivet::catch script error_code_var_name options_var_name Description ::rivet::catch wraps the core language catch command adding some extra error handling needed by mod_rivet design. The rationale for Rivet to have its own ::rivet::catch reads as follows: within mod_rivet a script execution can be interrupted by either calling ::rivet::exit (not recommended) or ::rivet::abort_page. These commands implement a simple internal exception mechanism by returning a special error code so that execution is in turn handed down to the AbortScript and eventually to AfterEveryScript (if any of them is defined). Any code calling one of these commands which runs under control of the ::catch command would need to do this chore itself, checking the error info and in case throw the error again if it had been originated by one of mod_rivet's exceptions calls. This is what ::rivet::catch does by hiding the implementation details and providing a better and more compatibile way to handle this condition. This command is not meant to replace the core command, thus it's not exported from the ::rivet namespace and therefore has to be fully qualified. clock_to_rfc850_gmt create a rfc850 time from [clock seconds]. ::rivet::clock_to_rfc850_gmt seconds Description Convert an integer-seconds-since-1970 click value to RFC850 format, with the additional requirement that it be GMT only. cookie get, set and delete cookies. ::rivet::cookie set cookieName cookiValue -days expireInDays -hours expireInHours -minutes expireInMinutes -expires Wdy, DD-Mon-YYYY HH:MM:SS GMT -path uriPathCookieAppliesTo -secure 1/0 -HttpOnly 1/0 ::rivet::cookie get cookieName ::rivet::cookie delete cookieName ::rivet::cookie unset cookieName Description cookie gets, sets, unsets or deletes a cookie. When you get a cookie, the command returns the value of the cookie, or an empty string if no cookie exists. cookie delete will set the timeout value to -1 minutes - deleting the cookie in the browser. cookie unset will remove the defined cookie in the server (perhaps preparatory to checking/resetting the cookie). The command has a number of switches setting a cookie attributes debug A command to print strings, arrays and the values of variables as specified by the arguments. ::rivet::debug -subst<on|off> -separator<string> -option<value> -option<value> ... Description A command to make debugging more convenient print strings, arrays and the values of variables as specified by the arguments. Also allows the setting of an array called debug which will pick up options for all debug commands. env Returns the value a single "environmental variable". ::rivet::env environment_variable_name Description ::rivet::env resolves a single environment variable and returns its value or an empty string if the environment variable name in the argument is not defined. This command is the recommended way to resolve an environment variable leaving ::rivet::load_env to debugging and development operations. escape_sgml_chars escape special SGML characters in a string. ::rivet::escape_sgml_chars string Description Scans through each character in the specified string looking for any special (with respect to SGML, and hence HTML) characters from the specified string, and returns the result. For example, the right angle bracket is escaped to the corrected ampersand gt symbol. escape_shell_command escape shell metacharacters in a string. ::rivet::escape_shell_command string Description Scans through each character in the specified string looking for any shell metacharacters, such as asterisk, less than and greater than, parens, square brackets, curly brackets, angle brackets, dollar signs, backslashes, semicolons, ampersands, vertical bars, etc. For each metacharacter found, it is quoted in the result by prepending it with a backslash, returning the result. escape_string convert a string into escaped characters. ::rivet::escape_string string Description Scans through each character in the specified string looking for special characters, escaping them as needed, mapping special characters to a quoted hexadecimal equivalent, returning the result. This is useful for quoting strings that are going to be part of a URL. exit terminate execution and child process ::rivet::exit code Description Replaces Tcl's exit core command. ::rivet::exit interrupts execution of the current script and passes execution to AbortScript if such script is set. After AbortScript has finished and request processing completed the child process is forced to exit by eventually calling Tcl_Exit producing the same final effect of the core command. During an AbortScript execution the exit condition can be detected if {[::rivet::abort_page -exiting]} { ...handle exit condition } ::rivet::exit has a single optional argument code. This value must be a positive integer number to be passed to Tcl_Exit. If any other value is given code is set to 0. The exit code can be obtained from the dictionary returned by ::rivet::abort_code [::rivet::abort_code] <== return_code code error_code exit Rivet's specific implementation prevents any abrupt process termination that otherwise the exit command would bring about deferring the call to Tcl_Exit to a later stage when the request processing has finished. This is always true if the mod_rivet runs the prefork bridge. The behavior with the worker bridge depends on the SingleThreadExit configuration directive. By default all the threads of a single process are requested to exit before the child process exits. Starting with version &version32; by setting the SingleThreadExit option directive calling ::rivet::exit causes a single thread termination. Though always accepted this directive is meaningful only if used with the worker or lazy bridges. Nonetheless we discourage the programmer to use such command, and suggest to focus on proper application design and avoid such a drastic way to bail out. If you need to restart the child processes from time to time we recommend to check the MaxRequests parameter in the prefork MPM documentation or the MaxRequestsPerChild configuration parameter headers set and parse HTTP headers. ::rivet::headers get set redirect add type numeric Description The headers command is for setting and parsing HTTP headers. ::rivet::headers get headername value Read arbitrary header names and values from output HTTP headers ::rivet::headers set headername value Set arbitrary header names and values into output HTTP headers ::rivet::headers sent Test internal status of the module and returns 1 if the HTTP headers have been already sent ::rivet::headers redirect uri Redirect from the current page to a new URI. Must be done in the first block of TCL code. ::rivet::headers add headername value Add text to header headername. ::rivet::headers type content-type This command sets the Content-type header returned by the script, which is useful if you wish to send content other than HTML with Rivet - PNG or jpeg images, for example. ::rivet::headers numeric response code Set a numeric response code, such as 200, 404 or 500. html construct html tagged text. ::rivet::html string arg Description Print text with the added ability to pass HTML tags following the string. Example: ::rivet::html "Test" b i produces: <b><i>Test</i></b> http_accept Parse HTTP Accept header lines ::rivet::http_accept -zeroweight -default -list http_accept_line Description Command for parsing HTTP Accept header lines that tell the server about preferences and/or capabilities of the browser (e.g. content language,media type, etc.). The following script ::rivet::http_accept returns a dictionary value in which every content preference is matched to its precedence value ::rivet::load_headers set language_precedence [::rivet::http_accept $headers(Accept-Language)] foreach lan [dict keys $language_precedence] { puts "$lan -> [dict get $language_precedence $lan]" } when run from a browser where 5 languages were chosen would output en-us -> 1 en -> 0.8 it -> 0.6 de-de -> 0.4 fr-fr -> 0.2 The -list switch would suppress the precedence values and the accepted fields are returned listed with decreasing precedence order. puts [::rivet::http_accept -list $headers(Accept)] text/html application/xhtml+xml application/xml */* import_keyvalue_pairs Import an argument list into the named array ::rivet::import_keyvalue_pairs arrayName argsList Description key-value pairs, like "-foo bar" are stored in the array arrayName. In that case, the value "bar" would be stored in the element "foo" If "--" appears or a key doesn't begin with "-", the rest of the arg list is stored in the special args element of the array. Example: ::rivet::import_keyvalue_pairs keyvalue_map [list -a1 v1 -a2 v2 -a3 v3 -- 1 2 3 4 5] parray keyvalue_map keyvalue_map(a1) = v1 keyvalue_map(a2) = v2 keyvalue_map(a3) = v3 keyvalue_map(args) = 1 2 3 4 5 include includes a file into the output stream without modification. ::rivet::include filename_name Description Include a file without parsing it for processing tags <? and ?>. This is the best way to include an HTML file or any other static content. inspect Rivet Configuration Introspection Command ::rivet::inspect configuration_section configuration_parameter Description ::rivet::inspect provides introspection into the running configuration of Rivet. Rivet's debug command uses it in order to gain insight into the configuration, but it can be used in any script. ::rivet::inspect can be called in 5 different forms With no argument the command returns a dictionary with 3 keys: server, dir, user. Each key is associated to a subdictionary carrying the configuration as set for that request. In this form the command is meant to support compatibility with previous versions of mod_rivet where three global arrays were created to be internally used by command ::rivet::debug. With the -all argument a dictionary carrying the whole configuration for that specific request is returned. If a configuration parameter is not set it's given the string undefined. Returned configuration paramenters are "ServerInitScript", "GlobalInitScript", "ChildInitScript", "ChildExitScript", "BeforeScript", "AfterScript", "AfterEveryScript", "AbortScript", "ErrorScript", "UploadMaxSize", "UploadDirectory", "UploadFilesToVar", "SeparateVirtualInterps", "HonorHeadRequests" With one of the Rivet configuration directives listed above as single argument ::rivet::inspect returns the current value in the configuration record. Passing the argument "script" ::rivet::inspect returns a path to the current script in a similar way core command [info script] does. The basic difference is that the core command returns a relative path with respect to the current working directory, whereas mod_rivet's command returns the full path. Passing the argument "server" ::rivet::inspect returns a dictionary with these fields taken from the server record descriptor hostname: The server hostname admin: The admin's contact information errorlog: The name of the error log server_path: Pathname for ServerPath lassign_array Assign a list of values to array variables ::rivet::lassign_array value_list array_name array_variables Description lassign_array is an utility command inspired by the same Tclx command and with a close resemblance with Tcl's lassign for assigning list elements to variables. lassign_array first argument is a list of values to be assigned to an array that must be given as second argument. The remaining arguments are the array's variable names which will store as values the elements of the list. Variables names don't matching values in the list are given an empty string. Unassigned list elements are returned as a list. ::rivet::lassign_array {1 2 3 4} assigned_array a b c d parray assigned_array assigned_array assigned_array(a) = 1 assigned_array(b) = 2 assigned_array(c) = 3 assigned_array(d) = 4 set rem [::rivet::lassign_array {1 2 3 4 5 6 7} assigned_array a b c d] puts $rem 5 6 7 lempty Returns 1 if <list> is empty or 0 if it has any elements. This command emulates the TclX lempty command. ::rivet::lempty list Description Returns 1 if <list> is empty or 0 if it has any elements. This command emulates the TclX lempty command. lmatch Look for elements in <list> that match <pattern> ::rivet::lmatch -exact -glob -regexp list pattern Description Look for elements in <list> that match <pattern>. This command is a decent replacement for TclX lmatch command when TclX is not available In the following example a regular expression is matched against each element in the input list and a list containing the matching elements is returned ::rivet::lmatch -regexp { aaxa bxxb ccxxxxcc } {.+[x]{2}.+} bxxb ccxxxxcc load_cookies get any cookie variables sent by the client. ::rivet::load_cookies array_name Description Load the array of cookie variables into the specified array name. Uses array cookies by default. load_env get the request's environment variables. ::rivet::load_env array_name Description Load the array of environment variables into the specified array name. Uses array by default. As Rivet pages are run in the namespace, it isn't necessary to qualify the array name for most uses - it's ok to access it as . load_headers get client request's headers. ::rivet::load_headers array_name Description Load the headers that come from a client request into the provided array name, or use if no name is provided. load_response load form variables into an array. ::rivet::load_response arrayName Description Load any form variables passed to this page into an array. If load_response is called without arguments the array is created in the scope of the caller. If the variables var1,var2,var3... having values val1,val2,val3... are passed to the page, the resulting array will be a collection mapping var1,var2,var3... to their corresponding values. load_response was inspired by the same NeoWebScript procedure in the way it deals with multiple assignments: if a variable is assigned more than once the corresponding array element will be a list of the values for the variable. This can be useful in the case of forms with checkbox options that are given the same name. This condition is signalled by the presence of an auxiliary array variable. Example: if a group of checkboxes are associated to the variable then response(var1) will store the list of their values and the array will also have the extra variable which can be tested with the usual [info exists response()] Calling load_response several times for the same array results in adding more values to the array at every call. When needed it is left to the caller to empty the array between two subsequent calls. lremove remove from a list elements matching one or more patterns ::rivet::lremove -regexp | -glob | -exact list pattern pattern pattern Description lremove removes from list list the first occurrence of an element matching one of the patterns listed in the command line. By specifying the option every occurrence of one the patterns is removed Pattern matching can be , style or following regular expressions (). These options are globally valid across the whole pattern list (default is glob style matching) ::rivet::lremove -all -regexp {aa e111 bab aa} aa e111 bab e111 bab ::rivet::lremove -all -regexp {aa e111 bab aa} aa "e\\d+" bab makeurl construct url's based on hostname, port. ::rivet::makeurl filename Description Create a self referencing URL from a filename. makeurl can be used in three ways With no arguments the current script URL is returned The argument is a relative path: the command returns the argument prefixed with the current script's URL The argument is an absolute path: the full URL to the resource is returned Example with an absolute path: ::rivet::makeurl /tclp.gif returns http://[hostname]:[port]/tclp.gif. where hostname and port are the hostname and port of the server in question. The protocol prefix is inferred from the protocol in the URL referencing the script. no_body Prevents Rivet from sending any content. ::rivet::no_body Description This command is useful for situations where it is necessary to only return HTTP headers and no actual content. For instance, when returning a 304 redirect. parray Tcl's parray with html formatting. ::rivet::parray arrayName pattern [*] command [puts stdout] Description An html version of the standard Tcl parray command. Displays the entire contents of an array in a sorted, nicely-formatted way. Mostly used for debugging purposes. Rivet's parray accepts 2 optional parameters: an array name selection pattern (like the pattern accepted by Tcl's [array names <array> -glob <pattern>]) and an output command (default: 'puts stdout'). parse parses a Rivet template file. ::rivet::parse filename ::rivet::parse template_string Description Like the Tcl source command, but also parses for Rivet <? and ?> processing tags. Using this command, you can use one .rvt file from another. The optional argument selects the external character encoding used to read the file. When omitted, the Tcl system encoding is retained for compatibility. Newline translation is disabled when an explicit encoding is selected. The form accepts an existing Tcl string and therefore performs no character decoding. raw_post get the unmodified body of a POST request sent by the client. ::rivet::raw_post Description Returns the raw POST data from the request. If the request was not a POST or there is no data, then "" - an empty string - is returned. redirect Interrupt processing and divert to a new URL ::rivet::redirect URL permanent Description ::rivet::redirect diverts the browser to a new URL and marks the redirection as either permanent in the browser local cache or non permanent (default). Calling ::rivet::redirect causes the script execution to interrupt and control passes to AbortScript, if such script is set, by calling ::rivet::abort_page and passing as abort code a dictionary with 2 keys: error_code: string literal 'redirect' location: the URL the browser will be redirected to ::rivet::redirect drives the redirection by setting the 301 (permanent = 1: permanent redirect) or 302 (permanent = 0: non permanent redirect) and attempts to discard the output the script might have already placed in the stdout channel buffer. The permanent argument can also be any of the other HTTP status codes. This is handy for returning one the 3xx status codes dedicated to the HTTP request redirection The command can fail if A flush stdout has already been called before ::rivet::redirect thus causing the HTTP headers to be sent The channel buffer has been flushed already by calling flush stdout or because the Rivet channel internal buffer was full The stdout channel, like any Tcl channels, can be manipulated and if needed its internal buffer stretched. read_file Read the entire contents of a file and return it as a string. ::rivet::read_file file name Description This is a utility command which loads the entire content of a file and returns it as a result. thread_id Returns the Tcl interpreter current thread id ::rivet::thread_id -decimal | -hex Description ::rivet::thread_id either returns the hexadecimal (default) or the decimal representation of the current thread id. This command is useful for precise identification of an execution thread when Apache runs a threaded MPM. When called with the -decimal switch the command prints the thread id can be compared with the tid information printed in the Apache error log. try Catch error and exception conditions ::rivet::try script script handlers finally script Description ::rivet::try wraps the core language command and simply traps exceptions that might have raised by ::rivet::abort_page and ::rivet::exit to throw them again and thus causing AbortScript to be executed. If neither ::rivet::abort_page nor ::rivet::exit are called from script then any handlers specified in the command are tested for execution. Thus ::rivet::try can transparently be used as a replacement for Tcl's own try and it's needed if you want script to safely bail out to AbortScript This command is not exported from the ::rivet namespace and therefore has to be fully qualified. This script shows how ::rivet:try handles different exceptions or errors. You can drive this script within mod_rivet adding the arguments fail or abort or exit to its URL. You can handle the exit and abort cases with an AbortScript. See AbortScript <html><? ::rivet::try { if {[::rivet::var_qs exists exit]} { ::rivet::exit [::rivet::var_qs get exit] } elseif {[::rivet::var_qs exists abort]} { ::rivet::abort_page [::rivet::var_qs get abort] } elseif {[::rivet::var_qs exists fail]} { # this is just a non existent command wrong_command } else { puts "<b>OK</b>" } } on error {e o} { puts "catching error -&gt; $e<br/>" dict for {fd fv} $o { puts "$fd --&gt;&gt; $fv<br/>" } } ?></html> Placing this code in a file (try.rvt) on the web server DocumentRoot directory and setting for example the browser to http://localhost/try.rvt?fail=1. catching error -> invalid command name "wrong_command" -errorcode -->> TCL LOOKUP COMMAND wrong_command -code -->> 1 -level -->> 0 -errorstack -->> INNER {invokeStk1 wrong_command} UP 1 -errorinfo -->> invalid command name "wrong_command" while executing "wrong_command" ("::try" body line 9) -errorline -->> 9 unescape_string unescape escaped characters in a string. ::rivet::unescape_string string Description Scans through each character in the specified string looking for escaped character sequences (characters containing a percent sign and two hexadecimal characters), unescaping them back to their original character values, as needed, also mapping plus signs to spaces, and returning the result. This is useful for unquoting strings that have been quoted to be part of a URL. upload handle a file uploaded by a client. ::rivet::upload channel save data exists size type filename Description The upload command is for file upload manipulation. See the relevant Apache Directives to further configure the behavior of this Rivet feature. ::rivet::upload channel uploadname When given the name of a file upload , returns a Tcl channel that can be used to access the uploaded file. ::rivet::upload save uploadname filename Saves the in the file . ::rivet::upload data uploadname Returns data uploaded to the server. This is binary clean - in other words, it will work even with files like images, executables, compressed files, and so on. ::rivet::upload exists uploadname Returns true if an upload named uploadname exists. This can be used in scripts that are meant to be run by different forms that send over uploads that might need specific processing. ::rivet::upload size uploadname Returns the size of the file uploaded. ::rivet::upload type If the Content-type is set, it is returned, otherwise, an empty string. ::rivet::upload filename uploadname Returns the filename on the remote host that uploaded the file. ::rivet::upload tempname uploadname Returns the name of the temporary file on the local host that the file was uploaded into. ::rivet::upload names Returns the variable names, as a list, of all the files uploaded. See . url_script get the code of the URL referenced Tcl script or Rivet template ::rivet::url_script Description This command is used internally by the rivet central Tcl procedure (::Rivet::request_handling) executed by the default traditional code for HTTP requests processing. Unless you're implementing your own ::Rivet::request_handling procedure it's unlikely it can be of any use. var var_qs var_post get the value of a form variable. ::rivet::var get list exists number all ::rivet::var_qs get list exists number all ::rivet::var_post get list exists number all Description The var command retrieves information about GET or POST variables sent to the script via client request. It treats both GET and POST variables the same, regardless of their origin. Note that there are two additional forms of ::rivet::var: rivet::var_qs and ::rivet::var_post. These two restrict the retrieval of information to parameters arriving via the querystring (?foo=bar&bee=bop) or POSTing, respectively. ::rivet::var get varname default Returns the value of variable as a string (even if there are multiple values). If the variable doesn't exist as a GET or POST variable, the value is returned, otherwise "" - an empty string - is returned. ::rivet::var list varname Returns the value of variable as a list, one list element per reference. Radiobuttons or multiple selection listboxes are suited widgets which may return list data. If the result list is passed as a default value to the form package, one could also set index "__varname" to get it interpreted as a list. set response(countries) [::rivet::var list countries] set response(__countries) "" form form_request -defaults response form_request select countries -multiple 1 -values {USA Canada Mexico} form_request end ::rivet::var exists varname Returns 1 if exists, 0 if it doesn't. ::rivet::var number Returns the number of variables. ::rivet::var all default_values Return a list of variable names and values. This is a flat list of key value pairs and as such can be intepreted as the representation of a single level dictionary. An optional argument is interpreted as a dictionary of default values See . with_binary_output evaluate a script while the response channel is configured for binary output. ::rivet::with_binary_output script Description Flushes stdout, saves its channel configuration, configures it with , and evaluates script. After flushing the binary output, the previous translation, encoding, and end-of-file character settings are restored. Restoration also takes place when the script returns an error or another non-standard Tcl completion code. Use this command to group multiple binary writes. Values written in the script must be byte-oriented Tcl values whose characters are in the range U+0000 through U+00FF. Text that is to form part of a binary protocol must first be converted explicitly, for example with encoding convertto utf-8. ::rivet::with_binary_output { puts -nonewline stdout $headerBytes puts -nonewline stdout $payloadBytes } This command is not placed in the export list of the ::rivet namespace write_binary write one binary value to the response channel. ::rivet::write_binary data Description Writes data to stdout without newline translation or character encoding, and without appending a newline. The previous response-channel configuration is restored before the command returns. This command is equivalent to: ::rivet::with_binary_output { puts -nonewline stdout $data } The value must be byte-oriented and contain only characters in the range U+0000 through U+00FF. Use ::rivet::with_binary_output when several consecutive binary output operations need to be grouped. This command is not placed in the export list of the ::rivet namespace wrap Split a string on newlines. ::rivet::wrap string maxlen html Description For each line, wrap the line at a space character to be equal to or shorter than the maximum length value passed. If a third argument called "-html" is present, the string is put together with html <br> line breaks, otherwise it's broken with newlines. wrapline Split the line into multiple lines by splitting on space characters ::rivet::wrapline string maxlen html Description Given a line and a maximum length and option "-html" argument, split the line into multiple lines by splitting on space characters and making sure each line is less than maximum length. If the third argument, "-html", is present, return the result with the lines separated by html <br> line breaks, otherwise the lines are returned separated by newline characters. xml XML Fragments creation ::rivet::xml string tag descriptor tag descriptor ... Description Given a string and a variable number of tag descriptors return XML fragment made by nesting the tags with the same hierarchical order they are listed on the command line. The tag descriptors can be a one element list (the tag) or an odd-length list whose first argument is the tag namme and the remaining elements are interpreted as attribute name-attribute value pairs. ::rivet::xml can work as a replacement of ::rivet::html provided you take care of sending the string with command puts ::rivet::xml "a string" b u <== <b><u>a string</u></b> You can specify the tags attributes by replacing a tag specification with a odd-length list containing the tag name and a series of attribute-value pairs ::rivet::xml "a string" [list div class box id testbox] b i <== <div class="box" id="testbox"><b><i>a string</i></b></div> ::rivet::xml "text to be wrapped in XML" div [list a href http://..../ title "info message"] <== <div><a href="http://..../" title="info message">text to be wrapped in XML</a></div> A single argument is interpreted as a list of tag name and attributes to be coded as a self closing element ::rivet::xml [list b a1 v1 a2 v2] <== <b a1="v1" a2="v2" /> Unless the string is literally an empty string ::rivet::xml "" [list b a1 v1 a2 v2] <== <b a1="v1" a2="v2"></b> which is useful for generating 'script' elements in an HTML page header that wouldn't be understood as single closing element ::rivet::xml "" [list script type "text/javascript" src js/myscripts.js] <== <script type="text/javascript" src="js/myscripts.js"></script>
rivet-3.0.0/doc/html/images/toc-minus.png000644 001750 001750 00000000403 15224455140 021014 0ustar00manghimanghi000000 000000 PNG  IHDR )bKGD#2IDATxch`g  I׏j?}-pZECtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignatureecf413ef47524404f90c44d8c7d12a2e݈ tEXtPage15x9+0+07vIENDB`rivet-3.0.0/README000664 001750 001750 00000001321 15224454746 014307 0ustar00manghimanghi000000 000000 Apache Rivet ============ See the doc/html/installation.html directory for installation and usage instructions. See INSTALL for brief installation instructions - although the above docs in HTML are more thorough and extensive. See LICENSE for licensing terms. RIVET NAMESPACE =============== - With the intruduction of the ::rivet namespace the command set has been moved into it and each command should now be fully qualified. Building rivet you can choose in case to place the commands on the export list or even automatically import them into the global namespace. This is a deprecated option though unless you have a compatibility issue with existing legacy Rivet based code. rivet-3.0.0/doc/html/images/toc-plus.png000644 001750 001750 00000000410 15224455140 020642 0ustar00manghimanghi000000 000000 PNG  IHDR )bKGD#2#IDATxch`#@C"ԣj?RJld:4CtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignatureab17802e1ddae3211b1ce6bc3b08aec7{( tEXtPage15x9+0+07vIENDB`rivet-3.0.0/README.MacOSX000664 001750 001750 00000002073 15224454746 015405 0ustar00manghimanghi000000 000000 $Id$ Building Rivet isn't 100% turnkey under Mac OS X, but it's getting better and hopefully it won't be too long until it builds without tweaking. In the meantime, here's what we do: Build and install tclsh8.4 and apache from darwinports, plus other stuff like postgres. Go get Pgtcl off of gborg.postgresql.org and get it built and installed. (If you want to use a SQL database, this is one way to go about it, and we've had good results with it.) Run the configure script: tclsh8.4 ./configure.tcl -prefix /opt/local -with-apxs /opt/local/sbin/apxs -verbose -with-tclconfig /opt/local/lib/tclConfig.sh It will complain about several undefined variables. Edit configs.tcl and change set ::configs::TCL_SHLIB_LD {} to be set ::configs::TCL_SHLIB_LD {cc -dynamiclib -undefined suppress -flat_namespace} ~ tclsh8.4 make.tcl tclsh8.4 make.tcl install ~ ~ rivet-3.0.0/doc/html/images/color-table.png000644 001750 001750 00000350767 15224455140 021326 0ustar00manghimanghi000000 000000 PNG  IHDR|Ve pHYs  tIME 0\6 IDATxw^U7|k]:O2LR0@ (MPDbsslGG^PWRc$If&ӟ]Z3L2Lw}N}]\ ;{߽W(ixGM0]/D@" B" "@Nˋ!oN&urJ  Q,2/gS,ٜM7q^//hCl)jXN`Ko8fQ~Prwಝ1O?ҽo şn2(irRX"u ꣌?c4[q(+я &i4pd @043tS۪O?H 4Pl:C=GAv]1(!/)O3O4v+tmM=6&wL8NzysdH/34~'th'ȌCc>TǒǙ},?1udLk/v>AE'ÜONɓH1a)nɌ}lRSHߦq_O09IL4OOpM3!Oq']thSY< @ȸPNTd@=j ٺy8`,8JpE7/ۢB ZP BY9(P㐃I9UQ`&>1,!J4CX`qO +z@`X8<-`X`ɀ\h9s!SaL@Z'<րB ߗ&͑`!PAOy01jVVb+w;d,,xq@ d&r$I =_NpIް$4GDMln9㤒OkQ01E򑻤l@0@@n/%!/4L!i줁DF[ƀt3D&C0dZf3N(X l\k @"लIk!nڌK_Me< C#{aN|Fd*?LȘ7ƈ#AƕNgU'<䶘`:U$h<dm[DlY54 򐉘ܬ$!#T#ÞB"A+ q^ƏgFfD4XJ) QZ'2kEhZFa1*$BHЕ51Ca/)iWQ3bLT- q "+e^ XȎ"T&=BCD #@JK'#dh((KYƈ|WW"F$e"]`(1A'+ GpVL+"1hՙa7hP]6KshC+?W[^Jn{cm(ź:K?lˮ5p]rmy" П>ARwlz`{8_|/+Қ:ޡaV/;皂R <;uUg>ڶC*6r`φ* νjv$yx;Tj׽=\ H)*-s_8ȎWT_nnisi[ZC8X0xW4ظfD>sdgEェ|E|۵ n:xٮGi[ y~w:pÍ3޳<OUd#?Yֱ5Tґ«yElizŁ}BϛO<ŭ˪?xC2#mc7Ls>zuͪNs}c{wYŌ~x9ms[nZ³M;4px&(_yyþfyWb~*# |E!=6=?X2?@ǧu7u.QgpϚz#};+G_iÆ'fR9?γ7պK+cβkwlg7Wg{Lc(rΥ \[07m>wvj^\zm;;ͧղ?h{^??t (eϻbnZ(cO=Oc]peov϶#}zg9-]Gz؅Y?2N&j~yk $?(o {CyA#+k.^ꯞNr_7UٔgUhjshQG-w=e?n,<PL޿@myn˲,fn¸wq unzN/tv1eGxVwwYS*_&'>W'J={yջ/$G+z` BkCukɘf`a4b~C?D`p|J?̪KFhJ#z-r4SXqց#~yH߻ooZpwcS1?GS} "/4藙xҾW3xdϛ?5=^иm[um&( 7\VR>~`al;F;yKɧ})} |`#6Kݲzzrgv}T~m506SjsbOXrL5ȑ ~`O늟Myn^3W,| 3t??VJnGێҨy,>֬a] yGυ~m03pmACyd́ ?D}|AQXռҏ֏m2Uqj8)_;Cɗ'kjѨ?w K0<9T֖Z9OFkfd'?_[վҞ;Ncc]^; C֟~P/, PWݿkS__kXP >LQC,8:rqT<?ΰ֒i¡ÿxw*_Ά M5[hX?W{aFqF8݋f +%j󩂙l&R,ϭ ί[g ϙi ~n7<:$޺[_l~8i|_,feƽ#Bыo{owe\<Ƴ ( ko^7g#sԼo.xYv۾}VEpxOjی5ŖOrYuQϽş=К֯H??WTo(Y?//ղ~?I'JB]E.A-=<Ս|~cc7O{2t,5ujTf3Iش܋fUuj~FW֨ƙjFq6=8 I}U4ؼ F,-d DHCzY}ِPZf[xr3~b0y@{{5VZi/ ;ΪLe H\Y^d08x) '5Jq:k%ڊȪ`PN?䛂 ey TouivAVyrJ¹m H1!R#;qH*Yv]od`YtWzRGq@r9:]Hfd2.8Z+KXG7r*}Az~goiXhŇ~kp1/Z1XfoQ:ޞMT\Pd-c&;R e_kvkF9:b n)> PsjWk}HI߯y}]B8cVW%ZZvU(nI y0PN xcxTWLɼ(5њHa)"޷"T`sXΰ*Dg>rF*Pk1oYIca -NhiJCPx@pe(z솽܊EPǿ-#Jg3F,XgGCX3o[_XKքlZPY:5m:Y&vВ`Xk^6O{/]riۮ[5=gU?zyYۮD,sA4Nd%.iBF-Cpa K+Vrd'1bY"\["NoDOlksgӁ?su{xZNH8`sNoTg880sľ  =V\~5z ,trdl: .oԨպ iƶ~Pi#CfB|% ̀xed]9SgvZNv" c0"byE+-3o-U^SuBvQcCս|L+\`Tgr*1N.  {&Q*ڪc/ȐGñLgr&@veA8dUlBL0c" 0@Ъ088CΦH wCBq~?9O$p(}DhRˊ`o{yMnNͤ_>/ OIaCMv%veNWbW56h"9 Lg蔊,z ozNh@n7ȸdB~ոs j<:',O'-]QPIkrR?,{k8$A8LJz&tYg J1K "#r)jfeBI՛G@'NZ_HzZ!k}_ֳCJ; c:$IX}wLȒ׭DqKʡ}nlp(wp v%IDc)sɢ- wK?A4 L+ t6n^xGff@Ʉt<]sC) khd7ϘmUWZ /mGƤ]/ko,9p%?rٶQ9[lW=^xGHTL9  j\xsӫ-|(U+&9$6Qw5~: |S$5;utw?gg 2{Y[o#"dW35D'϶>H͛f@]\|=K*Ai`iu !,䔙+(>6#h3̏U_q"SyGzrljn++s!g5|̚-:l"p0L3C3vL}E]HZp'%d]DAiWS.o*[eo6Mk]\ZӨIIBtS&/'sa[th赗TQ0a xI-4V9:++I=wxpDofqM+%0-&eR (rC%$Cm4a[ .H=sd/VVz><?̴͛Y͛+]ϔطѣa*r_}fsӖboWuV۾sV}sYM=\e Otva'R7,ғ D[׻w~-5QZB'e B* 9@H_J\’RXwòu׸_x= &<*]e֨}~qѢ {R8RllWڕ{b:Á* vUd:Vgv%sϟ)&|Mu" Ԟԇ?xkWFֿF慟n]Gi;(.3uٗET4ϰ>=N4J"|1ǐn=r% {vkBtՌhj4ޮ֌v444ٕWDµsJ"GC HRҪ74N Ň<_!"tW*Oe^km~ WiuEuMwyݽG7:ܠ*\_QYvow>WD+J4g{]͙BEI50D-ޮ\ H9Cߞ`'-Xe!$?iAsQq^ْ9ࡣ&;~&{*|lHVଳJ/{&-.1И 4T{骲:ԄPfd kf|梂hZ9@X6BE٥LqF/31E;ZYza޻'٬ IDAT0+\w\JYQXfa ue lUwRym>6y۟oÑ?8cД I_x7TTjCx82tfeM~Ioä16?&wnzΪ'Gȸ=!d?D@YٕϺ4dU>R #pR/<|O}2}JR#'dvd2^muIKPh7#7UFRO5YKVұ'mzd ߚW>El 7^Tj XV)/4D좛Mؓ4u >|@6^\Qt X^)/"TvuXkj<Ĵ$1eʵH,kL!4L9%4 Ҽk>6dgiHj72LPeW}ZT$PQ< MFiJIr4XV46W̄ de5#)K~ՋbEbuΉ #yK5j % |Yg%y@0~xW{r6; `lNpg6I4hҎDnl"W&+hRȫ"iVSGdniKisHB*֎&, 4# %@3D2b2 ֔U6]"}1'UhUZI@ww"5,Ze!yĪk!Md'eVi9$Ek(Sx|6Zd nIUQf؏;e͵V-(5ʙIVt?IZ,;[pote@TW!#jѤAo͈>rlMҥ};:>i [5;Wޞm}v\]sN@Yiev%Hj'4P8 exu]i<7)@8Đq D8r(,0BS)nNP|ה feCA/ TWg=Ѱa{c}x LT:neH`ڕ}>َ^υ 3 &P0bV7W|!G.782DaqSL,,a\ h4C7M- а18:i~-zۗWHh0Pg3ES/}%k?yν:b߫T|f tқm_n2Й'y[$L%]!󻏤=g2 B*ǎ4J9?w%Td^0: ^&:VwX(Lcء^(, !0l!+Pbq1 `Gp<ꃂ@2{ R =Gs2iZfg|# 2j ޗS[ޗ/^[j4@*ɟ?`s?=4&?qi¸mzzU1Zݴ/,ͩw?0_;#jkGӗ Yc+ e}q:E\f|Nz(D7 kXe~lq`j| ,5?6Ӥ,( 4ƍ n YepݍRܱ>p*\R? X8.-"X <PPRj{V1SU|ܘԌD;xE]huMhV~1o1 ** #ggVV\!)De8pkD}}'T\~K眕Z8ʰĨ' [@$\_d=PVu˅f{#nB=-;y+ˀdZ ZJp@>۩zXeq@A=hO'1윈!gD2$ GĽd˯bmad8Fa&zQ;Uz:{ q ~Id~Kǣe\Tﰃl;ݎ[8kߔKRXvrs=;(D;[,DeM9XHEDD#*<܎N^צ!$^l9$ П-]RLiV +!W/ n2J{lVc[懪 U__}5@tրpoIA-k `\AquᅳCO92g[L XPh8Is V`Զ9p$ 4(/ !e]lm ^Xb9IT]{D\pL/9,y$rU!8i`Z]33\ub̪iEex?39kVWV*3J.Eٴp(Ii'p{g34H԰orppR)~=syR 7Et z-su!Bۨ[4'Hk{F{VW[l뇂BLb;\zNAyT>*x2`RIuW_+ tD(cNhL,kʅ':Q(s~[SClQ7Be:Gh޺pҒ >^KB5xJj5UVP6,cAh4PQM%8g0xW]Y^ȑViѣ'?"ql  i './tJ~90RpIT0 JHE?Ҕ'\OG !+I`h6R:|!#ѻ!0 ` 4|qG~~[-S" ,<8QD>1΂ 1&g9QDo+"hդ c5aVwϭE<"IJKr/yJi&NDV>-f 9yJd|prQ e*GkMȐ| " Tϻ$jF;HkDn2.|RYH!H@dj_K ".)Q̴'(8(GF gڗȭ_z+wk)șNdA28i'#(׷,yr#/ t'ި<х4+ &E}cˠ̓d D })D!؈k&@\ ydm :;YSR*Pq*_ev ;!i8o6jnFlNJ}9IAҕqy5+}wRGMD'N{mH9.ROЬԜ0 Ht#3e J)O$B0tu娜ԓz֊Q؂3 sp3FDfra"ҾF HJI"DfrC@"d !#cSP:₠})eYcHe#7$ ?)Zi`7MD+l%Vw< ~.Ҁ<'aԼڛk>1<ĠmKC2Ȗ^ZGjʾh]MrQ`^#sB6u =q_]V ֣wmz!-6@+JUsݛ,`k>$T+oa?4J W>?Kt MݴaõI+څ F~})5z|+۟B\eחGjjd%0xݢfF~$ן{gF n{M},s. ֻ_ݿg=ϨY{ӼŋFvw m[~55o)-l5J֟s2uCӦg ^9 昚axǎ},~j[?nloqgV^[VYWs5 1g}Us;)G:/o7Ify;]B+ uס>ksX-=ذ97M3Q򊫫f[ssY޲&ʫaZ]{KcҞS}ͻϛg(BJyKNܳcOft]c x__5?ѧm!|ɺB|O{H ^nT(dz:ae7\d}L=WZ^rg\q[*|XڞIe ?rqeZyGq]}F.zRh9z߳6`_{8+mRwO09$3Edi%[I쵽$^Z^ieTV23D`LwW~ @>gyo~ ̭[7rC͘x g|#}ף7|,snj ξ{7Sɷ:!Li-eIDx~H9V]cqۢץC#}PJqC@SJ}7"w?zGLa#ơ[nК;]'_~ew^~ÆGf$b/Ouc>@_\2ѻOG~?5 tɺ%iE'jDgk`aZ8м6̵{_ iNN>u6kErU*>MKx/:,aX) . &{?uS!ȌTvEw[ o357{;8B"m=<+q0Z.dumgirt<&1H2\oij/ Wݒ{YU]bR 07/1`}-w< 0晎絪H=,=S%? fw]y`oX |ssryeQ(HY.# ?TܶU=\vzF@i|vacF>yҮ*e[6 DXz~ЉX8b^PpOn0a g~zvGflYHujJĔh[o-j;P]>e;!^ix B]`UqX m(GSo(\%"[3n+=Q""\n>ݴ:C[ElL@㣞\HP7}rݯ7HD\2p}w閵֨埭ႮǞ~=Y,ؚy[aIy6m 12&F]ZS'Az{fHwHk [_"!x>TNˬAn;PrTB\h-3-ӑ6=p~1/3Υs t_5SEHiM;IH1btZKC"uSvy3tvUx㩷'v]qPEHK{$!q3ۖsv_O!oӹ&i-u0hև7nfrn.K=b)!#TYKpus׻۶D; Ҁu٩#ovv J1$5#$7VC`OSaZmXA^[r\As#27p5ÛH%RzŊfz1nHN]-+OLsڌow3k31ٗn(7̾-_YU?r5-p a=vWH@꼪*B12,vmŅwCҋlQ [-X\ ~VFoBq9<0eyDtc&Q9")`ʫ_ 8ذ?$ICbHH %ˎexZm <`ml(EbӭϬd-y`t3{E1X&2zRpNv D`JDbR+5[4!4 ngvxc„^xR$IB K$ZFB6)Dyٗ [_?3_ 0  #fUNI3#/g_l\ABP8&d$fT?|ەq fDԧ+aBB`&S0&a|iFrB030FqS"%[?rmU&1 S]9JF1I`98MIwڸԣݯ [#=x(ً4S?dBi_d i֏mVUܹ$)aqO(^ A (xSmV)ukߐt#s&# I|@?v2)Q&(٬cK?~]1Txiy%quŔP%CO \;G j+> m셟_z"ۊ4"`JUF=QoQ T3{M|*gĄQRT*0!@o[`P D)gxV 6O{;.TL5e3_q-r4kNj<U_kAf2N]fe߼VD;GH-A'K5Nf^ӝeh^w jw>ºӄXBĮUdϕ_c4:&buz~J<*]q̎1tʦٵp>iq R;l=isgxa0(6Ή(/Zj7Ҁ^bieeŋ!ޏUԽ(w|nht^J09B1rw<%tcv#%9q}y_W&<)L.c]?t{R-x.ٴ\k]Gset 81f,.8 02пg^js;7gl_pm2+";Ȑqxʟo\Mr4$MBϚ{86(ܓr'V "Ma(GXpEXfSOA7X'hU38H.L~hʚꃟ){4%nMk7*\]]"XPuUIZg[Oל)298;,\Um1!{p s}M*|藻V\sastXJD";xq-8-#87у--7js%DGb#{.ܴ#w-~_Qݸ*~ޑIUU⒑Ǝؓ@HR^;ccq4R۾m FetGb>hm;v6zԬr&%8>:Fm~b6@=;=ޘrދD0_[}h4'bBUnK`U4&,,ڻ?S6a BCרxgEEDg1B<إ"tDR"PbQ 7!YIZP7 MF%Q$^&Qcoᧆ©))ttJf-.{-O:]Ц]c͞w{Ψ:+ -.{Bo]{P%X& )_ {QH+܆ 0<434nF,8q%'x0BSb3瓔0E0TH:`ÿ<%"b²fjdzgZ:t1Rٔvjrn1.e73=G)qWF,ŀ#A0KL &LuP[ %׭ru`y $t1f[bUgzv7~!0$VXb񴂐M|UVH$#R *\> E#—>pmi`;4F޸ `y@&,y9i$H F@H1($t2gRԌ6?m,Y PLiQw.*tfj =xg0HȢbjFO?SO&6 BM[sA"͕~wiJ{6txqsA_؂wk}7y# .1^Y)E̩obhwޗ%!@2"3Q*6[mNzC CW=q @8Ʊ-M|ej @7 L0l4KhE6Afv:JzWk0!*jVfD"!,enx n8 z#7[u>u`a%ELzJ+# %Ne+'5ӗw1#He#+Kp,H#iv ExT\@4 Ґ`ui rhNfMMژ/ʣed:#Ue}EE .+(^`Ԛ8qߖH y;y}X#ZV;԰+F2[ PEqZT*m hu['Ƈɫ$0]TQ\^C:]P$>M"{SqkʍFiڴ1sIFQx+ ,=c:-)Z =+P52ju)1< E^Utl?NK7ĹZxPfլN%no7us5MSb\% E poM9 $!+|>pTYJlM Sj3BMq8Y!a TȰOB$ҜȨVXm62ԖfbrM oҔ\ Fk`X^лGMv)Hy44҃݋] [sΣ\fآ2*AE`܌+p#9@be(4cERQ)Li(@M&4x0.LHR C`D9ISGBt'϶8_w[ bMUl)L:NKF>rb y3"jjI}V#r X3J<leRӑ7 ԩv%eVM$8f)e(a+u5upX-F2܅vU̘Cm3បxiաu\~UJOv<ٙw϶MMKޖ4AChXdZ:jӺ{@f}CxȈ2}a=WlF}#87 #!(XSg+uن7Tz67vX?fW$FY~{S"#f*FَoO6,5{: *%I%VթV},QpγtKQN;vhsS~r idzkXPc7^*;şvĞ=+#dW71#[&mm9h,)>-)S?~$.>r1 d!|a1?D^ЫpNmJh4Z<)]e'7ؾ7bPRz2 KTz|m6mʢ_-RtI**ϝ=/a+e^B r^x 3v^4{# G|!cS ޣaa _| O1S2~š fE_yї4|Od!5sȄGbXf9~ye&/ q+Nf@!s;b{ɝ9_YYy[7V3pޣٮ4E |@㴌,tdH[? ,{ޠ[- EYp*v|:I@5皪˷LA3_ -2yyP1;w쌟$^[uЩ9S \U0 3иRVe(϶/#)ʝ`;2.1%pfYroIm*w%@L|:eϖNO 3($b}ؓa/TZ!I" *G͡Om;93S|Zə;nk1ko|X"3GK,U߼M%eúZLT=Y9ٌDs>HgoS>ԌMkjZ`R =d\-,]Nkۿz7̢KGJ9<+Աg-KpOZtB~mk}ob#y?7ͪFķ_Pl\nq RH)U54]Q)- P~6X GP2o~`WӿzT^iWs'bӿ"Fϯ'W=%+rib~:ɤ9DD1&HS0H"RVg. $#$2&`H2&9f9@Q+!ϵbUIaD=7")d,AG6IКBd[[;։@F.Ӆ4ęA(\PA|@"C0f*x`L9G)x10S0S)L&MlVI. 3'# 4!1{Ʀy \7_@}{+ a!)Mƌe"\Y򠔝c0 [_1p.gFD1b@Be8@Ji+489_|Gw^7a(*9CcUa BaBBUPa4ÔYم2A\1|aU!/n!L!.&I(UI)M~.wƏث9ҽ/6_v&H]1=0F $&J_ѳavRt 4@B:e3Mgfa\HLT٢94EUx.sSTx t3+VU#J)0!=kʏ)-))vҩ退`٦ bdL!E6:)XK2jds0bki|ߢKg*"B o;aU&#%1TMlsJ9v`FթVYI\*ItR2M cEʜHMA@PmG gnޜ)̋C\>Uy쒀 "rΧۅp1[MOiL &1AHH_9?Vݘk0Ͱ9u1qGG%Bt@L ԧD|͙Ʌx,\md ӌS dcu#OKd\‰}?\)'$c \J"B&B+mJĠ:7(_?&hH}"X%&I_F o.K9i mhWeXDeY;WbmXN!TM+O$̓JeX  H:BVjYQcc+5 BjO1U.cyGyW7͚mqO:7!bI?>,Vli84`'MUJ[UeJۑ5lR:s":4Cs]NC &! X%\Qb m10 }2jrĬt 3Ai*58!Ve6R& 3ݜXSJL:!Qb??}1`Y ip0:30fH7BU\4|0 06(1i¨6aIM4&=2)9H(%*#VBBJa#<ѣN0U3*Bp %rV 00& c #"fo 3EINb̘KB4;̢ %B8%=`\JLB&B B'VgD ΥU!!!XͰH! IAB(kJF a<Z5SB1M~'e Г "gmEÉ}@Vue&ё1_|F-%5q2W&O8Iڮ[2߁0J8דCrz7X37VX \43FTѬص@ub{BG2gϏ9_5}{eݹ8EIcCcGZSգAJ5{UqJQz^h'+'w}3]Cc]ݯ+cf*pDtkASI)꽪$s! ]Y:#ǻn*dg^[MFGv83=c1VQZUc e<oeQ?X[C{h85.tL a㧛[Ivu䮬wR!ё-]g}q[ Tx)#-{B,z^< e<3v~4#څ B>dҞ^QSM[Sk34D4 řg񚥋BJ}qہ^)+bҊ zյ2-Ẁ ~}$ngEUj<~=}N>ҵsܯ{_n)L:Y2bw # n~/,Ix=];v=d c`{Ja`Bb9vbk۸Aps c0L:[{{~m!3>]]~QB%P56s&}>o8*a׶e7C]oƘ γB1Cm:7s x'>s("py0F08}m M;Aor@p,[1#9+l};;CGt8whᾧR>?U+F{[_ujĮQ M{5LRiû#cCc),]f ܒ2ƶvs%" Ս@bV:M2E >jfϽ?\b Hu+3, ^t:jaXUUefN w';:A$?¹iEwiqN;'0[բ[Pۑi}S:xIgOFZOb–_YPPs;Z1FiKn-<^hKϞ(4>(~vO킃mZ*R710UySȘѕ\:jo(&^yι k47FV02>p+NBqM#.B Wз׭,;~ ]̉bg;:7mhm0Z^}/ e WgWᝯտկl]5)'}'tĀP' }/YYzkW-*(5W=>эwԞ=;TzaVZG^!Tĸؘp~n<G, `|;wS*,Dw =lĩמhiØXc(ȶRtv!0"zFA9uѡ_l̇z'c6+e}BWpϑ珙oY"oA3ms,nӘfQe_`fO-)QT _tV-XQ #Bk]pԚU%dƒ;{zO.^k99ԛnXBz9GY~0Gjͩ"j^:v۷rIƊsF93YBVtY%$>&(>svX+*!iRgyEtwwwXˣbOMJSm>ݷnpgxcox3{]SqmFEֿ3>-inYɴ(247 d*<PӞ޵qޚ Zѕm/S{:zf;,Im\Wn?H0B@xg.ZUZuWu?N:<[Wׅk3b/o4ѧ Ŝz#R=f0a?>nIV]}tՏlף'#Ez@*χBttGL)'sK#Wy^YT7jsVVm}JDzM~1G<4D  LSY;6&b@j]o+`ͺ>BbAz yNtj:Dךjڰ;G. *1uȶFTᄍ&Q]Д:Dך*ڨ;G20B)(]:{IOOdboi!YObx"ȡ+BE !Weݐ']"|+pph` G 1JY.5(eWx]px\B{|h R:x$tM_PWl]nW./wU:1ܺVB%;8T-!@:|7R:K+]9w1h=fg\1874I-R3 @iՆ-.{/k}51ڼqfpx,4if%%adϱ^GJWMlE*ܲe%n>KvF(%t1 b G JF:FXJ 3K2;tBqyn,)ģ\}~f'u5 ɨ}nJ}W&zs(`h]>TF !TaW&A1&ހHm[SP\̶9#Gu'.0Ms39_Ǝu/j^槔F1&}GeQ( i_ܼj+C0ͫ]"fP-!jX c'l^~{{2bQXh8wK{W5GӖ9BٞWv%؍}iϞJ=3|fmZw_*:Q2C;=dFt|p+y Tʵ-l%tB(].X:i:;k6,YF6 &B)Y]͍b1Ս gngr-5:ܱjj?gFRܛ@m%Z:0/ M%u5*O<6Wl)3GB~pM%I=Ms@g  0z|).$޶ICgu}x/rADɃ&Is˛*u}{ɡU߱$>QTeIr㙎Vԣ/Vz "@,0C[.Z6 UzMշFF;8Y˙v|Wsi7j3!%$7V'CK|gh 6Mci9@.hoWJ0 **ou7|r{yWѪ9ބ<S}3ͮDzΨݳĚ\&4&CDLOT$xi1(r Ԓ),a360դC32= \Ei7nX#yCO>~)vrRŪ2}!1\l\#yOe|n4g@`ݚ eb~=V0=TAj9•7dG76Aj$Si慞D T֣ܲIlT0ؑp 1O}YTt[FiPƹUynSKS"H4z. Բ t{ `34܋ʀ-]*f Q[*P5:9HMFʨ)iv$ur2LvS(A~}#$İT!$ Ӎf ;B"/PKIPk "H ud >N3ZL/4>h~Ӣ NL  L_/t 9v*o_L=Cm6xbN5DC I2|3т7\&H{/(]M)Vm3cǶXJQ {EK|E(Rv*?0^pKH)8O,vzOXD\6G}'ZEz{/JprW*y& AфWsa%/, zNi\>oedKpzy"+\/R@$@ء' XD09h۹5/e yWc!kOoLvxD=A1.)u]W#pJ5&1@J,F0,ΖR [=gFHq!yrS1G,1K̦I*`iQ쩀[H@0" X*Uf}?k7NGIs9JpNǬ96v&9cСq׊۰5k j ZY?SBZ %mmJl]%ĶpҍGyj& ږԹ#lLWJtTlJ3mcpƏGHe1y(=uQYj<U/>tJC#QGpkeVmچj¨Et!g~ƌOwSyr/&pVխiSLhƀ(Tm 9C)-(@/k QmHԽb4ڟ 'hiȕw6îT63f0]5 U"ƹ.+Nk9EY9E_HMMK)/ ,*tWzXhW̭M 00{[ +܃g ,fm;dYxB C@:;Μ;0 T8X5fOWk{' ,Se:` + %$WELv^\Ùul(H(<瀭[6t^XFEaY] $A Qp zpD'~Ne:󯫓8Ss^>56- "4kI7W";?x9:y_L xPy~KwM=wo΂] C|{o,#6߳518îo+ɓiDpv"~&j0V緇9:l\7%AO-~~7)=o?XmVzk#\~Vz9[6iy[Ơxnq F{$AS^z_4 O5 wv];=p?)r.]w:A`:5k*?}cfb9_\x]eߪ]wNK[:k%@*a^aWFaւpX,8McҮ/%SAz ]8y3NN-;o]luæ5X^⦠ 3߷g eЯw} 7TQrm=۶-ԆSL;:$jZgjAiaӼka9P8ºyͷ.65 cv,΅>4{t6(>L)u>}(:Q+eDRϼq$c4I&O詹}~o>0'vޮ __9qgw ]ņ\y aXw#߷DD`ҡ^5u%TټaMtWr]b>䁮'$:}>JJX]]yAԁc]/52&D3%\A45=D fW]_9Ϗcѷ*!!vv2mOr߷a=rwRϻoQe@8>@gYٙѧ}eUZhێí:s6IP6 8qʍ~4& [`ω%0~mpʫ< w{'~ I-ă:q u\A^bp#ۻS._lIMC0vfgv-7}?%n螹^hCߥ:K+y6SyOAW?9QǾ@)0o9~vOG{ ko_[[X"%_t丂y<1!@+߷8Ae'_QW27tۿ<{YL*oY>齩[xS[ϥ4B)p̈$?45o}@u]Qo~k6, Cvc[Pl}=;h\ cE+qEi ` KBTՎԤ b4  1hv4M .,b(K+vBvFP=NT"'d"qqy$@am\L(.Ѵ/w9di:pq`SR$W1 J.20JXgXK]xC5鐂2"mFLkE@(h[93M+6 DC HPVN&r5gOlk(#Mr;n#FUIX e!lHB3Z!;80Q1z].3t2 Br-r,y}+Ƕp/f 9>J$_1N:laĐ!"F"fC9Œ1fPp.cM EKF "%TOiFKv;xCFm=tz=gVFAt#J2(a@tJ^2B7ׁ.&\^e3G#l*a&ݘ]Q/j+ljgRi0LލlI&ݴa>9"E6!mFа !Bi<~q3,bOLV1}hž1cZĜXgljĆ=ri0b IŖF VOm)Öl<B`ޥ-" ; QFsN킐CF ޥx 00x\aeh!n` t{j|ן?_`_I"k^2ezÕ%>/N}sz|{w0 +ՃuzRǗ;ǖ9%oj#r%~9=/j{ )5 T>uO}{YD0m! O?{\|)cWy0Ϧzg^FU_녹 95D'/]sO޿:D\.H\)9M?"B6s^s)PWnNbzCu\S'0G3IK2'53NS\0!/基_wzN3Zw5sƁ07Yn逗-&^xwg;chhm9`QWgrPyfjiܼCxRv6ܗjlB4(D)a [3E0Ajqm IDATSv /Ka@-] vLldR:Ř1(ȢC0S& AJg?FTҴaO[I8Dtm:Y?F aM :Ȉ'Ģ$FM0.Q5ĉ(a mˢ sLt@FYȋ140&A'VMM]eKSF1bJڞf$CiY pgj)a!r1maSI$zZ7.,(@BN0bi${$J U7 g*Jxh'"'=|<g3Bn}kw*Ix U_[(<omzh̳o?=̟ 4ɻw=Ƈqqz#)/4gX܅cueڱ?G}ǒe #y\i](kY]Hl:t]xWXS[1״Զ-yռ`ֿxpfĻ5o\m{u󝖳j?=2oP/k㒔ۻo(`_>=l\71'ӿ]F,|ݫ,lj? `pGWW"!^|}Je1A>Jr}ׯm.pC33/*k߽??V/z:0ƻW\0so 4'm:~柿SFBƨ._x $ K0d#kHQ0:%0wp)1Kk[(Obs߿*)O޶yq8YW۲aW.??_v;'a1vR~k쫟m1LY.Nu±]_YGBp81'T_u|4aso]I-{{oioak'~u  Da2~mn =ymO$P G״'νO1#wUVJ趯{+B@/*ޱ27_XMwnܰj7Ch8TܱGone%yfaIpX/]kiiհg5<;,%1-Ѻ]',]Тڄo4g.ٚڙ_ ;00.#]oKKN$9LGH̯D,:䑶hS$8a4ov{jO//AM,7Wœ0#5quϛQuҍ-*j ]8uB`G#M/y: 8 ,Wlhyd#qȞGrGCmP|SufƼlf%$?r]ZG E_B xg9 !̶aE,\`֎=Ue3B1gl|AY?l;]\6ߗJ*\@=2ƻ ˿v*ۿ9޺E%nXZXxjg9R*\@νN-( /~Agtp&}iNjV|1mOlAvYM!tV6/C0JR%{z4aw:/ fRXM}Ky/hWnvW羴`eWËnj͍ 0({~fCTT BGU Z|.~7VlBj}{'hw*?ywδR 4!%,K#~2W9Ŵ2G"\#z\r^PGO@6]J/nB{'\T1DPF"F Ďv["` \Kb/qTx5XK닝"dd2]Pʊ; Aᣧ0ylNmIMBl2ǻF҄M7k6QϵvbwPfq8>3+?rcsHyYDAς%{{yQ*()gQ{\ jgl?366=tа2 F#ʧ%JiGyBm-* BuNmk(zFǧo;m55`7tve~'(@LCSi21 c;Q$QxQ-KmF -)v0MM&UxfU]Q}ddt@*J.!A#QØ2X>ޮҹ8/i~2f{dXa2关%h,B[ׇ-*'% z5?z27!DPJ&q" :q}! 0'z6S'9/sdma Z.'LbĦ*WN1_M=A 1PsǏXj^Bί.sh3m >8f EJ0# 9Ḫt8pጚ:w#6W'Ii b{D_blՈ ćzi6tU6Enjh# vU LF\^mBmT#s'\4-c$eVCV4zP424ƄecI_@W $!h<**]$ ΒFi:ߟ 9l^~=M K[ZڄZC1?K@ |$W2 |իTBђqaճXx`Q2uteeig渄ަ͵"앶j pl<wD"4Oky))Kr-ly.W`)ln_M$:S{E闎(<-"YI DȒUc2q4JoXWϾEL"YJ @ ܩl 6Vz?z!oQWvⱶǺFtI"@W ЋHy$^L¶eknF[oݫgI!BƗ: pU mD2cH,(hE_;8 \]WE>yO~@β6at\@qWZ ĘC4]!4U>7y^wj|9·;1c"DLiu `r"vq7}1ybO8˘Wp{}]q~~{'r89+<wpn^^=~Ɣ T\7~L11&{,N%t:N9@)"a9 %ؕߜґTH"۔_:9mŖ5Zl3b 0 hxѮwANI`{\J/?3_g7pz̝x+ғf91J <MW:RH=ra}jk3leO_alK9ЉѾ1Fq˽.!FxbgFLWtPvil=Gpu%%!WHA@ga777Oi$5ER x!CK+ZZ_tXTrKlpכ] ko=5UA Ah|Xroyݷɞn&p . =u"qrWߡqw :(hYZ>1:~:u˅1G}CGI]΃=oYBRS 2w>ٖ*߼oߞyǥ_iM\e7@9wΦ*wpoHF978\Hg-r,!b!n|?/- %a~rYPq<(sPWT7_φ_b̴) Bѓۚ]N'ҙx5ͷ]\\dGr:cbǼyitGx 9 #|]~DʰYk*6oiwn^&Td:!1q챿y`5wՎ}.ѷvyȳ>kCʵgAXg<C B6QU>Lm5LK92lOLmx甭< }ʦ J NntDR!T_!r/g|qKܔ?2_ނ6, `t`3g(|5|b; Eu:g@^pU8J?q2%vv_ ._]ⴉzjpzTeb"s(<0JWx,So;؞#y牀f6Pu=gE 0*B e!{ܮ\d)X/!Aϼ#x?4;gϵnfffkN}Ri. %agOp ?6/g234.Q5gҠGt7|v-21={{S`@E`$RbX%.qlG8Kbq׹qb]DQ"ERX@^0ir? ؀ R}P/|<}>g:G!B`kӊf r]!8GJԲͣ':IN8 5=A^ 1 >Car4cAEv_2E!ĻCa1H@Dx6hMa`G4&bD9泺=$++rF2`kg'i|V,Hʞ,բHi3+Ɛ6o Q-|]yzpoRj,u`C͗'.͸cgvۊc'ؗ]% UzFDP֝ 7WDkIJ+VʆmR<+O1؞iW{4#}¥޲$G` x_^X$'LI(}ܜ4;f @f(H9sE03Zttܵh݈7;Ûƻha8:55K˜Ye|̜FMK$0͆멊Po HĻ#d\3΀B74 !d91^4y"L&w)yfP :\L';;J/_7>,I(Tl9^ &&ppN4M QZѴn(ē\ŗ?Ll1|6S.okI( '#Vi `N 0ndڐɁ4 'LRԠ-C*lyOkqY IDATtu (%^><nw'O<7/Xs!C WӁ!g˝`NQjqMF9VƧ_=ݮYO7͒H)Y!30F )첩tJw{Pm噒U'e@r2MF9@& `œ} B@)ӉL@.8}akڢeJ6{<,^1*;ˋej-Kb!kǞ !/{`&Bd+%ka]M推>2(tXYam Mv Apn@ YVY4lq+諯Z)'(K4sotE bU3,8ǖ\%6:IS%0",!kq*=ֶxt( XH'@G㦮Os@BF@ z\q.0Α! Mg|_wߗJʽs3b0CAD&,aHA& d#`wLXU4~'F-ݫZWr<(/e#L`%! OcYBbh灆+F`oc/(Hs;ѥ!d ’,1EE2 EcqvGIN9k#X{Yw߾a $ٞ}Mq3:=mt7^`JӉ.U>L$Y+F<6 `wڬvLGm՗3YU;B2o/;Mpo.ظ X\?ȶ*F{L穼Fػj^"pGkztG<C֊|6.S'cP{(]9l5@2۰^"=|x 6hCIJU85'B w.s1w ÉɌ&`mgq-e#;.LVeZkᚑ@K",o7>03޵ǰpߏqeLp]pvxʄ pM7kJ%q-Dp(UV!CZ )K h͇-Pr[wp&T^u tzOeG;:iCRB=k˚72747E]215(D`]K:Hm8bABR;u1[;}I_3*վһ֢9v]gM‰ 6F])K߽=x-tp{Z4gZkO"+=!#$I$)3.D{*q@ =\X&ZsLֳCe(t8ޣ:PJ,T-Yvyv?x,g4l;(j'Γm_RUe 4}ӐziNhwnmۄ7f}[Q"3"x݁=qI")}%3g4n#ݝi#HSG"rF B@h}XJWD(Ӿngg{)n/փiS9f[Gc#g!|cVx3tp/S-5/31*v9&kj:83 ܲcgB\FY-#}~˻kC !0u Z}nuژ X'x#u"8%8V׶ IIOdٌv3VY!N >o~QL\ϋ0wrj  z֌\Cmgs ,V[wv )#\`5z45ߣr(g `9D$$ RF݉eYRX5ybݡ)4ozqBFt-'#v;.S 0Q2 |B6-#D3-,^BFP\*! \6Oֶj pՠRA|b<_@{*Esn-{xOؘfr~O`>)]bps*8 hR jpu=Β*料o%F8v{[QI&pds:l& p+VSHH9v$)%ѐJޒ܊V`UȱjAzQ˫xlp0TV4T=fzJHbp|&$X΋p2#EN9HQ`F98j B0\H„@(g"Bgƅ43exq?f̤K >aIC95%6hr%"`&Ɂ!$kSR Oc`(.7 }wNᨮ`p$)"q-K\{].G 2@Bע_m>k0VŴ0??`$_{#sn5#)rhn&>%gm2r >z ۛ1i۬ҎC kn]ΞZv.04xfg2J+zM]' !T2mL5r%i~k2洢{ؤh`UDm884sFRp+BҤn)' sί=s 25D9n]\@)_빏Z'7~û|>O6_{YӴ0gz!A4r'Onٱ)E^cB8xrx7eh7|!rM07K+iZSP_GPZ_d;u% OpNgxcih\U7.CZD"|6c'Bk Db+V,>rdt4n9`GM&ZSiiyM >b8lu-7k1HV P,)> #bku=)q7f1S`dLGph[}dyd"Isɲ L`L$I!$嚛 'D~Mk)q H3n 1e@uO팛fI,K(K“Cș_JY"DdqL3dKdc/ޥ\Bgє[Xz_yC۪ejUb{wOE сJ/BywoLKl>|ni=1셟tZ-o?G`ɻoVh瞚?|L}7-RLh߶Oԇ%b@E˹ (w[wܼ~YCڛ[jblX 4q/,̕§wmy#ݦBvfڌe7 ~?^gVwNQ_龬>\)])uҁ-^!j.Zs7}\ I:7ҸӴ%w}n3xp?6(0\h˓YRj׮"jw~}Y)wpO \Jo^@D°iUٙFwdX}{`"-":KMLt ּ_ZR}kFā^\heavQ?lZ{V̘Sf)?s|i7.js|ٙLbz<\{rG`̳ΜYJ/Lw_ ՞A0^s^4txoh/ӛQ@L+yN<ý}2IJ&Y#GkȚ;e|68} T@u¾?eG=l͝)"ΨZ튴< =WS%Ҋ,ny?F$':.\v"ݵ)T7 ǺWuB Ӧ,Z6?"i.xHۿsxmڼ 5B; SznY,Eb)ծes-I\AG$ʺ5mPru -,-aSB(@ޒ;n%~{lޗTSWr}߿/Ñ 5t'A f殻9?xYQ8D2/uP_=֕02ֽ'_YfoXSxO Kf|޲bNmLl{ō-~nzՅYtla_Pd_;hMn@Oj km ֯,)?}#!&!\vJbRF`L/ZçGF!!)0ٵWB:)G={ow3$Wݷ "N$7v[^O+;GT:<ѺHr%GlOz_Cس`ü|?҄iiqsx+sB$ 1R{Cm߲z8A:l?8.c! OYPKQ2%/C7RfWO'1[n9-~[szS?l0mm~7`M=H7%I3?x;Oe?xH!six<S-d^}K~@_&h5~MVumfDO=7v ka0Ҽ{󉷣OG٤An~zdvVBA>3 ~ܪ_Zg@E6yƋ! 7y ?HBsL8|&M!-pvEGpփkokO瀶+@E_=3m.9@^t_?۷}EB@5k拁`jWNsv㳯$0k抁 Er *f nה.T@.~jzo?((ohp[P^Sl#=$$pu^l ,u(G@D-[Z d1l6䰋A6䡹4`ؕ ]^8f>4וRE<| 3ӎٴQz 3/;Kg'at}([;Z[3 }͛>x˗lm|Iܖ8V,ƇC" %ց{ IDATM7# oe餁ܣ'Np,3tmrmF%sgqю+?ɓmX)Er>:LȨ Zδ¸2MHʖ5 [?ع `% #I!nj_;, "+Z9}xbaNiv#/v֯{ap&A# NiZb5p#osXdQ;̹{00Ӷr^znƃ}L0)ɨȞ^Uصs{&I5fPC"Ί,+hLʓie^><]-icp" >QWY+jB$g&r y#(Q5}Z#E N'fn.ҭ|vD@1>6t(jrQH GF\yk,E_xaч4!B(68 JcsJJz41Α{^+o]L[Pq@f t03ˆf˹0&H=voҥ?I+3>7NuF/hlJ\ Bz̾N͔҃M~^B x3 wPG rV+I`@Sj<}s@ 6ƀ N;$8cZ+?6t*Y$$qz nUKs.$˒mP8cUcw!\ꥁs'ݟ]`Y#6 gB-'˖륺)t!Vc GCaG < ϬhΝ97_ 4\R`M248wi8!N/_Џ6/X" "U$+G9S}u,D²@(ݭ=e_ǫm~4h^>5Gm_k2]QzzZwϋ7gΦOzN sWVM!p}}4*`,ِ d'$9 @YYae-aq5 .칹E9ѓBHpʸx,`N$b\q͌ F1"t@{"d]hHT?Uz)8W6;,aa g T׃9KuEln2!Xp674x}Xq/oغ7;A .i]|s9}^Y3`N rS+L73:f- nr>{*I9,p\NcVx߁Z4g.YWu o 7W.g2Ns =ZP0QW֍9@G2*4<{CŴuqS(֫;חtF !H ) D~Q꺺=tf&|~due_\㩹pz`T%ފt R1!PPl)\ܼ,YGۉ$.)\bE"m}NεpIj:^VͶX`:'úf@\I!Bh|XH`9ʭr$ػn6{D$Pt"bνC$K@pH1#< $n};8Dpq E@`1hL xR:#șx(av!p2i|mkr_$B(E4V, @OHsp'4Q>xGk]%nCϜhoG??rxQD[w/ő)~㡡޸mk~g;N1+ ܒ A&*s15O;W(ȁӛ_a?5@d;Y s2BRyOۧϝ=HxW_o ϙQ,9=㾦ȒK?nԽl,eX!$x)w??VBt״/-i;W+QX"@W~;@+֮wL_{H\8{aWiܬ4Ϣ[+mjP91Kɂu??~cHVbB VO>Ch_y`@psM[y7/,lXRN=r3Yv'9,_οs-ĐdͿ ~pe ]j]lɿ Ƅ@ɉ!6AVnj{^C^i%o9- cFoiߙzx=Z* Qq׌bbLFgqo`@3zݾ?KʹH]*YsydccB\DuE4b5ǚBlո{#L:ߖdžl Uܚm]}2+21Ju R@10r{K.{->j}lTτC'g=)L]>=ncEHqf=NZvܞ]u4)vg6Jn\'oőP4NͰOvy \|wxMaQB &NhޚbZǜ JNUqɳhmͽw"C}OQ77pN#Ç_KYaM3iD ny}(=p21\LpHG̅͝k*J$v5Z37|q&xgN3df^yF ᫗Ez2rm5gC[O>m7H/=u2݄h t~y?409:2xOSmXuԞnk?wtg^{'U8z|ÍjZ5Jh?i9ynK|uH$|g_xU;)D~on /I9ġ3ǎ7w'LT ռKp.AD"ָ}WVe<}ykS!ŕ^W1?sZ] H#\{?C<{A< Pֶ/~q=QQLJDݝS 3 Ķ%UI`KGF0o^(8CF8@uHjV\ZW"}FoD^*G箧l-[Fވt(0$0ܥV}EBhj'E LMOb"z["a@ vCBwI-ddϕmI`HS?VOݟ6y#c+.welV/*@ g-r^y%>7vyݝHI`ʘUӞ ۏe7^ &X x^zqMI瑉^y0@9,%9XB ̴ѫ!@$=]dYC iܫ[*Hϡk,:p~EIҊ gL9~bM~~?X@hQɈS.n뛖woM1" ̤V1=՜؄\yK*(5n^j W+M a V-L2˫s葍MQ2~x3{~IZbh*osOX]-1~ݝq tUC#Ίnl}ӓ[YuuvwA(8Ns'S Uw6uViHo~20&=^5sss=#jg7w$DuJ%bKq,IjFXU,NR]bAS@BdS-@Y0rHT$aeTVV}gyDVL+T" lH^]ޞ#\rH3i @ZϚIJ 9-Wt1"9}ޟ^A{l1|_tk!H#d8P+k?&)nRz4ƀ"[} ֈLw6Bz֠Xb#;uśXzNI$:kwC),&X[;L?yK",y+W=r)ᮓd9Nu3rq߫2g|k'=6%/Z[85SX`٫UV)ȤUZߺ:=_R=݊3zhsP.1 wVַnw+N~@#J  5zG;:ʟ22Q=qϚ?m(_[x-H9{.bN~}(*o@X @͘`ǎbYݗ3R_5(LrQLaKUM fs RR8R0H%ƾ֬WÇw^BFSLNK`4!O:E 8"%fhe7+?ع?^x3)hR71ACd,a}A LY31ƅ!,㤹(xZZ/=?A ^tҨL 0'L>+q @qc'?a'?4i [ X= ׹r ιrEO((cF!ϖu %>_嫯@ o(!3 Bp&KBFPpA饒?q \0&ABi8! #r}895È:ybƣ& ] &`?(/&e8GaDnjq]jL$)Q%[drM';7'79i7'q$v[eI$K%T! Vujl!A97<^ߪ1@RZu޽*`T¼2*!&X%V>`\ׂ@RfW0g28ĚdR% *@ު%lrXX & Y*8DvE'֝xaS) V.BXQ(+T4r[^> V>;"F.m"RԥU)X-HձԮ "j,Hei-jCZR68VROV5.;\iƜc46 $,";o$e~,)h{ ܟ: K4~Gq]6H@.3ogak_ >./h%m24U8eW1AO9sιX~ud8%P9C/;Yɱ&rjJ)JBI)9b B DQ*!Le(cYK*B~TR ƎR+ իeb*Z(_bڦ5dIVW7ު͚^~Tܥi nB˰m uRbRZN sn"D^o \rK-I.e,@+k{ò_Wu:2&/%iCB#oL! 1nK kM`;14KeD!?omJgf'HUk^o/CuխɁR}մlP4g|4gz964`R:ƹp>/3=9nK[OXC~l24|[WulԲozmx;_C˳H|jnvõ }9$x?}Pmw`o IDATg_'7o,<5_>3y| ǯi2T % ˣs !!CwzST[5QTǧ;[LtOwN04|Esy( Sy` jDjqw\AmWL ) B@2[0.DEjq(=k6R&yqCqcQ;%j}˦-5(~stpKācϕ^ѾrMįԩӉ ˍ?WS"m55905p 62z JݡՄtڙS{RvfI`֚O[rYм& ށ 9 hip4:r焔kꮭAxrhttxW^Xb9Wը x3CꪶM^DPL6/`Zo Iى/x|Ά5}^H&2[۪hϦ'Dsj;ܲtBHsL.aBׄ*#sڞjBJa͝LLM \qaz<+8/"G uCU= N =-+tB`b|i7qB tƺ˦,oj`@ɳ3ӇRBk_ I 1zvF"NT鴛ugKi}#C)䚷qCCTd"+;CP6-?37~IA@°Z\1'&ON @cCˉe]077)2k^x6wn GNLb6xQ;N:4LSn빭ͩ;j_ 6l֦N:75kJ 8 v޷!&LO:Pf&\.Ef-xBuxi.V HSkƞ3S)omiR( ksZS,(&VR>ПF@;VV |o.y.Dǣ 1Qu@ ھ twӆ^ ӹ@͵~wߌ\jmg]wlVs񂬿ܷ'Zݐsz@I9Y$%ǡκL͞:嶐eˆm1nD \ z=K\N?fyXkGDYjVL $ VᘐкU% V]z߯ wn='ue2^)VYJd! nx`;=519a[NWUۥcDJ~\@'B2 UwGV=ؐ)LX M5'NT 'Q 7: J[{N9! WwW=ؐOXUn*!RHC;T'&Y^a$f1!J 7:lV^}UzPOD3yUĴkMZ9D@ ƕuc/̀ŤHoVEdkqq݁j 45 h\\5"% 39!D VQVccji&,APŽ͗#%Vzpl\6Gw)PFC>7 !ްOgѩYCӊ&-~0k*v Oav䤑nosr ^? ZP6ckMr3N*VCMƅEk|avd19:1ȅMq3r&!!lKGvvvTXN);ڜB.~6RH7mص kCTr|fd:4+ӴW$[gB՛>4ӯXE`ֲ:>}`֞<2[sAg&$"fN8PqiH?80yվcsV8:WwᓓRhT1͏CC\Yf a0 +[gJUo1Wst4HOC`8 ?VR\V-Kx.Fܱl:"[;Z;8Da{[5rh*;0(frQKm!^ڣLJ$rZ*$Q >R}N%77&g&,A(E yR~B\չN}}?O^O ,IL^)&R@X0.1Ѵ Q^E UVE)_}ciLorjB8Td&Qr`oTj $b D?70=u qŖm5N>84+^ ('ҳnzV|*19 bOKcR bv: !8bb]>5mXU(o ޜqo2 jҥCd3/g9Rɩyg )wu=rڧ{L|s4=*5mpsz;maMea:z(3kϥf@PC}}{H _2m]^lkCݍ;ln?:- cyv@P5lE$q-6RԱ7}7WeəK &׈ᷞ;u?^#9gn =?7M0n]&XOxVyyYc @VW7}gie*CB^:c/<ŶQ#i+TXz;VCwh_o/G͘9:éI C{O 3G>cO1[RoYڛ==5Rm@ba~'tԭkx_G)fفڶIz )!DNL#=w?Rܕ:tgGu~Mi@gs0@2_SM!+)ʄ|Q_M7U~!994{BfR 7t`L BAD#)ƹ@cUw-.:R⠷ ΍[$gR@H0MMnwO'"ll[- Z.,#@(Ynl丠6ڛhhf \5 HC뎖/|}nb;ZRBtz)J}c+o]<K_zƠ|l빳Ã`S1ݿ.q#)T xWj{ʓb!Ԛ0+N  ?q6歿=uA)冄0FvLm Vن4V$AvՊ"cr}'6V;98e\M]>(Hc(cSuդ8~.qjB]zGDxkzݖ_t<.(Je ^)D.aaiNf_dXmb5wv Bb՚;k).l`CL9179KܪC23!0ԹP,$iecHnP1h 3;1C*Tk} 'CATRx~)"!q;[OΉwR䒉$~:+FWvmz)@}*ZR[nf":]T?'s!?.NUĩ塑 IDATGxc-ee[~}{ާ~2g!J<_bĸT .9;qd?LX@fƂAMK|.)_kyfϦ B^"̤-p"9ccԴl 1vz?a憦m[n+*F_*aaĦQTՓk~ 43mMM[ESY4i"#\FC?<=v+vҮ}F#.l\e<32܏ZӤ *Q-5-uHU1{tyMOKwu)Z'q3 oou"gk@ [Ɗ)\f"i9N&UAj}N6?)Ç/EcӣhSOc7稥`Ij}N66X,_d-%a`kK!<]`N b'0wGbN'/Yjxt mJ sj"u guNc&*,2ByS6miæpnjF:_X˙iE[ eT[iO&+ZDKk;jfZkeQ)̢RP0)R2-&Zaq.iWvK޸+{|X!3Q\MIţ %txownAgNڜ4wFTĩ4߽YiنEy ܍>w<=:W$R W(ܾ9wp$QyI{Ӈ[vށ(JS]k8[N5bf Zi抠mUwE |~Ii޲)?o/sǏu-+z_&g&W4B ZBB LjlƥdfllHR+S.JHnoNI͍-] +X R.%g4sRmیK),J L%(Кnvٙaaթٱgw3qSʀ\JiQZduv]#F>W(9g@-Zx.Kq^)P¹Y#,WxX&ԮTgJ暺z,LFm.QS$o 2"PJsj53;l.cW8%@)%eLc/s||$6|,cun©T}r ˍEnK䝚sI&ա?%M'HBt ĺi0&(лzָn(N0@uU/CQ`h?^_GB6g& ӫV< Nɣ`1ckjDAiGtp#Yk=emHŪ`G  )MJ_U_ HӇPHY)GUt PtU0tDW*!l4MUO9r05F*r4.B]uΥgp8"ZM+jNnYr%@pҸ*^/~8GH@04?Dder_=}r\q XČ赁]=NLW6LuƿTA[q3=}e$xv,=x0>03/y%ikkx罏œ>9oI!g窞}+H$c?yc* Ohq/;~{'FEyyT7|=0Q`qfɃ'er$pOseU@M7O|__uG{Ԇ`Z(O7ϦѮ27~3oSCU~[<{Ч?;}ܮ5:Tе-?s?:<]FRpߊ+NR{B䡽ʹ$5 adf'{D |o_'M0^Jd7۽~v姢OsK+[ibHG\ЊsHQ+jDxmB37pOL[<:eF|)-j$Ċ~q_vW;67>~õ^LՂvoe!gϞ,%""͵ׯoBZP~pWFg4_U3g)$X \{ꚛ$$ϥve)E~`+sfHF, 6rgmS`)qSlYgD]>$ý&t"[7nԱO91|^B d˟}%n)⧇}H}?8cAhgsB17={&2 m~l.w6_ |={vAIuS˝Zk1ȧ{woݖJuȳ =mZ8tj*R9K8;c \ᖇ> wl~ ֵXU8"#r*0{^d}v<;ةiv`&@4}h<U7zKOB){-oNFPkZwZ3|i9M5nenX*@uk4Fx$rh7T2朅B%_L$+<R f,7IFrv:a"Iʲ 3_R|ګkʃM |rnd ٌ!V]_@W0R|J7=ہgD6kHjSW\0(Gs$ *\M&u)dBC$rj~!g?sӿ=F"i\H@K Vb6mAzRBO& ȅ|*)w,t,cϔÚ7ȩs,ogy*@'f1ڗFPzO{O/.߃"hz2c9|?p>[ta'i x)# ɥL`PS0|:Ee{Pq]^OE.U/:P0H'Kl)?Tԩ/v@ݵN$\!,ѡ)IbȁFTUEZ0%rSեk.r ^oa \z낥  lTk>O0څaP {.,Rg~q<4Qv*R 0E+`py0Rv!e[ACvg*Lrp9B%+ČbKz#&M˾b ) )!{5`F4}gnK5r 2EJ.ҦE!܊aPëh@r.fXE>rl>UARݣh:B36eeCC23g)nBA幚,tG-cބZMB()CDnAZ\1O@A|%9Bp:|.@ y*1Q}^zss.mqREw|(S͝ToK'$+ ( A2S|Cp B&[ϭJSR#D4`li^KY E@Dn")ͧ.$ x`qq~F v1mUg:ߍu|b[hḂPvbŠ/En&|*͛X2W^Ӓ@ @2e/5FIiR C h>?Kp-E_iSE U'!fanB)B7`vzU".NAJ;=3T Eg.{ɭtl6%A(L%R3;cdK+Wz D2ײ̥734Kd2k!F"]_T( sBɊt!qьFzƐ7o)>4.x ˍgcESa"@E"KTQ^|k0f"gޅ Z¾ %%f5 4UH%/Ry)Hc!f%( T7S3yI hrƥJagM0VLТ\x9Sy83RX 7 |t!hN/lX`bmv_"}@9ZA`P ]C*tD"R<Z謫q^%v;Uܗ+B 欪vZ9 w xBmKzGHh^ Y x?J %pxޝ8ag+n_O5x%[_.1o _ӇJՒE<-2_;*x ,pYU&%.m|d~Ow+)kKn;9/^o[q+&h,ia^%2Zr wJ#*K,r?M#K|-EYt4/nRQ^Er2,y HJe0+F Mf>gs`ږ%Xfږ(mxbRRj5W?ۥMLfif̂Ihfy)guR3ZZpvƾHRXWM%UBۢR+( F1ʄrD!sܗ DդZu-12j.] BK.GJLTTHnLA 6(~yyyyyyyG^t+d?Q[OlXZ?۶=Ʃ=ܬԢx^]ew[ު'w?~Y~ː3OW? o|uo}f&0~w/~&>施?cO\|p>eꆻSLery xQr]f.s89׍שa LHr,BX+ڀo-v15vXZ'tI?gȻn; >ץ5~.| |g?r/`id-)$ :Ru4ODP!BŅ!J(B#EH (lZQ= Ru1/.#CtBP *Bƕ/'Ң)!BbECHJj2TE!aEsW7Da,^DwYArjG+ͥ3H !@ QAy"ڊBT eXWAeԤ\"**(&*BJmKS%A(c`iV&!Nm H#sj\E.*Ybb É`HUDZ@LF iSUuj RJ e Eq)3-QDXUBܴ@;e퀙qS`ECCnQۖB "%Q+%J5-B#%):Qod9 k:HmS *BL LaTU$8e@ynRRb@ Fr'!bUUB)-XA0;(lqza`+ϩ(qtC0qJ"(SĩL bFVI-QiuԶ8BLtEQ HLjS VtE[m^!EIy2_mq.&+MyjjSFYm ;Qs*BU*+̶m B4]Q0R@Lc2JTE-j˥*|7Jά"B"EtE@J,fLHTlŊJu~Sg_? NRM$e+4"掤́\|G=?ke%pRx7?# >I@ɓW6{Fu:?ǟ{އ#.Dgա((K,oΦuڞߌ !!΍=A վQJf0ײx :Ew4LAA/`$X(Jd[d˖Kv;I;M-V^IJl{`L/_"I9{B}-k ɳyJ‡6^絪,p`ӝž%ߺiy"hWϹo, JIE劻W.Z>l6*l ElǛp6!JW+@EFA bj7ٹhy/9øpΚ1{A]Y@rܱ#]M#kEn+)#.R:ǭnrjg^YƱ[(hpx&_]Iܓ60d##ߪ*.lO‡v `&U+TkS§{]{۶縭 5?cM/1\$cէWڬԞG8[A9 X;m_YQH. {>93sŀԞ4 D@wwíū<җ@M.Zt=q=5pNFz±;nw*PRU%<7;Lc mK6,#M]Y.D }84_- &^sF7 #?~{v,Vڇ \ k[;f?܍E}PT5s7̦DY:o?^'$?`'+>1MjI^1 IDATs |\=>?>u[GЩe7M[Tr-YuQ"O>7N!ĩݽj98<5COy(tc-TGM&Nkϟ@ ʞM;?zD ^}_"(ӾEZپΛ Ⴭo?Hl[o7@QGW'ܩ_ض_58}O60۶o?xI;@*<%4=GBVHo[};! ,{6_Xw7p& <0F%w /i1 ,6/}aݙ>A+LNSm˶eAAllb UlhJKb f?9ٙ2<4M|h[Sce41щ}OM\hcaYY)o mx[}7<cL$%;}<ͿLr{G7nHio6xВ\y9o֒6x7&7L{~}ɳn_`L fY`p`{Ɣ%e#̀fBomZP,%z}U_ wͽF yp ѓnS2csqxK\DY6j1AOACwueyt_r5Δ]s M/:(꾺i:3J';jK_rg,UxOZubYZ {=*ڹ*땷z].>ҟ={|9eB~ƅFr[sޔ(Ӧn?|o>ցo/S24`ԯބPAk+^#IW-ٷfj=~9!'Aa#==P&He ƁJUk~XN,/Tl*dsTg\&[MR1Q% YENR![e-2/2z&aCJwU{t`:p Vlv3P&%-h FRid/v׺|%6Lt } s&.-חL{t|dYff8՚]tS˭71M=8Rxřc6p.dM0D AHΪ^d1ÉQ"w:|E" XK4}8]-I/Bju!u seZv$erdFfٜǂɑdT̡N; AYx"?$ 1BIpe>/3i@!BNS %lX\eWŹhQMЍX|lҡ@G`T7f{GTVAY2Ovk"K"c#cRUi Εp܀06.vkwFG895 }Ԭv%{񨙹H놵 5oْfzXWWپ>Yu5ǓK4``0#(攮\Xd/@`걑@O`$ Lbqۂ<;ZN)]ЖTy!([^ᡮd([\ (\,mݚVsK=E63iDuȼ} %u e#4bW{#͆Q̈́N "tP*,?ϮAy2bBȢ#=օb)O4>ԩ@ޛryȡ9c0Qd<|yEZ!KQ4C%bZl*aP&4jopOOVBX`7j:}#\?s[aJd.l i J߳zBh82pXNIl(\̔ $C#xbj2i k頤9є ulxЕU.QQWcaK n,ƒ?7ԊzG,*҄Ѧy ,JTc}rrƦ.ZA{`c#ݿ:9{̓KoNsk>]-Uvc.TW.YXk!GA'jv7E fgPB<+j+Oo?m͕҇B$+ -5Kl[~~.]^P" ݍ=}- ?s8q.hpg)-\\"$ 6Oe SgG4 ,_xjZZ0DLф?[Y`kj /s~d<)Ml驪nw/_RP# (ѱã\zV#KVX rU*ZGc2%#MkXGbNB$WUٿ;8.n r,_8tcQ)#`pF dٴTHJ'Hv-{-;C_ܤPͫ]S.S#sq`yK-;6D}:Mp(@n`\_mrDQUm&'h:esTXb@0$娪KR,] B 6Wwn_]"S1 RSB9!ポmSίnO@@՛WĎo@Finoo;3ʯ8T[>{.B>{K b#Hzܢ$z̺-ELɁ}Mgԅ\\A{=r5RۿN/tݶ|mEA=O{Υ,o⎆7 #a_ ?φ=ݲ#NM'ƨ'gƤ2$1e3 8Vn^ |x{%00@}%ꆻʿX!亅7$<+o*(AoB1vg )MHS4Ę>i}wؖk6^oQfWũLr\zg=gG`:%SpUqѳ~cYU3a:ڻToEHt|sEns17ZY˻w3\ݓP~_.m+&Y6,qcKYmI3&8Bh#фͷmK՘E0R:cߘ[c;8HbtMfoVUML!X,bzpFa~]"#9:%>>֋c* |HU7ltĎ&FyO#$E&E7[; TPp ̩Txsh|'smY0&8B56њ[Kr :"ccc1bINC{'^W2|Yr]Ri ufP&Mq)}$VѾ6^*&Ea]"?/>r9ۭ XX$Jj/̓`*}ti8~ `BWwWllLa^~r)b*B@ %$键B`F>Z`X?3%)%{!PE9nYWo. cE݆%RG!{3._G=0V{I Bo8H Vۙ!AeA]}bs_ϭ؊+T[ #]Ƶ;w oέpʲռ9 ݿqΈ\إ" < )Xl|/^ṎM!\c8Xsl<,S4ɹY<4fRIrVZ8d`p0&LSH&LB0Z\?, 6wnW ș Qol7MLQhhl"i Vp2sFizI)@jiժj𾽻 "ZQ[n$,_22*4,.e3ؒ-xEq؍x0,gX"Ѐ7.mo ~8~ YcˆL 1/5<tՍD0G1N Ƹ3Q f2N ZQ(`i8wLY%]GPͫ  E ӦSS/P ,eF4đcKI@Be#,8f(*Pqd0 NX`(Wf9Kr=Eu,Yd,). H/䂚#`|z< PdFgm͕BohHēo",1zB<95!!41׭sgObB.q`ɐX- d}a(Dm;{#G2ZJHKmK3f4 4'FϾrzꞯV4c,lO B)-!EU>q7C X’Mu[4Z,NӉd[aCpQ< Pb0eUdx4r$p,_~2 ם]ϷxD_|ڞ0&7}w(PR:%<:0ȱJh2օ0s#b"!!,xHD궩z,0<EjS2г;n}m<K\)/'}{K,cIA$aYF(QԻJ8*bTYY\p,rwRcBo%1djj!-w/YHyiLN%@YmP|$E䡩>oQPy/qTѽfg"%G]#= ~Uly5jYSPPwP^[dKnYâVnJFaV妒벳w/?ݑHRʄ0uu?ޱg_N;R }-~ei^Ye.س6>`o yV=-Er2O|oG8$j2,_zmlC˜ٵvfPX;u@^! $[TcObd d;7nY>aڋ"m'Z4Y~_)g[zp•>pY쨽fnV|󦵮cM?U?:XfflG_ Vb` z\"%kEΜȹcͯ{b-<=yޒu[Sys+0ɔ.o_k a[rY%(VT8T.UmMcIPPFC{RrGh 8ʼK+s-[zQN~JDрZk)tkLͶ$z2%#yn#M]⭨(@.]j?608 Wɗfv;k v|gG3r嬾.׋+rXgAdl4+cm-Iv'[alYTHS.ϲZ .%dd<|HQV>k\gZϒj{ HBCúҷk_d--w&ڏO'*CblζܞgϖgY<<4 FtS&"PnuNKY%ػ*hTKRv% ;S"߱H̓kQze@}3Tn\k;.+(E, k:R,$ LPrs.T|7Xn%!^z _L4=sU[Y}OIT^Y]ea򾞎^57Dž8?6 ?5HL3/,Y@44~O~ӍAF<ߖw4UZ-%]SS##&H]5\v%~w{nZȯR[h2xW{D+n^4SP>tl h>// 5c#G:1TVV;qfD[Ckj+ >vdp(hp˄o=>%cǂ:b]8ښRD3Znq,xxP@Sd|nFgVbSPƹ52L}!Lq!B|nm:+֊ fBgE {4`@mKB(F$ָ@#k Bd=:Ρ ;njtYXNL/tN7ԑ޶adA 2cq495ٖUzp $.,qJ FV NwXVY/O!f?qm:s F$)XO3ѓ XMc୦{A G O`&G]14Rα,I&BL2?g0b,KC8M8 ّQ!DVnEUYs/yf !JL7 JGne2?Ls frPfB$$ N N +g{/L V}Mꄠ:3ySa$)A 7͙!$ɗk,@YAqӸ0tȘHP̜J*μE0DiBt1i*=y19&L3ROc.8tRHs.\ɳe` 0F&sBBhKv`#tbHn! BD!Ct& /"Ե8DXX0C`":ן70VtcԠlz 3)3UOLSU?$L7td,!p/4RC눨6R @,rH$!a)˚9Ta4׬JrBM-I(X5@brmJHɰ gȓpޏd#Y0oIV$ ;dD; !VV%DRfO,8j" ,Wvd#Y ۪|`I|"e% UuΔ(tUEXQ  ,X0mX$r5VfypF̹NX"'DDAND#ImLُ!%RIN8y`iΗ!$2&s$H *ɐu%49Q- 8ՌF)̈)36 9K3S s `B4ڜfF"e!Ցsfs{Հ4S9EA5j^~D4kP;6ޚTHFkO-1FHRנ4f)LSŅ䔄m0&U5/1!^D90<܎k@(5[6hﱽxuw]{,ZAϟg>Aor(nǥלy!k 3Dqk L |mw#m#qM:mqıC&@kp N~z^{4lWK*6O>4^fu+?[7tD)Bu6~ٟ\s`!Lp eT2*I Fb@H(# [Ud)AMHФ % LM0X|m+LnBp$g14ũ.p Ir%Kt{ Ēf@""ϯ^AsbQԄ`(YHƨ9@".213ő*Y4|%?$0f$ !CՐ5XV1D@&BeTBHVB1q!"Kj2  H!r2 &D QFӣ"j#7Mfr1VH:DP &!Eh^BE=θirӥ (Kg#AՊ ByC7|b ya(' a̤i$0 >| DҍD)OJHtRNJd:7`` rv? JB %H&&0M&0(IPE|F &8F?$-.`8@fOBP&(C _n. .t*@! Ar)H"JPe,C`)`$)D"Mf 12#"EA g&X!jF5eNLb `Dʹ,#e$ MERe:3H+20j!@X`!`,IĢ"Ӕ!B$!̠Ø2]&`d܀$B.+PV !X^SW2[ Ӏ܂<\?.Yy)p8v{$% ._-"t*xG $eIE;k;dcG?0LAQ_meμԇ(ʷ - t#z4R/cyI"ͳ ̇?hx6}L=X [kϔYaabOs}mgXЙN

S&xL@9w_UWOsY2Aη) JBWO9<"KIח7<ܢzwC-:$ *_r/yXC{Bu ]Y݀u߭O}P0(ttV,vjS O'uK^Xg% e ۗBČƀj)pڈ$8V{6.Fall{l׿t lcs4s&.ҒԔi Jv{/ʻ~?N9\*QhGdA-oֺ;sX$#+AP\̨^80BPmZ~(nNCDTg 4 cgE] t]-ݦ> 6H4,A1c"#ΞV\E\xH8x7(<=/uNqww5Or6ϙUr{L]R|?n 5x՗s\m,.YiIp]o5/v8r&֪KlԟPݥ r.tu|Qi "3H@AyBX(W2Ju{ `Zm++"7F4I|άD>m¬āg!B ~*8=:Xi\)ft7QwM8Cۖh_gxu7~W H"Q]dEM~--HI\XIܒ؎,V($;n/[fpBNP~"wϞr/)Ӗg+k=nG۸lAD[TDkkBΎ4Cdhw ^~Nݓk l(|4PaK;j N0 Ƒͪ/z?.|;FR*TyEyg3c"?IXJ>XXr cLDwI_Q7>EraRʲeב+e`,;4Z{`]fB wbȜSͣƄ]#Ou(LblE8J%4cEYl,?b$^-cz?T{LO+2پs1/.k.ͧy:8ڝΘ "WM{ۜv^<_Xgb;vy\ߜv̙=Wy׎v<=x9|M`塅-}%ڒwo\,A&L;_yX=u͞mW>Ҳe[|$Gdͬ+TU޺_w G/ G“DVQwVjKC;`k# 'yd_D+M$2ܺ_LG*k1E}端7guM\ޭ=e% ٸ_x#BrP -/1(;oM{xDeQF㎛ ?{YNQX\U 3 zŰAo2i>2Ni $ z'' \36j.@ GreO zXxo/v>ՕBet.A㠬, dFG U uRt6f?(\hl2ow#x?P3.`mHb&r  3W2k-ueJQT$E@l[;;@qFAf%y\R)ƖR>"}׍ܩ~cxAl'G&yF.TE^ }P=W=חee?bS)QA$1H\e񨩸5&L(j.-oLk ГC۾ZXKg9:^KRc|m&0vx&|@ņm;XR᰷ ҹfU5\rn&b< y;XT@sҁ:>hUX/*[}Yߗ,EXJ[to vY~޷A$97x9@4.pV=HLiR7Wy-~^=R6}ҏ7IO9/w/# ,{6t/dV属'{f<t>qhK25,<xNQ|S}3:DMŞ~io(ڸ0ޝiR ƌJjtO@)iq)RbӚ2:*(}짉UYz[8MC)Xl˨d,lu}b+g=CΦ3E~Kvtc[hc s-w:_}keXIRӽhLOг|WKiMˊ7Cua ˤH7j5eŸP*VZ]0 D +hI'Q! .$RH<ح8f:UNž ?;ܵj]M`USzHlu%Y?w>hhp{|Cݙplu%&2F̆))էx}^ǬX֖vUsnS27~a!bc{ڶ\ ,.*N;TN9tZWX>T?rG~~dI_&|T$v4 A ;Hm?bK%׊"oRI *Z.wރ-/T\Ӈ̡Ӗ5mʚ=Z2 |faP0U/j;oLTN o{ٜOeQaR#9 m1=o/'9(T k40DkhUǟ뎉" {}p59@P|>~ipQ̙#r'yc=ζYJ&Ook(;(LIe6w-J}mivz##宼/wgāRT!X\E\޽?5>ڲG=Ùއd*T:SF>ԗLp~G/ؗ?c'3lͩʿ {uǺ튷tfP(8+oi3 ?P2Ù|LXkrW y](%F-ċ{:U6o#U#7Q[^<-'bX)tgĹa$;kwڈ BǛ/֘Pd9Hs#t}cq_&IQpaX;rﲊyLW?FSrh4ܨ ( sw(E4>yAeo>٣A(sGbO={R*+k6enȱ}[BJw/YVAtp\3B^\yJ>Qj}*ڞ0M?}wtؑDLźr) cVZ]A{FSq$0K=="x"5RWm 1gtd#s?`p[H k?s_?O r>k8WUVW5$93~&.Y_5}\c=ǞӰƒo?-R]S7gŁqz'H[q3P:?+_PfvU~tNY&_13+1(&"vk*Hd~,<݈Q3WAq15d57ӻP:j>t@B^܅I "}84q[یEtQHp%?^_X`W5ޛ#.ʁڵ<,d>%6K/ñtzU#2\ :`WUixO9b,)!- g[-q]ShOD˫]GQ`GG:RMɎ[q\r]4ql;a0sƄ Hچ'\<&jrDim{Oqf\ᤶlaP$zr6CS#&#xgd`bƵ+˜]♈\P4k4;R1 93GW,bỦ>d 5CG%0gv EXtLU4o_K$}RݝdeKY9feXa?242DC0Pc)7J*ϮjYlw fDRH.6˳*~8ܙc+1.61$05A @ si3 d"\= {I3X:rq [[~"Kݜ%bފZKd\}_(Z ^Ө\P "iYI\vS"v<\7L:$*˄RS:eg@QJ ^{ר86CY%]0EN[gvYu:DTоmuz|'[wb"ݫ"wrK"hmiG2)ӔFMW*Bi{ߎ5[qݑϞx1YYQn Sg:Nfx]/&g}3|LJh^}jKWGF@g qf=< 7گ|!okU,Y7~[Vby@/+[7_z[>/^χ?9!ůdk~Q+ 3{ o2ŤH Uh+6=nDΖj6 ߗ>ϙ|6g+>庥)NGn2!a*o?#s>y}쫭{7 iw3`-%eݕ:i)19 \Uֻub;>w2ZĘYoM)fA5[u$^@aHbWu_8j>|}]x,/n| fxov>Yvؕ*Zq&6' ƑlG")]U^:S<u/T6!"GaOҮR1~d.5v}dzSG6x5+`rX!Q%)R57gf$^њ5{3,nX_5e S=PI֊Fñi ٧SSUC֙szۼ2?g]-?|! QBJ1`Hڬ|m!'nNQZ tnAtvzZiU57.H#"5{o,Y_?:dnlKu =s5F$qw.1%7_~m_>:iK kuW03ۺ.ҋ}coiPͥ|Q JuR;/{Acm61d??|0fF3GOG2_ఢ+@*xs}Kj laT R0MlX[sK xy+ Ý.Ϧ+6dNkjtG;joY)M {_63L 66Bة׺%G YhPOk+B3}8{~CD>6Ѳwxn;gy\ٓO4?@&uޚF&n}=m9}殒{sΞO}>sX%pwisMa7>N9EϜ}s4*ۻyj(\o,^Qc@Ğ?v&7P0X޷jd`sf˛n'h0sm>՟]ɍ^ ar~'3Nտ}Ғd 5FJZ:f_s>T[gjDJ o<ahۻ[G>ym`=_[>x{)"9t>ecO9 4I񛨡քmH/$8xא)v<3)prtrP3Q5z[MVlό'v8g:c@9$ :"Y$ 6mHY82 qq߆6$:kb΄rc]nuD($PG;wp;+OxzG*>p9%q9Rʢq Sc۝kHɘ?А4h"HMJMe.([1oHi "gL9 o{ӷ<]۾sM<[Bpz @9r /s:@Hrr(%| jM+WOA9R5`z)ε̈W; 9^*AB˫GM\; <@J C!Eulp(G2U!*Ey|k 1 A9۟lkg`I:t! @8QqCIS=QHD'KRW^ "L,vePhRYu.s~oGSDd";^%EN~#Iɔ_ ^ɳ=#RɉɅ |̸i>Y *mBLJpi ^|ʁyogNڗd)Ҥ{yD*7j_zk)Fov0l#g*7xxiZL\ #Jy0fs}RC3=,"1 HbK3w" dԥ7 K?wmrj*g~~[e2]#-x)'lC{GR O$rK~~;#7Kx"*ܝ,}ʪпbA?4[ <%ؼ\8ycǍ"3[ /"Ԍ[": gZУܗ)e"]]]3 jOcr*RĐP}e*1}:w^21R9IbD6=)S\CDqdKeCg\gJ)K#)| Q$E"EDQH"[@/svL)9T(8 Ȓ$ Sb*; X(@D:)p֔"1" `4(@q\E"&@1x`&/l5dC05$GlL9xzQ|/`A(s,Lא!+m ȵq<$`9ʲ@ RfVș!cey c*{22LC8GCk'45 Y IS9;8w+-h`yV w\ sFgw@"/nӺ009W;5;HN'?Tۭ*`nVȪHE_šyj%s w>T9+@RQG_K`BZ oq:h 2EF-d)5n!9Y.*0OUK&}I٨XuAMUy˖%L;w[D÷T2dv촙ΌF;æ](,tFr/'I@}^trSP, %``龝lHyr١ \j\=9,"ha᡽ ;/\qGp1 )ۣCFP)c rͽL6)|ŷёIKWQb2ez[N 5y6?@h4U-n@p`Xp5<1$PhPOvD"JykvgcTؑf$ }jݥ:ćSz3Jo5F4T,#3:E+5vI2,rA`s<)GT툠'fAO:9ez@'4圖ΤSC% VT\3D.i3mh0P}{Y^ހwDbhEWņdad*&ѣSQ˵y65Y}o}M X]4eFNtYeJ.u(LGk޾+ޗ<Z~UFl WTnZ o>x&"lx_CTllxSIHf݇S& -]yqGں7::wn* ONuoOI^\e%2}g5žᡭ;jIF UҞ}S`9MvJ@\iZs]BrA_1NO@; wDKe VɪkA 5K&|D{rf?JPQs^rZw 䀨dʽQ`E xxBdf)c޵Ӳ4 r6W Eb<aer )NXE)Xv}_CyH<ļA)d%\Mőf^$ ewW #ڒ:$5ʹ 5|z:N<݁!@/2s1GMż%k ܚ`>$2Έs &mǹLbhǁ4& E[:y<>`55==u(E}_6޴B3߽extpwFŽ")S==lj`C&n纏ֿuvSV[ڏN9a|hǁƹ-ݻ4#{FNp<o y@lie/Pl} )| /J$>~{Nj\mdrN$- 8wꗝeU,gTD4:9n* 4/֧շmw*Ws/g3#O>vlWÞ @˭/6 C_ŋݏ~KL)k_v VҶ*=@ ;qZvx0[?u",ȽI7Nmߎݷ"X[aAh=kڻLvƘ~ewubz\w A~⋞;@Iz<{3`o>@9×"{>42#$k׫S2W52!з>\sݧQ(1/#2:-1*99~gY÷7}A/YwXS[^[[EX!<('F }[θÅG. W'1_(>0o8>Ɂt}jxdIPï#Żd>zD?:ANgBh8XK"7nľ旯?6@h8:P,ij:97}$m?_.ܚpMAD+* i-Ph;EL6R]Qu}1Є#U:Hp47RqudMIH |ճS,׏nIZYw6?Kx)Ct; #\ɡ#f[\VrʪT#Qrrx[= BaŚO~/{o6sg uTp`ed7OI,Z9k+n߸@۲) B VwϻJ|ׇ1DI γ:ڜ{]z]Nk4d1Eg,w';b T h"RZx'Q(|$ku2UXW2mؽY-t!Y錄11:9GS1Yi}/HL6kȸپ;3O22wG>z͔k2b $M#2e5~, l+U%p744Ԕf#/&L\nU˝cI ##D츥'p"4W&ە%.7S(GFrRqS{-Bcwa#>9>8"u.nrR)RDh,'GPQqml,eY5g\HG+ z:`^/Fs |aר_I%%"~z=}0|R=,' %:3 b/>7ֹ8 Bw/>uu}ީN[^F;r6CAxf/(=\ iO'|r?2.$v ]v_`BCD3z֦)4dMe9ϓ>mvjxfosI=?>,DA;4tY ԢS6'XoMI,Yd`En<'p&59EaE$^[=@w=>- C6=.1wSK\?^Y_K۱ǒ֔D TY3-2#TP\LNHKcea: Y\[*yN_N͂3mKu]4nu6exy@$:ٓ]Hi9se^0Ƴ2?!0y9ΈCA BtcR2a|aْ&LG%%Js|$^QCa.nhV6ǜaR}x A0#ׄf_Qi+G-S|a:6a^yb̻tv1T2o`wwG!kߓfݯĩv$G7VDEu^}IOĔa]̝?Nh4F <+oūE谓9#NI%kJ|vk*{ϩϾJh$B$m-0v`yqx`{8Ylǟ9 ĄIdžhABBH#>=ݪ?zF{"?o:S~A5rjhoKvю{I y.{"]^ON1?'I ant+~/z&1Y'Rk\! qBae9 T!\uC׆~οU+)`g7^tr4]&SmO\WbSLN>~uaµnL%}ʺM1-.Χ"Voޜ QzObҲ,2θڻsHoiReUɈ^ٰ|ccCSL  Яcc[6M X} z3~o l*G#?q X!WlrʰI*|c3"*0~ߏA= Fcm+e~$ #nƪzձPb^QZQw@ڂ2GyvEGa偓'}e) RCֺɬ?'s5 JP*MS~&Qz05z# uǟ^6\EB 5˔J J|@9… Z 'vL;If4D]bcp=(lf^t9~#)|Jc.jߝqok5#@YIښ 5k (!/'Im~#)YedɌȔn2;,< &>pX%ѠU Q{dž]/.ČF(^qY/!̦3Ai =)vel黹GJ<@_Qwcg"Hb~uϛT;Mo!! ruzl;FO@UubJjנ-<';}ZMJUo挞j\ G~wV">1Ֆʩ`A 4Z _HKxqswH!0Y%pU_c^xq[ EY4b4uQlE؜dxiDe(4>mn424T2kхT{gs`xc+*kuL*xzcW_RBеw?}51Gxu5hܒZ60HF_{ʺO,pnFtYnHrԇ`8LVݺS#O߳l})zߋC joh {_ltˎ?_hj'%v1aI ׭<|u9$ C@/7~6w 24X:Krƾe enT,ZO˅kD)$Q㝅K/y "K10O$Pm#`.oR'&*.9%< #S~G_n5ߋukuA9d/X&)3+R 0jYJw7IDAT$b* 13tngIHhis{{HI KK)fxʯɾ R@@ 4 2[cB 踉C ]`a<9GH" 6^ HhmSr2^}PFYnp@".Qp4L7 N1ODD񄫀69CC' b0 [a lt{z@?~u>.\)K꜡CVU߷|! G(lnss}B X;¨8HJJG*E{I!rݓ| e{]R'_z 㔨6"LP)P2jE0?ựyf=W.u[SY4JWt\־vR~qRWwFɉcYͷQ~leP? H&؀Zk!#?$[( ]5O} "tQ, 7x^ZYa|)J"FIRA.lOqVmNᢨD eOȕ$ŬwK3qI2~m#.h$nONOJo/ =Cd?R.$NMp(dǏDoʚ9}} 7uqş>/2)a(!Jn`7/ ǧ$|\xi4g.|]igz+oS9|R]eS3lR@m xLϕ2[_8:9`{oq 0|P:ﲯ{Q0kcOl[7YӚx¿}f7dG<6^2y;5>iY&7;/Buk/Id7 #Z3Q8]_-}-j_7Z3akyE^8"/e1-W|!ZjE\R=k_2Nސ};#)yMqDԱg=>B@Uaŗt%U [/+LK.zM- uT_˂6lDzB1Ro%2ٿ.cq.]We[K@y?aM>ڟླྀ0J)jkq-Ѧ d̼j]S$'uP,n?_CIiKhA/'v9-w71UHߖK$xM xSUݸjU!Og*A}xsc?.d5/^[cTYolbUkN׊bk ӿ~p!p(XtL@̏{ ˣw]aJ{,3ɳBW7‘̼wX*xQE@Ɗ|3g;ou7װt[3u/uo4t/1͏h [\-2aڠV,f !ce\p.ZdӐpI+Դj8#[:TfAdsMKx}f1$@+h2o;/'ef??>$E )"oZzZr=К.Y˫P:!ȉs; ^l{/= 7|ǁ;;V?yzrm]6T緞 |^Ň=7>8O޽ M* 57V쯾g[C O֌[okb֢\~}3=3Ebe_5TBD{n۳Ƕ#}¿*}Dtcǒ gW+:czYD|ro(nWOIx˯kƾg?v%<㞛jZs$D"oJ#SEEA (QoTxCPDx´ / SgeXM+.?sbKT H%Yv}=" Ё؃,!Y-d7Vê['d&`!4R*@ ֣fr(?^ \yEL7$THPiMFڙ䓾6K-g&ɧ|r5 2 S0BDp2w~s{?;  jZ4D*v.ǂ @DDԙQor3^K&=aLr396 1cM"J8,-Ԭ&(us #ȹr/ jQtղ[?ʣF@i5ZZH!jF 0Ke{ DR2: G3u]7+ 0,M^b$!g턇1+P3p X,l댑ФMk%=ֿңjcFIp٬;Szب jT)Q@ ARxB HNdAJM Qi'~AXUYT |Od6M,qdKRr1ƽO_3}ã3@@k2 <+0jLdR% "'0s 2w: XVzS) WYrV6tgF &ᇞP ,Us ,&࣌2 #:9jBWQWҰJC AJUb >ysHɂ*Fg1D ,|PUڟ~Wb7iV^*(&=PWX>0FB2/B=d4C_'DJ(M5Xu1ݮn!Hz<½qȁh`s5DJ IEf$07º "2q"?.uV'k+̌ Yl{`r&m$ǎfF< I5iEd/+B fX/cHCF/iε41 5JdSIaljՆ37c<=:p#}J%hg(z fഌPѰ2^hZ/8ɒ K @䤕P9z~zUV*/SUVh( *1Sh(j1=V):;MN."IML|f^A0Kb' Sp 'g@m("!4+iei-NbN)8MFI &GDΓfD'*Ef༈ac4O457 V}r+8sAi`@SkD)1k򪶸rg6V(0N %.5ӇeF褨{rq͛1T8S>)`.RJ@&6 ئy[`^"4>4ioއ4xhN"`O*pg*o<-)G!  +NsCJx[ĊD*%LFxls9Rڳ +C*}tR< :"RqΨ!V, G(@,*۱o~\UD((Xgߒ]c!g.MR6>3I>PIj-vyIԉ/(/AI@8b=IR P"?H[LyOVYXQ~ї\rL'5|{D͜u d_52- <d:L|%ݳ9 -3̥߆Pd;[nP9<PMJk0g st9:G;7st9ҞCJIENDB`rivet-3.0.0/configure.ac000664 001750 001750 00000100620 15224454746 015717 0ustar00manghimanghi000000 000000 #!/bin/sh dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run when building Rivet dnl to configure the system for the local environment. dnl dnl You need at least autoconf 2.59 dnl # #----------------------------------------------------------------------- # Sample configure.in for Tcl Extensions. The only places you should # need to modify this file are marked by the string __CHANGE__ #----------------------------------------------------------------------- #----------------------------------------------------------------------- # __CHANGE__ # Set your package name and version numbers here. # # This initializes the environment with PACKAGE_NAME and PACKAGE_VERSION # set as provided. These will also be added as -D defs in your Makefile # so you can encode the package version directly into the source files. #----------------------------------------------------------------------- m4_define([rivet_VERSION],m4_esyscmd([cat VERSION | tr -d '\n'])) AC_INIT([Rivet],m4_defn([rivet_VERSION]),[rivet-dev@tcl.apache.org],[rivet-]m4_defn([rivet_VERSION])) TEA_INIT([3.9]) # we are storing here the configure command line, as recursive # invocations change the value of the shell variables $0 $* CONFIGURE_CMD="$0 $*" AC_CONFIG_AUX_DIR(tclconfig) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) # AX_PREFIX_CONFIG_H is a macro taken from the autotools macro archive. # The typical configure generated 'config.h' can be renamed and # preprocessor symbols in it can be prefixed in order to avoid clashes # with Apache's config.h # # As of today (27 Sept 2008) this macro is not part of autotools and # it's in the 'm4' directory # AX_PREFIX_CONFIG_H([rivet_config.h],[rivet]) #-------------------------------------------------------------------- # Call TEA_INIT as the first TEA_ macro to set up initial vars. # This will define a ${TEA_PLATFORM} variable == "unix" or "windows" # as well as PKG_LIB_FILE and PKG_STUB_LIB_FILE. #-------------------------------------------------------------------- # # Init automake stuff # AC_DISABLE_STATIC AM_INIT_AUTOMAKE([foreign subdir-objects]) # establishing a landmark in the directory hierarchy as per # autotools design. This is what AC_CONFIG_SRCDIR is meant to do # I arbitrarily choose src/rivet.h as landmark, moving this file # to a different directory or deleting it implies this line has to # change AC_CONFIG_SRCDIR([src/rivet.h]) #-------------------------------------------------------------------- # Load the tclConfig.sh file #-------------------------------------------------------------------- TEA_PATH_TCLCONFIG TEA_LOAD_TCLCONFIG #-------------------------------------------------------------------- # Load the tkConfig.sh file if necessary (Tk extension) #-------------------------------------------------------------------- #TEA_PATH_TKCONFIG #TEA_LOAD_TKCONFIG #----------------------------------------------------------------------- # Handle the --prefix=... option by defaulting to what Tcl gave. # Must be called after TEA_LOAD_TCLCONFIG and before TEA_SETUP_COMPILER. #----------------------------------------------------------------------- TEA_PREFIX #----------------------------------------------------------------------- # Standard compiler checks. # This sets up CC by using the CC env var, or looks for gcc otherwise. # This also calls AC_PROG_CC, AC_PROG_INSTALL and a few others to create # the basic setup necessary to compile executables. #----------------------------------------------------------------------- TEA_SETUP_COMPILER # # For automake to be happy, we also need LT_INIT # # the LIBTOOL_DEPS macro sets up for automatic updating of the # libtool script if it becomes out of date, as per libtool docs # LT_INIT AC_SUBST(LIBTOOL_DEPS) #----------------------------------------------------------------------- # __CHANGE__ # Specify the C source files to compile in TEA_ADD_SOURCES, # public headers that need to be installed in TEA_ADD_HEADERS, # stub library C source files to compile in TEA_ADD_STUB_SOURCES, # and runtime Tcl library files in TEA_ADD_TCL_SOURCES. # This defines PKG(_STUB)_SOURCES, PKG(_STUB)_OBJECTS, PKG_HEADERS # and PKG_TCL_SOURCES. #----------------------------------------------------------------------- # Unused: src/TclWeb.c #TEA_ADD_SOURCES([src/TclWebcgi.c src/TclWebapache.c src/apache_multipart_buffer.c src/apache_request.c src/mod_rivet.c src/parserPkgInit.c src/rivetChannel.c src/rivetCore.c src/rivetCrypt.c src/rivetList.c src/rivetParser.c src/rivetPkgInit.c src/rivetWWW.c win/nmakehlp.c src/testing.c]) #TEA_ADD_HEADERS([src/TclWeb.h src/apache_multipart_buffer.h src/apache_request.h src/mod_rivet.h src/rivet.h src/rivetChannel.h src/rivetParser.h]) TEA_ADD_INCLUDES([]) TEA_ADD_LIBS([]) TEA_ADD_CFLAGS([]) TEA_ADD_STUB_SOURCES([]) TEA_ADD_TCL_SOURCES([]) #-------------------------------------------------------------------- # __CHANGE__ # A few miscellaneous platform-specific items: # # Define a special symbol for Windows (BUILD_sample in this case) so # that we create the export library with the dll. # # Windows creates a few extra files that need to be cleaned up. # You can add more files to clean if your extension creates any extra # files. # # TEA_ADD_* any platform specific compiler/build info here. #-------------------------------------------------------------------- # removed AC_DEFINE(BUILD_rivet....) as per TEA 3.9 (Massimo Manghi 20100825) if test "${TEA_PLATFORM}" = "windows" ; then # AC_DEFINE(BUILD_rivet,1,[Define to define the BUILD_rivet define (?)]) CLEANFILES="pkgIndex.tcl *.lib *.dll *.exp *.ilk *.pdb vc*.pch" # #TEA_ADD_SOURCES([win/winFile.c]) # #TEA_ADD_INCLUDES([-I\"$(${CYGPATH} ${srcdir}/win)\"]) else CLEANFILES="pkgIndex.tcl" # #TEA_ADD_SOURCES([unix/unixFile.c]) # #TEA_ADD_LIBS([-lsuperfly]) fi AC_SUBST(CLEANFILES) #-------------------------------------------------------------------- # __CHANGE__ # Choose which headers you need. Extension authors should try very # hard to only rely on the Tcl public header files. Internal headers # contain private data structures and are subject to change without # notice. # This MUST be called after TEA_LOAD_TCLCONFIG / TEA_LOAD_TKCONFIG #-------------------------------------------------------------------- TEA_PUBLIC_TCL_HEADERS #TEA_PRIVATE_TCL_HEADERS #TEA_PUBLIC_TK_HEADERS #TEA_PRIVATE_TK_HEADERS #TEA_PATH_X #-------------------------------------------------------------------- # Check whether --enable-threads or --disable-threads was given. # This auto-enables if Tcl was compiled threaded. #-------------------------------------------------------------------- TEA_ENABLE_THREADS #-------------------------------------------------------------------- # The statement below defines a collection of symbols related to # building as a shared library instead of a static library. #-------------------------------------------------------------------- TEA_ENABLE_SHARED #-------------------------------------------------------------------- # This macro figures out what flags to use with the compiler/linker # when building shared/static debug/optimized objects. This information # can be taken from the tclConfig.sh file, but this figures it all out. #-------------------------------------------------------------------- TEA_CONFIG_CFLAGS #-------------------------------------------------------------------- # Set the default compiler switches based on the --enable-symbols option. #-------------------------------------------------------------------- TEA_ENABLE_SYMBOLS #-------------------------------------------------------------------- # Everyone should be linking against the Tcl stub library. If you # can't for some reason, remove this definition. If you aren't using # stubs, you also need to modify the SHLIB_LD_LIBS setting below to # link against the non-stubbed Tcl library. Add Tk too if necessary. #-------------------------------------------------------------------- # # stubs are causing segmentation violations when mod_rivet is getting # loaded into apache. it would be nice if we did no stubs for this and # still did stubs for librivet and librivetparser, which seem to be OK. # #AC_DEFINE(USE_TCL_STUBS,1,[Define to link against the Tcl stub library]) #AC_DEFINE(USE_TK_STUBS) #-------------------------------------------------------------------- # This macro generates a line to use when building a library. It # depends on values set by the TEA_ENABLE_SHARED, TEA_ENABLE_SYMBOLS, # and TEA_LOAD_TCLCONFIG macros above. #-------------------------------------------------------------------- TEA_MAKE_LIB #-------------------------------------------------------------------- # Find tclsh so that we can run pkg_mkIndex to generate the pkgIndex.tcl # file during the install process. Don't run the TCLSH_PROG through # ${CYGPATH} because it's being used directly by make. # Require that we use a tclsh shell version 8.2 or later since earlier # versions have bugs in the pkg_mkIndex routine. # Add WISH as well if this is a Tk extension. #-------------------------------------------------------------------- # We have to either find a working tclsh or be told where it is # using --with-tclsh AC_ARG_WITH(tclsh, [ --with-tclsh=FILE location of a working tclsh executable], with_tclsh=${withval}) # # allow them to override the tclsh we think we found # if test x"${with_tclsh}" != x ; then AC_MSG_CHECKING([for tclsh]) if test -f "${with_tclsh}" ; then TCLSH_PROG=${with_tclsh} AC_MSG_RESULT([manually set by --with-tclsh=$TCLSH_PROG]) else AC_MSG_ERROR([No tclsh at place specified by --with-tclsh (${with_tclsh})]) fi AC_SUBST(TCLSH_PROG) else TEA_PROG_TCLSH fi #TEA_PROG_WISH # apache base directory AC_DEFUN([APACHE],[ AC_MSG_CHECKING(for Apache base) AC_ARG_WITH( apache, [ --with-apache[=DIR] Apache server base directory],, [with_apache="/usr/local/apache2"] ) apache_base="${with_apache}" AC_MSG_RESULT([$apache_base]) ]) # # We have to either find apxs or be told where it is using --with-apxs # AC_DEFUN([CHECK_APXS],[ AC_MSG_CHECKING(for Apache apxs) AC_ARG_WITH( apxs, [ --with-apxs=FILE location of Apache apxs tool], [if test -x "${with_apxs}" ; then apxs_found="${with_apxs}" AC_MSG_RESULT([$apxs_found]) fi] , [ APXS_NAMES=apxs for apxs_file in ${APXS_NAMES}; do for apxs_path in bin sbin; do if test -x "${apache_base}"/"${apxs_path}"/"${apxs_file}"; then apxs_found="${apache_base}"/"${apxs_path}"/"${apxs_file}" break 2 fi done done if test x"$apxs_found" = x; then AC_PATH_PROGS(with_apxs, apxs) if test "${with_apxs+set}" = set ; then apxs_found="${with_apxs}" fi fi if test x"${apxs_found}" = x; then AC_MSG_ERROR([Could not find apxs. apxs must be in your PATH or you must specify the location of the apxs script using --with-apxs]) else AC_MSG_RESULT([$apxs_found]) fi ] ) if test "${apxs_found+set}" = set ; then dnl At this point we already have apr sorted out export PATH=$PATH:`dirname $apxs_found` APXS_CPPFLAGS=`${apxs_found} -q CFLAGS` AC_SUBST(APXS_CPPFLAGS) APXS_LDFLAGS=`${apxs_found} -q LDFLAGS_SHLIB` AC_SUBST(APXS_LDFLAGS) APXS_LIBS=`${apxs_found} -q LIBS_SHLIB` AC_SUBST(APXS_LIBS) APXS_INCLUDES=-I`${apxs_found} -q INCLUDEDIR` AC_SUBST(APXS_INCLUDES) APXS_CPPFLAGS_SHLIB=`${apxs_found} -q CFLAGS_SHLIB` AC_SUBST(APXS_CPPFLAGS_SHLIB) APXS_LD_SHLIB=`${apxs_found} -q LD_SHLIB` AC_SUBST(APXS_LD_SHLIB) APXS_LIBEXECDIR=`${apxs_found} -q LIBEXECDIR` AC_SUBST(APXS_LIBEXECDIR) APXS_SYSCONFDIR=`${apxs_found} -q SYSCONFDIR` AC_SUBST(APXS_SYSCONFDIR) APXS_PREFIX=`${apxs_found} -q PREFIX` AC_SUBST(APXS_PREFIX) else AC_MSG_ERROR([Could not find apxs. apxs must be in your PATH or you must specify the location of the apxs script using --with-apxs]) fi ]) AC_DEFUN([APACHE_INCLUDES],[ AC_ARG_WITH( apache_include, [ --with-apache-include[=DIR] Apache server directory], [apache_include="${with_apache_include}"] ,[apache_include="${APXS_INCLUDES}"] ) AC_SUBST(apache_include) ]) AC_DEFUN([APR_HANDLING],[ AC_MSG_CHECKING(for Apache apr) AC_ARG_WITH( apr_config, [ --with-apr-config=FILE apr portable apr-1-config path], [if test -x "${with_apr_config}"; then apr_found="${with_apr_config}" fi] , [if test -x "${apache_base}/bin/apr-1-config" ; then apr_found="${apache_base}/bin/apr-1-config" elif test -x "${apache_base}/sbin/apr-1-config" ; then apr_found="${apache_base}/sbin/apr-1-config" elif test "${apache_base+set}" = set; then AC_PATH_PROGS(with_apr_config, apr-1-config) if test "${with_apr_config+set}" = set ; then apr_found="${with_apr_config}" fi else AC_MSG_ERROR( Specify the apr-1-config path using --with-apr-config, 1) fi] ) if test "${apr_found+set}" = set ; then AC_MSG_RESULT([$apr_found]) dnl At this point we already have apr sorted out dnl It actually calls another script, so the PATH needs to be set. export PATH=$PATH:`dirname ${apr_found}` APR_CPPFLAGS=`${apr_found} --cppflags` AC_SUBST(APR_CPPFLAGS) APR_INCLUDES=`${apr_found} --includes` AC_SUBST(APR_INCLUDES) APR_LDLFAGS=`${apr_found} --link-libtool --libs` AC_SUBST(APR_LDFLAGS) else AC_MSG_ERROR([Could not find apr-1-config. apr-1-config must be in your PATH or you must specify the location of the apr script using --with-apr-config]) fi ]) # -- APU_HANDLING # # calling apu-1-config to determine where apr-utils includes # and library are # AC_DEFUN([APU_HANDLING],[ AC_MSG_CHECKING(for Apache apu) AC_ARG_WITH( apu_config, [ --with-apu-config=FILE apu portable apu-1-config path], [if "${with_apu_config}" --version; then apu_found="${with_apu_config}" fi] , [if apu-1-config --version; then apu_found=apu-1-config elif test -x "${apache_base}/bin/apu-1-config" ; then apu_found="${apache_base}/bin/apu-1-config" elif test -x "${apache_base}/sbin/apu-1-config" ; then apu_found="${apache_base}/sbin/apu-1-config" elif test "${apache_base+set}" = set; then AC_PATH_PROGS(with_apu_config, apu-1-config) if test "${with_apu_config+set}" = set ; then apu_found="${with_apu_config}" fi else AC_MSG_ERROR( Specify the apu-1-config path or program name using --with-apu-config, 1) fi] ) if test "${apu_found+set}" = set ; then AC_MSG_RESULT([$apu_found_]) dnl At this point we already have apu sorted out dnl It actually calls another script, so the PATH needs to be set. export PATH=$PATH:`dirname ${apu_found}` APU_INCLUDES=`${apu_found} --includes` AC_SUBST(APU_INCLUDES) APU_LDLFAGS=`${apu_found} --link-libtool --libs` AC_SUBST(APU_LDFLAGS) else AC_MSG_ERROR([Could not find apu-1-config. apu-1-config must be in your PATH or you must specify the location of the apu script using --with-apu-config]) fi ]) #-------------------------------------------------------------------- # 6-Dec-2011: Introducing new ::rivet namespace. Some components # (namely RivetTcl, providing Tcl level initialization) are required # within mod_rivet.c. Unfortunalely Tcl < 8.5.10 shared # libs exporting names could clash with Apache's binary own names. # Hence we have to make sure we are running a Tcl compatible version. # (See Tcl bug #3216070). # # Effect: If you're running Tcl < 8.5.10 we refuse to build Rivet... AX_COMPARE_VERSION([$TCL_VERSION$TCL_PATCH_LEVEL],[lt],[8.5.10],[ AC_MSG_ERROR([Rivet m4_defn([rivet_VERSION]) requires Tcl > 8.5.10 (current is $TCL_VERSION$TCL_PATCH_LEVEL)]) ] , [ AC_MSG_NOTICE([we are building Rivet m4_defn([rivet_VERSION]) with Tcl $TCL_VERSION$TCL_PATCH_LEVEL]) ]) print_fileevent_msg="0" AX_COMPARE_VERSION([$TCL_VERSION$TCL_PATCH_LEVEL],[lt],[8.5.15],[ print_fileevent_msg="1" ] , ) AX_COMPARE_VERSION([$TCL_VERSION],[eq],[8.6],[ if test "$TCL_PATCH_LEVEL" = ".0" ; then print_fileevent_msg="1" fi ] , ) # MOD_RIVET_CORE # # Determining the path to the mod_rivet.* source files # AC_DEFUN([MOD_RIVET_CORE],[ AC_ARG_WITH( rivet_core, [ --with-rivet-core[=path] mod_rivet core directory],, [with_rivet_core="mod_rivet_ng"] ) 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 rivet_core=${with_rivet_core} # by default we search the channel and core commands # implementation in the same directory. This can # be superseded by other macros default_rivet_commands=${rivet_core} default_rivet_channel=${rivet_core} #AC_CONFIG_FILES([src/${rivet_core}/Makefile]) AC_SUBST(rivet_core) AC_MSG_RESULT([$rivet_core]) ]) # AC_DEFUN([HANDLE_TCL_PACKAGE_PATH],[ # shamelessly stolen from TEA_LOAD_TCLCONFIG AC_MSG_CHECKING([Debian TCL_PACKAGE_PATH workaround]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # If we have multiple paths, pull the first one, add end slash if needed res=`echo ${TCL_PACKAGE_PATH} | \ grep '[[^\]] ' | \ sed -e 's/\([[^\]]\)\( \)\(.*\)$/\1/' -e 's/\([[^\/]]\)$/\1\//' ` if test x"${res}" != x; then TCL_PACKAGE_PATH=${res} AC_SUBST(TCL_PACKAGE_PATH) fi ]) 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 # # Choosing where is located the code for handling Apache request data (like # form data etc). Default: 'request' AC_DEFUN([APACHE_REQUEST],[ AC_ARG_WITH( apache_request, [ --with-apache-request=DIR path to rivet HTML form and urlencoded data handler],, [with_apache_request="request"] ) AC_MSG_CHECKING([code for HTML form and urlencoded data handling]) apache_request=${with_apache_request} AC_SUBST(apache_request) AC_MSG_RESULT([$apache_request]) ]) # RIVET_CORE_CMDS # # selecting non default directory for Rivet code commands core # AC_DEFUN([RIVET_CORE_CMDS],[ AC_ARG_WITH( rivet_commands, [ --with-rivet-commands[=dir] path to Rivet core commands code],, [with_rivet_commands=$default_rivet_commands] ) AC_MSG_CHECKING([for Rivet core commands code]) rivet_commands=${with_rivet_commands} AC_SUBST(rivet_commands) AC_MSG_RESULT([$rivet_commands]) ]) # RIVET_CHANNEL # # selecting the Rivet channel code directory AC_DEFUN([RIVET_CHANNEL],[ AC_ARG_WITH( rivet_channel, [ --with-rivet-channel=DIR Rivet channel code path ],, [with_rivet_channel=$default_rivet_channel] ) AC_MSG_CHECKING([for Rivet channel code path]) rivet_channel=${with_rivet_channel} AC_SUBST(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 and binary libraries target dir ],, with_rivet_target_dir="${apache_base}/lib/rivet${PACKAGE_VERSION}" ) 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]) ]) # DISPLAY_RIVET_VERSION # # --enable-version-display=[yes|no] (default: no) # switches on version number display in Apache's signature. # AC_DEFUN([DISPLAY_RIVET_VERSION],[ AC_ARG_ENABLE( version_display, [ --enable-version-display Display Rivet version in Apache signature], [ signature_version_display=$enable_version_display ], [ signature_version_display="no" ] ) AC_MSG_CHECKING([whether rivet version is printed in Apache signature]) if test "$signature_version_display" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(DISPLAY_VERSION,1,[Display Rivet version in Apache signature]) else AC_MSG_RESULT([no, Rivet version will be hidden]) AC_DEFINE(DISPLAY_VERSION,0,[Display Rivet version in Apache signature]) fi ]) # UPLOAD_DIRECTORY # # Adds '--with-upload-dir=DIR' to configure's arguments # # let's make configuration of the upload directory more flexible for windows builds # (in case someone steps forward and takes up the Windows port) # The upload directory can be changed in the configuration, but we give the # user/packager the chance to set a default at compile time. # Default: /tmp AC_DEFUN([UPLOAD_DIRECTORY],[ AC_ARG_WITH( upload_dir, [ --with-upload-dir=DIR Default directory for uploads],, with_upload_dir="/tmp" ) AC_MSG_CHECKING(where Rivet will save uploads) RIVET_UPLOAD_DIR=${with_upload_dir} AC_SUBST(RIVET_UPLOAD_DIR) AC_MSG_RESULT([$with_upload_dir]) ]) # HONOR_HEAD_REQUESTS (--enable-head-requests) # Rivet answers to HEAD requests with a standard response to avoid the whole workload # of generating the content of a page with to the sole purpose of returning the HTTP # headers.To test the configuration or scripts that manipulate the headers it # can be useful to let Rivet honor a HEAD request as if the whole content was # generated so that the real headers are returned (this can be set in configuration # by adding "RivetServerConf HonorHeaderOnlyRequests yes" to the server configuration) # # Default: no AC_DEFUN([HONOR_HEAD_REQUESTS],[ AC_ARG_ENABLE( head_requests, [ --enable-head-requests Returns real headers in response to a HEAD request], [ honor_head_requests=$enable_head_requests ], [ honor_head_requests="yes"] ) AC_MSG_CHECKING([if Rivet has to honor HEAD requests]) if test "$honor_head_requests" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(HEAD_REQUESTS,1,[Honor HEAD requests]) else AC_MSG_RESULT([no, Rivet will shunt HEAD requests]) AC_DEFINE(HEAD_REQUESTS,0,[Honor HEAD requests]) fi ]) # SINGLE_WORKER_TCL_THREAD # # This options is used by the worker MPM bridge for debugging. # When enabled rivet_worker_bridge will create a single Tcl interp thread instead # of the a whole pool of them # # Defautl: no AC_DEFUN([SINGLE_WORKER_TCL_THREAD],[ AC_ARG_ENABLE( single_thread, [ --enable-single-thread forces the worker brigde to create a single thread (debug)], [ single_thread=$enable_single_thread ], [ single_thread="no"] ) AC_MSG_CHECKING([if the worker MPM bridge will run in single thread mode]) if test "$single_thread" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(MPM_SINGLE_TCL_THREAD,1,[yes, MPM worker single thread]) else AC_MSG_RESULT([no, maximal number of Tcl threads]) fi ]) # -- SERIALIZE_HTTP_REQUEST # # The macro defines the symbol SERIALIZE_HTTP_REQUESTS and cooperates # with macro HTTP_REQUESTS_PROC. This option is useful only # for debugging (avoids threads concurrency). See the code of the # worker bridge to see the preprocessor macros cooperating to # attain this feature # # Default: no AC_DEFUN([HTTP_REQUESTS_MUTEX],[ AC_ARG_ENABLE( requests_serialization, [ --enable-requests-serialization Forces HTTP requests serialization among threads(debug)], [ requests_serialization=$enable_requests_serialization ], [ requests_serialization="no" ] ) AC_MSG_CHECKING([if we want the worker bridge to serialize HTTP requests]) if test "$requests_serialization" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(SERIALIZE_HTTP_REQUESTS,1,[requests will be serialized]) else AC_MSG_RESULT([no, HTTP requests will not be serialized]) fi ]) # -- RIVET_DEBUG_BUILD # # Defining a symbol for conditional inclusion of code for debugging purposes # # Default: no # AC_DEFUN([BUILD_DEBUG_CODE],[ AC_ARG_ENABLE( rivet_debug_build, [ --enable-rivet-debug-build Includes optional debugging code], [ rivet_debug_build=$enable_rivet_debug_build ], [ rivet_debug_build="no" ] ) AC_MSG_CHECKING([if we are building mod_rivet for debugging]) if test "$rivet_debug_build" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(DEBUG_BUILD,1,[we are building mod_rivet with optional code]) else AC_MSG_RESULT([no, ordinary build]) fi ]) # RIVET_COMMANDS_EXPORT (--enable-rivet-commands-export). # Enable export of commands in Rivet's namespace. Definining this symbols # sets the boolean configuration variable rivet_commands_export # Default: yes AC_DEFUN([RIVET_COMMANDS_EXPORT],[ AC_ARG_ENABLE( rivet-commands-export, [ --disable-rivet-commands-export to prevent export from ::rivet namespace], [ rivet_commands_export=$enable_rivet_commands_export ], [ rivet_commands_export="yes"] ) AC_MSG_CHECKING([if the commands in ::rivet namespace will be exported]) if test "$rivet_commands_export" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(NAMESPACE_EXPORT,1,[commands will be exported]) else AC_MSG_RESULT([no]) AC_DEFINE(NAMESPACE_EXPORT,0,[commands will not be exported]) fi ]) # IMPORT_RIVET_COMMANDS (--enable-import-rivet-commands). # For compatibility the module can be compiled and installed forcing rivet # to import commands from ::rivet into the global namespace. # Default: no AC_DEFUN([IMPORT_RIVET_COMMANDS],[ AC_ARG_ENABLE( import-rivet-commands, [ --enable-import-rivet-commands requires explicit namespace import], [ import_rivet_commands=$enable_import_rivet_commands], [ import_rivet_commands="no"] ) AC_MSG_CHECKING([if ::rivet namespace will be automatically imported for compatibility]) if test "$import_rivet_commands" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(NAMESPACE_IMPORT,1,[commands will be imported into the global namespace]) else AC_MSG_RESULT([no]) AC_DEFINE(NAMESPACE_IMPORT,0,[good, no automatic import will be done]) fi ]) # SEPARATE_VIRTUAL_INTERPS (--enable-virtual-interps-separation) # Virtual hosts get their own interpreter and configuration. Different # applications running on different virtual hosts don't mix up variables # and namespaces, avoiding conflicts. # Default: no AC_DEFUN([VIRTUAL_INTERPS_SEPARATION],[ AC_ARG_ENABLE( virtual-interps-separation, [ --enable-virtual-interps-separation to turn on virtual host separation], [ separate_virtual_interps=$enable_virtual_interps_separation ], [ separate_virtual_interps="no"] ) AC_MSG_CHECKING([whether Rivet will create an interpreter for each virtual host]) if test "$separate_virtual_interps" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(SEPARATE_VIRTUAL_INTERPS,1,[virtual hosts will have their own interp]) else AC_MSG_RESULT([no]) AC_DEFINE(SEPARATE_VIRTUAL_INTERPS,0,[one interpreter per child]) fi ]) # POST_MAX_SIZE (--with-post-max) # Maximum size of data posted by a form # Default: 0=unlimited AC_DEFUN([POST_MAX_SIZE],[ AC_ARG_WITH( post_max, [ --with-post-max=BYTES Maximum size of data to be sent with a POST],, with_post_max=0 ) AC_MSG_CHECKING([maximum size of a POST]) MAX_POST=${with_post_max} AC_SUBST(MAX_POST) if test $with_post_max = 0; then AC_MSG_RESULT([unlimited size]) else AC_MSG_RESULT([$with_post_max]) fi ]) # UPLOAD_TO_VAR (--enable-upload-var) # Enables upload of files into Tcl variables # Default: 1=enabled AC_DEFUN([UPLOAD_TO_VAR],[ AC_ARG_ENABLE( upload-var, [ --disable-upload-var to disable automatic upload to variables ], [ upload_var=$enable_upload_var ], [ upload_var="yes"] ) AC_MSG_CHECKING([whether files are uploaded to Tcl variables]) if test "$upload_var" = "yes"; then AC_MSG_RESULT([yes]) AC_DEFINE(UPLOAD_FILES_TO_VAR,1,[Files are uploaded to Tcl variables]) else AC_MSG_RESULT([no]) AC_DEFINE(UPLOAD_FILES_TO_VAR,0,[uploads go to files]) fi ]) #APACHE_VERSION MOD_RIVET_CORE GET_RIVET_BASE APACHE CHECK_APXS APACHE_INCLUDES APR_HANDLING APU_HANDLING RIVET_TCL_LIB DISPLAY_RIVET_VERSION UPLOAD_DIRECTORY HONOR_HEAD_REQUESTS VIRTUAL_INTERPS_SEPARATION POST_MAX_SIZE UPLOAD_TO_VAR IMPORT_RIVET_COMMANDS APACHE_REQUEST RIVET_CORE_CMDS RIVET_CHANNEL SINGLE_WORKER_TCL_THREAD HTTP_REQUESTS_MUTEX BUILD_DEBUG_CODE AC_HEADER_STDBOOL # Let's separate the point version from the major and minor version # to build a Rivet version to be substituted as basic version for # package Rivet, central initialization of the Tcl environment VERSION=${PACKAGE_VERSION} AX_SPLIT_VERSION AC_DEFINE_UNQUOTED(INIT_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}",[Rivet Tcl package version]) AC_MSG_NOTICE([Rivet package version is ${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}]) AC_SUBST(INIT_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}") AC_SUBST(RIVETLIB_PACKAGE,"rivetlib",[rivetlib package name]) AC_SUBST(RIVETLIB_PACKAGE_VERSION,"${AX_MAJOR_VERSION}.${AX_MINOR_VERSION}") if test $import_rivet_commands = "yes"; then AC_MSG_NOTICE([forcing Rivet to export commands from ::rivet namespace]) AC_DEFINE(NAMESPACE_EXPORT,1,[commands will be exported]) else RIVET_COMMANDS_EXPORT fi AC_C_INLINE #AC_SUBST(apache_version_dir) AC_SUBST(MOD_RIVET_INCLUDES) AC_DEFINE_UNQUOTED(RIVETLIB_DESTDIR,"${RIVET_TCL_TARGET}",[The path to the rivet tcl library]) AC_DEFINE_UNQUOTED(NAMEOFEXECUTABLE,"${TCLSH_PROG}",[The path to a working tclsh executable]) AC_DEFINE_UNQUOTED(UPLOAD_DIR,"${RIVET_UPLOAD_DIR}",[Path to the disk directory where uploads are saved]) AC_DEFINE_UNQUOTED(MAX_POST,[$MAX_POST],[Max size of data in POST operations]) AC_DEFINE_UNQUOTED(SEPARATE_CHANNELS,0,[Separate Channels for virtual hosts]) AC_DEFINE_UNQUOTED(CONFIGURE_CMD,"${CONFIGURE_CMD}",[configure command string]) AC_DEFINE_UNQUOTED(RIVET_CORE,"${rivet_core}",[mod_rivet core]) # We need to use the package path for the installation procedure. On #Debian linux TCL_PACKAGE_PATH may have more than one path in the #TCL_PACKAGE_PATH variable, so we have to handle this HANDLE_TCL_PACKAGE_PATH AC_SUBST(TCL_PACKAGE_PATH) # Finally, substitute all of the various values into the Makefile. # 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 doc/Makefile doc/convert_examples.tcl doc/rivet.xml]) #case $apache_version_dir in # apache-1) AC_CONFIG_FILES([Makefile src/Makefile src/apache-1/Makefile doc/Makefile]) ;; # apache-2) AC_CONFIG_FILES([Makefile src/Makefile src/apache-2/Makefile doc/Makefile]) ;; #esac AC_OUTPUT if test "$print_fileevent_msg" = "1"; then AC_MSG_NOTICE([========================================================================]) AC_MSG_NOTICE([ WARNING!]) AC_MSG_NOTICE([========================================================================]) AC_MSG_NOTICE([The Tcl notifier (and consequently the event loop) does not work with]) AC_MSG_NOTICE([Rivet running Tcl $TCL_VERSION$TCL_PATCH_LEVEL and the 'prefork' MPM of Apache.]) AC_MSG_NOTICE([In order to have asynchronous I/O working the required versions are:]) AC_MSG_NOTICE([ - threaded builds: Tcl >= 8.5.15 (8.5 version) or Tcl >= 8.6.1]) AC_MSG_NOTICE([ - any non-threaded build of Tcl >= 8.5.10]) AC_MSG_NOTICE([]) AC_MSG_NOTICE([Nonetheless Rivet scripts work with Tcl >= 8.5.10 provided]) AC_MSG_NOTICE([you do not have to rely on the event loop to do I/O (e.g. you]) AC_MSG_NOTICE([cannot use the 'fileevent' command to set up callbacks)]) AC_MSG_NOTICE([see https://issues.apache.org/bugzilla/show_bug.cgi?id=55153]) AC_MSG_NOTICE([========================================================================]) fi rivet-3.0.0/README.md000664 001750 001750 00000003745 15224454746 014722 0ustar00manghimanghi000000 000000 # ![Rivet Logo](doc/images/home.png)

Apache Rivet
[Apache Rivet](https://tcl.apache.org/rivet/) is a powerful, flexible, consistent, fast, and robust solution to creating web applications with the help of the [Tcl](http://www.tcl.tk/) language and [Apache HTTP Server](https://httpd.apache.org/). See the [doc/html/installation.html](doc/html/installation.html) directory for installation and usage instructions. See [INSTALL](INSTALL) for brief installation instructions - although the above docs in HTML are more thorough and extensive. See [LICENSE](LICENSE) for licensing terms. ## Current Travis/AppVeyor CI build status for Rivet: | OS | Master Branch | Release Branch | Branch 'winbuild' | ---|---|---|-- | Linux 64, Apache 2.4.37, Tcl/Tk 8.6 | | | | | Windows 64, Apache 2.4.37, Tcl/Tk 8.6.7 | [![Build status](https://ci.appveyor.com/api/projects/status/3si279ye7gxl7wgg/branch/master?svg=true)](https://ci.appveyor.com/project/petasis/tcl-rivet/branch/master)
fork: [![Build status](https://ci.appveyor.com/api/projects/status/69nj1qs4ia8pj87v/branch/master?svg=true)](https://ci.appveyor.com/project/petasis/tcl-rivet-scuqj/branch/master) | | [![Build status](https://ci.appveyor.com/api/projects/status/3si279ye7gxl7wgg/branch/winbuild?svg=true)](https://ci.appveyor.com/project/petasis/tcl-rivet/branch/winbuild)
fork: [![Build status](https://ci.appveyor.com/api/projects/status/69nj1qs4ia8pj87v/branch/winbuild?svg=true)](https://ci.appveyor.com/project/petasis/tcl-rivet-scuqj/branch/winbuild) | | macOS 64 (Darwin), Apache 2.4.37, Tcl/Tk 8.5 | | | | ## RIVET NAMESPACE - The Rivet command set was moved into the ::rivet namespace and each command should now be fully qualified. By default the command set (exceptions are ::rivet::try and ::rivet::catch) is placed in the namespace export list, so you can import it into the global namespace for compatibility with Rivet version < 2.0. This is a deprecated option though and it could be removed in future releases. rivet-3.0.0/rivet/rivet-tcl/random.tcl000664 001750 001750 00000001655 15224454746 020467 0ustar00manghimanghi000000 000000 ### ## random [seed | value ] ## ## Generate a random number using only Tcl code. This proc tries to ## emulate what the TclX random function does. If we don't have TclX ## though, this is a decent substitute. ## ## Note: random predates the existence of Tcl's built-in rand() function, ## that is a part of the expr command -- programmers should consider using ## Tcl's built-in rand() function as an alternative to this command. ## ## $Id$ ## ### namespace eval ::rivet { proc random {args} { global _ran if {[llength $args] > 1} { set _ran [lindex $args 1] } else { set period 233280 if {[info exists _ran]} { set _ran [expr { ($_ran*9301 + 49297) % $period }] } else { set _ran [expr { [clock seconds] % $period } ] } return [expr { int($args*($_ran/double($period))) } ] } } } rivet-3.0.0/doc/images/000775 001750 001750 00000000000 15224454746 015444 5ustar00manghimanghi000000 000000 rivet-3.0.0/README.configure000664 001750 001750 00000002360 15224454746 016273 0ustar00manghimanghi000000 000000 $Id$ This is an agglomeration of notes about using autoconf and friends to create the build environment (configure script, etc) that builds and installs Rivet. It will probably go away eventually. WHERE IS THE CONFIGURE SCRIPT? If you've checked out the source tree from SVN, you'll notice there's no configure script, and no configure.in, and no Makefile.in, etc. You get to fiddle the autoconf stuff to create all that. This used to be hard but not so much anymore. Try autoreconf -fi This runs aclocal, autoconf, automake and whatever else to properly generate config.h.in, aclocal.m4, */Makefile.in, etc. autoconf and stuff has evolved, and old versions won't work and will cause weird problems. You want to be at least at autoconf 2.58 automake 1.11 CONFIG.GUESS AND FRIENDS Ever wonder where config.guess, install-sh, and stuff come from? (You see them in a lot of packages.) This stuff a lot can get pooped out there using libtoolize. libtoolize --force --copy to install config.guess, config.sub, ltmain.sh This stuff is in the tclconfig directory, which isn't really the best name because it's grown to include a lot of autoconf-related stuff. But it really doesn't matter anymore because autoreconf appears to take care of it all. rivet-3.0.0/tests/binary.test000664 001750 001750 00000002024 15224454746 016757 0ustar00manghimanghi000000 000000 # -- binary file download # # set testfilename1 binary.rvt set binaryfile AngeloFish.jpg ::tcltest::test binary-1.1 {binary data test} { set page [::http::geturl "${urlbase}$testfilename1?test1=1"] file stat $binaryfile fs set fl [open $binaryfile r] chan configure $fl -translation binary set fcontent [read $fl] close $fl set ret [string equal -length $fs(size) [::http::data $page] $fcontent] set ret } 1 ::tcltest::test binary-2.1 {binary data test with 'include'} { set page [ ::http::geturl "${urlbase}$testfilename1?test2=1" ] file stat $binaryfile fs set fl [open $binaryfile r] chan configure $fl -translation binary set fcontent [read $fl] close $fl set ret [string equal -length $fs(size) [::http::data $page] $fcontent] set ret } 1 ::tcltest::test binary-3.1 {scoped binary output restores stdout} { set page [::http::geturl "${urlbase}binaryscope.tcl"] set data [::http::data $page] ::http::cleanup $page binary encode hex $data } 00fffe014f4b rivet-3.0.0/doc/xml/internals.xml000664 001750 001750 00000047221 15224454746 017526 0ustar00manghimanghi000000 000000
Rivet Internals This section easily falls out of date, as new code is added, old code is removed, and changes are made. The best place to look is the source code itself. If you are interested in the changes themselves, the Subversion revision control system (svn) can provide you with information about what has been happening with the code.
Rivet approach to Apache Multiprocessing Models The Apache HTTP web server has an extremely modular architecture that made it very popular among web developers. Most of the server features can be implemented in external modules, including some of the way the server interfaces to the operative system. The multiprocessing modules are meant to provide different models for distributing the server workload but also to cope with different operative systems having their specific architectures and services. From the very beginning mod_rivet was designed to work with the prefork MPM MPM (Multi Processing Module) which assumes the OS to have 'fork' capabilities. This prerequisite basically restricted mod_rivet to work only with Unix-like operative systems. Starting with version 3.0 we reorganized mod_rivet to offer a design that could work together with more MPM and hopefully pave the way to support different OS that have no 'fork' call. At the same time we tried to preserve some of the basic features of mod_rivet when working with the prefork MPM, chiefly the feature of the Unix fork system call of 'cloning' a parent process memory into its child, thus allowing fast initialization of interpreters. The central design of mod_rivet now relies on the idea of MPM bridges, loadable modules that are responsible to adapt the module procedural design to a given class of Apache MPMs. This design is open to the development of more MPM bridges coping with different multi-processing models but also to the development of different approaches to resource consumption and workload balance. Currently we have 3 bridges: rivet_prefork_mpm.c: a bridge for the prefork MPM rivet_worker_mpm.c: a threaded bridge creating a pool of threads each running Tcl interpreters and communicating with the worker MPM threads through a thread safe queue. This bridge is needed by the worker MPM and by any the winnt MPM on Windows. rivet_lazy_mpm.c: a threaded bridge where Tcl threads are started on demand. The bridge creates no threads and Tcl interpreters at start up, only when requests come in Tcl execution threads are created. This bridge is explained in detail in the next section. Since the resource demand at startup is minimal this bridge should suit development machines that go through frequent web server restarts.
mod_rivet MPM Bridge callbacks A bridge is a loadable library implementing different ways to handle specific features needed to mod_rivet. It was originally meant as a way to handle the prefork/worker/event MPM specificities, at the same time avoiding the need to stuff the code with conditional statements that would have implied useless complexity (an instance of the Apache web server can run only an MPM at a time), error prone programming and performance costs. New bridges could be imagined also to implement different models of workload and resource management (like the resources demanded by the Tcl interpreters). We designed an interface between the core of mod_rivet and its MPM bridges based on a set of functions defined in the rivet_bridge_table structure. typedef struct _mpm_bridge_table { RivetBridge_ServerInit *server_init; RivetBridge_ThreadInit *thread_init; RivetBridge_Request *request_processor; RivetBridge_Finalize *child_finalize; RivetBridge_Exit_Handler *exit_handler; RivetBridge_Thread_Interp *thread_interp; } rivet_bridge_table; mpm_server_init: pointer to any specific server inititalization function. This field can be NULL if no bridge specific initialization is needed. The core of mod_rivet runs the ServerInitScript before calling this function. mpm_child_init: Bridge specific child process initialization. If the pointer is assigned with a non-NULL value the function is called by Rivet_ChildInit. mpm_request: This pointer must be a valid function pointer to the content generator implemented by the bridge. If the pointer is not defined the Apache web server will stop at start up. This condition is motivated by the need of avoiding useless testing of the pointer. The fundamental purpose of a content generator module (like mod_rivet) is to respond to requests creating content, thus whatever it is a content generating function must exist (during the early stages of development you can create a simple test function for that). In a threaded MPM this function typically prepares the request processing stuffing somewhere the pointer to the request_rec structure passed by the web server and then it calls some method to communicate these data to the Tcl execution thread waiting for result to be returned. The prefork bridge is an exception since there are no threads and the bridge calls directly Rivet_SendContent mpm_finalize: pointer to a finalization function called during a child process exit. This function is registered as child process memory pool cleanup function. If the pointer is NULL the pool is given a default cleanup function (apr_pool_cleanup_null) defined in src/mod_rivet/mod_rivet.c. For instance the finalize function in the worker MPM bridge notifies a supervisor thread demanding the whole pool of threads running Tcl interpreters to orderly exit. This pointer can be NULL if the bridge has no special need when a child process must exit (unlikely if you have multiple threads running) mpm_exit_handler: mod_rivet replaces the core exit command with a new one (::rivet::exit). This command must handle the process exit in the best possible way for the bridge and the threading model it implements (for the 2 current threaded bridges this implies signaling the threads to exit). The ::rivet::exit actually doesn't terminate the process, but interrupts execution returning a specific error code commands ::rivet::catch and ::rivet::try can detect. Before the process is terminated the AbortScript script is fired and ::rivet::abort_code returns a message describing the exit condition. For instance the worker MPM bridge the finalize function is called after the current thread itself is set up for termination. See function Rivet_ExitCmd in rivetCore.c to have details on how and at what stage this callback is invoked. mpm_thread_interp must be a function returning the interpreter object (a pointer to record of type rivet_thread_interp) associated to a given configuration as stored in a rivet_server_conf* object. This element was temporarily introduced in the mpm_bridge_table table and should be accessed through the macro RIVET_PEEK_INTERP. interp_obj = RIVET_PEEK_INTERP(private,private->conf); Every bridge implementation should have its own way to store interpreter data and manage their status. So this macro (and associated function) should hide from the module core function the specific approach followed in a particular bridge
Server Initialization and MPM Bridge
RivetChan The RivetChan system was created in order to have an actual Tcl channel that we could redirect standard output to. This enables us use, for instance, the regular puts command in .rvt pages. It works by creating a channel that buffers output, and, at predetermined times, passes it on to Apache's I/O system. Tcl's regular standard output is replaced with an instance of this channel type, so that, by default, output will go to the web page.
The <command>global</command> Command Rivet aims to run standard Tcl code with as few surprises as possible. At times this involves some compromises - in this case regarding the global command. The problem is that the command will create truly global variables. If the user is just cut'n'pasting some Tcl code into Rivet, they most likely just want to be able to share the variable in question with other procs, and don't really care if the variable is actually persistant between pages. The solution we have created is to create a proc ::request::global that takes the place of the global command in Rivet templates. If you really need a true global variable, use either ::global or add the :: namespace qualifier to variables you wish to make global.
Page Parsing, Execution and Caching When a Rivet page is requested, it is transformed into an ordinary Tcl script by parsing the file for the <? ?> processing instruction tags. Everything outside these tags becomes a large puts statement, and everything inside them remains Tcl code. Each .rvt file is evaluated in its own ::request namespace, so that it is not necessary to create and tear down interpreters after each page. By running in its own namespace, though, each page will not run afoul of local variables created by other scripts, because they will be deleted automatically when the namespace goes away after Apache finishes handling the request. One current problem with this system is that while variables are garbage collected, file handles are not, so that it is very important that Rivet script authors make sure to close all the files they open. After a script has been loaded and parsed into it's "pure Tcl" form, it is also cached, so that it may be used in the future without having to reload it (and re-parse it) from the disk. The number of scripts stored in memory is configurable. This feature can significantly improve performance.
Extending Rivet by developing C code procedures Rivet endows the Tcl interpreter with new commands serving as interface between the application layer and the Apache web server. Many of these commands are meaningful only when a HTTP request is under way and therefore a request_rec object allocated by the framework is existing and was passed to mod_rivet as argument of a callback. In case commands have to gain access to a valid request_rec object the C procedure must check if such a pointer exists and it's initialized with valid data. For this purpose the procedure handling requests (Rivet_SendContent) makes a copy of such pointer and keeps it in an internal structure. The copy is set to NULL just before returning to the framework, right after mod_rivet's has carried out its request processing. When the pointer copy is NULL the module is outside any request processing and this condition invalidates the execution of many of the Rivet commands. In case they are called (for example in a ChildInitScript, GlobalInitScript, ServerInitScript or ChildExitScript) they fail with a Tcl error you can handle with a catch command. For this purpose in the macro CHECK_REQUEST_REC was defined accepting two arguments: the thread private data object and the command name. If the pointer is NULL the macro calls Tcl_NoRequestRec and returns TCL_ERROR causing the command to fail. These are the steps to follow in order to write a new C language command for mod_rivet Define the command and associated C language procedure in src/mod_rivet_ng/rivetCore.c using the macro RIVET_OBJ_CMD("mycmd",Rivet_MyCmd,private) This macro ensures the command is defined as ::rivet::mycmd and its ClientData pointer is defined with the thread private data Add the code of Rivet_MyCmd to src/mod_rivet_ng/rivetCore.c (in case the code resides in a different file also src/Makefile.am should be changed to tell the build system how to compile the code and link it into mod_rivet.so) If the code must have access to the request record in private->r use the macro THREAD_PRIVATE_DATA in order to claim the thread private data, then check for the validity of the pointer using the macro CHECK_REQUEST_REC(private,"::rivet::<cmd_name>") TCL_CMD_HEADER(Rivet_MyCmd) { /* we have to get the thread private data */ THREAD_PRIVATE_DATA(private) /* if ::rivet::mycmd works within a request processing we have * to check if 'private' is carrying a non null request_rec pointer */ CHECK_REQUEST_REC(private,"::rivet::mycmd"); .... return TCL_OK; } Add a test for this command in . For instance ... check_fail no_body check_fail virtual_filename unkn check_fail my_cmd <arg1> <arg2> .... Where are optional arguments in case the command has different forms depending on the arguments. Then, if ::rivet::mycmd must fail also should modified as virtual_filename->1 mycmd->1 The value associated to the test must be in case the command doesn't need to test the private->r pointer.
Debugging Rivet and Apache If you are interested in hacking on Rivet, you're welcome to contribute! Invariably, when working with code, things go wrong, and it's necessary to do some debugging. In a server environment like Apache, it can be a bit more difficult to find the right way to do this. Here are some techniques to try. The first thing you should know is that Apache can be launched as a single process with the argument: httpd -X. On Linux, one of the first things to try is the system call tracer, strace. You don't even have to recompile Rivet or Apache for this to work. strace -o /tmp/outputfile -S 1000 httpd -X This command will run httpd in the system call tracer, which leaves its output (there is potentially a lot of it) in /tmp/outputfile. The option tells strace to only record the first 1000 bytes of a syscall. Some calls such as write can potentially be much longer than this, so you may want to increase this number. The results are a list of all the system calls made by the program. You want to look at the end, where the failure presumably occured, to see if you can find anything that looks like an error. If you're not sure what to make of the results, you can always ask on the Rivet development mailing list. If strace (or its equivalent on your operating system) doesn't answer your question, it may be time to debug Apache and Rivet. To do this, you will need to rebuild mod_rivet. First of all you have to configure the build by running the ./configure script with the option and after you have set the CFLAGS and LDFLAGS environment variables export CFLAGS="-g -O0" export LDFLAGS="-g" ./configure --enable-symbols ...... make make install Arguments to ./configure must fit your Apache HTTP web server installation. See the output produced by ./configure --help And check the installation page to have further information. Since it's easier to debug a single process, we'll still run Apache in single process mode with -X: @ashland [~] $ gdb /usr/sbin/apache.dbg GNU gdb 5.3-debian Copyright 2002 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "powerpc-linux"... (gdb) run -X Starting program: /usr/sbin/apache.dbg -X [New Thread 16384 (LWP 13598)] . . . When your apache session is up and running, you can request a web page with the browser, and see where things go wrong (if you are dealing with a crash, for instance).
rivet-3.0.0/rivet/packages/dtcl/pkgIndex.tcl000664 001750 001750 00000000102 15224454746 021535 0ustar00manghimanghi000000 000000 package ifneeded Dtcl 1.0 [list source [file join $dir dtcl.tcl]] rivet-3.0.0/doc/html/images/qbullet-note.png000644 001750 001750 00000000541 15224455140 021514 0ustar00manghimanghi000000 000000 PNG  IHDR [jgAMA asRGB cHRMz&u0`:pQ<PLTELzTTT8αtRNS@fbKGDH pHYsHHFk>-IDATc!% S@2i0Vr6d`PR4u``5(%tEXtdate:create2012-10-01T18:28:46+02:00^%tEXtdate:modify2004-02-19T05:50:41+01:00f IENDB`rivet-3.0.0/doc/html/shorthand.html000664 001750 001750 00000006155 15224455137 020025 0ustar00manghimanghi000000 000000 <?= ... ?>

Name

<?= ... ?> — Shorthand construct for single strings output

Synopsis

<?= $string ?>

Description

This construct is a simplified form to print a single string wherever needed in a ?.rvt? template. The contruct is equivalent to writing the following line of Tcl code

puts -nonewline $string

The ?string? argument to the shorthand construct can be any Tcl command returning a value

See Example 1, “Hello World” or Example 3, “Variable Access”

rivet-3.0.0/src/TclWebcgi.c000664 001750 001750 00000003611 15224454746 016231 0ustar00manghimanghi000000 000000 /* * TclWeb.c -- * Common API layer. * * These are the standalone (CGI) variants of the functions found in * TclWeb.h. Low-level implementations are provided in this file. */ /* Copyright 2002-2004 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$ */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include #include "TclWeb.h" typedef struct _TclWebRequest { Tcl_Interp *interp; int header_sent; Tcl_HashTable *headers; int status; } TclWebRequest; int TclWeb_InitRequest(TclWebRequest *req, void *arg) { req = Tcl_Alloc(sizeof(TclWebRequest)); req->headers = Tcl_Alloc(sizeof(Tcl_HashTable)); Tcl_InitHashTable(req->headers, TCL_STRING_KEYS); return TCL_OK; } /* All these are still TODO. */ int TclWeb_SendHeaders(TclWebRequest *req) { return TCL_OK; } int TclWeb_HeaderSet(char *header, char *val, TclWebRequest *req); int TclWeb_SetStatus(int status, TclWebRequest *req); int TclWeb_GetCGIVars(Tcl_Obj *list, TclWebRequest *req); int TclWeb_GetEnvVars(Tcl_Obj *list, TclWebRequest *req); int TclWeb_Base64Encode(char *out, char *in, int len, TclWebRequest *req); int TclWeb_Base64Decode(char *out, char *in, int len, TclWebRequest *req); int TclWeb_EscapeShellCommand(char *out, char *in, TclWebRequest *req); /* output/write/flush? */ /* error (log) ? send to stderr with some information. */ rivet-3.0.0/STATUS000664 001750 001750 00000001103 15224454746 014373 0ustar00manghimanghi000000 000000 tcl-rivet STATUS: Committers: ========== Massimo Manghi George Petasis Brice Hamon Work in progress: ================ *) Rivet 3.2: *) Rivet 'quattuor' branch (to become Rivet 4.0) *) Installation Min Required Platform Tcl Version Ok? -------- ----------- --- Debian Tcl 8.6 Yes Ubuntu Tcl 8.6 Yes CentOS Tcl 8.6 Yes Suse Tcl 8.6 Yes FreeBSD Tcl 8.6 Yes Windows 10 Tcl 8.6 Yes rivet-3.0.0/tclconfig/ltmain.sh000664 001750 001750 00001177167 15224454746 017246 0ustar00manghimanghi000000 000000 #! /bin/sh ## DO NOT EDIT - This file generated from ./build-aux/ltmain.in ## by inline-source v2014-01-03.01 # libtool (GNU libtool) 2.4.6 # Provide generalized library-building support services. # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996-2015 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. # GNU Libtool 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 # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool 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 . PROGRAM=libtool PACKAGE=libtool VERSION="2.4.6 Debian-2.4.6-14" package_revision=2.4.6 ## ------ ## ## Usage. ## ## ------ ## # Run './libtool --help' for help with using this script from the # command line. ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # After configure completes, it has a better idea of some of the # shell tools we need than the defaults used by the functions shared # with bootstrap, so set those here where they can still be over- # ridden by the user, but otherwise take precedence. : ${AUTOCONF="autoconf"} : ${AUTOMAKE="automake"} ## -------------------------- ## ## Source external libraries. ## ## -------------------------- ## # Much of our low-level functionality needs to be sourced from external # libraries, which are installed to $pkgauxdir. # Set a version string for this script. scriptversion=2015-01-20.17; # UTC # General shell script boiler plate, and helper functions. # Written by Gary V. Vaughan, 2004 # Copyright (C) 2004-2015 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. # This program 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. # As a special exception to the GNU General Public License, if you distribute # this file as part of a program or library that is built using GNU Libtool, # you may include this file under the same distribution terms that you use # for the rest of that program. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNES 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 . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # Evaluate this file near the top of your script to gain access to # the functions and variables defined here: # # . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh # # If you need to override any of the default environment variable # settings, do that before evaluating this file. ## -------------------- ## ## Shell normalisation. ## ## -------------------- ## # Some shells need a little help to be as Bourne compatible as possible. # Before doing anything else, make sure all that help has been provided! DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # NLS nuisances: We save the old values in case they are required later. _G_user_locale= _G_safe_locale= for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test set = \"\${$_G_var+set}\"; then save_$_G_var=\$$_G_var $_G_var=C export $_G_var _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\" _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\" fi" done # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Make sure IFS has a sensible default sp=' ' nl=' ' IFS="$sp $nl" # There are apparently some retarded systems that use ';' as a PATH separator! if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi ## ------------------------- ## ## Locate command utilities. ## ## ------------------------- ## # func_executable_p FILE # ---------------------- # Check that FILE is an executable regular file. func_executable_p () { test -f "$1" && test -x "$1" } # func_path_progs PROGS_LIST CHECK_FUNC [PATH] # -------------------------------------------- # Search for either a program that responds to --version with output # containing "GNU", or else returned by CHECK_FUNC otherwise, by # trying all the directories in PATH with each of the elements of # PROGS_LIST. # # CHECK_FUNC should accept the path to a candidate program, and # set $func_check_prog_result if it truncates its output less than # $_G_path_prog_max characters. func_path_progs () { _G_progs_list=$1 _G_check_func=$2 _G_PATH=${3-"$PATH"} _G_path_prog_max=0 _G_path_prog_found=false _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:} for _G_dir in $_G_PATH; do IFS=$_G_save_IFS test -z "$_G_dir" && _G_dir=. for _G_prog_name in $_G_progs_list; do for _exeext in '' .EXE; do _G_path_prog=$_G_dir/$_G_prog_name$_exeext func_executable_p "$_G_path_prog" || continue case `"$_G_path_prog" --version 2>&1` in *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;; *) $_G_check_func $_G_path_prog func_path_progs_result=$func_check_prog_result ;; esac $_G_path_prog_found && break 3 done done done IFS=$_G_save_IFS test -z "$func_path_progs_result" && { echo "no acceptable sed could be found in \$PATH" >&2 exit 1 } } # We want to be able to use the functions in this file before configure # has figured out where the best binaries are kept, which means we have # to search for them ourselves - except when the results are already set # where we skip the searches. # Unless the user overrides by setting SED, search the path for either GNU # sed, or the sed that truncates its output the least. test -z "$SED" && { _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for _G_i in 1 2 3 4 5 6 7; do _G_sed_script=$_G_sed_script$nl$_G_sed_script done echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed _G_sed_script= func_check_prog_sed () { _G_path_prog=$1 _G_count=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo '' >> conftest.nl "$_G_path_prog" -f conftest.sed conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin rm -f conftest.sed SED=$func_path_progs_result } # Unless the user overrides by setting GREP, search the path for either GNU # grep, or the grep that truncates its output the least. test -z "$GREP" && { func_check_prog_grep () { _G_path_prog=$1 _G_count=0 _G_path_prog_max=0 printf 0123456789 >conftest.in while : do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo 'GREP' >> conftest.nl "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' conftest.out 2>/dev/null || break diff conftest.out conftest.nl >/dev/null 2>&1 || break _G_count=`expr $_G_count + 1` if test "$_G_count" -gt "$_G_path_prog_max"; then # Best one so far, save it but keep looking for a better one func_check_prog_result=$_G_path_prog _G_path_prog_max=$_G_count fi # 10*(2^10) chars as input seems more than enough test 10 -lt "$_G_count" && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out } func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin GREP=$func_path_progs_result } ## ------------------------------- ## ## User overridable command paths. ## ## ------------------------------- ## # All uppercase variable names are used for environment variables. These # variables can be overridden by the user before calling a script that # uses them if a suitable command of that name is not already available # in the command search PATH. : ${CP="cp -f"} : ${ECHO="printf %s\n"} : ${EGREP="$GREP -E"} : ${FGREP="$GREP -F"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} ## -------------------- ## ## Useful sed snippets. ## ## -------------------- ## sed_dirname='s|/[^/]*$||' sed_basename='s|^.*/||' # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s|\([`"$\\]\)|\\\1|g' # Same as above, but do not quote variable references. sed_double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution that turns a string into a regex matching for the # string literally. sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g' # Sed substitution that converts a w32 file name or path # that contains forward slashes, into one that contains # (escaped) backslashes. A very naive implementation. sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Re-'\' parameter expansions in output of sed_double_quote_subst that # were '\'-ed in input to the same. If an odd number of '\' preceded a # '$' in input to sed_double_quote_subst, that '$' was protected from # expansion. Since each input '\' is now two '\'s, look for any number # of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'. _G_bs='\\' _G_bs2='\\\\' _G_bs4='\\\\\\\\' _G_dollar='\$' sed_double_backslash="\ s/$_G_bs4/&\\ /g s/^$_G_bs2$_G_dollar/$_G_bs&/ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g s/\n//g" ## ----------------- ## ## Global variables. ## ## ----------------- ## # Except for the global variables explicitly listed below, the following # functions in the '^func_' namespace, and the '^require_' namespace # variables initialised in the 'Resource management' section, sourcing # this file will not pollute your global namespace with anything # else. There's no portable way to scope variables in Bourne shell # though, so actually running these functions will sometimes place # results into a variable named after the function, and often use # temporary variables in the '^_G_' namespace. If you are careful to # avoid using those namespaces casually in your sourcing script, things # should continue to work as you expect. And, of course, you can freely # overwrite any of the functions or variables defined here before # calling anything to customize them. EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. # Allow overriding, eg assuming that you follow the convention of # putting '$debug_cmd' at the start of all your functions, you can get # bash to show function call trace with: # # debug_cmd='echo "${FUNCNAME[0]} $*" >&2' bash your-script-name debug_cmd=${debug_cmd-":"} exit_cmd=: # By convention, finish your script with: # # exit $exit_status # # so that you can set exit_status to non-zero if you want to indicate # something went wrong during execution without actually bailing out at # the point of failure. exit_status=$EXIT_SUCCESS # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath=$0 # The name of this program. progname=`$ECHO "$progpath" |$SED "$sed_basename"` # Make sure we have an absolute progpath for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=`$ECHO "$progpath" |$SED "$sed_dirname"` progdir=`cd "$progdir" && pwd` progpath=$progdir/$progname ;; *) _G_IFS=$IFS IFS=${PATH_SEPARATOR-:} for progdir in $PATH; do IFS=$_G_IFS test -x "$progdir/$progname" && break done IFS=$_G_IFS test -n "$progdir" || progdir=`pwd` progpath=$progdir/$progname ;; esac ## ----------------- ## ## Standard options. ## ## ----------------- ## # The following options affect the operation of the functions defined # below, and should be set appropriately depending on run-time para- # meters passed on the command line. opt_dry_run=false opt_quiet=false opt_verbose=false # Categories 'all' and 'none' are always available. Append any others # you will pass as the first argument to func_warning from your own # code. warning_categories= # By default, display warnings according to 'opt_warning_types'. Set # 'warning_func' to ':' to elide all warnings, or func_fatal_error to # treat the next displayed warning as a fatal error. warning_func=func_warn_and_continue # Set to 'all' to display all warnings, 'none' to suppress all # warnings, or a space delimited list of some subset of # 'warning_categories' to display only the listed warnings. opt_warning_types=all ## -------------------- ## ## Resource management. ## ## -------------------- ## # This section contains definitions for functions that each ensure a # particular resource (a file, or a non-empty configuration variable for # example) is available, and if appropriate to extract default values # from pertinent package files. Call them using their associated # 'require_*' variable to ensure that they are executed, at most, once. # # It's entirely deliberate that calling these functions can set # variables that don't obey the namespace limitations obeyed by the rest # of this file, in order that that they be as useful as possible to # callers. # require_term_colors # ------------------- # Allow display of bold text on terminals that support it. require_term_colors=func_require_term_colors func_require_term_colors () { $debug_cmd test -t 1 && { # COLORTERM and USE_ANSI_COLORS environment variables take # precedence, because most terminfo databases neglect to describe # whether color sequences are supported. test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"} if test 1 = "$USE_ANSI_COLORS"; then # Standard ANSI escape sequences tc_reset='' tc_bold=''; tc_standout='' tc_red=''; tc_green='' tc_blue=''; tc_cyan='' else # Otherwise trust the terminfo database after all. test -n "`tput sgr0 2>/dev/null`" && { tc_reset=`tput sgr0` test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold` tc_standout=$tc_bold test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso` test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1` test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2` test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4` test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5` } fi } require_term_colors=: } ## ----------------- ## ## Function library. ## ## ----------------- ## # This section contains a variety of useful functions to call in your # scripts. Take note of the portable wrappers for features provided by # some modern shells, which will fall back to slower equivalents on # less featureful shells. # func_append VAR VALUE # --------------------- # Append VALUE onto the existing contents of VAR. # We should try to minimise forks, especially on Windows where they are # unreasonably slow, so skip the feature probes when bash or zsh are # being used: if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then : ${_G_HAVE_ARITH_OP="yes"} : ${_G_HAVE_XSI_OPS="yes"} # The += operator was introduced in bash 3.1 case $BASH_VERSION in [12].* | 3.0 | 3.0*) ;; *) : ${_G_HAVE_PLUSEQ_OP="yes"} ;; esac fi # _G_HAVE_PLUSEQ_OP # Can be empty, in which case the shell is probed, "yes" if += is # useable or anything else if it does not work. test -z "$_G_HAVE_PLUSEQ_OP" \ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \ && _G_HAVE_PLUSEQ_OP=yes if test yes = "$_G_HAVE_PLUSEQ_OP" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_append () { $debug_cmd eval "$1+=\$2" }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_append () { $debug_cmd eval "$1=\$$1\$2" } fi # func_append_quoted VAR VALUE # ---------------------------- # Quote VALUE and append to the end of shell variable VAR, separated # by a space. if test yes = "$_G_HAVE_PLUSEQ_OP"; then eval 'func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1+=\\ \$func_quote_for_eval_result" }' else func_append_quoted () { $debug_cmd func_quote_for_eval "$2" eval "$1=\$$1\\ \$func_quote_for_eval_result" } fi # func_append_uniq VAR VALUE # -------------------------- # Append unique VALUE onto the existing contents of VAR, assuming # entries are delimited by the first character of VALUE. For example: # # func_append_uniq options " --another-option option-argument" # # will only append to $options if " --another-option option-argument " # is not already present somewhere in $options already (note spaces at # each end implied by leading space in second argument). func_append_uniq () { $debug_cmd eval _G_current_value='`$ECHO $'$1'`' _G_delim=`expr "$2" : '\(.\)'` case $_G_delim$_G_current_value$_G_delim in *"$2$_G_delim"*) ;; *) func_append "$@" ;; esac } # func_arith TERM... # ------------------ # Set func_arith_result to the result of evaluating TERMs. test -z "$_G_HAVE_ARITH_OP" \ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \ && _G_HAVE_ARITH_OP=yes if test yes = "$_G_HAVE_ARITH_OP"; then eval 'func_arith () { $debug_cmd func_arith_result=$(( $* )) }' else func_arith () { $debug_cmd func_arith_result=`expr "$@"` } fi # func_basename FILE # ------------------ # Set func_basename_result to FILE with everything up to and including # the last / stripped. if test yes = "$_G_HAVE_XSI_OPS"; then # If this shell supports suffix pattern removal, then use it to avoid # forking. Hide the definitions single quotes in case the shell chokes # on unsupported syntax... _b='func_basename_result=${1##*/}' _d='case $1 in */*) func_dirname_result=${1%/*}$2 ;; * ) func_dirname_result=$3 ;; esac' else # ...otherwise fall back to using sed. _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`' _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"` if test "X$func_dirname_result" = "X$1"; then func_dirname_result=$3 else func_append func_dirname_result "$2" fi' fi eval 'func_basename () { $debug_cmd '"$_b"' }' # func_dirname FILE APPEND NONDIR_REPLACEMENT # ------------------------------------------- # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. eval 'func_dirname () { $debug_cmd '"$_d"' }' # func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT # -------------------------------------------------------- # Perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # For efficiency, we do not delegate to the functions above but instead # duplicate the functionality here. eval 'func_dirname_and_basename () { $debug_cmd '"$_b"' '"$_d"' }' # func_echo ARG... # ---------------- # Echo program name prefixed message. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname: $_G_line" done IFS=$func_echo_IFS } # func_echo_all ARG... # -------------------- # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } # func_echo_infix_1 INFIX ARG... # ------------------------------ # Echo program name, followed by INFIX on the first line, with any # additional lines not showing INFIX. func_echo_infix_1 () { $debug_cmd $require_term_colors _G_infix=$1; shift _G_indent=$_G_infix _G_prefix="$progname: $_G_infix: " _G_message=$* # Strip color escape sequences before counting printable length for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan" do test -n "$_G_tc" && { _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"` _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"` } done _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes func_echo_infix_1_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_infix_1_IFS $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2 _G_prefix=$_G_indent done IFS=$func_echo_infix_1_IFS } # func_error ARG... # ----------------- # Echo program name prefixed message to standard error. func_error () { $debug_cmd $require_term_colors func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2 } # func_fatal_error ARG... # ----------------------- # Echo program name prefixed message to standard error, and exit. func_fatal_error () { $debug_cmd func_error "$*" exit $EXIT_FAILURE } # func_grep EXPRESSION FILENAME # ----------------------------- # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $debug_cmd $GREP "$1" "$2" >/dev/null 2>&1 } # func_len STRING # --------------- # Set func_len_result to the length of STRING. STRING may not # start with a hyphen. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_len () { $debug_cmd func_len_result=${#1} }' else func_len () { $debug_cmd func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } fi # func_mkdir_p DIRECTORY-PATH # --------------------------- # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { $debug_cmd _G_directory_path=$1 _G_dir_list= if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then # Protect directory names starting with '-' case $_G_directory_path in -*) _G_directory_path=./$_G_directory_path ;; esac # While some portion of DIR does not yet exist... while test ! -d "$_G_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. _G_dir_list=$_G_directory_path:$_G_dir_list # If the last portion added has no slash in it, the list is done case $_G_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"` done _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'` func_mkdir_p_IFS=$IFS; IFS=: for _G_dir in $_G_dir_list; do IFS=$func_mkdir_p_IFS # mkdir can fail with a 'File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$_G_dir" 2>/dev/null || : done IFS=$func_mkdir_p_IFS # Bail out if we (or some other process) failed to create a directory. test -d "$_G_directory_path" || \ func_fatal_error "Failed to create '$1'" fi } # func_mktempdir [BASENAME] # ------------------------- # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, BASENAME is the basename for that directory. func_mktempdir () { $debug_cmd _G_template=${TMPDIR-/tmp}/${1-$progname} if test : = "$opt_dry_run"; then # Return a directory name, but don't create it in dry-run mode _G_tmpdir=$_G_template-$$ else # If mktemp works, use that first and foremost _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null` if test ! -d "$_G_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race _G_tmpdir=$_G_template-${RANDOM-0}$$ func_mktempdir_umask=`umask` umask 0077 $MKDIR "$_G_tmpdir" umask $func_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$_G_tmpdir" || \ func_fatal_error "cannot create temporary directory '$_G_tmpdir'" fi $ECHO "$_G_tmpdir" } # func_normal_abspath PATH # ------------------------ # Remove doubled-up and trailing slashes, "." path components, # and cancel out any ".." path components in PATH after making # it an absolute path. func_normal_abspath () { $debug_cmd # These SED scripts presuppose an absolute path with a trailing slash. _G_pathcar='s|^/\([^/]*\).*$|\1|' _G_pathcdr='s|^/[^/]*||' _G_removedotparts=':dotsl s|/\./|/|g t dotsl s|/\.$|/|' _G_collapseslashes='s|/\{1,\}|/|g' _G_finalslash='s|/*$|/|' # Start from root dir and reassemble the path. func_normal_abspath_result= func_normal_abspath_tpath=$1 func_normal_abspath_altnamespace= case $func_normal_abspath_tpath in "") # Empty path, that just means $cwd. func_stripname '' '/' "`pwd`" func_normal_abspath_result=$func_stripname_result return ;; # The next three entries are used to spot a run of precisely # two leading slashes without using negated character classes; # we take advantage of case's first-match behaviour. ///*) # Unusual form of absolute path, do nothing. ;; //*) # Not necessarily an ordinary path; POSIX reserves leading '//' # and for example Cygwin uses it to access remote file shares # over CIFS/SMB, so we conserve a leading double slash if found. func_normal_abspath_altnamespace=/ ;; /*) # Absolute path, do nothing. ;; *) # Relative path, prepend $cwd. func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath ;; esac # Cancel out all the simple stuff to save iterations. We also want # the path to end with a slash for ease of parsing, so make sure # there is one (and only one) here. func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"` while :; do # Processed it all yet? if test / = "$func_normal_abspath_tpath"; then # If we ascended to the root using ".." the result may be empty now. if test -z "$func_normal_abspath_result"; then func_normal_abspath_result=/ fi break fi func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcar"` func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \ -e "$_G_pathcdr"` # Figure out what to do with it case $func_normal_abspath_tcomponent in "") # Trailing empty path component, ignore it. ;; ..) # Parent dir; strip last assembled component from result. func_dirname "$func_normal_abspath_result" func_normal_abspath_result=$func_dirname_result ;; *) # Actual path component, append it. func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent" ;; esac done # Restore leading double-slash if one was found on entry. func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result } # func_notquiet ARG... # -------------------- # Echo program name prefixed message only when not in quiet mode. func_notquiet () { $debug_cmd $opt_quiet || func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_relative_path SRCDIR DSTDIR # -------------------------------- # Set func_relative_path_result to the relative path from SRCDIR to DSTDIR. func_relative_path () { $debug_cmd func_relative_path_result= func_normal_abspath "$1" func_relative_path_tlibdir=$func_normal_abspath_result func_normal_abspath "$2" func_relative_path_tbindir=$func_normal_abspath_result # Ascend the tree starting from libdir while :; do # check if we have found a prefix of bindir case $func_relative_path_tbindir in $func_relative_path_tlibdir) # found an exact match func_relative_path_tcancelled= break ;; $func_relative_path_tlibdir*) # found a matching prefix func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir" func_relative_path_tcancelled=$func_stripname_result if test -z "$func_relative_path_result"; then func_relative_path_result=. fi break ;; *) func_dirname $func_relative_path_tlibdir func_relative_path_tlibdir=$func_dirname_result if test -z "$func_relative_path_tlibdir"; then # Have to descend all the way to the root! func_relative_path_result=../$func_relative_path_result func_relative_path_tcancelled=$func_relative_path_tbindir break fi func_relative_path_result=../$func_relative_path_result ;; esac done # Now calculate path; take care to avoid doubling-up slashes. func_stripname '' '/' "$func_relative_path_result" func_relative_path_result=$func_stripname_result func_stripname '/' '/' "$func_relative_path_tcancelled" if test -n "$func_stripname_result"; then func_append func_relative_path_result "/$func_stripname_result" fi # Normalisation. If bindir is libdir, return '.' else relative path. if test -n "$func_relative_path_result"; then func_stripname './' '' "$func_relative_path_result" func_relative_path_result=$func_stripname_result fi test -n "$func_relative_path_result" || func_relative_path_result=. : } # func_quote_for_eval ARG... # -------------------------- # Aesthetically quote ARGs to be evaled later. # This function returns two values: # i) func_quote_for_eval_result # double-quoted, suitable for a subsequent eval # ii) func_quote_for_eval_unquoted_result # has all characters that are still active within double # quotes backslashified. func_quote_for_eval () { $debug_cmd func_quote_for_eval_unquoted_result= func_quote_for_eval_result= while test 0 -lt $#; do case $1 in *[\\\`\"\$]*) _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;; *) _G_unquoted_arg=$1 ;; esac if test -n "$func_quote_for_eval_unquoted_result"; then func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg" else func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg" fi case $_G_unquoted_arg in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and variable expansion # for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_quoted_arg=\"$_G_unquoted_arg\" ;; *) _G_quoted_arg=$_G_unquoted_arg ;; esac if test -n "$func_quote_for_eval_result"; then func_append func_quote_for_eval_result " $_G_quoted_arg" else func_append func_quote_for_eval_result "$_G_quoted_arg" fi shift done } # func_quote_for_expand ARG # ------------------------- # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { $debug_cmd case $1 in *[\\\`\"]*) _G_arg=`$ECHO "$1" | $SED \ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;; *) _G_arg=$1 ;; esac case $_G_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") _G_arg=\"$_G_arg\" ;; esac func_quote_for_expand_result=$_G_arg } # func_stripname PREFIX SUFFIX NAME # --------------------------------- # strip PREFIX and SUFFIX from NAME, and store in func_stripname_result. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_stripname () { $debug_cmd # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary variable first. func_stripname_result=$3 func_stripname_result=${func_stripname_result#"$1"} func_stripname_result=${func_stripname_result%"$2"} }' else func_stripname () { $debug_cmd case $2 in .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;; *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;; esac } fi # func_show_eval CMD [FAIL_EXP] # ----------------------------- # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} func_quote_for_expand "$_G_cmd" eval "func_notquiet $func_quote_for_expand_result" $opt_dry_run || { eval "$_G_cmd" _G_status=$? if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_show_eval_locale CMD [FAIL_EXP] # ------------------------------------ # Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { $debug_cmd _G_cmd=$1 _G_fail_exp=${2-':'} $opt_quiet || { func_quote_for_expand "$_G_cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || { eval "$_G_user_locale $_G_cmd" _G_status=$? eval "$_G_safe_locale" if test 0 -ne "$_G_status"; then eval "(exit $_G_status); $_G_fail_exp" fi } } # func_tr_sh # ---------- # Turn $1 into a string suitable for a shell variable name. # Result is stored in $func_tr_sh_result. All characters # not in the set a-zA-Z0-9_ are replaced with '_'. Further, # if $1 begins with a digit, a '_' is prepended as well. func_tr_sh () { $debug_cmd case $1 in [0-9]* | *[!a-zA-Z0-9_]*) func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'` ;; * ) func_tr_sh_result=$1 ;; esac } # func_verbose ARG... # ------------------- # Echo program name prefixed message in verbose mode only. func_verbose () { $debug_cmd $opt_verbose && func_echo "$*" : } # func_warn_and_continue ARG... # ----------------------------- # Echo program name prefixed warning message to standard error. func_warn_and_continue () { $debug_cmd $require_term_colors func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2 } # func_warning CATEGORY ARG... # ---------------------------- # Echo program name prefixed warning message to standard error. Warning # messages can be filtered according to CATEGORY, where this function # elides messages where CATEGORY is not listed in the global variable # 'opt_warning_types'. func_warning () { $debug_cmd # CATEGORY must be in the warning_categories list! case " $warning_categories " in *" $1 "*) ;; *) func_internal_error "invalid warning category '$1'" ;; esac _G_category=$1 shift case " $opt_warning_types " in *" $_G_category "*) $warning_func ${1+"$@"} ;; esac } # func_sort_ver VER1 VER2 # ----------------------- # 'sort -V' is not generally available. # Note this deviates from the version comparison in automake # in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a # but this should suffice as we won't be specifying old # version formats or redundant trailing .0 in bootstrap.conf. # If we did want full compatibility then we should probably # use m4_version_compare from autoconf. func_sort_ver () { $debug_cmd printf '%s\n%s\n' "$1" "$2" \ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n } # func_lt_ver PREV CURR # --------------------- # Return true if PREV and CURR are in the correct order according to # func_sort_ver, otherwise false. Use it like this: # # func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..." func_lt_ver () { $debug_cmd test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q` } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: #! /bin/sh # Set a version string for this script. scriptversion=2015-10-07.11; # UTC # A portable, pluggable option parser for Bourne shell. # Written by Gary V. Vaughan, 2010 # Copyright (C) 2010-2015 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. # This program 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # Please report bugs or propose patches to gary@gnu.org. ## ------ ## ## Usage. ## ## ------ ## # This file is a library for parsing options in your shell scripts along # with assorted other useful supporting features that you can make use # of too. # # For the simplest scripts you might need only: # # #!/bin/sh # . relative/path/to/funclib.sh # . relative/path/to/options-parser # scriptversion=1.0 # func_options ${1+"$@"} # eval set dummy "$func_options_result"; shift # ...rest of your script... # # In order for the '--version' option to work, you will need to have a # suitably formatted comment like the one at the top of this file # starting with '# Written by ' and ending with '# warranty; '. # # For '-h' and '--help' to work, you will also need a one line # description of your script's purpose in a comment directly above the # '# Written by ' line, like the one at the top of this file. # # The default options also support '--debug', which will turn on shell # execution tracing (see the comment above debug_cmd below for another # use), and '--verbose' and the func_verbose function to allow your script # to display verbose messages only when your user has specified # '--verbose'. # # After sourcing this file, you can plug processing for additional # options by amending the variables from the 'Configuration' section # below, and following the instructions in the 'Option parsing' # section further down. ## -------------- ## ## Configuration. ## ## -------------- ## # You should override these variables in your script after sourcing this # file so that they reflect the customisations you have added to the # option parser. # The usage line for option parsing errors and the start of '-h' and # '--help' output messages. You can embed shell variables for delayed # expansion at the time the message is displayed, but you will need to # quote other shell meta-characters carefully to prevent them being # expanded when the contents are evaled. usage='$progpath [OPTION]...' # Short help message in response to '-h' and '--help'. Add to this or # override it after sourcing this library to reflect the full set of # options your script accepts. usage_message="\ --debug enable verbose shell tracing -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -v, --verbose verbosely report processing --version print version information and exit -h, --help print short or long help message and exit " # Additional text appended to 'usage_message' in response to '--help'. long_help_message=" Warning categories include: 'all' show all warnings 'none' turn off all the warnings 'error' warnings are treated as fatal errors" # Help message printed before fatal option parsing errors. fatal_help="Try '\$progname --help' for more information." ## ------------------------- ## ## Hook function management. ## ## ------------------------- ## # This section contains functions for adding, removing, and running hooks # to the main code. A hook is just a named list of of function, that can # be run in order later on. # func_hookable FUNC_NAME # ----------------------- # Declare that FUNC_NAME will run hooks added with # 'func_add_hook FUNC_NAME ...'. func_hookable () { $debug_cmd func_append hookable_fns " $1" } # func_add_hook FUNC_NAME HOOK_FUNC # --------------------------------- # Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must # first have been declared "hookable" by a call to 'func_hookable'. func_add_hook () { $debug_cmd case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not accept hook functions." ;; esac eval func_append ${1}_hooks '" $2"' } # func_remove_hook FUNC_NAME HOOK_FUNC # ------------------------------------ # Remove HOOK_FUNC from the list of functions called by FUNC_NAME. func_remove_hook () { $debug_cmd eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`' } # func_run_hooks FUNC_NAME [ARG]... # --------------------------------- # Run all hook functions registered to FUNC_NAME. # It is assumed that the list of hook functions contains nothing more # than a whitespace-delimited list of legal shell function names, and # no effort is wasted trying to catch shell meta-characters or preserve # whitespace. func_run_hooks () { $debug_cmd _G_rc_run_hooks=false case " $hookable_fns " in *" $1 "*) ;; *) func_fatal_error "'$1' does not support hook funcions.n" ;; esac eval _G_hook_fns=\$$1_hooks; shift for _G_hook in $_G_hook_fns; do if eval $_G_hook '"$@"'; then # store returned options list back into positional # parameters for next 'cmd' execution. eval _G_hook_result=\$${_G_hook}_result eval set dummy "$_G_hook_result"; shift _G_rc_run_hooks=: fi done $_G_rc_run_hooks && func_run_hooks_result=$_G_hook_result } ## --------------- ## ## Option parsing. ## ## --------------- ## # In order to add your own option parsing hooks, you must accept the # full positional parameter list in your hook function, you may remove/edit # any options that you action, and then pass back the remaining unprocessed # options in '_result', escaped suitably for # 'eval'. In this case you also must return $EXIT_SUCCESS to let the # hook's caller know that it should pay attention to # '_result'. Returning $EXIT_FAILURE signalizes that # arguments are left untouched by the hook and therefore caller will ignore the # result variable. # # Like this: # # my_options_prep () # { # $debug_cmd # # # Extend the existing usage message. # usage_message=$usage_message' # -s, --silent don'\''t print informational messages # ' # # No change in '$@' (ignored completely by this hook). There is # # no need to do the equivalent (but slower) action: # # func_quote_for_eval ${1+"$@"} # # my_options_prep_result=$func_quote_for_eval_result # false # } # func_add_hook func_options_prep my_options_prep # # # my_silent_option () # { # $debug_cmd # # args_changed=false # # # Note that for efficiency, we parse as many options as we can # # recognise in a loop before passing the remainder back to the # # caller on the first unrecognised argument we encounter. # while test $# -gt 0; do # opt=$1; shift # case $opt in # --silent|-s) opt_silent=: # args_changed=: # ;; # # Separate non-argument short options: # -s*) func_split_short_opt "$_G_opt" # set dummy "$func_split_short_opt_name" \ # "-$func_split_short_opt_arg" ${1+"$@"} # shift # args_changed=: # ;; # *) # Make sure the first unrecognised option "$_G_opt" # # is added back to "$@", we could need that later # # if $args_changed is true. # set dummy "$_G_opt" ${1+"$@"}; shift; break ;; # esac # done # # if $args_changed; then # func_quote_for_eval ${1+"$@"} # my_silent_option_result=$func_quote_for_eval_result # fi # # $args_changed # } # func_add_hook func_parse_options my_silent_option # # # my_option_validation () # { # $debug_cmd # # $opt_silent && $opt_verbose && func_fatal_help "\ # '--silent' and '--verbose' options are mutually exclusive." # # false # } # func_add_hook func_validate_options my_option_validation # # You'll also need to manually amend $usage_message to reflect the extra # options you parse. It's preferable to append if you can, so that # multiple option parsing hooks can be added safely. # func_options_finish [ARG]... # ---------------------------- # Finishing the option parse loop (call 'func_options' hooks ATM). func_options_finish () { $debug_cmd _G_func_options_finish_exit=false if func_run_hooks func_options ${1+"$@"}; then func_options_finish_result=$func_run_hooks_result _G_func_options_finish_exit=: fi $_G_func_options_finish_exit } # func_options [ARG]... # --------------------- # All the functions called inside func_options are hookable. See the # individual implementations for details. func_hookable func_options func_options () { $debug_cmd _G_rc_options=false for my_func in options_prep parse_options validate_options options_finish do if eval func_$my_func '${1+"$@"}'; then eval _G_res_var='$'"func_${my_func}_result" eval set dummy "$_G_res_var" ; shift _G_rc_options=: fi done # Save modified positional parameters for caller. As a top-level # options-parser function we always need to set the 'func_options_result' # variable (regardless the $_G_rc_options value). if $_G_rc_options; then func_options_result=$_G_res_var else func_quote_for_eval ${1+"$@"} func_options_result=$func_quote_for_eval_result fi $_G_rc_options } # func_options_prep [ARG]... # -------------------------- # All initialisations required before starting the option parse loop. # Note that when calling hook functions, we pass through the list of # positional parameters. If a hook function modifies that list, and # needs to propagate that back to rest of this script, then the complete # modified list must be put in 'func_run_hooks_result' before # returning $EXIT_SUCCESS (otherwise $EXIT_FAILURE is returned). func_hookable func_options_prep func_options_prep () { $debug_cmd # Option defaults: opt_verbose=false opt_warning_types= _G_rc_options_prep=false if func_run_hooks func_options_prep ${1+"$@"}; then _G_rc_options_prep=: # save modified positional parameters for caller func_options_prep_result=$func_run_hooks_result fi $_G_rc_options_prep } # func_parse_options [ARG]... # --------------------------- # The main option parsing loop. func_hookable func_parse_options func_parse_options () { $debug_cmd func_parse_options_result= _G_rc_parse_options=false # this just eases exit handling while test $# -gt 0; do # Defer to hook functions for initial option parsing, so they # get priority in the event of reusing an option name. if func_run_hooks func_parse_options ${1+"$@"}; then eval set dummy "$func_run_hooks_result"; shift _G_rc_parse_options=: fi # Break out of the loop if we already parsed every option. test $# -gt 0 || break _G_match_parse_options=: _G_opt=$1 shift case $_G_opt in --debug|-x) debug_cmd='set -x' func_echo "enabling shell trace mode" $debug_cmd ;; --no-warnings|--no-warning|--no-warn) set dummy --warnings none ${1+"$@"} shift ;; --warnings|--warning|-W) if test $# = 0 && func_missing_arg $_G_opt; then _G_rc_parse_options=: break fi case " $warning_categories $1" in *" $1 "*) # trailing space prevents matching last $1 above func_append_uniq opt_warning_types " $1" ;; *all) opt_warning_types=$warning_categories ;; *none) opt_warning_types=none warning_func=: ;; *error) opt_warning_types=$warning_categories warning_func=func_fatal_error ;; *) func_fatal_error \ "unsupported warning category: '$1'" ;; esac shift ;; --verbose|-v) opt_verbose=: ;; --version) func_version ;; -\?|-h) func_usage ;; --help) func_help ;; # Separate optargs to long options (plugins may need this): --*=*) func_split_equals "$_G_opt" set dummy "$func_split_equals_lhs" \ "$func_split_equals_rhs" ${1+"$@"} shift ;; # Separate optargs to short options: -W*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "$func_split_short_opt_arg" ${1+"$@"} shift ;; # Separate non-argument short options: -\?*|-h*|-v*|-x*) func_split_short_opt "$_G_opt" set dummy "$func_split_short_opt_name" \ "-$func_split_short_opt_arg" ${1+"$@"} shift ;; --) _G_rc_parse_options=: ; break ;; -*) func_fatal_help "unrecognised option: '$_G_opt'" ;; *) set dummy "$_G_opt" ${1+"$@"}; shift _G_match_parse_options=false break ;; esac $_G_match_parse_options && _G_rc_parse_options=: done if $_G_rc_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} func_parse_options_result=$func_quote_for_eval_result fi $_G_rc_parse_options } # func_validate_options [ARG]... # ------------------------------ # Perform any sanity checks on option settings and/or unconsumed # arguments. func_hookable func_validate_options func_validate_options () { $debug_cmd _G_rc_validate_options=false # Display all warnings if -W was not given. test -n "$opt_warning_types" || opt_warning_types=" $warning_categories" if func_run_hooks func_validate_options ${1+"$@"}; then # save modified positional parameters for caller func_validate_options_result=$func_run_hooks_result _G_rc_validate_options=: fi # Bail if the options were screwed! $exit_cmd $EXIT_FAILURE $_G_rc_validate_options } ## ----------------- ## ## Helper functions. ## ## ----------------- ## # This section contains the helper functions used by the rest of the # hookable option parser framework in ascii-betical order. # func_fatal_help ARG... # ---------------------- # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { $debug_cmd eval \$ECHO \""Usage: $usage"\" eval \$ECHO \""$fatal_help"\" func_error ${1+"$@"} exit $EXIT_FAILURE } # func_help # --------- # Echo long help message to standard output and exit. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message" exit 0 } # func_missing_arg ARGNAME # ------------------------ # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { $debug_cmd func_error "Missing argument for '$1'." exit_cmd=exit } # func_split_equals STRING # ------------------------ # Set func_split_equals_lhs and func_split_equals_rhs shell variables after # splitting STRING at the '=' sign. test -z "$_G_HAVE_XSI_OPS" \ && (eval 'x=a/b/c; test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \ && _G_HAVE_XSI_OPS=yes if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_equals () { $debug_cmd func_split_equals_lhs=${1%%=*} func_split_equals_rhs=${1#*=} test "x$func_split_equals_lhs" = "x$1" \ && func_split_equals_rhs= }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_equals () { $debug_cmd func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'` func_split_equals_rhs= test "x$func_split_equals_lhs" = "x$1" \ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'` } fi #func_split_equals # func_split_short_opt SHORTOPT # ----------------------------- # Set func_split_short_opt_name and func_split_short_opt_arg shell # variables after splitting SHORTOPT after the 2nd character. if test yes = "$_G_HAVE_XSI_OPS" then # This is an XSI compatible shell, allowing a faster implementation... eval 'func_split_short_opt () { $debug_cmd func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"} }' else # ...otherwise fall back to using expr, which is often a shell builtin. func_split_short_opt () { $debug_cmd func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'` func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'` } fi #func_split_short_opt # func_usage # ---------- # Echo short help message to standard output and exit. func_usage () { $debug_cmd func_usage_message $ECHO "Run '$progname --help |${PAGER-more}' for full usage" exit 0 } # func_usage_message # ------------------ # Echo short help message to standard output. func_usage_message () { $debug_cmd eval \$ECHO \""Usage: $usage"\" echo $SED -n 's|^# || /^Written by/{ x;p;x } h /^Written by/q' < "$progpath" echo eval \$ECHO \""$usage_message"\" } # func_version # ------------ # Echo version message to standard output and exit. func_version () { $debug_cmd printf '%s\n' "$progname $scriptversion" $SED -n ' /(C)/!b go :more /\./!{ N s|\n# | | b more } :go /^# Written by /,/# warranty; / { s|^# || s|^# *$|| s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2| p } /^# Written by / { s|^# || p } /^warranty; /q' < "$progpath" exit $? } # Local variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC" # time-stamp-time-zone: "UTC" # End: # Set a version string. scriptversion='(GNU libtool) 2.4.6' # func_echo ARG... # ---------------- # Libtool also displays the current mode in messages, so override # funclib.sh func_echo with this custom definition. func_echo () { $debug_cmd _G_message=$* func_echo_IFS=$IFS IFS=$nl for _G_line in $_G_message; do IFS=$func_echo_IFS $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line" done IFS=$func_echo_IFS } # func_warning ARG... # ------------------- # Libtool warnings are not categorized, so override funclib.sh # func_warning with this simpler definition. func_warning () { $debug_cmd $warning_func ${1+"$@"} } ## ---------------- ## ## Options parsing. ## ## ---------------- ## # Hook in the functions to make sure our own options are parsed during # the option parsing loop. usage='$progpath [OPTION]... [MODE-ARG]...' # Short help message in response to '-h'. usage_message="Options: --config show all configuration variables --debug enable verbose shell tracing -n, --dry-run display commands without modifying any files --features display basic configuration information and exit --mode=MODE use operation mode MODE --no-warnings equivalent to '-Wnone' --preserve-dup-deps don't remove duplicate dependency libraries --quiet, --silent don't print informational messages --tag=TAG use configuration variables from tag TAG -v, --verbose print more informational messages than default --version print version information -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all] -h, --help, --help-all print short, long, or detailed help message " # Additional text appended to 'usage_message' in response to '--help'. func_help () { $debug_cmd func_usage_message $ECHO "$long_help_message MODE must be one of the following: clean remove files from the build directory compile compile a source file into a libtool object execute automatically set library path, then run a program finish complete the installation of libtool libraries install install libraries or executables link create a library or an executable uninstall remove libraries from an installed directory MODE-ARGS vary depending on the MODE. When passed as first option, '--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that. Try '$progname --help --mode=MODE' for a more detailed description of MODE. When reporting a bug, please describe a test case to reproduce it and include the following information: host-triplet: $host shell: $SHELL compiler: $LTCC compiler flags: $LTCFLAGS linker: $LD (gnu? $with_gnu_ld) version: $progname $scriptversion Debian-2.4.6-14 automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` Report bugs to . GNU libtool home page: . General help using GNU software: ." exit 0 } # func_lo2o OBJECT-NAME # --------------------- # Transform OBJECT-NAME from a '.lo' suffix to the platform specific # object suffix. lo2o=s/\\.lo\$/.$objext/ o2lo=s/\\.$objext\$/.lo/ if test yes = "$_G_HAVE_XSI_OPS"; then eval 'func_lo2o () { case $1 in *.lo) func_lo2o_result=${1%.lo}.$objext ;; * ) func_lo2o_result=$1 ;; esac }' # func_xform LIBOBJ-OR-SOURCE # --------------------------- # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise) # suffix to a '.lo' libtool-object suffix. eval 'func_xform () { func_xform_result=${1%.*}.lo }' else # ...otherwise fall back to using sed. func_lo2o () { func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"` } func_xform () { func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'` } fi # func_fatal_configuration ARG... # ------------------------------- # Echo program name prefixed message to standard error, followed by # a configuration failure hint, and exit. func_fatal_configuration () { func__fatal_error ${1+"$@"} \ "See the $PACKAGE documentation for more information." \ "Fatal configuration error." } # func_config # ----------- # Display the configuration for all the tags in this script. func_config () { re_begincf='^# ### BEGIN LIBTOOL' re_endcf='^# ### END LIBTOOL' # Default configuration. $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath" # Now print the configurations for the tags. for tagname in $taglist; do $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath" done exit $? } # func_features # ------------- # Display the features supported by this script. func_features () { echo "host: $host" if test yes = "$build_libtool_libs"; then echo "enable shared libraries" else echo "disable shared libraries" fi if test yes = "$build_old_libs"; then echo "enable static libraries" else echo "disable static libraries" fi exit $? } # func_enable_tag TAGNAME # ----------------------- # Verify that TAGNAME is valid, and either flag an error and exit, or # enable the TAGNAME tag. We also add TAGNAME to the global $taglist # variable here. func_enable_tag () { # Global variable: tagname=$1 re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$" re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$" sed_extractcf=/$re_begincf/,/$re_endcf/p # Validate tagname. case $tagname in *[!-_A-Za-z0-9,/]*) func_fatal_error "invalid tag name: $tagname" ;; esac # Don't test for the "default" C tag, as we know it's # there but not specially marked. case $tagname in CC) ;; *) if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # func_check_version_match # ------------------------ # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } # libtool_options_prep [ARG]... # ----------------------------- # Preparation for options parsed by libtool. libtool_options_prep () { $debug_mode # Option defaults: opt_config=false opt_dlopen= opt_dry_run=false opt_help=false opt_mode= opt_preserve_dup_deps=false opt_quiet=false nonopt= preserve_args= _G_rc_lt_options_prep=: # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; *) _G_rc_lt_options_prep=false ;; esac if $_G_rc_lt_options_prep; then # Pass back the list of options. func_quote_for_eval ${1+"$@"} libtool_options_prep_result=$func_quote_for_eval_result fi $_G_rc_lt_options_prep } func_add_hook func_options_prep libtool_options_prep # libtool_parse_options [ARG]... # --------------------------------- # Provide handling for libtool specific options. libtool_parse_options () { $debug_cmd _G_rc_lt_parse_options=false # Perform our own loop to consume as many options as possible in # each iteration. while test $# -gt 0; do _G_match_lt_parse_options=: _G_opt=$1 shift case $_G_opt in --dry-run|--dryrun|-n) opt_dry_run=: ;; --config) func_config ;; --dlopen|-dlopen) opt_dlopen="${opt_dlopen+$opt_dlopen }$1" shift ;; --preserve-dup-deps) opt_preserve_dup_deps=: ;; --features) func_features ;; --finish) set dummy --mode finish ${1+"$@"}; shift ;; --help) opt_help=: ;; --help-all) opt_help=': help-all' ;; --mode) test $# = 0 && func_missing_arg $_G_opt && break opt_mode=$1 case $1 in # Valid mode arguments: clean|compile|execute|finish|install|link|relink|uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $_G_opt" exit_cmd=exit break ;; esac shift ;; --no-silent|--no-quiet) opt_quiet=false func_append preserve_args " $_G_opt" ;; --no-warnings|--no-warning|--no-warn) opt_warning=false func_append preserve_args " $_G_opt" ;; --no-verbose) opt_verbose=false func_append preserve_args " $_G_opt" ;; --silent|--quiet) opt_quiet=: opt_verbose=false func_append preserve_args " $_G_opt" ;; --tag) test $# = 0 && func_missing_arg $_G_opt && break opt_tag=$1 func_append preserve_args " $_G_opt $1" func_enable_tag "$1" shift ;; --verbose|-v) opt_quiet=false opt_verbose=: func_append preserve_args " $_G_opt" ;; # An option not handled by this hook function: *) set dummy "$_G_opt" ${1+"$@"} ; shift _G_match_lt_parse_options=false break ;; esac $_G_match_lt_parse_options && _G_rc_lt_parse_options=: done if $_G_rc_lt_parse_options; then # save modified positional parameters for caller func_quote_for_eval ${1+"$@"} libtool_parse_options_result=$func_quote_for_eval_result fi $_G_rc_lt_parse_options } func_add_hook func_parse_options libtool_parse_options # libtool_validate_options [ARG]... # --------------------------------- # Perform any sanity checks on option settings and/or unconsumed # arguments. libtool_validate_options () { # save first non-option argument if test 0 -lt $#; then nonopt=$1 shift fi # preserve --debug test : = "$debug_cmd" || func_append preserve_args " --debug" case $host in # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452 # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788 *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps ;; esac $opt_help || { # Sanity checks first: func_check_version_match test yes != "$build_libtool_libs" \ && test yes != "$build_old_libs" \ && func_fatal_configuration "not configured to build any kind of library" # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$opt_dlopen" && test execute != "$opt_mode"; then func_error "unrecognized option '-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help=$help help="Try '$progname --help --mode=$opt_mode' for more information." } # Pass back the unparsed argument list func_quote_for_eval ${1+"$@"} libtool_validate_options_result=$func_quote_for_eval_result } func_add_hook func_validate_options libtool_validate_options # Process options as early as possible so that --help and --version # can return quickly. func_options ${1+"$@"} eval set dummy "$func_options_result"; shift ## ----------- ## ## Main. ## ## ----------- ## magic='%%%MAGIC variable%%%' magic_exe='%%%MAGIC EXE variable%%%' # Global variables. extracted_archives= extracted_serial=0 # If this variable is set in any of the actions, the command in it # will be execed at the end. This prevents here-documents from being # left over by shells. exec_cmd= # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $1 _LTECHO_EOF' } # func_generated_by_libtool # True iff stdin has been generated by Libtool. This function is only # a basic sanity check; it will hardly flush out determined imposters. func_generated_by_libtool_p () { $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p } # func_lalib_unsafe_p file # True iff FILE is a libtool '.la' library or '.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if 'file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case $lalib_p_line in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test yes = "$lalib_p" } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { test -f "$1" && $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $debug_cmd save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # 'FILE.' does not work on cygwin managed mounts. func_source () { $debug_cmd case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_resolve_sysroot PATH # Replace a leading = in PATH with a sysroot. Store the result into # func_resolve_sysroot_result func_resolve_sysroot () { func_resolve_sysroot_result=$1 case $func_resolve_sysroot_result in =*) func_stripname '=' '' "$func_resolve_sysroot_result" func_resolve_sysroot_result=$lt_sysroot$func_stripname_result ;; esac } # func_replace_sysroot PATH # If PATH begins with the sysroot, replace it with = and # store the result into func_replace_sysroot_result. func_replace_sysroot () { case $lt_sysroot:$1 in ?*:"$lt_sysroot"*) func_stripname "$lt_sysroot" '' "$1" func_replace_sysroot_result='='$func_stripname_result ;; *) # Including no sysroot. func_replace_sysroot_result=$1 ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $debug_cmd if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_append_quoted CC_quoted "$arg" done CC_expanded=`func_echo_all $CC` CC_quoted_expanded=`func_echo_all $CC_quoted` case "$@ " in " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \ " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with '--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=$1 if test yes = "$build_libtool_libs"; then write_lobj=\'$2\' else write_lobj=none fi if test yes = "$build_old_libs"; then write_oldobj=\'$3\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T </dev/null` if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" | $SED -e "$sed_naive_backslashify"` else func_convert_core_file_wine_to_w32_result= fi fi } # end: func_convert_core_file_wine_to_w32 # func_convert_core_path_wine_to_w32 ARG # Helper function used by path conversion functions when $build is *nix, and # $host is mingw, cygwin, or some other w32 environment. Relies on a correctly # configured wine environment available, with the winepath program in $build's # $PATH. Assumes ARG has no leading or trailing path separator characters. # # ARG is path to be converted from $build format to win32. # Result is available in $func_convert_core_path_wine_to_w32_result. # Unconvertible file (directory) names in ARG are skipped; if no directory names # are convertible, then the result may be empty. func_convert_core_path_wine_to_w32 () { $debug_cmd # unfortunately, winepath doesn't convert paths, only file names func_convert_core_path_wine_to_w32_result= if test -n "$1"; then oldIFS=$IFS IFS=: for func_convert_core_path_wine_to_w32_f in $1; do IFS=$oldIFS func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f" if test -n "$func_convert_core_file_wine_to_w32_result"; then if test -z "$func_convert_core_path_wine_to_w32_result"; then func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result else func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result" fi fi done IFS=$oldIFS fi } # end: func_convert_core_path_wine_to_w32 # func_cygpath ARGS... # Wrapper around calling the cygpath program via LT_CYGPATH. This is used when # when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2) # $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or # (2), returns the Cygwin file name or path in func_cygpath_result (input # file name or path is assumed to be in w32 format, as previously converted # from $build's *nix or MSYS format). In case (3), returns the w32 file name # or path in func_cygpath_result (input file name or path is assumed to be in # Cygwin format). Returns an empty string on error. # # ARGS are passed to cygpath, with the last one being the file name or path to # be converted. # # Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH # environment variable; do not put it in $PATH. func_cygpath () { $debug_cmd if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null` if test "$?" -ne 0; then # on failure, ensure result is empty func_cygpath_result= fi else func_cygpath_result= func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'" fi } #end: func_cygpath # func_convert_core_msys_to_w32 ARG # Convert file name or path ARG from MSYS format to w32 format. Return # result in func_convert_core_msys_to_w32_result. func_convert_core_msys_to_w32 () { $debug_cmd # awkward: cmd appends spaces to result func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null | $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"` } #end: func_convert_core_msys_to_w32 # func_convert_file_check ARG1 ARG2 # Verify that ARG1 (a file name in $build format) was converted to $host # format in ARG2. Otherwise, emit an error message, but continue (resetting # func_to_host_file_result to ARG1). func_convert_file_check () { $debug_cmd if test -z "$2" && test -n "$1"; then func_error "Could not determine host file name corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_file_result=$1 fi } # end func_convert_file_check # func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH # Verify that FROM_PATH (a path in $build format) was converted to $host # format in TO_PATH. Otherwise, emit an error message, but continue, resetting # func_to_host_file_result to a simplistic fallback value (see below). func_convert_path_check () { $debug_cmd if test -z "$4" && test -n "$3"; then func_error "Could not determine the host path corresponding to" func_error " '$3'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This is a deliberately simplistic "conversion" and # should not be "improved". See libtool.info. if test "x$1" != "x$2"; then lt_replace_pathsep_chars="s|$1|$2|g" func_to_host_path_result=`echo "$3" | $SED -e "$lt_replace_pathsep_chars"` else func_to_host_path_result=$3 fi fi } # end func_convert_path_check # func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG # Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT # and appending REPL if ORIG matches BACKPAT. func_convert_path_front_back_pathsep () { $debug_cmd case $4 in $1 ) func_to_host_path_result=$3$func_to_host_path_result ;; esac case $4 in $2 ) func_append func_to_host_path_result "$3" ;; esac } # end func_convert_path_front_back_pathsep ################################################## # $build to $host FILE NAME CONVERSION FUNCTIONS # ################################################## # invoked via '$to_host_file_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # Result will be available in $func_to_host_file_result. # func_to_host_file ARG # Converts the file name ARG from $build format to $host format. Return result # in func_to_host_file_result. func_to_host_file () { $debug_cmd $to_host_file_cmd "$1" } # end func_to_host_file # func_to_tool_file ARG LAZY # converts the file name ARG from $build format to toolchain format. Return # result in func_to_tool_file_result. If the conversion in use is listed # in (the comma separated) LAZY, no conversion takes place. func_to_tool_file () { $debug_cmd case ,$2, in *,"$to_tool_file_cmd",*) func_to_tool_file_result=$1 ;; *) $to_tool_file_cmd "$1" func_to_tool_file_result=$func_to_host_file_result ;; esac } # end func_to_tool_file # func_convert_file_noop ARG # Copy ARG to func_to_host_file_result. func_convert_file_noop () { func_to_host_file_result=$1 } # end func_convert_file_noop # func_convert_file_msys_to_w32 ARG # Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_file_result. func_convert_file_msys_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_to_host_file_result=$func_convert_core_msys_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_w32 # func_convert_file_cygwin_to_w32 ARG # Convert file name ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_file_cygwin_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # because $build is cygwin, we call "the" cygpath in $PATH; no need to use # LT_CYGPATH in this case. func_to_host_file_result=`cygpath -m "$1"` fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_cygwin_to_w32 # func_convert_file_nix_to_w32 ARG # Convert file name ARG from *nix to w32 format. Requires a wine environment # and a working winepath. Returns result in func_to_host_file_result. func_convert_file_nix_to_w32 () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_file_wine_to_w32 "$1" func_to_host_file_result=$func_convert_core_file_wine_to_w32_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_w32 # func_convert_file_msys_to_cygwin ARG # Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_file_msys_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then func_convert_core_msys_to_w32 "$1" func_cygpath -u "$func_convert_core_msys_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_msys_to_cygwin # func_convert_file_nix_to_cygwin ARG # Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed # in a wine environment, working winepath, and LT_CYGPATH set. Returns result # in func_to_host_file_result. func_convert_file_nix_to_cygwin () { $debug_cmd func_to_host_file_result=$1 if test -n "$1"; then # convert from *nix to w32, then use cygpath to convert from w32 to cygwin. func_convert_core_file_wine_to_w32 "$1" func_cygpath -u "$func_convert_core_file_wine_to_w32_result" func_to_host_file_result=$func_cygpath_result fi func_convert_file_check "$1" "$func_to_host_file_result" } # end func_convert_file_nix_to_cygwin ############################################# # $build to $host PATH CONVERSION FUNCTIONS # ############################################# # invoked via '$to_host_path_cmd ARG' # # In each case, ARG is the path to be converted from $build to $host format. # The result will be available in $func_to_host_path_result. # # Path separators are also converted from $build format to $host format. If # ARG begins or ends with a path separator character, it is preserved (but # converted to $host format) on output. # # All path conversion functions are named using the following convention: # file name conversion function : func_convert_file_X_to_Y () # path conversion function : func_convert_path_X_to_Y () # where, for any given $build/$host combination the 'X_to_Y' value is the # same. If conversion functions are added for new $build/$host combinations, # the two new functions must follow this pattern, or func_init_to_host_path_cmd # will break. # func_init_to_host_path_cmd # Ensures that function "pointer" variable $to_host_path_cmd is set to the # appropriate value, based on the value of $to_host_file_cmd. to_host_path_cmd= func_init_to_host_path_cmd () { $debug_cmd if test -z "$to_host_path_cmd"; then func_stripname 'func_convert_file_' '' "$to_host_file_cmd" to_host_path_cmd=func_convert_path_$func_stripname_result fi } # func_to_host_path ARG # Converts the path ARG from $build format to $host format. Return result # in func_to_host_path_result. func_to_host_path () { $debug_cmd func_init_to_host_path_cmd $to_host_path_cmd "$1" } # end func_to_host_path # func_convert_path_noop ARG # Copy ARG to func_to_host_path_result. func_convert_path_noop () { func_to_host_path_result=$1 } # end func_convert_path_noop # func_convert_path_msys_to_w32 ARG # Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic # conversion to w32 is not available inside the cwrapper. Returns result in # func_to_host_path_result. func_convert_path_msys_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from ARG. MSYS # behavior is inconsistent here; cygpath turns them into '.;' and ';.'; # and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_msys_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_msys_to_w32 # func_convert_path_cygwin_to_w32 ARG # Convert path ARG from Cygwin to w32 format. Returns result in # func_to_host_file_result. func_convert_path_cygwin_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"` func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_cygwin_to_w32 # func_convert_path_nix_to_w32 ARG # Convert path ARG from *nix to w32 format. Requires a wine environment and # a working winepath. Returns result in func_to_host_file_result. func_convert_path_nix_to_w32 () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_to_host_path_result=$func_convert_core_path_wine_to_w32_result func_convert_path_check : ";" \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" ";" "$1" fi } # end func_convert_path_nix_to_w32 # func_convert_path_msys_to_cygwin ARG # Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set. # Returns result in func_to_host_file_result. func_convert_path_msys_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # See func_convert_path_msys_to_w32: func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_msys_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_msys_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_msys_to_cygwin # func_convert_path_nix_to_cygwin ARG # Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a # a wine environment, working winepath, and LT_CYGPATH set. Returns result in # func_to_host_file_result. func_convert_path_nix_to_cygwin () { $debug_cmd func_to_host_path_result=$1 if test -n "$1"; then # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_stripname : : "$1" func_to_host_path_tmp1=$func_stripname_result func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1" func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result" func_to_host_path_result=$func_cygpath_result func_convert_path_check : : \ "$func_to_host_path_tmp1" "$func_to_host_path_result" func_convert_path_front_back_pathsep ":*" "*:" : "$1" fi } # end func_convert_path_nix_to_cygwin # func_dll_def_p FILE # True iff FILE is a Windows DLL '.def' file. # Keep in sync with _LT_DLL_DEF_P in libtool.m4 func_dll_def_p () { $debug_cmd func_dll_def_p_tmp=`$SED -n \ -e 's/^[ ]*//' \ -e '/^\(;.*\)*$/d' \ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \ -e q \ "$1"` test DEF = "$func_dll_def_p_tmp" } # func_mode_compile arg... func_mode_compile () { $debug_cmd # Get the compilation command and the source file. base_compile= srcfile=$nonopt # always keep a non-empty value in "srcfile" suppress_opt=yes suppress_output= arg_mode=normal libobj= later= pie_flag= for arg do case $arg_mode in arg ) # do not "continue". Instead, add this to base_compile lastarg=$arg arg_mode=normal ;; target ) libobj=$arg arg_mode=normal continue ;; normal ) # Accept any command-line options. case $arg in -o) test -n "$libobj" && \ func_fatal_error "you cannot specify '-o' more than once" arg_mode=target continue ;; -pie | -fpie | -fPIE) func_append pie_flag " $arg" continue ;; -shared | -static | -prefer-pic | -prefer-non-pic) func_append later " $arg" continue ;; -no-suppress) suppress_opt=no continue ;; -Xcompiler) arg_mode=arg # the next one goes into the "base_compile" arg list continue # The current "srcfile" will either be retained or ;; # replaced later. I would guess that would be a bug. -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result lastarg= save_ifs=$IFS; IFS=, for arg in $args; do IFS=$save_ifs func_append_quoted lastarg "$arg" done IFS=$save_ifs func_stripname ' ' '' "$lastarg" lastarg=$func_stripname_result # Add the arguments to base_compile. func_append base_compile " $lastarg" continue ;; *) # Accept the current argument as the source file. # The previous "srcfile" becomes the current argument. # lastarg=$srcfile srcfile=$arg ;; esac # case $arg ;; esac # case $arg_mode # Aesthetically quote the previous argument. func_append_quoted base_compile "$lastarg" done # for arg case $arg_mode in arg) func_fatal_error "you must specify an argument for -Xcompile" ;; target) func_fatal_error "you must specify a target with '-o'" ;; *) # Get the name of the library object. test -z "$libobj" && { func_basename "$srcfile" libobj=$func_basename_result } ;; esac # Recognize several different file suffixes. # If the user specifies -o file.o, it is replaced with file.lo case $libobj in *.[cCFSifmso] | \ *.ada | *.adb | *.ads | *.asm | \ *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup) func_xform "$libobj" libobj=$func_xform_result ;; esac case $libobj in *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;; *) func_fatal_error "cannot determine name of library object from '$libobj'" ;; esac func_infer_tag $base_compile for arg in $later; do case $arg in -shared) test yes = "$build_libtool_libs" \ || func_fatal_configuration "cannot build a shared library" build_old_libs=no continue ;; -static) build_libtool_libs=no build_old_libs=yes continue ;; -prefer-pic) pic_mode=yes continue ;; -prefer-non-pic) pic_mode=no continue ;; esac done func_quote_for_eval "$libobj" test "X$libobj" != "X$func_quote_for_eval_result" \ && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \ && func_warning "libobj name '$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname=$func_basename_result xdir=$func_dirname_result lobj=$xdir$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test yes = "$build_old_libs"; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test no = "$compiler_c_o"; then output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext lockfile=$output_obj.lock else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test yes = "$need_locks"; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test warn = "$need_locks"; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi func_append removelist " $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist func_append removelist " $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 func_to_tool_file "$srcfile" func_convert_file_msys_to_w32 srcfile=$func_to_tool_file_result func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test yes = "$build_libtool_libs"; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test no != "$pic_mode"; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir func_append command " -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test yes = "$suppress_opt"; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test yes = "$build_old_libs"; then if test yes != "$pic_mode"; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test yes = "$compiler_c_o"; then func_append command " -o $obj" fi # Suppress compiler output if we already did a PIC compilation. func_append command "$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test warn = "$need_locks" && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support '-c' and '-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test no != "$need_locks"; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test compile = "$opt_mode" && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $opt_mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to build PIC objects only -prefer-non-pic try to build non-PIC objects only -shared do not build a '.o' file suitable for static linking -static only build a '.o' file suitable for static linking -Wc,FLAG pass FLAG directly to the compiler COMPILE-COMMAND is a command to be used in creating a 'standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix '.c' with the library object suffix, '.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to '-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the '--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the 'install' or 'cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix-dir PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -bindir BINDIR specify path to binaries directory (for systems where libraries must be found in the PATH setting at runtime) -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE use a list of object files found in FILE to specify objects -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes) -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface -Wc,FLAG -Xcompiler FLAG pass linker-specific FLAG directly to the compiler -Wl,FLAG -Xlinker FLAG pass linker-specific FLAG directly to the linker -XCClinker FLAG pass link-specific FLAG to the compiler driver (CC) All other options (arguments beginning with '-') are ignored. Every other argument is treated as a filename. Files ending in '.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in '.la', then a libtool library is created, only library objects ('.lo' files) may be specified, and '-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created using 'ar' and 'ranlib', or on Windows using 'lib'. If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode '$opt_mode'" ;; esac echo $ECHO "Try '$progname --help' for more information about other modes." } # Now that we've collected a possible --mode arg, show help if necessary if $opt_help; then if test : = "$opt_help"; then func_mode_help else { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do func_mode_help done } | $SED -n '1p; 2,$s/^Usage:/ or: /p' { func_help noexit for opt_mode in compile link execute install finish uninstall clean; do echo func_mode_help done } | $SED '1d /^When reporting/,/^Report/{ H d } $x /information about other modes/d /more detailed .*MODE/d s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/' fi exit $? fi # func_mode_execute arg... func_mode_execute () { $debug_cmd # The first argument is the command name. cmd=$nonopt test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $opt_dlopen; do test -f "$file" \ || func_fatal_help "'$file' is not a file" dir= case $file in *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "'$file' was not linked with '-export-dynamic'" continue fi func_dirname "$file" "" "." dir=$func_dirname_result if test -f "$dir/$objdir/$dlname"; then func_append dir "/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir=$func_dirname_result ;; *) func_warning "'-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir=$absdir # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic=$magic # Check if any of the arguments is a wrapper script. args= for file do case $file in -* | *.la | *.lo ) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file=$progdir/$program elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file=$progdir/$program fi ;; esac # Quote arguments (to preserve shell metacharacters). func_append_quoted args "$file" done if $opt_dry_run; then # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" echo "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS else if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd=\$cmd$args fi } test execute = "$opt_mode" && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $debug_cmd libs= libdirs= admincmds= for opt in "$nonopt" ${1+"$@"} do if test -d "$opt"; then func_append libdirs " $opt" elif test -f "$opt"; then if func_lalib_unsafe_p "$opt"; then func_append libs " $opt" else func_warning "'$opt' is not a valid libtool archive" fi else func_fatal_error "invalid argument '$opt'" fi done if test -n "$libs"; then if test -n "$lt_sysroot"; then sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"` sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;" else sysroot_cmd= fi # Remove sysroot references if $opt_dry_run; then for lib in $libs; do echo "removing references to $lt_sysroot and '=' prefixes from $lib" done else tmpdir=`func_mktempdir` for lib in $libs; do $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \ > $tmpdir/tmp-la mv -f $tmpdir/tmp-la $lib done ${RM}r "$tmpdir" fi fi if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || func_append admincmds " $cmds" fi done fi # Exit here if they wanted silent mode. $opt_quiet && exit $EXIT_SUCCESS if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then echo "----------------------------------------------------------------------" echo "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done echo echo "If you ever happen to want to link against installed libraries" echo "in a given directory, LIBDIR, you must either use libtool, and" echo "specify the full pathname of the library, or use the '-LLIBDIR'" echo "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then echo " - add LIBDIR to the '$shlibpath_var' environment variable" echo " during execution" fi if test -n "$runpath_var"; then echo " - add LIBDIR to the '$runpath_var' environment variable" echo " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the '$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'" fi echo echo "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) echo "more information, such as the ld(1), crle(1) and ld.so(8) manual" echo "pages." ;; *) echo "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac echo "----------------------------------------------------------------------" fi exit $EXIT_SUCCESS } test finish = "$opt_mode" && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $debug_cmd # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" || # Allow the use of GNU shtool's install command. case $nonopt in *shtool*) :;; *) false;; esac then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" func_append install_prog "$func_quote_for_eval_result" install_shared_prog=$install_prog case " $install_prog " in *[\\\ /]cp\ *) install_cp=: ;; *) install_cp=false ;; esac # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=false stripme= no_mode=: for arg do arg2= if test -n "$dest"; then func_append files " $dest" dest=$arg continue fi case $arg in -d) isdir=: ;; -f) if $install_cp; then :; else prev=$arg fi ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then if test X-m = "X$prev" && test -n "$install_override_mode"; then arg2=$install_override_mode no_mode=false fi prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" func_append install_prog " $func_quote_for_eval_result" if test -n "$arg2"; then func_quote_for_eval "$arg2" fi func_append install_shared_prog " $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the '$prev' option requires an argument" if test -n "$install_override_mode" && $no_mode; then if $install_cp; then :; else func_quote_for_eval "$install_override_mode" func_append install_shared_prog " -m $func_quote_for_eval_result" fi fi if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=: if $isdir; then destdir=$dest destname= else func_dirname_and_basename "$dest" "" "." destdir=$func_dirname_result destname=$func_basename_result # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "'$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "'$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. func_append staticlibs " $file" ;; *.la) func_resolve_sysroot "$file" file=$func_resolve_sysroot_result # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "'$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) func_append current_libdirs " $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) func_append future_libdirs " $libdir" ;; esac fi func_dirname "$file" "/" "" dir=$func_dirname_result func_append dir "$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"` fi func_warning "relinking '$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname=$1 shift srcname=$realname test -n "$relink_command" && srcname=${realname}T # Install the shared library and build the symlinks. func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme=$stripme case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme= ;; esac ;; os2*) case $realname in *_dll.a) tstripme= ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try 'ln -sf' first, because the 'ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib=$destdir/$realname func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name=$func_basename_result instname=$dir/${name}i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && func_append staticlibs " $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest=$destfile destfile= ;; *) func_fatal_help "cannot copy a libtool object to '$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test yes = "$build_old_libs"; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile=$destdir/$destname else func_basename "$file" destfile=$func_basename_result destfile=$destdir/$destfile fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext= case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=.exe fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script '$wrapper'" finalize=: for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'` if test -n "$libdir" && test ! -f "$libfile"; then func_warning "'$lib' has not been installed in '$libdir'" finalize=false fi done relink_command= func_source "$wrapper" outputname= if test no = "$fast_install" && test -n "$relink_command"; then $opt_dry_run || { if $finalize; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file=$func_basename_result outputname=$tmpdir/$file # Replace the output file specification. relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'` $opt_quiet || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink '$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file=$outputname else func_warning "cannot relink '$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name=$func_basename_result # Set up the ranlib parameters. oldlib=$destdir/$name func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $tool_oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run '$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test install = "$opt_mode" && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $debug_cmd my_outputname=$1 my_originator=$2 my_pic_p=${3-false} my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms=${my_outputname}S.c else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist=$output_objdir/$my_outputname.nm func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif #if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4)) #pragma GCC diagnostic ignored \"-Wstrict-prototypes\" #endif /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT_DLSYM_CONST #else # define LT_DLSYM_CONST const #endif #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* External symbol declarations for the compiler. */\ " if test yes = "$dlself"; then func_verbose "generating symbol list for '$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP` for progfile in $progfiles; do func_to_tool_file "$progfile" func_convert_file_msys_to_w32 func_verbose "extracting global C symbols from '$func_to_tool_file_result'" $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols=$output_objdir/$outputname.exp $opt_dry_run || { $RM $export_symbols eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from '$dlprefile'" func_basename "$dlprefile" name=$func_basename_result case $host in *cygwin* | *mingw* | *cegcc* ) # if an import library, we need to obtain dlname if func_win32_import_lib_p "$dlprefile"; then func_tr_sh "$dlprefile" eval "curr_lafile=\$libfile_$func_tr_sh_result" dlprefile_dlbasename= if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then # Use subshell, to avoid clobbering current variable values dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"` if test -n "$dlprefile_dlname"; then func_basename "$dlprefile_dlname" dlprefile_dlbasename=$func_basename_result else # no lafile. user explicitly requested -dlpreopen . $sharedlib_from_linklib_cmd "$dlprefile" dlprefile_dlbasename=$sharedlib_from_linklib_result fi fi $opt_dry_run || { if test -n "$dlprefile_dlbasename"; then eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"' else func_warning "Could not compute DLL name from $name" eval '$ECHO ": $name " >> "$nlist"' fi func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe | $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'" } else # not an import lib $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } fi ;; *) $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'" } ;; esac done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else echo '/* NONE */' >> "$output_objdir/$my_dlsyms" fi func_show_eval '$RM "${nlist}I"' if test -n "$global_symbol_to_import"; then eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I' fi echo >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; extern LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[];\ " if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ static void lt_syminit(void) { LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols; for (; symbol->name; ++symbol) {" $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms" echo >> "$output_objdir/$my_dlsyms" "\ } }" fi echo >> "$output_objdir/$my_dlsyms" "\ LT_DLSYM_CONST lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = { {\"$my_originator\", (void *) 0}," if test -s "$nlist"I; then echo >> "$output_objdir/$my_dlsyms" "\ {\"@INIT@\", (void *) <_syminit}," fi case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac echo >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) $my_pic_p && pic_flag_for_symtable=" $pic_flag" ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) func_append symtab_cflags " $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"' # Transform the symbol file into the correct name. symfileobj=$output_objdir/${my_outputname}S.$objext case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for '$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"` finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"` fi } # func_cygming_gnu_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is a GNU/binutils-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_gnu_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'` test -n "$func_cygming_gnu_implib_tmp" } # func_cygming_ms_implib_p ARG # This predicate returns with zero status (TRUE) if # ARG is an MS-style import library. Returns # with nonzero status (FALSE) otherwise. func_cygming_ms_implib_p () { $debug_cmd func_to_tool_file "$1" func_convert_file_msys_to_w32 func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'` test -n "$func_cygming_ms_implib_tmp" } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. # Despite the name, also deal with 64 bit binaries. func_win32_libid () { $debug_cmd win32_libid_type=unknown win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD. if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then case $nm_interface in "MS dumpbin") if func_cygming_ms_implib_p "$1" || func_cygming_gnu_implib_p "$1" then win32_nmres=import else win32_nmres= fi ;; *) func_to_tool_file "$1" func_convert_file_msys_to_w32 win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" | $SED -n -e ' 1,100{ / I /{ s|.*|import| p q } }'` ;; esac case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_cygming_dll_for_implib ARG # # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib () { $debug_cmd sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"` } # func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs # # The is the core of a fallback implementation of a # platform-specific function to extract the name of the # DLL associated with the specified import library LIBNAME. # # SECTION_NAME is either .idata$6 or .idata$7, depending # on the platform and compiler that created the implib. # # Echos the name of the DLL associated with the # specified import library. func_cygming_dll_for_implib_fallback_core () { $debug_cmd match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"` $OBJDUMP -s --section "$1" "$2" 2>/dev/null | $SED '/^Contents of section '"$match_literal"':/{ # Place marker at beginning of archive member dllname section s/.*/====MARK====/ p d } # These lines can sometimes be longer than 43 characters, but # are always uninteresting /:[ ]*file format pe[i]\{,1\}-/d /^In archive [^:]*:/d # Ensure marker is printed /^====MARK====/p # Remove all lines with less than 43 characters /^.\{43\}/!d # From remaining lines, remove first 43 characters s/^.\{43\}//' | $SED -n ' # Join marker and all lines until next marker into a single line /^====MARK====/ b para H $ b para b :para x s/\n//g # Remove the marker s/^====MARK====// # Remove trailing dots and whitespace s/[\. \t]*$// # Print /./p' | # we now have a list, one entry per line, of the stringified # contents of the appropriate section of all members of the # archive that possess that section. Heuristic: eliminate # all those that have a first or second character that is # a '.' (that is, objdump's representation of an unprintable # character.) This should work for all archives with less than # 0x302f exports -- but will fail for DLLs whose name actually # begins with a literal '.' or a single character followed by # a '.'. # # Of those that remain, print the first one. $SED -e '/^\./d;/^.\./d;q' } # func_cygming_dll_for_implib_fallback ARG # Platform-specific function to extract the # name of the DLL associated with the specified # import library ARG. # # This fallback implementation is for use when $DLLTOOL # does not support the --identify-strict option. # Invoked by eval'ing the libtool variable # $sharedlib_from_linklib_cmd # Result is available in the variable # $sharedlib_from_linklib_result func_cygming_dll_for_implib_fallback () { $debug_cmd if func_cygming_gnu_implib_p "$1"; then # binutils import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"` elif func_cygming_ms_implib_p "$1"; then # ms-generated import library sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"` else # unknown sharedlib_from_linklib_result= fi } # func_extract_an_archive dir oldlib func_extract_an_archive () { $debug_cmd f_ex_an_ar_dir=$1; shift f_ex_an_ar_oldlib=$1 if test yes = "$lock_old_archive_extraction"; then lockfile=$f_ex_an_ar_oldlib.lock until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done fi func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \ 'stat=$?; rm -f "$lockfile"; exit $stat' if test yes = "$lock_old_archive_extraction"; then $opt_dry_run || rm -f "$lockfile" fi if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $debug_cmd my_gentop=$1; shift my_oldlibs=${1+"$@"} my_oldobjs= my_xlib= my_xabs= my_xdir= for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib=$func_basename_result my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir=$my_gentop/$my_xlib_u func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` func_basename "$darwin_archive" darwin_base_archive=$func_basename_result darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches; do func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch" $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive" cd "unfat-$$/$darwin_base_archive-$darwin_arch" func_extract_an_archive "`pwd`" "$darwin_base_archive" cd "$darwin_curdir" $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP` done func_extract_archives_result=$my_oldobjs } # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory where it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=${1-no} $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then file=\"\$0\"" qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"` $ECHO "\ # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$1 _LTECHO_EOF' } ECHO=\"$qECHO\" fi # Very basic option parsing. These options are (a) specific to # the libtool wrapper, (b) are identical between the wrapper # /script/ and the wrapper /executable/ that is used only on # windows platforms, and (c) all begin with the string "--lt-" # (application programs are unlikely to have options that match # this pattern). # # There are only two supported options: --lt-debug and # --lt-dump-script. There is, deliberately, no --lt-help. # # The first argument to this parsing function should be the # script's $0 value, followed by "$@". lt_option_debug= func_parse_lt_options () { lt_script_arg0=\$0 shift for lt_opt do case \"\$lt_opt\" in --lt-debug) lt_option_debug=1 ;; --lt-dump-script) lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\` test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=. lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\` cat \"\$lt_dump_D/\$lt_dump_F\" exit 0 ;; --lt-*) \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2 exit 1 ;; esac done # Print the debug banner immediately: if test -n \"\$lt_option_debug\"; then echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2 fi } # Used when --lt-debug. Prints its arguments to stdout # (redirection is the responsibility of the caller) func_lt_dump_args () { lt_dump_args_N=1; for lt_arg do \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\" lt_dump_args_N=\`expr \$lt_dump_args_N + 1\` done } # Core function for launching the target application func_exec_program_core () { " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ if test -n \"\$lt_option_debug\"; then \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2 func_lt_dump_args \${1+\"\$@\"} 1>&2 fi exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 } # A function to encapsulate launching the target application # Strips options in the --lt-* namespace from \$@ and # launches target application with the remaining arguments. func_exec_program () { case \" \$* \" in *\\ --lt-*) for lt_wr_arg do case \$lt_wr_arg in --lt-*) ;; *) set x \"\$@\" \"\$lt_wr_arg\"; shift;; esac shift done ;; esac func_exec_program_core \${1+\"\$@\"} } # Parse options func_parse_lt_options \"\$0\" \${1+\"\$@\"} # Find the directory that this script lives in. thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\` done # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test yes = "$fast_install"; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else \$ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # fixup the dll searchpath if we need to. # # Fix the DLL searchpath if we need to. Do this before prepending # to shlibpath, because on Windows, both are PATH and uninstalled # libraries must come first. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi # Export our shlibpath_var if we have one. if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\` export $shlibpath_var " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. func_exec_program \${1+\"\$@\"} fi else # The program doesn't exist. \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include #else # include # include # ifdef __CYGWIN__ # include # endif #endif #include #include #include #include #include #include #include #include #define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0) /* declarations of non-ANSI functions */ #if defined __MINGW32__ # ifdef __STRICT_ANSI__ int _putenv (const char *); # endif #elif defined __CYGWIN__ # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif /* #elif defined other_platform || defined ... */ #endif /* portability defines, excluding path handling macros */ #if defined _MSC_VER # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv # define S_IXUSR _S_IEXEC #elif defined __MINGW32__ # define setmode _setmode # define stat _stat # define chmod _chmod # define getcwd _getcwd # define putenv _putenv #elif defined __CYGWIN__ # define HAVE_SETENV # define FOPEN_WB "wb" /* #elif defined other platforms ... */ #endif #if defined PATH_MAX # define LT_PATHMAX PATH_MAX #elif defined MAXPATHLEN # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif /* path handling portability macros */ #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \ defined __OS2__ # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free (stale); stale = 0; } \ } while (0) #if defined LT_DEBUGWRAPPER static int lt_debug = 1; #else static int lt_debug = 0; #endif const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */ void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_debugprintf (const char *file, int line, const char *fmt, ...); void lt_fatal (const char *file, int line, const char *message, ...); static const char *nonnull (const char *s); static const char *nonempty (const char *s); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); char **prepare_spawn (char **argv); void lt_dump_script (FILE *f); EOF cat <= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n", nonempty (path)); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; size_t tmp_len; char *concat_name; lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n", nonempty (wrapper)); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined HAVE_DOS_BASED_FILE_SYSTEM if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined HAVE_DOS_BASED_FILE_SYSTEM } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = (size_t) (q - p); p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal (__FILE__, __LINE__, "getcwd failed: %s", nonnull (strerror (errno))); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { lt_debugprintf (__FILE__, __LINE__, "checking path component for symlinks: %s\n", tmp_pathspec); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { lt_fatal (__FILE__, __LINE__, "error accessing file \"%s\": %s", tmp_pathspec, nonnull (strerror (errno))); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal (__FILE__, __LINE__, "could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (STREQ (str, pat)) *str = '\0'; } return str; } void lt_debugprintf (const char *file, int line, const char *fmt, ...) { va_list args; if (lt_debug) { (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line); va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } } static void lt_error_core (int exit_status, const char *file, int line, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *file, int line, const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap); va_end (ap); } static const char * nonnull (const char *s) { return s ? s : "(null)"; } static const char * nonempty (const char *s) { return (s && !*s) ? "(empty)" : nonnull (s); } void lt_setenv (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_setenv) setting '%s' to '%s'\n", nonnull (name), nonnull (value)); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else size_t len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { size_t orig_value_len = strlen (orig_value); size_t add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } void lt_update_exe_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_exe_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ size_t len = strlen (new_value); while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[--len] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { lt_debugprintf (__FILE__, __LINE__, "(lt_update_lib_path) modifying '%s' by prepending '%s'\n", nonnull (name), nonnull (value)); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF case $host_os in mingw*) cat <<"EOF" /* Prepares an argument vector before calling spawn(). Note that spawn() does not by itself call the command interpreter (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") : ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); GetVersionEx(&v); v.dwPlatformId == VER_PLATFORM_WIN32_NT; }) ? "cmd.exe" : "command.com"). Instead it simply concatenates the arguments, separated by ' ', and calls CreateProcess(). We must quote the arguments since Win32 CreateProcess() interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a special way: - Space and tab are interpreted as delimiters. They are not treated as delimiters if they are surrounded by double quotes: "...". - Unescaped double quotes are removed from the input. Their only effect is that within double quotes, space and tab are treated like normal characters. - Backslashes not followed by double quotes are not special. - But 2*n+1 backslashes followed by a double quote become n backslashes followed by a double quote (n >= 0): \" -> " \\\" -> \" \\\\\" -> \\" */ #define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" #define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037" char ** prepare_spawn (char **argv) { size_t argc; char **new_argv; size_t i; /* Count number of arguments. */ for (argc = 0; argv[argc] != NULL; argc++) ; /* Allocate new argument vector. */ new_argv = XMALLOC (char *, argc + 1); /* Put quoted arguments into the new argument vector. */ for (i = 0; i < argc; i++) { const char *string = argv[i]; if (string[0] == '\0') new_argv[i] = xstrdup ("\"\""); else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL) { int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL); size_t length; unsigned int backslashes; const char *s; char *quoted_string; char *p; length = 0; backslashes = 0; if (quote_around) length++; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') length += backslashes + 1; length++; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) length += backslashes + 1; quoted_string = XMALLOC (char, length + 1); p = quoted_string; backslashes = 0; if (quote_around) *p++ = '"'; for (s = string; *s != '\0'; s++) { char c = *s; if (c == '"') { unsigned int j; for (j = backslashes + 1; j > 0; j--) *p++ = '\\'; } *p++ = c; if (c == '\\') backslashes++; else backslashes = 0; } if (quote_around) { unsigned int j; for (j = backslashes; j > 0; j--) *p++ = '\\'; *p++ = '"'; } *p = '\0'; new_argv[i] = quoted_string; } else new_argv[i] = (char *) string; } new_argv[argc] = NULL; return new_argv; } EOF ;; esac cat <<"EOF" void lt_dump_script (FILE* f) { EOF func_emit_wrapper yes | $SED -n -e ' s/^\(.\{79\}\)\(..*\)/\1\ \2/ h s/\([\\"]\)/\\\1/g s/$/\\n/ s/\([^\n]*\).*/ fputs ("\1", f);/p g D' cat <<"EOF" } EOF } # end: func_emit_cwrapperexe_src # func_win32_import_lib_p ARG # True if ARG is an import lib, as indicated by $file_magic_cmd func_win32_import_lib_p () { $debug_cmd case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in *import*) : ;; *) false ;; esac } # func_suncc_cstd_abi # !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!! # Several compiler flags select an ABI that is incompatible with the # Cstd library. Avoid specifying it if any are in CXXFLAGS. func_suncc_cstd_abi () { $debug_cmd case " $compile_command " in *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*) suncc_use_cstd_abi=no ;; *) suncc_use_cstd_abi=yes ;; esac } # func_mode_link arg... func_mode_link () { $debug_cmd case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # what system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll that has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no bindir= dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= os2dllname= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=false prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module=$wl-single_module func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test yes != "$build_libtool_libs" \ && func_fatal_configuration "cannot build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg=$1 shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in bindir) bindir=$arg prev= continue ;; dlfiles|dlprefiles) $preload || { # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=: } case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test no = "$dlself"; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test dlprefiles = "$prev"; then dlself=yes elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test dlfiles = "$prev"; then func_append dlfiles " $arg" else func_append dlprefiles " $arg" fi prev= continue ;; esac ;; expsyms) export_symbols=$arg test -f "$arg" \ || func_fatal_error "symbol file '$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex=$arg prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) func_append deplibs " $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir=$arg prev= continue ;; mllvm) # Clang does not use LLVM to link, so we can simply discard any # '-mllvm $arg' options when doing the link step. prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # func_append moreargs " $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result if test none != "$pic_object"; then # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object fi # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file '$arg' does not exist" fi arg=$save_arg prev= continue ;; os2dllname) os2dllname=$arg prev= continue ;; precious_regex) precious_files_regex=$arg prev= continue ;; release) release=-$arg prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test rpath = "$prev"; then case "$rpath " in *" $arg "*) ;; *) func_append rpath " $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) func_append xrpath " $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds=$arg prev= continue ;; weak) func_append weak_libs " $arg" prev= continue ;; xcclinker) func_append linker_flags " $qarg" func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) func_append compiler_flags " $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) func_append linker_flags " $qarg" func_append compiler_flags " $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg=$arg case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "'-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -bindir) prev=bindir continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test X-export-symbols = "X$arg"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname "-L" '' "$arg" if test -z "$func_stripname_result"; then if test "$#" -gt 0; then func_fatal_error "require no space between '-L' and '$1'" else func_fatal_error "need path for '-L' option" fi fi func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of '$dir'" dir=$absdir ;; esac case "$deplibs " in *" -L$dir "* | *" $arg "*) # Will only happen for absolute or sysroot arguments ;; *) # Preserve sysroot, but never include relative directories case $dir in [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;; *) func_append deplibs " -L$dir" ;; esac func_append lib_search_path " $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) func_append dllsearchpath ":$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac continue ;; -l*) if test X-lc = "X$arg" || test X-lm = "X$arg"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test X-lc = "X$arg" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc due to us having libc/libc_r. test X-lc = "X$arg" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework func_append deplibs " System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test X-lc = "X$arg" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test X-lc = "X$arg" && continue ;; esac elif test X-lc_r = "X$arg"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi func_append deplibs " $arg" continue ;; -mllvm) prev=mllvm continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot|--sysroot) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) func_append compiler_flags " $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) func_append new_inherited_linker_flags " $arg" ;; esac continue ;; -multi_module) single_module=$wl-multi_module continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "'-no-install' is ignored for $host" func_warning "assuming '-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -os2dllname) prev=os2dllname continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; =*) func_stripname '=' '' "$dir" dir=$lt_sysroot$func_stripname_result ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $func_quote_for_eval_result" func_append compiler_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs=$IFS; IFS=, for flag in $args; do IFS=$save_ifs func_quote_for_eval "$flag" func_append arg " $wl$func_quote_for_eval_result" func_append compiler_flags " $wl$func_quote_for_eval_result" func_append linker_flags " $func_quote_for_eval_result" done IFS=$save_ifs func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; # Flags to be passed through unchanged, with rationale: # -64, -mips[0-9] enable 64-bit mode for the SGI compiler # -r[0-9][0-9]* specify processor for the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler # +DA*, +DD* enable 64-bit mode for the HP compiler # -q* compiler args for the IBM compiler # -m*, -t[45]*, -txscale* architecture-specific flags for GCC # -F/path path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* profiling flags for GCC # -fstack-protector* stack protector flags for GCC # @file GCC response files # -tp=* Portland pgcc target processor selection # --sysroot=* for sysroot support # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization # -specs=* GCC specs files # -stdlib=* select c++ std lib with clang # -fsanitize=* Clang/GCC memory and address sanitizer # -fuse-ld=* Linker select flags for GCC # -static-* direct GCC to link specific libraries statically # -fcilkplus Cilk Plus language extension features for C/C++ -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \ -specs=*|-fsanitize=*|-fuse-ld=*|-static-*|-fcilkplus) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result func_append compile_command " $arg" func_append finalize_command " $arg" func_append compiler_flags " $arg" continue ;; -Z*) if test os2 = "`expr $host : '.*\(os2\)'`"; then # OS/2 uses -Zxxx to specify OS/2-specific options compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case $arg in -Zlinker | -Zstack) prev=xcompiler ;; esac continue else # Otherwise treat like 'Some other compiler flag' below func_quote_for_eval "$arg" arg=$func_quote_for_eval_result fi ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; *.$objext) # A standard object. func_append objs " $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test none = "$pic_object" && test none = "$non_pic_object"; then func_fatal_error "cannot find name of object for '$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result test none = "$pic_object" || { # Prepend the subdirectory the object is found in. pic_object=$xdir$pic_object if test dlfiles = "$prev"; then if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then func_append dlfiles " $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test dlprefiles = "$prev"; then # Preload the old-style object. func_append dlprefiles " $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg=$pic_object } # Non-PIC object. if test none != "$non_pic_object"; then # Prepend the subdirectory the object is found in. non_pic_object=$xdir$non_pic_object # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test none = "$pic_object"; then arg=$non_pic_object fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object=$pic_object func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir=$func_dirname_result func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "'$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. func_append deplibs " $arg" func_append old_deplibs " $arg" continue ;; *.la) # A libtool-controlled library. func_resolve_sysroot "$arg" if test dlfiles = "$prev"; then # This library was specified with -dlopen. func_append dlfiles " $func_resolve_sysroot_result" prev= elif test dlprefiles = "$prev"; then # The library was specified with -dlpreopen. func_append dlprefiles " $func_resolve_sysroot_result" prev= else func_append deplibs " $func_resolve_sysroot_result" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg=$func_quote_for_eval_result ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the '$prevarg' option requires an argument" if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname=$func_basename_result libobjs_save=$libobjs if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" # Definition is injected by LT_CONFIG during libtool generation. func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH" func_dirname "$output" "/" "" output_objdir=$func_dirname_result$objdir func_to_tool_file "$output_objdir/" tool_output_objdir=$func_to_tool_file_result # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_preserve_dup_deps; then case "$libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append libs " $deplib" done if test lib = "$linkmode"; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;; esac func_append pre_post_deps " $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can '-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=false newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test lib,link = "$linkmode,$pass"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs=$tmp_deplibs fi if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass"; then libs=$deplibs deplibs= fi if test prog = "$linkmode"; then case $pass in dlopen) libs=$dlfiles ;; dlpreopen) libs=$dlprefiles ;; link) libs="$deplibs %DEPLIBS%" test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs" ;; esac fi if test lib,dlpreopen = "$linkmode,$pass"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= func_resolve_sysroot "$lib" case $lib in *.la) func_source "$func_resolve_sysroot_result" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do func_basename "$deplib" deplib_base=$func_basename_result case " $weak_libs " in *" $deplib_base "*) ;; *) func_append deplibs " $deplib" ;; esac done done libs=$dlprefiles fi if test dlopen = "$pass"; then # Collect dlpreopened libraries save_deplibs=$deplibs deplibs= fi for deplib in $libs; do lib= found=false case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append compiler_flags " $deplib" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -l*) if test lib != "$linkmode" && test prog != "$linkmode"; then func_warning "'-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test lib = "$linkmode"; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib=$searchdir/lib$name$search_ext if test -f "$lib"; then if test .la = "$search_ext"; then found=: else found=false fi break 2 fi done done if $found; then # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll=$l done if test "X$ll" = "X$old_library"; then # only static version available found=false func_dirname "$lib" "" "." ladir=$func_dirname_result lib=$ladir/$old_library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi else # deplib doesn't seem to be a libtool library if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs" fi continue fi ;; # -l *.ltframework) if test prog,link = "$linkmode,$pass"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test lib = "$linkmode"; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) func_append new_inherited_linker_flags " $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test conv = "$pass" && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; prog) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi if test scan = "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; *) func_warning "'-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test link = "$pass"; then func_stripname '-R' '' "$deplib" func_resolve_sysroot "$func_stripname_result" dir=$func_resolve_sysroot_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) func_append xrpath " $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) func_resolve_sysroot "$deplib" lib=$func_resolve_sysroot_result ;; *.$libext) if test conv = "$pass"; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=false case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=: fi ;; pass_all) valid_a_lib=: ;; esac if $valid_a_lib; then echo $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" else echo $ECHO "*** Warning: Trying to link with static lib archive $deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because the file extensions .$libext of this argument makes me believe" echo "*** that it is just a static archive that I should not use here." fi ;; esac continue ;; prog) if test link != "$pass"; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test conv = "$pass"; then deplibs="$deplib $deplibs" elif test prog = "$linkmode"; then if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then # If there is no dlopen support or we're linking statically, # we need to preload. func_append newdlprefiles " $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else func_append newdlfiles " $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=: continue ;; esac # case $deplib $found || test -f "$lib" \ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'" # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "'$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir=$func_dirname_result dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` if test lib,link = "$linkmode,$pass" || test prog,scan = "$linkmode,$pass" || { test prog != "$linkmode" && test lib != "$linkmode"; }; then test -n "$dlopen" && func_append dlfiles " $dlopen" test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen" fi if test conv = "$pass"; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for '$lib'" fi # It is a libtool convenience library, so add in its objects. func_append convenience " $ladir/$objdir/$old_library" func_append old_convenience " $ladir/$objdir/$old_library" tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done elif test prog != "$linkmode" && test lib != "$linkmode"; then func_fatal_error "'$lib' is not a convenience library" fi continue fi # $pass = conv # Get the name of the library we link against. linklib= if test -n "$old_library" && { test yes = "$prefer_static_libs" || test built,no = "$prefer_static_libs,$installed"; }; then linklib=$old_library else for l in $old_library $library_names; do linklib=$l done fi if test -z "$linklib"; then func_fatal_error "cannot find name of link library for '$lib'" fi # This library was specified with -dlopen. if test dlopen = "$pass"; then test -z "$libdir" \ && func_fatal_error "cannot -dlopen a convenience library: '$lib'" if test -z "$dlname" || test yes != "$dlopen_support" || test no = "$build_libtool_libs" then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. func_append dlprefiles " $lib $dependency_libs" else func_append newdlfiles " $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of '$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir=$ladir fi ;; esac func_basename "$lib" laname=$func_basename_result # Find the relevant object directory and library name. if test yes = "$installed"; then if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library '$lib' was moved." dir=$ladir absdir=$abs_ladir libdir=$abs_ladir else dir=$lt_sysroot$libdir absdir=$lt_sysroot$libdir fi test yes = "$hardcode_automatic" && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir=$ladir absdir=$abs_ladir # Remove this search path later func_append notinst_path " $abs_ladir" else dir=$ladir/$objdir absdir=$abs_ladir/$objdir # Remove this search path later func_append notinst_path " $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test dlpreopen = "$pass"; then if test -z "$libdir" && test prog = "$linkmode"; then func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'" fi case $host in # special handling for platforms with PE-DLLs. *cygwin* | *mingw* | *cegcc* ) # Linker will automatically link against shared library if both # static and shared are present. Therefore, ensure we extract # symbols from the import library if a shared library is present # (otherwise, the dlopen module name will be incorrect). We do # this by putting the import library name into $newdlprefiles. # We recover the dlopen module name by 'saving' the la file # name in a special purpose variable, and (later) extracting the # dlname from the la file. if test -n "$dlname"; then func_tr_sh "$dir/$linklib" eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname" func_append newdlprefiles " $dir/$linklib" else func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" fi ;; * ) # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then func_append newdlprefiles " $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ func_append dlpreconveniencelibs " $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then func_append newdlprefiles " $dir/$dlname" else func_append newdlprefiles " $dir/$linklib" fi ;; esac fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test lib = "$linkmode"; then deplibs="$dir/$old_library $deplibs" elif test prog,link = "$linkmode,$pass"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test prog = "$linkmode" && test link != "$pass"; then func_append newlib_search_path " $ladir" deplibs="$lib $deplibs" linkalldeplibs=false if test no != "$link_all_deplibs" || test -z "$library_names" || test no = "$build_libtool_libs"; then linkalldeplibs=: fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result" func_append newlib_search_path " $func_resolve_sysroot_result" ;; esac # Need to link against all dependency_libs? if $linkalldeplibs; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $deplib "*) func_append specialdeplibs " $deplib" ;; esac fi func_append tmp_libs " $deplib" done # for deplib continue fi # $linkmode = prog... if test prog,link = "$linkmode,$pass"; then if test -n "$library_names" && { { test no = "$prefer_static_libs" || test built,yes = "$prefer_static_libs,$installed"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then # Make sure the rpath contains only unique directories. case $temp_rpath: in *"$absdir:"*) ;; *) func_append temp_rpath "$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi # $linkmode,$pass = prog,link... if $alldeplibs && { test pass_all = "$deplibs_check_method" || { test yes = "$build_libtool_libs" && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test built = "$use_static_libs" && test yes = "$installed"; then use_static_libs=no fi if test -n "$library_names" && { test no = "$use_static_libs" || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc* | *os2*) # No point in relinking DLLs because paths are not encoded func_append notinst_deplibs " $lib" need_relink=no ;; *) if test no = "$installed"; then func_append notinst_deplibs " $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule= for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule=$dlpremoduletest break fi done if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then echo if test prog = "$linkmode"; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test lib = "$linkmode" && test yes = "$hardcode_into_libs"; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) func_append compile_rpath " $absdir" ;; esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname=$1 shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname=$dlname elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc* | *os2*) func_arith $current - $age major=$func_arith_result versuffix=-$major ;; esac eval soname=\"$soname_spec\" else soname=$realname fi # Make a new name for the extract_expsyms_cmds to use soroot=$soname func_basename "$soroot" soname=$func_basename_result func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from '$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for '$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test prog = "$linkmode" || test relink != "$opt_mode"; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test no = "$hardcode_direct"; then add=$dir/$linklib case $host in *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;; *-*-sysv4*uw2*) add_dir=-L$dir ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir=-L$dir ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we cannot # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library"; then echo echo "*** And there doesn't seem to be a static archive available" echo "*** The link will probably fail, sorry" else add=$dir/$old_library fi elif test -n "$old_library"; then add=$dir/$old_library fi fi esac elif test no = "$hardcode_minus_L"; then case $host in *-*-sunos*) add_shlibpath=$dir ;; esac add_dir=-L$dir add=-l$name elif test no = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; relink) if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$dir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$absdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name elif test yes = "$hardcode_shlibpath_var"; then add_shlibpath=$dir add=-l$name else lib_linked=no fi ;; *) lib_linked=no ;; esac if test yes != "$lib_linked"; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) func_append compile_shlibpath "$add_shlibpath:" ;; esac fi if test prog = "$linkmode"; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test yes != "$hardcode_direct" && test yes != "$hardcode_minus_L" && test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac fi fi fi if test prog = "$linkmode" || test relink = "$opt_mode"; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test yes = "$hardcode_direct" && test no = "$hardcode_direct_absolute"; then add=$libdir/$linklib elif test yes = "$hardcode_minus_L"; then add_dir=-L$libdir add=-l$name elif test yes = "$hardcode_shlibpath_var"; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) func_append finalize_shlibpath "$libdir:" ;; esac add=-l$name elif test yes = "$hardcode_automatic"; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib"; then add=$inst_prefix_dir$libdir/$linklib else add=$libdir/$linklib fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir=-L$libdir # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) func_append add_dir " -L$inst_prefix_dir$libdir" ;; esac fi add=-l$name fi if test prog = "$linkmode"; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test prog = "$linkmode"; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test unsupported != "$hardcode_direct"; then test -n "$old_library" && linklib=$old_library compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test yes = "$build_libtool_libs"; then # Not a shared library if test pass_all != "$deplibs_check_method"; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. echo $ECHO "*** Warning: This system cannot link to static lib archive $lib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have." if test yes = "$module"; then echo "*** But as you try to build a module library, libtool will still create " echo "*** a static module, that should work as long as the dlopening application" echo "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test lib = "$linkmode"; then if test -n "$dependency_libs" && { test yes != "$hardcode_into_libs" || test yes = "$build_old_libs" || test yes = "$link_static"; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) func_append xrpath " $temp_xrpath";; esac;; *) func_append temp_deplibs " $libdir";; esac done dependency_libs=$temp_deplibs fi func_append newlib_search_path " $absdir" # Link against this library test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" case $deplib in -L*) func_stripname '-L' '' "$deplib" func_resolve_sysroot "$func_stripname_result";; *) func_resolve_sysroot "$deplib" ;; esac if $opt_preserve_dup_deps; then case "$tmp_libs " in *" $func_resolve_sysroot_result "*) func_append specialdeplibs " $func_resolve_sysroot_result" ;; esac fi func_append tmp_libs " $func_resolve_sysroot_result" done if test no != "$link_all_deplibs"; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do path= case $deplib in -L*) path=$deplib ;; *.la) func_resolve_sysroot "$deplib" deplib=$func_resolve_sysroot_result func_dirname "$deplib" "" "." dir=$func_dirname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of '$dir'" absdir=$dir fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names"; then for tmp in $deplibrary_names; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl"; then depdepl=$absdir/$objdir/$depdepl darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl" func_append linker_flags " -dylib_file $darwin_install_name:$depdepl" path= fi fi ;; *) path=-L$absdir/$objdir ;; esac else eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "'$deplib' seems to be moved" path=-L$absdir fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test link = "$pass"; then if test prog = "$linkmode"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs=$newdependency_libs if test dlpreopen = "$pass"; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test dlopen != "$pass"; then test conv = "$pass" || { # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) func_append lib_search_path " $dir" ;; esac done newlib_search_path= } if test prog,link = "$linkmode,$pass"; then vars="compile_deplibs finalize_deplibs" else vars=deplibs fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) func_append tmp_libs " $deplib" ;; esac ;; *) func_append tmp_libs " $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Add Sun CC postdeps if required: test CXX = "$tagname" && { case $host_os in linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; solaris*) func_cc_basename "$CC" case $func_cc_basename_result in CC* | sunCC*) func_suncc_cstd_abi if test no != "$suncc_use_cstd_abi"; then func_append postdeps ' -library=Cstd -library=Crun' fi ;; esac ;; esac } # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i= ;; esac if test -n "$i"; then func_append tmp_libs " $i" fi done dependency_libs=$tmp_libs done # for pass if test prog = "$linkmode"; then dlfiles=$newdlfiles fi if test prog = "$linkmode" || test lib = "$linkmode"; then dlprefiles=$newdlprefiles fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "'-R' is ignored for archives" test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "'-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "'-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs=$output func_append objs "$old_deplibs" ;; lib) # Make sure we only generate libraries of the form 'libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test no = "$module" \ && func_fatal_help "libtool library '$output' must begin with 'lib'" if test no != "$need_lib_prefix"; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test pass_all != "$deplibs_check_method"; then func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs" else echo $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" func_append libobjs " $objs" fi fi test no = "$dlself" \ || func_warning "'-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test 1 -lt "$#" \ && func_warning "ignoring multiple '-rpath's for a libtool library" install_libdir=$1 oldlibs= if test -z "$rpath"; then if test yes = "$build_libtool_libs"; then # Building a libtool convenience library. # Some compilers have problems with a '.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "'-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "'-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs=$IFS; IFS=: set dummy $vinfo 0 0 0 shift IFS=$save_ifs test -n "$7" && \ func_fatal_help "too many parameters to '-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major=$1 number_minor=$2 number_revision=$3 # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # that has an extra 1 added just for fun # case $version_type in # correct linux to gnu/linux during the next big refactor darwin|freebsd-elf|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_revision ;; freebsd-aout|qnx|sunos) current=$number_major revision=$number_minor age=0 ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age=$number_minor revision=$number_minor lt_irix_increment=no ;; *) func_fatal_configuration "$modename: unknown library version type '$version_type'" ;; esac ;; no) current=$1 revision=$2 age=$3 ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT '$current' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION '$revision' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE '$age' must be a nonnegative integer" func_fatal_error "'$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE '$age' is greater than the current interface number '$current'" func_fatal_error "'$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" # On Darwin other compilers case $CC in nagfor*) verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision" ;; *) verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; esac ;; freebsd-aout) major=.$current versuffix=.$current.$revision ;; freebsd-elf) func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; irix | nonstopux) if test no = "$lt_irix_increment"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring=$verstring_prefix$major.$revision # Add in all the interfaces that we are compatible with. loop=$revision while test 0 -ne "$loop"; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring_prefix$major.$iface:$verstring done # Before this point, $major must not contain '.'. major=.$major versuffix=$major.$revision ;; linux) # correct to gnu/linux during the next big refactor func_arith $current - $age major=.$func_arith_result versuffix=$major.$age.$revision ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=.$current.$age.$revision verstring=$current.$age.$revision # Add in all the interfaces that we are compatible with. loop=$age while test 0 -ne "$loop"; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring=$verstring:$iface.0 done # Make executables depend on our current version. func_append verstring ":$current.0" ;; qnx) major=.$current versuffix=.$current ;; sco) major=.$current versuffix=.$current ;; sunos) major=.$current versuffix=.$current.$revision ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 file systems. func_arith $current - $age major=$func_arith_result versuffix=-$major ;; *) func_fatal_configuration "unknown library version type '$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring=0.0 ;; esac if test no = "$need_version"; then versuffix= else versuffix=.0.0 fi fi # Remove version info from name if versioning should be avoided if test yes,no = "$avoid_version,$need_version"; then major= versuffix= verstring= fi # Check to see if the archive will have undefined symbols. if test yes = "$allow_undefined"; then if test unsupported = "$allow_undefined_flag"; then if test yes = "$build_old_libs"; then func_warning "undefined symbols not allowed in $host shared libraries; building static only" build_libtool_libs=no else func_fatal_error "can't build $host shared library unless -no-undefined is specified" fi fi else # Don't allow undefined symbols. allow_undefined_flag=$no_undefined_flag fi fi func_generate_dlsyms "$libname" "$libname" : func_append libobjs " $symfileobj" test " " = "$libobjs" && libobjs= if test relink != "$opt_mode"; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*) if test -n "$precious_files_regex"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi func_append removelist " $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then func_append oldlibs " $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"` # deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"` # dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do func_replace_sysroot "$libdir" func_append temp_xrpath " -R$func_replace_sysroot_result" case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles=$dlfiles dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) func_append dlfiles " $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles=$dlprefiles dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) func_append dlprefiles " $lib" ;; esac done if test yes = "$build_libtool_libs"; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework func_append deplibs " System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test yes = "$build_libtool_need_lc"; then func_append deplibs " -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release= versuffix= major= newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` $nocaseglob else potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null` fi for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib=$potent_lib while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | $SED 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;; *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test yes = "$allow_libtool_libs_with_static_runtimes"; then case " $predeps $postdeps " in *" $a_deplib "*) func_append newdeplibs " $a_deplib" a_deplib= ;; esac fi if test -n "$a_deplib"; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib=$potent_lib # see symlink-check above in file_magic test if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then func_append newdeplibs " $a_deplib" a_deplib= break 2 fi done done fi if test -n "$a_deplib"; then droppeddeps=yes echo $ECHO "*** Warning: linker path does not have real file for library $a_deplib." echo "*** I have the capability to make that library automatically link in when" echo "*** you link to this library. But I can only do this if you have a" echo "*** shared version of the library, which you do not appear to have" echo "*** because I did check the linker path looking for a file starting" if test -z "$potlib"; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. func_append newdeplibs " $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs= tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'` if test yes = "$allow_libtool_libs_with_static_runtimes"; then for i in $predeps $postdeps; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"` done fi case $tmp_deplibs in *[!\ \ ]*) echo if test none = "$deplibs_check_method"; then echo "*** Warning: inter-library dependencies are not supported in this platform." else echo "*** Warning: inter-library dependencies are not known to be supported." fi echo "*** All declared inter-library dependencies are being dropped." droppeddeps=yes ;; esac ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac if test yes = "$droppeddeps"; then if test yes = "$module"; then echo echo "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" echo "*** a static module, that should work as long as the dlopening" echo "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then echo echo "*** However, this would only work if libtool was able to extract symbol" echo "*** lists from a program, using 'nm' or equivalent, but libtool could" echo "*** not find such a program. So, this module is probably useless." echo "*** 'nm' from GNU binutils and a full rebuild may help." fi if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else echo "*** The inter-library dependencies that have been dropped here will be" echo "*** automatically added whenever a program is linked with this library" echo "*** or is declared to -dlopen it." if test no = "$allow_undefined"; then echo echo "*** Since this library must not contain undefined symbols," echo "*** because either the platform does not support them or" echo "*** it was explicitly requested with -no-undefined," echo "*** libtool will only create a static version of it." if test no = "$build_old_libs"; then oldlibs=$output_objdir/$libname.$libext build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done deplibs=$new_libs # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test yes = "$build_libtool_libs"; then # Remove $wl instances when linking with ld. # FIXME: should test the right _cmds variable. case $archive_cmds in *\$LD\ *) wl= ;; esac if test yes = "$hardcode_into_libs"; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath=$finalize_rpath test relink = "$opt_mode" || rpath=$compile_rpath$rpath for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then func_replace_sysroot "$libdir" libdir=$func_replace_sysroot_result if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append dep_rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval "dep_rpath=\"$hardcode_libdir_flag_spec\"" fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath=$finalize_shlibpath test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname=$1 shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname=$realname fi if test -z "$dlname"; then dlname=$soname fi lib=$output_objdir/$realname linknames= for link do func_append linknames " $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols=$output_objdir/$libname.uexp func_append delfiles " $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile func_dll_def_p "$export_symbols" || { # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols=$export_symbols export_symbols= always_export_symbols=yes } fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs=$IFS; IFS='~' for cmd1 in $cmds; do IFS=$save_ifs # Take the normal branch if the nm_file_list_spec branch # doesn't work or if tool conversion is not needed. case $nm_file_list_spec~$to_tool_file_cmd in *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*) try_normal_branch=yes eval cmd=\"$cmd1\" func_len " $cmd" len=$func_len_result ;; *) try_normal_branch=no ;; esac if test yes = "$try_normal_branch" \ && { test "$len" -lt "$max_cmd_len" \ || test "$max_cmd_len" -le -1; } then func_show_eval "$cmd" 'exit $?' skipped_export=false elif test -n "$nm_file_list_spec"; then func_basename "$output" output_la=$func_basename_result save_libobjs=$libobjs save_output=$output output=$output_objdir/$output_la.nm func_to_tool_file "$output" libobjs=$nm_file_list_spec$func_to_tool_file_result func_append delfiles " $output" func_verbose "creating $NM input file list: $output" for obj in $save_libobjs; do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > "$output" eval cmd=\"$cmd1\" func_show_eval "$cmd" 'exit $?' output=$save_output libobjs=$save_libobjs skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS=$save_ifs if test -n "$export_symbols_regex" && test : != "$skipped_export"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test : != "$skipped_export" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) func_append tmp_deplibs " $test_deplib" ;; esac done deplibs=$tmp_deplibs if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test yes = "$compiler_needs_object" && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $convenience func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" func_append linker_flags " $flag" fi # Make a backup of the uninstalled library when relinking if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test : != "$skipped_export" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output func_basename "$output" output_la=$func_basename_result # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then output=$output_objdir/$output_la.lnkscript func_verbose "creating GNU ld script: $output" echo 'INPUT (' > $output for obj in $save_libobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done echo ')' >> $output func_append delfiles " $output" func_to_tool_file "$output" output=$func_to_tool_file_result elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then output=$output_objdir/$output_la.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test yes = "$compiler_needs_object"; then firstobj="$1 " shift fi for obj do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" >> $output done func_append delfiles " $output" func_to_tool_file "$output" output=$firstobj\"$file_list_spec$func_to_tool_file_result\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-$k.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test -z "$objlist" || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test 1 -eq "$k"; then # The first file doesn't have a previous command to add. reload_objs=$objlist eval concat_cmds=\"$reload_cmds\" else # All subsequent reloadable object files will link in # the last one created. reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-$k.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-$k.$objext objlist=" $obj" func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ reload_objs="$objlist $last_robj" eval concat_cmds=\"\$concat_cmds$reload_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi func_append delfiles " $output" else output= fi ${skipped_export-false} && { func_verbose "generating symbol list for '$libname.la'" export_symbols=$output_objdir/$libname.exp $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi } test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs=$IFS; IFS='~' for cmd in $concat_cmds; do IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi ${skipped_export-false} && { if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols=$export_symbols test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for '$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands, which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter func_append delfiles " $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi } libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test yes = "$module" && test -n "$module_cmds"; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append libobjs " $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs=$IFS; IFS='~' for cmd in $cmds; do IFS=$sp$nl eval cmd=\"$cmd\" IFS=$save_ifs $opt_quiet || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test relink = "$opt_mode"; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS=$save_ifs # Restore the uninstalled library and exit if test relink = "$opt_mode"; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test yes = "$module" || test yes = "$export_dynamic"; then # On all known operating systems, these are identical. dlname=$soname fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then func_warning "'-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "'-l' and '-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "'-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "'-R' is ignored for objects" test -n "$vinfo" && \ func_warning "'-version-info' is ignored for objects" test -n "$release" && \ func_warning "'-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object '$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj=$output ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # if reload_cmds runs $LD directly, get rid of -Wl from # whole_archive_flag_spec and hope we can get by with turning comma # into space. case $reload_cmds in *\$LD[\ \$]*) wl= ;; esac if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'` reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags else gentop=$output_objdir/${obj}x func_append generated " $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # If we're not building shared, we need to use non_pic_objs test yes = "$build_libtool_libs" || libobjs=$non_pic_objects # Create the old-style object. reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs output=$obj func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi test yes = "$build_libtool_libs" || { if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS } if test -n "$pic_flag" || test default != "$pic_mode"; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output=$libobj func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "'-version-info' is ignored for programs" test -n "$release" && \ func_warning "'-release' is ignored for programs" $preload \ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test CXX = "$tagname"; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) func_append compile_command " $wl-bind_at_load" func_append finalize_command " $wl-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) func_append new_libs " -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) func_append new_libs " $deplib" ;; esac ;; *) func_append new_libs " $deplib" ;; esac done compile_deplibs=$new_libs func_append compile_command " $compile_deplibs" func_append finalize_command " $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) func_append finalize_rpath " $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) func_append perm_rpath " $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) func_append dllsearchpath ":$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) func_append dllsearchpath ":$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath=$rpath rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs=$libdir else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) func_append hardcode_libdirs "$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" func_append rpath " $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) func_append finalize_perm_rpath " $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir=$hardcode_libdirs eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath=$rpath if test -n "$libobjs" && test yes = "$build_old_libs"; then # Transform all the library objects into standard objects. compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP` finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" false # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=: case $host in *cegcc* | *mingw32ce*) # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway. wrappers_required=false ;; *cygwin* | *mingw* ) test yes = "$build_libtool_libs" || wrappers_required=false ;; *) if test no = "$need_relink" || test yes != "$build_libtool_libs"; then wrappers_required=false fi ;; esac $wrappers_required || { # Replace the output file specification. compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'` link_command=$compile_command$compile_rpath # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Delete the generated files. if test -f "$output_objdir/${outputname}S.$objext"; then func_show_eval '$RM "$output_objdir/${outputname}S.$objext"' fi exit $exit_status } if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do func_append rpath "$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do func_append rpath "$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test yes = "$no_install"; then # We don't need to create a wrapper script. link_command=$compile_var$compile_command$compile_rpath # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi exit $EXIT_SUCCESS fi case $hardcode_action,$fast_install in relink,*) # Fast installation is not supported link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath func_warning "this platform does not like uninstalled shared libraries" func_warning "'$output' will be relinked during installation" ;; *,yes) link_command=$finalize_var$compile_command$finalize_rpath relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'` ;; *,no) link_command=$compile_var$compile_command$compile_rpath relink_command=$finalize_var$finalize_command$finalize_rpath ;; *,needless) link_command=$finalize_var$compile_command$finalize_rpath relink_command= ;; esac # Replace the output file specification. link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' if test -n "$postlink_cmds"; then func_to_tool_file "$output_objdir/$outputname" postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'` func_execute_cmds "$postlink_cmds" 'exit $?' fi # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource=$output_path/$objdir/lt-$output_name.c cwrapper=$output_path/$output_name.exe $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host"; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do case $build_libtool_libs in convenience) oldobjs="$libobjs_save $symfileobj" addlibs=$convenience build_libtool_libs=no ;; module) oldobjs=$libobjs_save addlibs=$old_convenience build_libtool_libs=no ;; *) oldobjs="$old_deplibs $non_pic_objects" $preload && test -f "$symfileobj" \ && func_append oldobjs " $symfileobj" addlibs=$old_convenience ;; esac if test -n "$addlibs"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $addlibs func_append oldobjs " $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_extract_archives $gentop $dlprefiles func_append oldobjs " $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else echo "copying selected object files to avoid basename conflicts..." gentop=$output_objdir/${outputname}x func_append generated " $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase=$func_basename_result case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" func_append oldobjs " $gentop/$newobj" ;; *) func_append oldobjs " $obj" ;; esac done fi func_to_tool_file "$oldlib" func_convert_file_msys_to_w32 tool_oldlib=$func_to_tool_file_result eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds elif test -n "$archiver_list_spec"; then func_verbose "using command file archive linking..." for obj in $oldobjs do func_to_tool_file "$obj" $ECHO "$func_to_tool_file_result" done > $output_objdir/$libname.libcmd func_to_tool_file "$output_objdir/$libname.libcmd" oldobjs=" $archiver_list_spec$func_to_tool_file_result" cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj"; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test -z "$oldobjs"; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test yes = "$build_old_libs" && old_library=$libname.$libext func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"` if test yes = "$hardcode_automatic"; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test yes = "$installed"; then if test -z "$install_libdir"; then break fi output=$output_objdir/${outputname}i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name=$func_basename_result func_resolve_sysroot "$deplib" eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result` test -z "$libdir" && \ func_fatal_error "'$deplib' is not a valid libtool archive" func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name" ;; -L*) func_stripname -L '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -L$func_replace_sysroot_result" ;; -R*) func_stripname -R '' "$deplib" func_replace_sysroot "$func_stripname_result" func_append newdependency_libs " -R$func_replace_sysroot_result" ;; *) func_append newdependency_libs " $deplib" ;; esac done dependency_libs=$newdependency_libs newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name" ;; *) func_append newdlfiles " $lib" ;; esac done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name=$func_basename_result eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "'$lib' is not a valid libtool archive" func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name" ;; esac done dlprefiles=$newdlprefiles else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlfiles " $abs" done dlfiles=$newdlfiles newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;; *) abs=`pwd`"/$lib" ;; esac func_append newdlprefiles " $abs" done dlprefiles=$newdlprefiles fi $RM $output # place dlname in correct position for cygwin # In fact, it would be nice if we could use this code for all target # systems that can't hard-code library paths into their executables # and that have no shared library path variable independent of PATH, # but it turns out we can't easily determine that from inspecting # libtool variables, so we have to hard-code the OSs to which it # applies here; at the moment, that means platforms that use the PE # object format with DLL files. See the long comment at the top of # tests/bindir.at for full details. tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) # If a -bindir argument was supplied, place the dll there. if test -n "$bindir"; then func_relative_path "$install_libdir" "$bindir" tdlname=$func_relative_path_result/$dlname else # Otherwise fall back on heuristic. tdlname=../bin/$dlname fi ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that cannot go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test no,yes = "$installed,$need_relink"; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } if test link = "$opt_mode" || test relink = "$opt_mode"; then func_mode_link ${1+"$@"} fi # func_mode_uninstall arg... func_mode_uninstall () { $debug_cmd RM=$nonopt files= rmforce=false exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic=$magic for arg do case $arg in -f) func_append RM " $arg"; rmforce=: ;; -*) func_append RM " $arg" ;; *) func_append files " $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= for file in $files; do func_dirname "$file" "" "." dir=$func_dirname_result if test . = "$dir"; then odir=$objdir else odir=$dir/$objdir fi func_basename "$file" name=$func_basename_result test uninstall = "$opt_mode" && odir=$dir # Remember odir for removal later, being careful to avoid duplicates if test clean = "$opt_mode"; then case " $rmdirs " in *" $odir "*) ;; *) func_append rmdirs " $odir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif $rmforce; then continue fi rmfiles=$file case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do func_append rmfiles " $odir/$n" done test -n "$old_library" && func_append rmfiles " $odir/$old_library" case $opt_mode in clean) case " $library_names " in *" $dlname "*) ;; *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;; esac test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test none != "$pic_object"; then func_append rmfiles " $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test none != "$non_pic_object"; then func_append rmfiles " $dir/$non_pic_object" fi fi ;; *) if test clean = "$opt_mode"; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe func_append rmfiles " $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result func_append rmfiles " $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles func_append rmfiles " $odir/$name $odir/${name}S.$objext" if test yes = "$fast_install" && test -n "$relink_command"; then func_append rmfiles " $odir/lt-$name" fi if test "X$noexename" != "X$name"; then func_append rmfiles " $odir/lt-$noexename.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done # Try to remove the $objdir's in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then func_mode_uninstall ${1+"$@"} fi test -z "$opt_mode" && { help=$generic_help func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode '$opt_mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # where we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: rivet-3.0.0/contrib/000775 001750 001750 00000000000 15224454746 015072 5ustar00manghimanghi000000 000000 rivet-3.0.0/doc/html/unescape_string.html000664 001750 001750 00000005344 15224455137 021223 0ustar00manghimanghi000000 000000 unescape_string

Name

unescape_string — unescape escaped characters in a string.

Synopsis

::rivet::unescape_string ?string?

Description

Scans through each character in the specified string looking for escaped character sequences (characters containing a percent sign and two hexadecimal characters), unescaping them back to their original character values, as needed, also mapping plus signs to spaces, and returning the result.

This is useful for unquoting strings that have been quoted to be part of a URL.

rivet-3.0.0/doc/rivet.css000664 001750 001750 00000017240 15224454746 016046 0ustar00manghimanghi000000 000000 BODY { font-family: verdana; background-color: #fbfcfc; } DIV.ABSTRACT { border: solid 2px; padding-left: 10pt; padding-right: 10pt; } PRE.SCREEN { font-family:monospace; white-space: pre; width: 100%; background-color: #ffffcc; border:solid; color: #000000; border-color: #009999; border-left: solid #009999 2px; border-right: solid #009999 2px; border-top: solid #009999 2px; border-bottom: solid #009999 2px; padding-left: 15pt; } PRE.PROGRAMLISTING { font-family: monospace; white-space: pre; width: 95%; background-color: #e8ecf2; border: solid; color: #000000; border-color: #a3b1bc; border-left: solid #a3b1bc 1px; border-right: solid #a3b1bc 1px; border-top: solid #a3b1bc 1px; border-bottom: solid #a3b1bc 1px; font-size: normal; padding-top: 1em; padding-left: 1em; padding-bottom: 1em; font-size: 0.9em; } H1 { color: #ffffff; border: solid 3px #1d252b; background-color: #a3b1bc; font-variant: small-caps; width: 100%; } H1.TITLE { color: #ffffff; border: solid 3px #1d252b; background-color: #a3b1bc; font-variant: small-caps; width: 100%; } .TITLE a { color: #ffffff; text-decoration: none; } .TITLE a:active { color: #ffffff; text-decoration: none; } .TITLE a:visited { color: #ffffff; text-decoration: none; } H2 { COLOR: #ffffff ; font-style: italic; border: solid 3px #1d252b; background-color: #a3b1bc; PADDING: 0.5em; } TABLE.IMPORTANT { font-style:italic; border: solid 2px #ff0000; width: 70%; margin-left: 15%; } TABLE.CAUTION { font-style:italic; border: ridge 2px #ffff00; width: 70%; margin-left: 15%; } TABLE.NOTE { font-style:italic; border: solid 1px #000000; width: 70%; margin-left: 15%; } TABLE.TIP { font-style:italic; border: solid 1px #000000; width: 70%; margin-left: 15%; } TABLE.WARNING { font-style:italic; font-weight: bold; border: ridge 4px #ff0000; width: 70%; margin-left: 15%; } DIV.VARIABLELIST { font-family: sans-serif; font-style: normal; font-weight: normal; padding-left: 20px; font-size: small; } .VARLISTENTRY { font-weight: bold; margin-top: 10px; color: #ffffff ; background-color: #e8ecf2; border: solid 1px #a3b1bc; padding: 1px } /* * See http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html * for an explanation of the following few commands. * They are really too complicated to explain here in all depth. ;-) */ P { font-size: 12px; } /* A{ color: maroon; } A:visited { color: darkgreen; } */ BODY P { /* font-size: x-small; */ voice-family: "\"}\""; voice-family: inherit; font-size: normal; } HTML>BODY P { font-size: normal; } /* */ /* Add an external-link icon to absolute links */ a[href^="http:"] { background: url(images/remote.png) right center no-repeat; padding-right: 12px; } a[href^="http:"]:hover { background: url(images/remote.png) right center no-repeat; } /* Add a note icon to footnote links */ a[href^="#FTN"] { background: url(images/qbullet-note.png) right center no-repeat; padding-right: 12px; } a[href^="#FTN"]:hover { background: url(images/qbullet-note.png) right center no-repeat; } /* ...and a back icon to the backlinks in the footnotes themselves */ a[name^="FTN"] { background: url(images/scrollup.png) right center no-repeat; padding-right: 12px; } a[name^="FTN"]:hover { background: url(images/scrollup.png) right center no-repeat; } /* Add a download icon to .gz links */ a[href$=".gz"],a[href$=".tar"],a[href$=".zip"] { background: url(images/disk.png) right center no-repeat; padding-right: 12px; } /* Add an Acrobat Reader icon to PDF links */ a[href$=".pdf"] { background: url(images/acrobat.png) right center no-repeat; padding-right: 12px; } a[href$=".pdf"]:hover { background: url(images/acrobat.png) right center no-repeat; } /* Add a Word icon to RTF links */ a[href$=".rtf"] { background: url(images/word.png) right center no-repeat; padding-right: 12px; } /* ...but not to absolute links in this domain... */ a[href^="http://www.karakas-online.de"] { background: transparent; padding-right: 0px; } a[href^="http://www.karakas-online.de"]:hover { background: transparent; } /* ...or to the translation links on each page */ DIV.translatelink > a[href^="http:"] { background: transparent; padding-right: 0px; } DIV.translatelink > a[href^="http:"]:hover { background: transparent; } /* ...or to any images */ DIV.imagelink a[href^="http:"] { background: transparent; padding-right: 0px; } DIV.imagelink a[href^="http:"]:hover { background: transparent; } P.C2 { COLOR: #ffffff ; BACKGROUND-color: #a0a0d0; BORDER: solid 1px #606090; PADDING: 1px } DIV.NAVFOOTER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-top: 10px; width: 100%; border: 2px solid #a3b1bc; } DIV.NUKEFOOTER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-top: 10px; width: 100%; border: thin solid #a3b1bc; } DIV.NAVHEADER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-bottom: 10px; width: 100%; border: 2px solid #a3b1bc; } DIV.SECT1,DIV.SECT2,DIV.SECT3 { margin-left: 20px; } DIV.EXAMPLE,DIV.TOC { border: thin dotted #4e5f6e; padding-left: 10px; padding-right: 10px; color: #000000; background-color: #e8ecf2; } DIV.EXAMPLE { border: thin dotted #22AA22; background-color: #EEE; } DIV.TOC { margin-left: 20px; margin-right: 20px; width: 95%; } UL { /* list-style: url("images/tux-bullet.png") disc; */ } .namespaces { border: 1px solid black; } .namespaces td { padding: 0.2em 1em; /* font-weight: bold; */ } .namespaces thead { background-color: #aaf; } .namespaces tr.init { background-color: #e88; } .namespaces tr.childinit { background-color: #eee; } .namespaces tr.processing { background-color: #e88; } .namespaces tr.childexit { background-color: #eee; } table.directives { border-collapse: collapse; } .directives thead { background-color: #bbf; font-size: 1em; text-decoration: none; } .directives thead td { padding: 8px; } .directives tbody tr > :first-child { background-color: #eee; padding-left: 2em; padding-right: 2em; text-align: left; } .directives tbody tr > :last-child { text-decoration: none; font-weight: normal; font-size: small; border-left: 1px solid black; text-align: left; } .directives tbody tr td { text-align: center; text-decoration: none; font-weight: normal; padding-left: 1em; padding-right: 1em; padding-bottom: 4px; padding-top: 4px; border-bottom: 1px solid black; } .note td { font-size: small; } li.listitem { font-size: small; } rivet-3.0.0/doc/html/raw_post.html000664 001750 001750 00000004567 15224455137 017676 0ustar00manghimanghi000000 000000 raw_post

Name

raw_post — get the unmodified body of a POST request sent by the client.

Synopsis

::rivet::raw_post

Description

Returns the raw POST data from the request. If the request was not a POST or there is no data, then "" - an empty string - is returned.

rivet-3.0.0/doc/xml/form.xml000664 001750 001750 00000066200 15224454746 016470 0ustar00manghimanghi000000 000000
Form: An HTML Form Fields Generation Utility
Introduction The form package is a utility for generating html forms. A form object command saves the programmer from typing the cumbersome html code of input elements, working out a solution for better standardization and readability of the code. form requires that only the minimum necessary to distinguish the element is typed, greatly simplyfing the development of forms. Options to the command are treated as a list of parameter-value pairs that become the defaults for the corresponding attributes of the form. A form object has specialized menthods to generate all of the standard input fields, i.e. text, password, hidden, generic button, submit or reset buttons and image. form creates select input fields, radiobutton and checkbox boolean options groups. Also new inputs introduced with HTML5 are supported: color, date, datetime, datetime-local, email, file, month, number, range, search, tel, time, url, week. Other input elements can be generated using the general purpose 'field' method.
form a Tcl command object for creating HTML forms form form_name -option1 value_1 -option2 value_2 ... creates and returns a new Tcl command named . Options -method post|get The http method for sending the form data back to the server. Possible values are get or post -name form_name a name for the form being created: this value becomes the value of the attribute 'name' in the <form> tag. -defaults default_values an array of default values to be assigned to the fields of the form. Every name in the array is matched with an input field, when a given field gets added to the form it is initialized with the value of the corresponding variable in the array. This option works well in conjuction with the load_response command of Rivet when default values come from another form. -emit true(default)|false a Tcl accepted representation of a Boolean value. Change a form object instance behavior so that methods generating HTML form entries return to the caller their output as string instead of directly sending it to stdout -action URL The URL the data are being sent to. If no -action switch is specified the data are sent to the form's URL. Form Object Commands Form object commands follow the usual syntax of Tcl commands with a subcommand argument playing the role of a switch among various functionalities of the command. Form objects also need the name parameter which is to become the value of the 'name' attribute in an input field. This argument is the key that has to be used by the server-side script to retrieve the input field value. form_object subcommand name -option1 value1 -option2 value2 ... Options passed to a subcommand are copied into the tag as attribute="value" pairs. Some subcommands (e.g. form, radiobuttons and checkboxes) treat specific options in a way that fits the specific organization and function of these fields. Exceptions to this general syntax are the field and end subcommands. field is an abstract input field creation method and requires an additional parameter specifiyng the type of field to create. Every concrete input field generation command uses this subcommand internally to print the final html. Subcommands start name -method get | post -name form_name -defaults default_values -action URL args Print the <form> tag with all its attributes. This command must be called as first in the form generation process. The following is a sample of code creating a form named 'formname' whose data will be sent via the GET method. Initial form fields values will be obtained from array response form myform -defaults response -method get -name formname myform start myform text text_entry -size 20 myform select option_selected -values {opt1 opt2 opt3 opt4} myform submit submit -value Search myform end The code prints a form that sends a text entry content and the option value associated with a radiobutton. The URL of the server script is the same that created the form. Use the -url option to specify a different url. Options -method post|get The method to be used to encode the form data. Possible values are get or post -name form_name a name for the form being generated: this value becomes the value of the attribute 'name' in the <form> tag. -defaults default_values an array of default values to be assigned to the fields of the form. Every name in the array is matched with an input field, when a given field gets added to the form it is initialized with the value of the corresponding variable in the array. This option works well in conjuction with the load_response command of Rivet when default values come from another form. -action URL The URL the data will be sent to. If no -action switch is specified the data are sent to the form's URL. end Print the </form> closing tag. This command must be called last in the form generation process field name type args Print a field of the given type and name, including any default key-value pairs defined for this field type and optional key-value pairs included with the statement Options -opt1 val1 Option description radiobuttons name -values values -labels labels args the radiobutton creates a whole radiobutton group with the values and labels specified in the argument list. If no -labels switch is passed to the subcommand the values are printed as labels of the radiobutton. Options -values values_list List of values associated with the radiobuttons to be displayed -labels labels_list List of labels to be printed with every radiobutton. There must be a label for every radiobutton Example: form myform -defaults response -method get -name formname myform start myform text text_entry -size 20 myform radiobuttons fruit -values {big medium small} \ -labels {Watermelon Orange Strawberry} \ -class myradiobclass myform submit submit -value Search myform end will print the following HTML code. <input type="radio" name="fruit" class="myradiobclass" value="big" />Watermelon <input type="radio" name="fruit" class="myradiobclass" value="medium" />Orange <input type="radio" name="fruit" class="myradiobclass" value="small" />Strawberry if the response array has a variable for the name 'fruit' the corresponding radiobutton field is automatically checked. The options values and labels are used internally and don't get into the tag attributes. If a labels option is not given, labels are assigned using the values list. checkbox name -label label -value value args The checkbox subcommand emits a checkbox type input field with the name, label and value attributes set according to the parameters passed to the subcommand. Example: form myform -defaults response -method get -name formname -action <form_url> myform start myform checkbox options -value opt1 -label "Option 1" myform checkbox options -value opt2 -label "Option 2" myform checkbox options -value opt3 -label "Option 3" myform checkbox options -value opt4 -label "Option 4" myform submit save_tps -value "Send Options" myform end myform destroy Provided opt2 was in response array (in the list valued 'options' variable) that initialized the form, the output would look like this <form action="<form_url>" method="get" name="formname"> <input type="checkbox" name="options" id="autogen_1" label="Option 1" value="sopt1" /><label for="autogen_1">Option 1</label> <input type="checkbox" name="options" id="autogen_2" label="Option 2" value="sopt2" /><label for="autogen_2">Option 2</label> <input type="checkbox" name="options" id="autogen_3" label="Option 3" value="sopt3" /><label for="autogen_3">Option 3</label> <input type="checkbox" name="options" id="autogen_4" label="Option 4" value="sopt4" /><label for="autogen_4">Option 4</label> <input type="submit" name="submit" value="Send" /> </form> checkboxes name -labels labels_list -values values_list args The checkboxes is an extended form of the checkbox subcommand. checkboxes prints as many checkboxes as the number of elements in the labels_list argument Options -values values_list List of values associated with the checkboxes to be displayed -labels labels_list List of labels to be printed with every checkbox. There must be a label for every checkbox Example: form myform -defaults response -method post -action <form_url> myform start myform checkboxes options -values {opt1 opt2 opt3 opt4} -labels {"Option 1" "Option 2" "Option 3" "Option 4"} myform submit save_tps -value "Send Options" myform end myform destroy will print the following HTML code <form action="<form_url>" method="post"> <input type="checkbox" name="options" id="autogen_1" label="Option 1" value="opt1" /><label for="autogen_1">Option 1</label> <input type="checkbox" name="options" id="autogen_2" label="Option 2" value="opt2" /><label for="autogen_2">Option 2</label> <input type="checkbox" name="options" id="autogen_3" label="Option 3" value="opt3" /><label for="autogen_3">Option 3</label> <input type="checkbox" name="options" id="autogen_4" label="Option 4" value="opt4" /><label for="autogen_4">Option 4</label> <input type="submit" name="save_tps" value="Send Options" /> </form> password name args Same as text, but the input is obfuscated so as not to reveal the text being typed hidden name args hidden input element: typicall embedded in a form in order to pass status variables. submit name args emits the code for a classical HTML submit button. Example: the following code form myform -defaults response -method get -name feedsearch myform start myform submit submit -value Search Would emit a form like this <form...> <input type="submit" name="submit" value="Search" /> </form> button name args emits the code for a button field having name as name reset name args Classical HTML reset button that resets the input fields back to their initial values image name args Emits an image input field radio name args Emits a radiobutton input field color name args Emits an HTML 5 "color" form field date name args Emits an HTML 5 "date" form field datetime name args Emits an HTML 5 "datetime" form field datetime_local name args Emits an HTML 5 "datetime_local" form field email name args Emits an HTML 5 "email" form field file name args Emits an HTML 5 "file" form field month name args Emits an HTML 5 "month" form field number name args Emits an HTML 5 "number" form field range name args Emits an HTML 5 "range" form field search name args Emits an HTML 5 "search" form field tel name args Emits an HTML 5 "tel" form field time name args Emits an HTML 5 "time" form field url name args Emits an HTML 5 "url" form field week name args Emits an HTML 5 "week" form field
rivet-3.0.0/tests/binaryscope.tcl000664 001750 001750 00000001642 15224454746 017621 0ustar00manghimanghi000000 000000 ::rivet::headers type "application/octet-stream" set before [list \ [fconfigure stdout -translation] \ [fconfigure stdout -encoding] \ [fconfigure stdout -eofchar]] ::rivet::with_binary_output { puts -nonewline stdout [binary format H* 00ff] } ::rivet::write_binary [binary format H* fe01] set afterSuccess [list \ [fconfigure stdout -translation] \ [fconfigure stdout -encoding] \ [fconfigure stdout -eofchar]] catch {::rivet::with_binary_output {error expected}} message set returnCode [catch { ::rivet::with_binary_output {return returned} } returnMessage] set afterError [list \ [fconfigure stdout -translation] \ [fconfigure stdout -encoding] \ [fconfigure stdout -eofchar]] puts -nonewline stdout [expr { $before eq $afterSuccess && $before eq $afterError && $message eq "expected" && $returnCode == 2 && $returnMessage eq "returned" ? "OK" : "BAD" }] rivet-3.0.0/doc/examples/vars.rvt000664 001750 001750 00000002317 15224454746 017530 0ustar00manghimanghi000000 000000 $err " } } else { puts "Thanks for the information!" ?>
Title:
Boss:
Salary:
Skills:
rivet-3.0.0/doc/html/installation.html000664 001750 001750 00000041364 15224455137 020535 0ustar00manghimanghi000000 000000 Apache Rivet 3.3 Installation

Apache Rivet 3.3 Installation

Rivet 3.3 runs with the Apache 2.4.x HTTP web server. It is known to build and run on various Linux distributions (Debian & Ubuntu, Redhat, SuSE and CentOS), FreeBSD and OpenBSD. For some of these Unix-like operative systems binary packages are already available for download.

Rivet 2.x was restricted to work with the prefork MPM of the Apache HTTP webserver. MPM modules are fundamental components of the webserver architecture. They provide multiple implementations of multiprocessing in order to better suit specific OS features and scalability requirements. The prefork MPM exploited the UNIX traditional approach to multiprocess server applications based on the fork system call. This model has several limitations but also some advantages. The solution we adopted tries to attain the best from any MPM as much as possible and Rivet 3.3 is now able to run with the worker and the event MPMs. Rivet 3.3 has not been ported to OS of the Windows family but we feel that the current design would fit just fine with the Windows specific MPMs such as winnt.

If you need to build Apache Rivet yourself this is the procedure to follow

  1. Building Tcl: requirements

    Installing Rivet is about endowing the Apache HTTP webserver with the ability of running scripts written with the Tcl programming language. Therefore the Tcl language with its runtime, development libraries and shell (≥8.5.10 required, ≥8.6.0 recommended) have to be installed. Building Rivet you will have to tell the scripts where the Tcl libraries are located via the --with-tcl option of the configure script (see below).

    Several Tcl packages shipped with rivet need also the Itcl OOP extension of Tcl. If you need to run any of the Session or DIO packages you need to install this language extension but you don't need it to build mod_rivet

    The Apache HTTP Webserver development files and libraries are required along with the Apache Portable Runtime and the libapreq library.

  2. Building Rivet

  3. Getting and Installing the Apache Sources

    You can build Rivet either statically (compiled into the Apache web server) or dynamically (as a loadable shared library). We recommend that you build Rivet as a shared library, for maximum flexibility. We will tell Rivet where it the Apache development files and libraries are located via the --with-apxs option to configure (see below).

    Most modern Unix OS (Linux and FreeBSD systems included) come with their own packages of the Apache Web Server executables, runtime libraries and development files and libraries. Check the documentation of the package manager of your OS to find out how to install this software

  4. Uncompress Sources

    Download the sources at http://tcl.apache.org/rivet/html/download.html.

    We will assume that you have Apache installed at this point. You must uncompress the Rivet sources in the directory where you wish to compile them.

    gunzip rivet-3.3.0.tar.gz
    tar -xvf rivet-3.3.0.tar.gz

  5. Building Rivet

    1. Rivet uses the standard ./configure ; make ; make install sequence which installs to their target directories the Apache module, the binary libraries and the Tcl code

      There are several rivet specific options to configure that might be useful (or needed):

      --with-apache
      Defines the configure internal variable 'apache_base'. This variable points to the root of the Apache web server directory hierarchy
      --with-tcl
      This points to the directory where the tclConfig.sh file is located.
      --with-tclsh
      This points to the location of the tclsh executable.
      --with-apxs
      The location of the apxs program that provides information about the configuration and compilation options of Apache modules.
      --with-apache-include[=DIR]
      Locates the Apache include files on your computer, if they're not in standard directory.
      --enable-version-display=[yes|no]
      This option enables Rivet to display its version in the logfiles when Apache is started. The default is to keep the Rivet version hidden.
      --with-rivet-target-dir=DIR
      This option is for fine tuning of the installation final directories. Rivet Tcl packages, commands and loadable libraries go into the same directory hierarchy (by default is ${apache_base}/lib/rivet${PACKAGE_VERSION}, where $apache_base takes the value set by --with-apache)
      --with-upload-dir=DIR
      Configures Rivet's default upload directory. It can be overridden in the configuration either globally or specifically for a virtual host
      --with-post-max=BYTES
      The value to this option establishes a default for the maximum size of POST data. Default: 0 (unlimited size)
      --enable-head-requests
      By default HEAD requests don't go through the usual request processing which leads to script execution and therefore resource consumption and Rivet returns a standard hardcoded HTML header to save CPU time. --enable-head-requests can change the default.
      --enable-rivet-commands-export
      By default Rivet's commands are put on the export list of the ::rivet namespace. With this option you may prevent it thus forcing the programmers to fully qualify in their code. By default this option is enabled and it can be changed in the configuration with the directive ExportRivetNS. Disabling this option can be also reverted to 'On' with the --enable-import-rivet-commands switch
      --enable-import-rivet-commands
      Rivet's namespace is by default imported into the global namespace. Enabling the import of Rivet's commands overrides the switch and forces --enable-rivet-commands-export=yes thus demanding the commands to be exported (otherwise it would generate errors at run-time). This option is disabled by default and it can be changed in the configuration with the ImportRivetNS directive
      --enable-rivet-debug-build
      Enable definition of the preprocessor symbol RIVET_DEBUG_BUILD. This is used to conditionally include code into the build for development and debugging purposes
      --enable-virtual-interps-separation
      This option changes the default for the SeparateVirtualInterps configuration variable. Default: 0 (no separation among interpreters)

      Example: configuring the build system to compile Rivet for an Apache HTTP server custom installation, using tcl8.6. In this specific case the determination of the apxs path is redundant and it could be omitted since it could be inferred from the --with-apache option value

      ./configure --with-tcl=/usr/lib/tcl8.6/ --with-tclsh=/usr/bin/tclsh8.6 \
      	    --with-apxs=/usr/local/apache2/bin/apxs --with-apache=/usr/local/apache2 \
      	    --with-rivetlib-target-dir=/usr/local/apache2/rivet3.3
    2. Run make

      At this point, you are ready to run make, which should run to completion without any errors (a warning or two is OK, generally).

    3. Install

      Now, you are ready to run the

      make install

      to install the resulting files. The install target actually fires the install-binaries and install-packages targets which in turn copy the binary modules and Tcl packages to their destination directories. This commands create a functional Rivet environment with its core language.

  6. Apache Configuration Files

    Rivet is relatively easy to configure - we start off by adding the module itself:

    LoadModule rivet_module	/usr/lib/apache2/modules/mod_rivet.so

    This tells Apache to load the Rivet shared object, wherever it happens to reside on your file system. Now we have to tell Apache what kind of files are "Rivet" files and how to process them:

    AddType application/x-httpd-rivet rvt
    AddType application/x-rivet-tcl tcl

    These tell Apache to process files with the .rvt and .tcl extensions as Rivet files.

    The characters encoding can be changed using the header type command, but you can also change the default charset for the whole site:

    AddType 'application/x-httpd-rivet;charset=utf-8' rvt

    All the pages generated by Rivet on this site will be sent with a Content-Type:'text/html;charset=utf-8' header.

    You may also wish to use Rivet files as index files for directories. In that case, you would do the following:

    DirectoryIndex index.html index.htm index.shtml index.cgi index.tcl index.rvt

    For other directives that Rivet provides for Apache configuration, please see the section called “Apache Rivet 3.3 Configuration”.

rivet-3.0.0/doc/html/abort_page.html000664 001750 001750 00000010140 15224455137 020123 0ustar00manghimanghi000000 000000 abort_page

Name

abort_page — Stops outputting data to web page, similar in purpose to PHP's die command.

Synopsis

::rivet::abort_page (abort code | -aborting)

Description

This command flushes the output buffer and stops the Tcl script from sending any more data to the client. A normal Tcl script might use the exit command, but that cannot be used in Rivet without actually exiting the apache child process! abort_page triggers the execution of an optional AbortScript that has to be specified in the configuration. The value of the argument ?abort code? can be retrieved with the abort_code command during the execution of AbortScript or AfterEveryScript, allowing the script to take appropriate actions in order to deal with the cause of the abort.

The argument -aborting causes abort_page to return 1 when the current execution is the outcome of an abort condition. In other words this query is meaningful in code specified as AfterEveryScript to understand if an abort condition took place beforehand.

rivet-3.0.0/tests/mime.types000664 001750 001750 00000030042 15224454746 016610 0ustar00manghimanghi000000 000000 # This is a comment. I love comments. # This file controls what Internet media types are sent to the client for # given file extension(s). Sending the correct media type to the client # is important so they know how to handle the content of the file. # Extra types can either be added here or by using an AddType directive # in your config files. For more information about Internet media types, # please read RFC 2045, 2046, 2047, 2048, and 2077. The Internet media type # registry is at . # MIME type Extension application/EDI-Consent application/EDI-X12 application/EDIFACT application/activemessage application/andrew-inset ez application/applefile application/atomicmail application/batch-SMTP application/beep+xml application/cals-1840 application/commonground application/cybercash application/dca-rft application/dec-dx application/dvcs application/eshop application/http application/hyperstudio application/iges application/index application/index.cmd application/index.obj application/index.response application/index.vnd application/iotp application/ipp application/isup application/font-tdpfr application/mac-binhex40 hqx application/mac-compactpro cpt application/macwriteii application/marc application/mathematica application/mathematica-old application/msword doc application/news-message-id application/news-transmission application/ocsp-request application/ocsp-response application/octet-stream bin dms lha lzh exe class so dll application/oda oda application/parityfec application/pdf pdf application/pgp-encrypted application/pgp-keys application/pgp-signature application/pkcs10 application/pkcs7-mime application/pkcs7-signature application/pkix-cert application/pkix-crl application/pkixcmp application/postscript ai eps ps application/prs.alvestrand.titrax-sheet application/prs.cww application/prs.nprend application/qsig application/remote-printing application/riscos application/rtf application/sdp application/set-payment application/set-payment-initiation application/set-registration application/set-registration-initiation application/sgml application/sgml-open-catalog application/sieve application/slate application/smil smi smil application/timestamp-query application/timestamp-reply application/vemmi application/vnd.3M.Post-it-Notes application/vnd.FloGraphIt application/vnd.accpac.simply.aso application/vnd.accpac.simply.imp application/vnd.acucobol application/vnd.aether.imp application/vnd.anser-web-certificate-issue-initiation application/vnd.anser-web-funds-transfer-initiation application/vnd.audiograph application/vnd.businessobjects application/vnd.bmi application/vnd.canon-cpdl application/vnd.canon-lips application/vnd.claymore application/vnd.commerce-battelle application/vnd.commonspace application/vnd.comsocaller application/vnd.contact.cmsg application/vnd.cosmocaller application/vnd.cups-postscript application/vnd.cups-raster application/vnd.cups-raw application/vnd.ctc-posml application/vnd.cybank application/vnd.dna application/vnd.dpgraph application/vnd.dxr application/vnd.ecdis-update application/vnd.ecowin.chart application/vnd.ecowin.filerequest application/vnd.ecowin.fileupdate application/vnd.ecowin.series application/vnd.ecowin.seriesrequest application/vnd.ecowin.seriesupdate application/vnd.enliven application/vnd.epson.esf application/vnd.epson.msf application/vnd.epson.quickanime application/vnd.epson.salt application/vnd.epson.ssf application/vnd.ericsson.quickcall application/vnd.eudora.data application/vnd.fdf application/vnd.ffsns application/vnd.framemaker application/vnd.fsc.weblaunch application/vnd.fujitsu.oasys application/vnd.fujitsu.oasys2 application/vnd.fujitsu.oasys3 application/vnd.fujitsu.oasysgp application/vnd.fujitsu.oasysprs application/vnd.fujixerox.ddd application/vnd.fujixerox.docuworks application/vnd.fujixerox.docuworks.binder application/vnd.fut-misnet application/vnd.grafeq application/vnd.groove-account application/vnd.groove-identity-message application/vnd.groove-injector application/vnd.groove-tool-message application/vnd.groove-tool-template application/vnd.groove-vcard application/vnd.hhe.lesson-player application/vnd.hp-HPGL application/vnd.hp-PCL application/vnd.hp-PCLXL application/vnd.hp-hpid application/vnd.hp-hps application/vnd.httphone application/vnd.hzn-3d-crossword application/vnd.ibm.afplinedata application/vnd.ibm.MiniPay application/vnd.ibm.modcap application/vnd.informix-visionary application/vnd.intercon.formnet application/vnd.intertrust.digibox application/vnd.intertrust.nncp application/vnd.intu.qbo application/vnd.intu.qfx application/vnd.irepository.package+xml application/vnd.is-xpr application/vnd.japannet-directory-service application/vnd.japannet-jpnstore-wakeup application/vnd.japannet-payment-wakeup application/vnd.japannet-registration application/vnd.japannet-registration-wakeup application/vnd.japannet-setstore-wakeup application/vnd.japannet-verification application/vnd.japannet-verification-wakeup application/vnd.koan application/vnd.lotus-1-2-3 application/vnd.lotus-approach application/vnd.lotus-freelance application/vnd.lotus-notes application/vnd.lotus-organizer application/vnd.lotus-screencam application/vnd.lotus-wordpro application/vnd.mcd application/vnd.mediastation.cdkey application/vnd.meridian-slingshot application/vnd.mif mif application/vnd.minisoft-hp3000-save application/vnd.mitsubishi.misty-guard.trustweb application/vnd.mobius.daf application/vnd.mobius.dis application/vnd.mobius.msl application/vnd.mobius.plc application/vnd.mobius.txf application/vnd.motorola.flexsuite application/vnd.motorola.flexsuite.adsi application/vnd.motorola.flexsuite.fis application/vnd.motorola.flexsuite.gotap application/vnd.motorola.flexsuite.kmr application/vnd.motorola.flexsuite.ttc application/vnd.motorola.flexsuite.wem application/vnd.mozilla.xul+xml application/vnd.ms-artgalry application/vnd.ms-asf application/vnd.ms-excel xls application/vnd.ms-lrm application/vnd.ms-powerpoint ppt application/vnd.ms-project application/vnd.ms-tnef application/vnd.ms-works application/vnd.mseq application/vnd.msign application/vnd.music-niff application/vnd.musician application/vnd.netfpx application/vnd.noblenet-directory application/vnd.noblenet-sealer application/vnd.noblenet-web application/vnd.novadigm.EDM application/vnd.novadigm.EDX application/vnd.novadigm.EXT application/vnd.osa.netdeploy application/vnd.palm application/vnd.pg.format application/vnd.pg.osasli application/vnd.powerbuilder6 application/vnd.powerbuilder6-s application/vnd.powerbuilder7 application/vnd.powerbuilder7-s application/vnd.powerbuilder75 application/vnd.powerbuilder75-s application/vnd.previewsystems.box application/vnd.publishare-delta-tree application/vnd.pvi.ptid1 application/vnd.pwg-xhtml-print+xml application/vnd.rapid application/vnd.s3sms application/vnd.seemail application/vnd.shana.informed.formdata application/vnd.shana.informed.formtemplate application/vnd.shana.informed.interchange application/vnd.shana.informed.package application/vnd.sss-cod application/vnd.sss-dtf application/vnd.sss-ntf application/vnd.street-stream application/vnd.svd application/vnd.swiftview-ics application/vnd.triscape.mxs application/vnd.trueapp application/vnd.truedoc application/vnd.tve-trigger application/vnd.ufdl application/vnd.uplanet.alert application/vnd.uplanet.alert-wbxml application/vnd.uplanet.bearer-choice-wbxml application/vnd.uplanet.bearer-choice application/vnd.uplanet.cacheop application/vnd.uplanet.cacheop-wbxml application/vnd.uplanet.channel application/vnd.uplanet.channel-wbxml application/vnd.uplanet.list application/vnd.uplanet.list-wbxml application/vnd.uplanet.listcmd application/vnd.uplanet.listcmd-wbxml application/vnd.uplanet.signal application/vnd.vcx application/vnd.vectorworks application/vnd.vidsoft.vidconference application/vnd.visio application/vnd.vividence.scriptfile application/vnd.wap.sic application/vnd.wap.slc application/vnd.wap.wbxml wbxml application/vnd.wap.wmlc wmlc application/vnd.wap.wmlscriptc wmlsc application/vnd.webturbo application/vnd.wrq-hp3000-labelled application/vnd.wt.stf application/vnd.xara application/vnd.xfdl application/vnd.yellowriver-custom-menu application/whoispp-query application/whoispp-response application/wita application/wordperfect5.1 application/x-bcpio bcpio application/x-cdlink vcd application/x-chess-pgn pgn application/x-compress application/x-cpio cpio application/x-csh csh application/x-director dcr dir dxr application/x-dvi dvi application/x-futuresplash spl application/x-gtar gtar application/x-gzip application/x-hdf hdf application/x-javascript js application/x-koan skp skd skt skm application/x-latex latex application/x-netcdf nc cdf application/x-sh sh application/x-shar shar application/x-shockwave-flash swf application/x-stuffit sit application/x-sv4cpio sv4cpio application/x-sv4crc sv4crc application/x-tar tar application/x-tcl tcl application/x-tex tex application/x-texinfo texinfo texi application/x-troff t tr roff application/x-troff-man man application/x-troff-me me application/x-troff-ms ms application/x-ustar ustar application/x-wais-source src application/x400-bp application/xml application/xml-dtd application/xml-external-parsed-entity application/zip zip audio/32kadpcm audio/basic au snd audio/g.722.1 audio/l16 audio/midi mid midi kar audio/mp4a-latm audio/mpa-robust audio/mpeg mpga mp2 mp3 audio/parityfec audio/prs.sid audio/telephone-event audio/tone audio/vnd.cisco.nse audio/vnd.cns.anp1 audio/vnd.cns.inf1 audio/vnd.digital-winds audio/vnd.everad.plj audio/vnd.lucent.voice audio/vnd.nortel.vbk audio/vnd.nuera.ecelp4800 audio/vnd.nuera.ecelp7470 audio/vnd.nuera.ecelp9600 audio/vnd.octel.sbc audio/vnd.qcelp audio/vnd.rhetorex.32kadpcm audio/vnd.vmx.cvsd audio/x-aiff aif aiff aifc audio/x-mpegurl m3u audio/x-pn-realaudio ram rm audio/x-pn-realaudio-plugin rpm audio/x-realaudio ra audio/x-wav wav chemical/x-pdb pdb chemical/x-xyz xyz image/bmp bmp image/cgm image/g3fax image/gif gif image/ief ief image/jpeg jpeg jpg jpe image/naplps image/png png image/prs.btif image/prs.pti image/tiff tiff tif image/vnd.cns.inf2 image/vnd.dwg image/vnd.dxf image/vnd.fastbidsheet image/vnd.fpx image/vnd.fst image/vnd.fujixerox.edmics-mmr image/vnd.fujixerox.edmics-rlc image/vnd.mix image/vnd.net-fpx image/vnd.svf image/vnd.wap.wbmp wbmp image/vnd.xiff image/x-cmu-raster ras image/x-portable-anymap pnm image/x-portable-bitmap pbm image/x-portable-graymap pgm image/x-portable-pixmap ppm image/x-rgb rgb image/x-xbitmap xbm image/x-xpixmap xpm image/x-xwindowdump xwd message/delivery-status message/disposition-notification message/external-body message/http message/news message/partial message/rfc822 message/s-http model/iges igs iges model/mesh msh mesh silo model/vnd.dwf model/vnd.flatland.3dml model/vnd.gdl model/vnd.gs-gdl model/vnd.gtw model/vnd.mts model/vnd.vtu model/vrml wrl vrml multipart/alternative multipart/appledouble multipart/byteranges multipart/digest multipart/encrypted multipart/form-data multipart/header-set multipart/mixed multipart/parallel multipart/related multipart/report multipart/signed multipart/voice-message text/calendar text/css css text/directory text/enriched text/html html htm text/parityfec text/plain asc txt text/prs.lines.tag text/rfc822-headers text/richtext rtx text/rtf rtf text/sgml sgml sgm text/tab-separated-values tsv text/t140 text/uri-list text/vnd.DMClientScript text/vnd.IPTC.NITF text/vnd.IPTC.NewsML text/vnd.abc text/vnd.curl text/vnd.flatland.3dml text/vnd.fly text/vnd.fmi.flexstor text/vnd.in3d.3dml text/vnd.in3d.spot text/vnd.latex-z text/vnd.motorola.reflex text/vnd.ms-mediapackage text/vnd.wap.si text/vnd.wap.sl text/vnd.wap.wml wml text/vnd.wap.wmlscript wmls text/x-setext etx text/xml xml xsl text/xml-external-parsed-entity video/mp4v-es video/mpeg mpeg mpg mpe video/parityfec video/pointer video/quicktime qt mov video/vnd.fvt video/vnd.motorola.video video/vnd.motorola.videop video/vnd.mpegurl mxu video/vnd.mts video/vnd.nokia.interleaved-multimedia video/vnd.vivo video/x-msvideo avi video/x-sgi-movie movie x-conference/x-cooltalk ice rivet-3.0.0/src/mod_rivet_ng/rivet_types.h000664 001750 001750 00000005756 15224454746 021440 0ustar00manghimanghi000000 000000 /* -- rivet_types.h: this file should collect all the basic types used * in mod_rivet and other related code */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #ifndef __rivet_types_h__ #define __rivet_types_h__ #include #include #ifndef TCL_SIZE_MAX # define Tcl_GetSizeIntFromObj Tcl_GetIntFromObj # define TCL_SIZE_MAX INT_MAX # ifndef Tcl_Size typedef int Tcl_Size; # endif # define TCL_SIZE_MODIFIER "" #endif /* Definition suggested in * * https://www.gnu.org/software/autoconf/manual/autoconf-2.67/html_node/Particular-Headers.html * * in order to have a portable definition of the 'bool' data type */ #ifdef HAVE_STDBOOL_H # include #else # ifndef HAVE__BOOL # ifdef __cplusplus typedef bool _Bool; # else # define _Bool signed char # endif # endif # define bool _Bool # define false 0 # define true 1 # define __bool_true_false_are_defined 1 #endif typedef struct _ApacheRequest ApacheRequest; typedef struct _ApacheUpload ApacheUpload; typedef struct _ApacheUpload { ApacheUpload* next; char* filename; char* name; char* tempname; apr_table_t* info; apr_file_t* fp; size_t size; ApacheRequest* req; } ApacheUpload; typedef struct _ApacheRequest { apr_table_t* parms; ApacheUpload* upload; int status; int parsed; int post_max; int disable_uploads; int (*upload_hook)(void *ptr, char *buf, int len, ApacheUpload *upload); void* hook_data; const char* temp_dir; char* raw_post; /* Raw post data. */ int raw_length; request_rec* r; int nargs; } ApacheRequest; typedef struct TclWebRequest { Tcl_Interp* interp; request_rec* req; ApacheRequest* apachereq; ApacheUpload* upload; int headers_printed; /* has the header been printed yet? */ int headers_set; /* has the header been set yet? */ int content_sent; unsigned int environment_set; /* have we setup the environment variables? */ char* charset; } TclWebRequest; #endif /* __rivet_types_h__ */ rivet-3.0.0/doc/html/images/home.png000644 001750 001750 00000012704 15224455140 020035 0ustar00manghimanghi000000 000000 PNG  IHDRd?m`bKGD pHYs  ~tIME*!@0\tEXtCommentCreated with GIMPW,IDATx{]W}?u+Yz_ݫ7u' O'!$`4ctqIqMIH&'i<ʤ(48< cK˲d!eْ㜳>>}JQs9{}Z}:tȾpcǎ\-[p7k.n*3,Ǿ}lk9 =qkﰇz.;^ eϖ/_>mcj5?l/r;D{?nf{<nwtR2Q}MOًضm۔;3&҉KҥKѣ/XP?|}QDY=|u׾6}&),3gp}he/7 t$`R]0\Z|&f AJHIK_ ֭geh8%a6iFʔAOH+)g>c ti8>p-z;Ysꫦj¶׾/(1FsԒ6% bdjQ{#  PR$SOr?}3$Ko}]}풦)p4\*Q)J-IM*jxp$i!>{o~ 8DnlZ}~s _}wI =uY{Y5yg7,ԉEpx`t,XXcٻ~cY:s} M>79Đ\I "`3c-[eZ@),xNwpsj+?,~;6-|l gss \mی/4;h!AtX85cojq&vg7BeKmpx.<;3raP7?jɩ3}{;z4AeeC r CY_`>>/_oHW7!h!"ƲY3z"#q#n->iE"9ꌦӿ[&v\1U+i`wwODɁ?Wt MgV"cĴfL %Sݲ#AsIB!sGDy_O"{eIR3 gTكf~!9PR8I7/}GEqPޠn)D+̇2A|l ,œH}49tV.EmCD5>Q`\X\!Yw=j!缇 #p[}RY{۪obN u#@&xih<}ԚǏRٺ H%jF4(K:Z镯7a04;e* Y#ԉ`P2Ox}>$NPs9 +wT|-T -qVUTĻ)%:Ap0W \D@SϫؙI!Sq-d>|)$$lRDՃAAM)xɬQU.zؙð{i{eFr|Gl9ܻ\h̉tT^"m;"D _@sV"M* ~;_2߂Paͽ_'3l%gb+*EzTvS۰μ;I~)a?S\uˉVc^DĚB1Í :N o`ʋFK]<*7Ozvvb9)zY7hK,X@B2cn\"ruǏ`I1wy~Æ$\* Fǧ9W]u\rd?r !X/r32t,)B3Gyj- ez#wI> GjZ$1*'>B;Jk 8p[pZ.41aJ&=7SYꕲ1 '%dDҽ7P#|. Jڵ׏q" \4);ϰΒ䔜qc[R!@,,Y%;#-_Oy9߿ƹRLsA. 248rAd8j$F:$4#P,VyrH TᝫG3`6*j¼tj\3;S2YCbb)$*|gOp"xq 4k_l+@(d΍ύhDHTHqs"suk2W6Aŭu?i_#j7SKEx2^D9)Fu~*=57XYϯXEM?OtJB:G/YDժ 09/ ]۶_~[7>oO' T{4$łR陜&H-?b3*M+;t:^W{o=7͞~IJ._zë\OR s -P3\D݌ c@޿1ynV*('J. i=质,z!ZQ+i\ t!bdlWD&N*+>Os;zB.r=^;|0rycfo7/fFhG5b@H9a,H &>I11|mL$X&Q#RS%f99\0U,C\[z$Hy R6`Vz<6[-by,VkKcmd'-!sMbaS3 CAަJ/SbW< = 20000101L #define _stdopen _stdfdopen #endif extern Sfio_t* _stdopen _ARG_((int, const char*)); /*1999*/ #undef FILE #define FILE Sfio_t #undef fwrite #define fwrite(p,s,n,f) sfwrite((f),(p),(s)*(n)) #undef fseek #define fseek(f,a,b) sfseek((f),(a),(b)) #undef ap_pfdopen #define ap_pfdopen(p,q,r) _stdopen((q),(r)) #undef ap_pfclose #define ap_pfclose(p,q) sfclose(q) #endif /*SFIO*/ #ifndef strEQ #define strEQ(s1,s2) (!strcmp((s1),(s2))) #endif #ifndef strEQN #define strEQN(s1,s2,n) (!strncmp((s1),(s2),(n))) #endif #ifndef strcaseEQ #define strcaseEQ(s1,s2) (!strcasecmp((s1),(s2))) #endif #ifndef strncaseEQ #define strncaseEQ(s1,s2,n) (!strncasecmp((s1),(s2),(n))) #endif #define DEFAULT_TABLE_NELTS 10 #define DEFAULT_ENCTYPE "application/x-www-form-urlencoded" #define DEFAULT_ENCTYPE_LENGTH 33 #define MULTIPART_ENCTYPE "multipart/form-data" #define MULTIPART_ENCTYPE_LENGTH 19 #define TEXT_XML_ENCTYPE "text/xml" #define TEXT_XML_ENCTYPE_LENGTH 8 #ifdef __cplusplus extern "C" { #endif ApacheRequest* ApacheRequest_new(apr_pool_t *); ApacheRequest* ApacheRequest_init(ApacheRequest* req, request_rec *r); /* int ApacheRequest_save_post_data(request_rec *r, int flag); char *ApacheRequest_fetch_post_data(request_rec *r); */ int ApacheRequest_parse_multipart(ApacheRequest *req,const char* ct); int ApacheRequest_parse_urlencoded(ApacheRequest *req); char *ApacheRequest_script_name(ApacheRequest *req); char *ApacheRequest_script_path(ApacheRequest *req); const char *ApacheRequest_param(ApacheRequest *req, const char *key); apr_array_header_t *ApacheRequest_params(ApacheRequest *req, const char *key); char *ApacheRequest_params_as_string(ApacheRequest *req, const char *key); int ApacheRequest___parse(ApacheRequest *req); #define ApacheRequest_parse(req) \ ((req)->status = (req)->parsed ? (req)->status : ApacheRequest___parse(req)) apr_table_t *ApacheRequest_query_params(ApacheRequest *req, apr_pool_t *p); apr_table_t *ApacheRequest_post_params(ApacheRequest *req, apr_pool_t *p); apr_table_t *ApacheRequest_query_params(ApacheRequest *req, apr_pool_t *p); apr_table_t *ApacheRequest_post_params(ApacheRequest *req, apr_pool_t *p); apr_file_t *ApacheRequest_tmpfile(ApacheRequest *req, ApacheUpload *upload); ApacheUpload *ApacheUpload_new(ApacheRequest *req); ApacheUpload *ApacheUpload_find(ApacheUpload *upload, char *name); #define ApacheRequest_upload(req) \ (((req)->parsed || (ApacheRequest_parse(req) == OK)) ? (req)->upload : NULL) #define ApacheUpload_FILE(upload) ((upload)->fp) #define ApacheUpload_size(upload) ((upload)->size) #define ApacheUpload_info(upload, key) apr_table_get((upload)->info, (key)) #define ApacheUpload_type(upload) ApacheUpload_info((upload), "Content-Type") #define ApacheRequest_set_post_max(req, max) ((req)->post_max = (max)) #define ApacheRequest_set_temp_dir(req, dir) ((req)->temp_dir = (dir)) char *ApacheRequest_get_raw_post(ApacheRequest *req, int *len); char *ApacheUtil_expires(apr_pool_t *p, char *time_str, int type); #define EXPIRES_HTTP 1 #define EXPIRES_COOKIE 2 char *ApacheRequest_expires(ApacheRequest *req, char *time_str); #ifdef __cplusplus } #endif #define REQ_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, APR_EGENERAL, req->r #define REQ_INFO APLOG_MARK, APLOG_INFO, APR_EGENERAL, req->r #ifdef REQDEBUG #define REQ_DEBUG(a) (a) #else #define REQ_DEBUG(a) #endif #endif /* __apache_request_h__ */ rivet-3.0.0/rivet/rivet-tcl/rivet_command_document.tcl000664 001750 001750 00000003112 15224454746 023722 0ustar00manghimanghi000000 000000 ### ## ## rivet_command_document - Given a list of key-value pairs, emit HTML in ## to document a command -- required keys are "name", "package", ## "short" and "command". ## ## Optional keys are "command", "arguments", and "seealso" ## ## $Id$ ## ### namespace eval ::rivet { proc rivet_command_document {list} { array set info $list puts "" puts "$info(name) Documentation" puts "" puts "" puts "
" puts {} puts "$info(name) - $info(package)" puts "" puts "
" puts "" puts {Synopsis} puts " * " puts {Description} if {[info exists info(seealso)]} { puts " * " puts {See Also} } puts "" puts "
" puts {

Name

} puts "$info(name) - $info(short)" if {![info exists info(command)]} { set info(command) $info(name) } puts {

Synopsis

} puts "$info(command)" if {[info exists info(arguments)]} { puts "$info(arguments)" } puts {

Description

} puts $info(description) if {[info exists info(seealso)]} { puts {

See Also

} puts $info(seealso) } } } rivet-3.0.0/src/mod_rivet_ng/worker_prefork_common.h000664 001750 001750 00000002424 15224454746 023461 0ustar00manghimanghi000000 000000 /* -- worker_prefork_common.h */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #ifndef __worker_prefork_common_h__ #define __worker_prefork_common_h__ /* Thread specific data common to the worker and prefork bridges * Actually the prefork bridge won't use the keep_going flag, but * they share the same interpreters array */ typedef struct mpm_bridge_specific { int keep_going; /* thread loop controlling variable */ rivet_thread_interp** interps; } mpm_bridge_specific; #endif /* */ rivet-3.0.0/doc/xml/dio.xml000664 001750 001750 00000073467 15224454746 016315 0ustar00manghimanghi000000 000000
DIO - Database Interface Objects DIO Database Interface Objects ::DIO::handle interface objectName -option option -option option ... ::DIO::handle Tdbc interface objectName -option option -option option ... Description DIO is designed to be a generic, object-oriented interface to SQL databases. Its main goal is to be as generic as possible, but since not all SQL databases support the exact same syntaxes, keeping code generic between databases is left to the abilities of the programmer. DIO simply provides a way to keep the Tcl interface generic. - The name of the database interface. Currently supported direct interfaces are , , and . Starting with version 1.2 DIO supports also the TDBC DBMS driver series through the interface. In this form the command requires a further argument for one of the TDBC drivers. Avaliable TDBC drivers are: (supports also MariaDB), (provides also support for ), and If is specified, DIO creates an object of that name. If there is no given, DIO will automatically generate a unique object ID Options -host hostname The hostname of the computer to connect to. If none is given, DIO assumes the local host. -port portNumber The port number to connect to on . -user username The username you wish to login to the server as. -pass password The password to login to the server with. -db database The name of the database to connect to. -table tableName The default table to use when using built-in commands for storing and fetching. -keyfield keyFieldname The default field to use as the primary key when using built-in commands for storing and fetching. -autokey 1 0 If this option is set to 1, DIO will attempt to determine an automatic key for when storing and fetching. In most databases, this requires that the also be specified. In the case of MySQL, where sequences do not exist, autokey must be used in conjunction with a table which has a field specified as AUTO. -sequence sequenceName If DIO is automatically generating keys, it will use this sequence as a means to gain a unique number for the stored key. DIO Object Commands objectName array request Execute as a SQL query and create an array from the first record found. The array is set with the fields of the table and the values of the record found. objectName autokey value boolean Return the current autokey value. If is specified, it sets a new value for the autokey option. objectName close Close the current database connection. This command is automatically called when the DIO object is destroyed. objectName count Return a count of the number of rows in the specified (or current) table. objectName db value Return the current database. If is specified, it sets a new value for the database. In most cases, the DIO object will automatically connect to the new database when this option is changed. objectName delete key -option option ... Delete a record from the database where the primary key matches . objectName destroy Destroy the DIO object. objectName errorinfo value contains the value of the last error, if any, to occur while executing a request. When a request fails for any reason, this variable is filled with the error message from the SQL interface package. objectName exec request Execute as an SQL query. When the exec command is called, the query is executed, and a DIO result object is returned. From there, the result object can be used to obtain information about the query status and records in a generic way. See Result Object Commands objectName fetch key arrayName -option option ... Fetch a record from the database where the primary key matches and store the result in an array called . objectName forall request arrayName body Execute an SQL select and iteratively fill the array named with elements named with the matching field names, and values containing the matching values, repeatedly executing the specified code for each row returned. objectName host value Return the current host value. If is specified, it sets a new value for the host. objectName insert table arrayName -option option ... Insert fields from into the specified in the database. objectName interface Return the database interface type, such as Postgresql or Mysql. objectName keyfield value Return the current keyfield. If is specified, it sets a new value for the keyfield. can contain multiple key fields as a Tcl list, if the table has multiple key fields. objectName keys pattern -option option ... Return a list of keys in the database. If is specified, only the keys matching will be returned. objectName lastkey Return the last key that was used from . If sequence has not been specified, this command returns an empty string. objectName list request Execute as a SQL query and return a list of the first column of each record found. objectName makekey arrayName keyfield Given an array containing key-value pairs and an optional list of key fields (we use the object's keyfield if none is specified), if we're doing auto keys, create and return a new key, otherwise if it's a single key, just return its value from the array, else if there are multiple keys, return all the keys' values from the array as a list. objectName nextkey Increment and return the next key to be used. If sequence has not been specified, this command returns an empty string. objectName open Open the connection to the current database. This command is automatically called from any command which accesses the database. objectName pass value Return the current pass value. If is specified, it sets a new value for the password. objectName port value Return the current port value. If is specified, it sets a new value for the port. objectName quote string Return the specified quoted in a way that makes it acceptable as a value in a SQL statement. objectName search -option option ... Search the current table, or the specified table if -table tableName is specified, for rows matching one or more fields as key-value pairs, and return a query result handle. See Result Object Commands For example, set res [DIO search -table people -firstname Bob] objectName sequence value Return the current sequence value. If is specified, it sets a new value for the sequence. objectName store arrayName -option option ... Store the contents of in the database, where the keys are the field names and the array's values are the corresponding values. Do an SQL insert if the corresponding row doesn't exist, or an update if it does. The table name must have been previously set or specified with -table, and the key field(s) must have been previously set or specified with -keyfield. Please note that the store method has significantly higher overhead than the update or insert methods, so if you know you are inserting a row rather than updating one, it is advisable to use the insert method and, likewise, if you know you are updating rather than inserting, to use the update method. objectName string request Execute as a SQL query and return a string containing the first record found. objectName table value Return the current table. If is specified, it sets a new value for the table. objectName update arrayName -option option ... Updates the row matching the contents of in the database. The matching row must already exist. The table can have already been set or can be specified with -table, and the key field(s) must either have been set or specified with -keyfield. objectName user value Return the current user value. If is specified, it sets a new value for the user. Result Object Commands resultObj autocache value Return the current autocache value. If is specified, it sets a new value for autocache. If autocache is true, the result object will automatically cache rows as you use them. This means that the first time you execute a forall command, each row is being cached in the result object itself and will no longer need to access the SQL result. Default is true. resultObj cache Cache the results of the current SQL result in the result object itself. This means that even if the database connection is closed and all the results of the DIO object are lost, this result object will still maintain a cached copy of its records. resultObj errorcode value Return the current errorcode value. If is specified, it sets a new value for errorcode. contains the current code from the SQL database which specifies the result of the query statement which created this object. This variable can be used to determine the success or failure of a query. resultObj errorinfo value Return the current errorinfo value. If is specified, it sets a new value for errorinfo. If an error occurred during the SQL query, DIO attempts to set the value of to the resulting error message. resultObj fields value Return the current fields value. If is specified, it sets a new value for fields. contains the list of fields used in this query. The fields are in order of the fields retrieved for each row. resultObj forall -type varName body Execute over each record in the result object. Types: -array Create as an array where the indexes are the names of the fields in the table and the values are the values of the current row. -keyvalue Set to a list containing key-value pairs of fields and values from the current row. (-field value -field value) -list Set to a list that contains the values of the current row. resultObj next -type varName Retrieve the next record in the result object. Types: -array Create as an array where the indexes are the names of the fields in the table and the values are the values of the current row. -dict Set to a list containing ordinary key-value pairs of fields and values from the current row. This form is naturally intepreted as dictionary where each key corresponds to a column. The result representation produced by this option is naturally equivalent to the -keyvalue Set to a list containing key-value pairs of fields and values from the current row (-field value -field value). This form is handy to build query arguments for the search method of a DIO object -list Set to a list that contains the values of the current row. resultObj numrows value Return the current numrows value. If is specified, it sets a new value for numrows. is the number of rows in this result. resultObj resultid value Return the current resultid value. If is specified, it sets a new value for resultid. in most databases is the result pointer which was given us by the database. This variable is not generic and should not really be used, but it's there if you want it. resultObj rowid value Return the current rowid value. If is specified, it sets a new value for rowid. contains the number of the current result record in the result object. This variable should not really be accessed outside of the result object, but it's there if you want it.
rivet-3.0.0/doc/images/qbullet-note.png000664 001750 001750 00000000541 15224454746 020565 0ustar00manghimanghi000000 000000 PNG  IHDR [jgAMA asRGB cHRMz&u0`:pQ<PLTELzTTT8αtRNS@fbKGDH pHYsHHFk>-IDATc!% S@2i0Vr6d`PR4u``5(%tEXtdate:create2012-10-01T18:28:46+02:00^%tEXtdate:modify2004-02-19T05:50:41+01:00f IENDB`rivet-3.0.0/doc/examples-sgml/upload.rvt000664 001750 001750 00000000267 15224454746 021003 0ustar00manghimanghi000000 000000 <? ::rivet::upload save MyUpload /tmp/uploadfiles/file1 puts "Saved file [::rivet::upload filename MyUpload] \ ([::rivet::upload size MyUpload] bytes) to server" ?> rivet-3.0.0/doc/html/request.html000664 001750 001750 00000046653 15224455137 017532 0ustar00manghimanghi000000 000000 Apache Child Processes Lifecycle and Request Processing

Apache Child Processes Lifecycle and Request Processing

Apache Child Process Lifecycle

Apache Rivet devolves to the Multi-Processing Module (MPM) the task of managing the agents responding to network requests. An MPM is responsible for creating such agents during the start-up, and is in charge for terminating existing ones and recreating new agents when the workload is requiring it.

Apache Rivet 2.x supported only the prefork MPM which creates child processes as independent agents responding to network requests. Starting with 3.0 also the worker and event MPM are supported. The worker MPM is an hybrid model where forked child processes in turn create threads as real network agents. Also Apache on Windows© is now supported and tested with the winnt MPM, where a single process creates and manages a large number of thread agents.

Configuration parameters about this critical point can be read in the Apache documentation.

There are 4 stages in the lifetime of an Apache webserver that are relevant to Rivet:

  1. Server Initialization

    Apaches starts up as a single process. During this stage Apache performs various preliminary tasks including reading and parsing the configuration. After the configuration has been read Rivet sets up some internal resources and if a Tcl script is set as argument of a ServerInitScript directive the script is executed. Variables, arrays or dictionaries created during the execution of this script will be preserved and later replicated in the child process intepreters if the prefork MPM is loaded (which restricts this feature to the Unix systems). The prefork MPM creates new child processes with a fork() system call, which involves only in memory copy of sections of a process address space. Tcl is careful about reproducing an environment across a fork call in order to have a functional interpreter.
    Still, regardless the OS and loaded MPM ServerInitScript is a good place to do global initialization that doesn't involve creation of private data. Example of tasks that can be done in this context are IPC methods that must be initialized at this stage. With the prefork MPM also importing from namespaces and loading packages can be done here removing the burden from the child initialization stage.
  2. Child Process Initialization

    A child process calls the MPM bridge interface function to set up the Tcl run time environment,either creating multiple threads each running its Tcl interpreters or, in the case of the prefork MPM bridge, setting up the environment within a the child process itself as a single Tcl thread.
    This is the stage where most likely you want to open I/O channels, database connections or any other resource that has to be private to an interpreter and has to persist over a whole thread lifespan. When the option SeparateVirtualInterps is turned off child processes will have a single interpreter regardless the number of virtual hosts configured. The GlobalInitScript is the configuration script the child process will run once before getting ready to serve requests
    When SeparateVirtualInterps is turned on each configured virtual host will have its own slave interpreter which can will run the ChildInitScript directive as initialization script. The ChildInitScript has to be placed within a <VirtualHost...>...</VirtualHost ...> stanza to associate a script to a specific virtual host initialization. This scenario of interpreter separation is extremely useful to prevent resource conflicts when different virtual hosts are serving different web applications.
    [Note]Note
    GlobalInitScript has no effect to working interpreters when SeparateVirtualInterps is set.
    [Note]Note
    The lazy MPM bridge implements a model where every worker thread has exactly one interpreter and belongs to a single virtual host, therefore SeparateVirtualInterps is ignored and you can't share the same interpreter among virtual host
  3. Request Processing and Content Generation

    [Note]Note
    This section explain the default request handling procedure which was written to let Rivet 3.0 work as a drop in replacement of any 2.x module. For a in-depth understanding of the new request processing mechanics please read the request processing section of the manual
    After a child has been initialized it's ready to serve requests. A child process' lifetime is almost entirely spent in this phase, waiting for connections and responding to requests. At every request the URL goes through filter processing and, in case, rewritten (mod_rewrite, Alias directives, etc). Parameter values encoded in the request are made available to the environment and finally the script encoded in the URL is run. The developer can tell Rivet if optionally the execution has to be preceded by a BeforeScript and followed by an AfterScript. The real script mod_rivet will execute is the result of the concatenation of the BeforeScript, the script encoded in the URL and the AfterScript. Thus the whole ensemble of code that makes up a web application might be running within the same "before" and "after" scripts to which the programmer can devolve tasks common to every page of an application.
  4. Child Process Exit

    If no error condition forces the child process to a premature exit, his life is determined by the Apache configuration parameters. To reduce the effects of memory leaks in buggy applications the Apache webserver forces a child process to exit after a certain number of requests served. A child process gets replaced with a brand new one if the workload of webserver requires so. Before the process quits an exit handler can be run to do some housekeeping, just in case something the could have been left behind has to be cleaned up. Like the initialization scripts ChildExitScript too is a "one shot" script.
    The Tcl exit command forces an interpreter to quit, thus removing the ability of the process embedding it to run more Tcl scripts. The child process then is forced to exit and be replaced by a new one when the workload demands it. This operation implies the ChildExitScript be run before the interpreter is actually deleted.

Apache Rivet Error and Exception Scripts Directives

Rivet is highly configurable and each of the webserver lifecycle stages can be exploited to control a web application. Not only the orderly sequence of stages in a child lifecycle can be controlled with Tcl scripts, but also Tcl error or abnormal conditions taking place during the execution can be caught and handled with specific scripts.

Tcl errors (conditions generated when a command exits with code TCL_ERROR) usually result in the printing of a backtrace of the code fragment relevant to the error. Rivet can set up scripts to trap these errors and run instead an ErrorScript to handle it and conceal details that usually have no interest for the end user and it may show lines of code that ought to remain private. The ErrorScript handler might create a polite error page where things can be explained in human readable form, thus enabling the end user to provide meaningful feedback information.

In other cases an unmanageable conditions might take place in the data and this could demand an immediate interruption of the content generation. These abort conditions can be fired by the abort_page command, which in turn fires the execution of an AbortScript to handle the abnormal condition. Starting with Rivet 2.1.0 abort_page accepts a free form parameter that can be retrieved later with the command abort_code

Tcl Namespaces in Rivet and the ::request Namespace

[Note]Note
This section explain the default request handling procedure which was written to let Rivet 3.0 work as a drop in replacement of any 2.x module. For a in-depth understanding of the new request processing mechanics please read the request processing section of the manual

With the sole exception of .rvt templates, mod_rivet runs pure Tcl scripts at the global namespace. That means that every variable or procedure created in Tcl scripts resides by default in the "::" namespace (just like in traditional Tcl scripting) and they are persistent across different requests until explicitly unset or until the interpreter is deleted. You can create your own application namespaces to store data but it is important to remember that subsequent requests will in general be served by different child processes. Your application can rely on the fact that certain application data will be in the interpreter, but you shouldn't assume the state of a transaction spanning several pages can be stored in this way and be safely kept available to a specific client. Sessions exist for this purpose and Rivet ships its own session package with support for most of popular DBMS. Nonetheless storing data in the global namespace can be useful, even though scoping data in a namespace is recommended. I/O channels and database connections are examples of information usually specific to a process for which you don't want to pay the overhead of creating them at every request, probably causing a dramatic loss in the application performance.

A special role in the interpreter is played by the ::request namespace. The ::request namespace is deleted and recreated at every request and Rivet templates (.rvt files) are executed within it.

Unless you're fully qualifying variable names outside the ::request namespace, every variable and procedure created in .rvt files is by default placed in it and deleted before any other requests gets processed. It is therefore safe to create variables or object instances in template files and foresake about them: Rivet will take care of cleaning the namespace up and everything created inside the namespace will be destroyed.

StageScriptNamespace
Apache InitializationServerInitScript::
Child InitializationGlobalInitScript::
ChildInitScript::
Request ProcessingBeforeScript::
.rvt::request
.tcl::
AfterScript::
AbortScript::
AfterEveryScript::
Child TerminationChildExitScript::
Error HandlingErrorScript::
rivet-3.0.0/tclconfig/ChangeLog000664 001750 001750 00000067710 15224454746 017167 0ustar00manghimanghi000000 000000 2009-04-10 Daniel Steffen * tcl.m4 (Darwin): check for 64-bit TkAqua. 2009-03-26 Jan Nijtmans * tclconfig/tcl.m4: Adapt LDFLAGS and LD_SEARCH_FLAGS together with SHLIB_LD definition to unbreak building on HPUX. 2009-03-20 Andreas Kupries * tclconfig/tcl.m4: Changed SHLIB_LD definition to unbreak building on HPUX. 2009-03-16 Joe English * tcl.m4(TEA_PUBLIC_TK_HEADERS): Look at ${TK_INCLUDE_SPEC} (found in tkConfig.sh) when trying to guess where tk.h might be [Patch 1960628]. 2009-03-11 Joe English * tcl.m4: Allow ${SHLIB_SUFFIX} to be overridden at configure-time [Patch 1960628]. Also fix some comment typos, and an uninitialized variable bug-waiting-to-happen. 2008-12-21 Jan Nijtmans * tcl.m4: [Bug 2073255] Tcl_GetString(NULL) doesn't crash on HP-UX (this bug report was for Tcl, but holds for TEA as well.) 2008-12-20 Daniel Steffen * tcl.m4: sync with tdbc tcl.m4 changes (SunOS-5.11): Sun cc SHLIB_LD: use LDFLAGS_DEFAULT instead of LDFLAGS 2008-12-02 Jeff Hobbs *** Bump to TEA_VERSION 3.7 *** * tcl.m4: in private header check, check for Port.h instead of Int.h to ensure all private headers are available. 2008-11-04 Daniel Steffen * tcl.m4 (Darwin): sync TEA_PRIVATE_TK_HEADERS handling of Tk.framework PrivateHeaders with TEA_PRIVATE_TCL_HEADERS. 2008-11-04 Jeff Hobbs * tcl.m4 (TEA_PATH_TCLCONFIG, TEA_PATH_TKCONFIG): exit with error when tclConfig.sh cannot be found. [Bug #1997760] (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): allow for finding the headers installed in the public areas, e.g. a result of make install-private-headers. [Bug #1631922] 2008-08-12 Daniel Steffen * tcl.m4 (Darwin): link shlib with current and compatiblity version flags; look for libX11.dylib when searching for X11 libraries. 2008-06-12 Daniel Steffen * tcl.m4 (SunOS-5.11): fix 64bit amd64 support with gcc & Sun cc. 2008-03-27 Daniel Steffen * tcl.m4 (SunOS-5.1x): fix 64bit support for Sun cc. [Bug 1921166] 2008-02-01 Donal K. Fellows * tcl.m4 (TEA_CONFIG_CFLAGS): Updated to work at least in part with more modern VC versions. Currently just made the linker flags more flexible; more work may be needed. 2007-10-26 Daniel Steffen * tcl.m4 (Darwin): add support for 64-bit X11. 2007-10-23 Jeff Hobbs *** Tagged tea-3-branch to start TEA 4 development on HEAD *** 2007-09-17 Joe English * tcl.m4: use '${CC} -shared' instead of 'ld -Bshareable' to build shared libraries on current NetBSDs [Bug 1749251]. 2007-09-15 Daniel Steffen * tcl.m4: replace all direct references to compiler by ${CC} to enable CC overriding at configure & make time. (SunOS-5.1x): replace direct use of '/usr/ccs/bin/ld' in SHLIB_LD by 'cc' compiler driver. 2007-08-08 Jeff Hobbs * tcl.m4: check Ttk dir for Tk private headers (8.5). Add some comments to other bits. 2007-06-25 Jeff Hobbs * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): move where / is added. 2007-06-13 Jeff Hobbs * tcl.m4: fix --with-tkinclude alignment. [Bug 1506111] 2007-06-06 Daniel Steffen * tcl.m4 (Darwin): fix 64bit arch removal in fat 32&64bit builds. 2007-05-18 Donal K. Fellows * tcl.m4: Added quoting so that paths with spaces cause fewer problems. 2007-03-07 Daniel Steffen * tcl.m4 (Darwin): s/CFLAGS/CPPFLAGS/ in -mmacosx-version-min check. 2007-02-15 Jeff Hobbs * tcl.m4: correct private header check to search in generic subdir 2007-02-09 Jeff Hobbs *** Bump to TEA_VERSION 3.6 *** * tcl.m4: correct -d to -f (TEA_CONFIG_CFLAGS): SHLIB_SUFFIX is .so on HP ia64 [Bug 1615058] 2007-02-08 Jeff Hobbs * tcl.m4 (TEA_PRIVATE_TCL_HEADERS, TEA_PRIVATE_TK_HEADERS): check that the dirs actually have private headers. [Bug 1631922] 2007-02-04 Daniel Steffen * tcl.m4: add caching to -pipe check. 2007-01-25 Daniel Steffen * tcl.m4: integrate CPPFLAGS into CFLAGS as late as possible and move (rather than duplicate) -isysroot flags from CFLAGS to CPPFLAGS to avoid errors about multiple -isysroot flags from some older gcc builds. 2006-01-19 Daniel Steffen * tcl.m4: ensure CPPFLAGS env var is used when set. [Bug 1586861] (Darwin): add -isysroot and -mmacosx-version-min flags to CPPFLAGS when present in CFLAGS to avoid discrepancies between what headers configure sees during preprocessing tests and compiling tests. 2006-12-19 Daniel Steffen * tcl.m4 (Darwin): --enable-64bit: verify linking with 64bit -arch flag succeeds before enabling 64bit build. 2006-12-16 Daniel Steffen * tcl.m4 (Linux): fix previous change to use makefile variable LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile are picked up. 2006-11-26 Daniel Steffen * tcl.m4 (Linux): --enable-64bit support. [Patch 1597389], [Bug 1230558] 2006-08-18 Daniel Steffen * tcl.m4 (Darwin): add support for --enable-64bit on x86_64, for universal builds including x86_64 and for use of -mmacosx-version-min instead of MACOSX_DEPLOYMENT_TARGET. For Tk extensions, remove 64-bit arch flags from CFLAGS like in the Tk configure, as neither TkAqua nor TkX11 can be built for 64-bit at present. 2006-03-28 Jeff Hobbs * tcl.m4: []-quote AC_DEFUN functions. (TEA_PATH_TKCONFIG): Fixed Windows-specific check for tkConfig.sh. (TEA_MAKE_LIB): Prepend 'lib' for Windows-gcc configs. 2006-03-07 Joe English * tcl.m4: Set SHLIB_LD_FLAGS='${LIBS}' on NetBSD, as per the other *BSD variants [Bug 1334613]. 2006-01-25 Jeff Hobbs *** Bump to TEA version 3.5 *** * tcl.m4: keep LD_SEARCH_FLAGS and CC_SEARCH_FLAGS synchronous with core tcl.m4 meaning. 2006-01-24 Daniel Steffen * tcl.m4 (Darwin): use makefile variable LDFLAGS_DEFAULT instead of LDFLAGS in SHLIB_LD, to ensure linker flags in sampleextension Makefile are picked up. [Bug 1403343] 2006-01-23 Jeff Hobbs * tcl.m4: add C:/Tcl/lib and C:/Progra~1/Tcl/lib dirs to check for *Config.sh on Windows. [Bug 1407544] 2006-01-23 Daniel Steffen * tcl.m4 (Darwin): for Tk extensions, remove -arch ppc64 from CFLAGS like in the Tk configure, as neither TkAqua nor TkX11 can be built for 64bit at present (no 64bit GUI libraries). 2006-01-22 Jeff Hobbs * tcl.m4: restore system=windows on Windows. Remove error if 'ar' isn't found (it may not be on Windows). Do not add -lxnet or define _XOPEN_SOURCE on HP-UX by default. Ensure the C|LDFLAGS_DEFAULT gets the fully sub'd value at configure time. 2006-01-10 Daniel Steffen * tcl.m4: add caching, use AC_CACHE_CHECK instead of AC_CACHE_VAL where possible, consistent message quoting, sync relevant tcl/unix/tcl.m4 HEAD changes and gratuitous formatting differences (notably sunc removal of support for for ancient BSD's, IRIX 4, RISCos and Ultrix by kennykb), Darwin improvements to TEA_LOAD_*CONFIG to make linking work against Tcl/Tk frameworks installed in arbitrary location, change TEA_PROG_* search order (look in *_BIN_DIR parents before *_PREFIX). 2006-01-05 Jeff Hobbs * tcl.m4: add dkf's system config refactor 2006-01-04 Jeff Hobbs * tcl.m4: remove extraneous ' that causes bash 3.1 to choke 2005-12-19 Joe English * tcl.m4 (TEA_PATH_TCLCONFIG &c): Look for tclConfig.sh &c in ${libdir}, where they are installed by default [Patch #1377407]. 2005-12-05 Don Porter * tcl.m4 (TEA_PUBLIC_*_HEADERS): Better support for finding header files for uninstalled Tcl and Tk. 2005-12-02 Jeff Hobbs * tcl.m4: correctly bump TEA_VERSION var to 3.4 2005-12-01 Daniel Steffen * unix/tcl.m4 (Darwin): fixed error when MACOSX_DEPLOYMENT_TARGET unset 2005-11-29 Jeff Hobbs * tcl.m4: *** Bump to TEA version 3.4 *** Add Windows x64 build support. Remove TEA_PATH_NOSPACE and handle the problem with ""s where necessary - the macro relied on TCLSH_PROG which didn't work for cross-compiles. 2005-11-27 Daniel Steffen * tcl.m4 (Darwin): add 64bit support, add CFLAGS to SHLIB_LD to support passing -isysroot in env(CFLAGS) to configure (flag can't be present twice, so can't be in both CFLAGS and LDFLAGS during configure), don't use -prebind when deploying on 10.4. (TEA_ENABLE_LANGINFO, TEA_TIME_HANDLER): add/fix caching. 2005-10-30 Daniel Steffen * tcl.m4: fixed two tests for TEA_WINDOWINGSYSTEM = "aqua" that should have been for `uname -s` = "Darwin" instead; added some missing quoting. (TEA_PROG_TCLSH, TEA_PROG_WISH): fix incorrect assumption that install location of tclConfig.sh/tkConfig.sh allows to determine the tclsh/wish install dir via ../bin. Indeed tcl/tk can be configured with arbitrary --libdir and --bindir (independent of prefix) and such a configuration is in fact standard with Darwin framework builds. At least now also check ${TCL_PREFIX}/bin resp. ${TK_PREFIX}/bin for presence of tclsh resp. wish (if tcl/tk have been configured with arbitrary --bindir, this will still not find them, for a general solution *Config.sh would need to contain the values of bindir/libdir/includedir passed to configure). 2005-10-07 Jeff Hobbs * tcl.m4: Fix Solaris 5.10 check and Solaris AMD64 64-bit builds. 2005-10-04 Jeff Hobbs * tcl.m4 (TEA_PRIVATE_TCL_HEADERS): add / to finish sed macro (TEA_ENABLE_THREADS): don't check for pthread_attr_setstacksize func 2005-09-13 Jeff Hobbs * tcl.m4: *** Update to TEA version 3.3 *** define TEA_WINDOWINGSYSTEM in TEA_LOAD_TKCONFIG. Make --enable-threads the default (users can --disable-threads). Improve AIX ${CC}_r fix to better check existing ${CC} value. Do the appropriate evals to not require the *TOP_DIR_NATIVE vars be set for extensions that use private headers. Make aqua check for Xlib compat headers the same as win32. 2005-07-26 Mo DeJong * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, TEA_PROG_WISH, TEA_BUILD_WISH): Remove TEA_BUILD_TCLSH and TEA_BUILD_WISH because of complaints that it broke the build when only an installed version of Tcl was available at extension build time. The TEA_PROG_TCLSH and TEA_PROG_WISH macros will no longer search the path at all. The build tclsh or installed tclsh shell will now be found by TEA_PROG_TCLSH. 2005-07-24 Mo DeJong * tcl.m4 (TEA_PROG_TCLSH, TEA_BUILD_TCLSH, TEA_PROG_WISH, TEA_BUILD_WISH): Split confused search for tclsh on PATH and build and install locations into two macros. TEA_PROG_TCLSH and TEA_PROG_WISH search the system PATH for an installed tclsh or wish. The TEA_BUILD_TCLSH and TEA_BUILD_WISH macros determine the name of tclsh or wish in the Tcl or Tk build directory even if tclsh or wish has not yet been built. [Tcl bug 1160114] [Tcl patch 1244153] 2005-06-23 Daniel Steffen * tcl.m4 (TEA_PRIVATE_TK_HEADERS): add ${TK_SRC_DIR}/macosx to TK_INCLUDES when building against TkAqua. * tcl.m4 (TEA_PATH_X): fixed missing comma in AC_DEFINE * tcl.m4: changes to better support framework builds of Tcl and Tk out of the box: search framework install locations for *Config.sh, and if in presence of a framework build, use the framework's Headers and PrivateHeaders directories for public and private includes. [FR 947735] 2005-06-18 Daniel Steffen * tcl.m4 (Darwin): add -headerpad_max_install_names to LDFLAGS to ensure we can always relocate binaries with install_name_tool. 2005-06-04 Daniel Steffen * tcl.m4 (TEA_PATH_X): for TEA_WINDOWINGSYSTEM == aqua, check if xlib compat headers are available in tkheaders location, otherwise add xlib sourcedir to TK_XINCLUDES. 2005-04-25 Daniel Steffen * tcl.m4: added AC_DEFINE* descriptions (from core tcl.m4) to allow use with autoheader. (Darwin): added configure checks for recently added linker flags -single_module and -search_paths_first to allow building with older tools (and on Mac OS X 10.1), use -single_module in SHLIB_LD. (TEA_MISSING_POSIX_HEADERS): added caching of dirent.h check. (TEA_BUGGY_STRTOD): added caching (sync with core tcl.m4). 2005-03-24 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): use Tcl header defaults for wide int type only on Windows when __int64 is detected as valid. 2005-03-24 Don Porter * README.txt: Update reference to "SC_* macros" to "TEA_* macros". * tcl.m4: Incorporated recent improvements in SC_PATH_TCLCONFIG and SC_PATH_TKCONFIG into TEA_PATH_TCLCONFIG and TEA_PATH_TKCONFIG. Corrected search path in TEA_PATH_CONFIG and added AC_SUBST($1_BIN_DIR) to TEA_LOAD_CONFIG so that packages that load the configuration of another package can know where they loaded it from. 2005-03-18 Jeff Hobbs * tcl.m4 (TEA_CONFIG_CFLAGS): correct 2005-03-17 change to have variant LD_SEARCH_FLAGS for gcc and cc builds. * tcl.m4 (TEA_PROG_TCLSH, TEA_PROG_WISH): correct x-compile check. 2005-03-17 Jeff Hobbs * tcl.m4: Correct gcc build and HP-UX-11. 2005-02-08 Jeff Hobbs * tcl.m4 (TEA_ADD_LIBS): don't touch lib args starting with -. (TEA_CONFIG_CFLAGS): only define _DLL for CE in shared build. (TEA_MAKE_LIB): set RANLIB* to : on Windows (it's not needed). 2005-02-01 Jeff Hobbs * tcl.m4: redo of 2005-01-27 changes to correctly handle paths with spaces. Win/CE and Win/64 builds now require a prebuilt tclsh to handle conversion to short pathnames. This is done in the new TEA_PATH_NOSPACE macro. For Win/CE|64, make CC just the compiler and move the necessary includes to CFLAGS. (TEA_CONFIG_CFLAGS): Add Solaris 64-bit gcc build support. (TEA_PROG_TCLSH, TEA_PROG_WISH): Allow TCLSH_PROG and WISH_PROG to be set in the env and prevent resetting. (TEA_ADD_LIBS): On Windows using GCC (mingw), convert foo.lib args to -lfoo, for use with mingw. *** POTENTIAL INCOMPATABILITY *** (TEA_CONFIG_CFLAGS): Fix AIX gcc builds to work out-of-box. Bumped TEA to 3.2. 2005-01-27 Jeff Hobbs * tcl.m4: remove cygpath calls to support msys. Update base CE build assumption to "420,ARMV4,ARM,Pocket PC 2003". Make STLIB_LD use $LINKBIN -lib. 2005-01-25 Daniel Steffen * tcl.m4 (Darwin): fixed bug with static build linking to dynamic library in /usr/lib etc instead of linking to static library earlier in search path. [Tcl Bug 956908] Removed obsolete references to Rhapsody. 2004-12-29 Jeff Hobbs * tcl.m4: Updates for VC7 compatibility, fixing CFLAGS and LDFLAGS options, using better default -O levels. [Bug 1092952, 1091967] 2004-12-29 Joe English * tcl.m4: Do not use ${DBGX} suffix when building shared libraries [patch #1081595, TIP #34] 2004-09-07 Jeff Hobbs * tcl.m4 (TEA_CONFIG_CFLAGS): support eVC4 Win/CE builds 2004-08-10 Jeff Hobbs * tcl.m4 (TEA_INIT, TEA_PREFIX): update handling of exec_prefix to work around subdir configures since autoconf only propagates the prefix (not exec_prefix). 2004-07-23 Daniel Steffen * tcl.m4 (TEA_CONFIG_CFLAGS): Darwin section: brought inline with Tcl 8.5 HEAD config, removed core specific & obsolete settings. 2004-07-22 Jeff Hobbs * tcl.m4 (TEA_PATH_X): check in TK_DEFS for MAC_OSX_TK to see if we are compiling on Aqua. Add TEA_WINDOWINGSYSTEM var that reflects 'tk windowingsystem' value. 2004-07-16 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): force a threaded build when building against a threaded core. (CFLAGS_WARNING): Remove -Wconversion for gcc builds (TEA_CONFIG_CFLAGS): Reorder configure.in for better 64-bit build configuration, replacing EXTRA_CFLAGS with CFLAGS. [Bug #874058] Update to latest Tcl 8.5 head config settings. Call this TEA version 3.1. 2004-04-29 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): replace AC_TRY_RUN test with AC_TRY_COMPILE for the long vs. long long check. (kenny) 2004-04-26 Jeff Hobbs * tcl.m4 (TEA_TCL_64BIT_FLAGS): update against core tcl.m4 to define TCL_WIDE_INT_IS_LONG if 'using long'. 2004-03-19 Jeff Hobbs * tcl.m4: correct Windows builds getting LDFLAGS info in MAKE_LIB 2004-02-11 Jeff Hobbs * tcl.m4: correct TCL_INCLUDES for private headers on Windows - it doesn't need the eval. 2004-02-10 Jeff Hobbs * tcl.m4: don't require TK_INCLUDES and TCL_INCLUDES to have the DIR_NATIVE vars defined when using private headers on unix. Allow $... to TEA_ADD_SOURCES for constructs like TEA_ADD_SOURCES([\$(WIN_OBJECTS)]), that allow the developer to place more in the Makefile.in. tkUnixPort.h checks for HAVE_LIMITS_H, so do both HAVE and CHECK on limits.h 2003-12-10 Jeff Hobbs * Makefile.in: added TEA_ADD_LIBS, TEA_ADD_INCLUDES and * configure: TEA_ADD_CFLAGS to configurable parameters with * configure.in: PKG_* equivs in the Makefile. This allows the * tclconfig/tcl.m4: user to worry less about actual magic VAR names. Corrected Makefile.in to note that TEA_ADD_TCL_SOURCES requires exact file names. 2003-12-09 Jeff Hobbs * tcl.m4: updated OpenBSD support based on [Patch #775246] (cassoff) 2003-12-05 Jeff Hobbs * configure: * configure.in: * Makefile.in (VPATH): readd $(srcdir) to front of VPATH as the first part of VPATH can get chopped off. Change .c.$(OBJEXT) rule to .c.@OBJEXT@ to support more makes. * tclconfig/tcl.m4: add TEA_ADD_STUB_SOURCES to support libstub generation and TEA_ADD_TCL_SOURCES to replace RUNTIME_SOURCES as the way the user specifies library files. 2003-12-03 Jeff Hobbs * configure: Update of TEA spec to (hopefully) simplify * configure.in: some aspects of TEA by making use of more * Makefile.in: AC 2.5x features. Use PACKAGE_NAME (instead * generic/tclsample.c: of PACKAGE) and PACKAGE_VERSION (instead of * tclconfig/tcl.m4: VERSION) arguments to AC_INIT as the TEA package name and version. Provide a version argument to TEA_INIT - starting with 3.0. Drop all use of interior shell substs that older makefiles didn't like. Use PKG_* naming convention instead. Move specification of source files and public headers into configure.in with TEA_ADD_SOURCES and TEA_ADD_HEADERS. These will be munged during ./configure into the right obj file names (no $(SOURCES:.c=.obj) needed). There is almost nothing that should be touched in Makefile.in now for the developer. May want to add a TEA_ADD_TCL_SOURCES for the RUNTIME_SOURCES that remains. Use SHLID_LD_FLAGS (instead of SHLID_LDFLAGS) as Tcl does. Only specify the user requested LDFLAGS/CFLAGS in the Makefile, don't mention the _OPTIMIZE/_DEBUG variants. 2003-10-15 Jeff Hobbs * tcl.m4: create a TEA_SETUP_COMPILER_CC the precedes the TEA_SETUP_COMPILER macro. They are split so the check for CC occurs before any use of CC. Also add AC_PROG_CPP to the compiler checks. 2003-10-06 Jeff Hobbs * tcl.m4: Updated for autoconf 2.5x prereq. Where TCL_WIDE_INT_TYPE would be __int64, defer to the code checks in tcl.h, which also handles TCL_LL_MODIFIER* properly. 2003-04-22 Jeff Hobbs * tcl.m4: correct default setting of ARCH for WinCE builds. Correct \ escaping for CE sed macros. 2003-04-10 Jeff Hobbs * tcl.m4: replace $(syscal) construct with older `syscall` for systems where sh != bash. 2003-04-09 Jeff Hobbs * tcl.m4 (TEA_WITH_CELIB): add --enable-wince and --with-celib options for Windows/CE compilation support. Requires the Microsoft eMbedded SDK and Keuchel's celib emulation layer. 2003-02-18 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): Make sure -lpthread gets passed on the link line when checking for the pthread_attr_setstacksize symbol. (dejong) * tcl.m4 (TEA_SETUP_COMPILER): added default calls to TEA_TCL_EARLY_FLAGS, TEA_TCL_64BIT_FLAGS, TEA_MISSING_POSIX_HEADERS and TEA_BUGGY_STRTOD. 2003-02-14 Jeff Hobbs * tcl.m4: correct HP-UX ia64 --enable-64bit build flags 2003-01-29 Jeff Hobbs * tcl.m4: check $prefix/lib as well as $exec_prefix/lib when looking for tcl|tkConfig.sh, as this check is done before we would set exec_prefix when the user does not define it. 2003-01-21 Mo DeJong * tcl.m4 (TEA_CONFIG_CFLAGS): Fix build support for mingw, the previous implementation would use VC++ when compiling with mingw gcc. Don't pass -fPIC since gcc always compiles pic code under win32. Change some hard coded cases of gcc to ${CC}. 2002-10-15 Jeff Hobbs * tcl.m4: move the CFLAGS definition from TEA_ENABLE_SHARED to TEA_MAKE_LIB because setting too early confuses other AC_* macros. Correct the HP-11 SHLIB_LD_LIBS setting. * tcl.m4: add the CFLAGS definition into TEA_ENABLE_SHARED and make it pick up the env CFLAGS at configure time. 2002-10-09 Jeff Hobbs * tcl.m4: add --enable-symbols=mem option to enable TCL_MEM_DEBUG. Improved AIX 64-bit build support, allow it on AIX-4 as well. Enable 64-bit HP-11 compilation with gcc. Enable 64-bit IRIX64-6 cc build support. Correct FreeBSD thread library linkage. Add OSF1 static build support. Improve SunOS-5 shared build SHLIB_LD macro. 2002-07-20 Zoran Vasiljevic * tcl.m4: Added MINGW32 to list of systems checked for Windows build. Also, fixes some indentation issues with "--with-XXX" options. 2002-04-23 Jeff Hobbs * tcl.m4 (TEA_ENABLE_THREADS): added USE_THREAD_ALLOC define to use new threaded allocatory by default on Unix for Tcl 8.4. (TEA_CONFIG_CFLAGS): corrected LD_SEARCH_FLAGS for FreeBSD-3+. 2002-04-22 Jeff Hobbs * tcl.m4 (TEA_SETUP_COMPILER): removed call to AC_CYGWIN so that we can use autoconf 2.5x as well as 2.13. This prevents us from being able to warn against the use of cygwin gcc at configure time, but allows autoconf 2.5x, which is what is shipped with most newer systems. 2002-04-11 Jeff Hobbs * tcl.m4: Enabled COFF as well as CV style debug info with --enable-symbols to allow Dr. Watson users to see function info. More info on debugging levels can be obtained at: http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp 2002-04-03 Jeff Hobbs * tcl.m4: change all SC_* macros to TEA_*. The SC_ was for Scriptics, which is no more. TEA represents a better, independent prefix that won't need changing. Added preliminary mingw gcc support. [Patch #538772] Added TEA_PREFIX macro that handles defaulting the prefix and exec_prefix vars to those used by Tcl if none were specified. Added TEA_SETUP_COMPILER macro that encompasses the AC_PROG_CC check and several other basic AC_PROG checks needed for making executables. This greatly simplifies user's configure.in files. Collapsed AIX-5 defines into AIX-* with extra checks for doing the ELF stuff on AIX-5-ia64. Updated TEA_ENABLE_THREADS to take an optional arg to allow switching it on by default (for Thread) and add sanity checking to warn the user if configuring threads incompatibly. 2002-03-29 Jeff Hobbs * tcl.m4: made sure that SHLIB_LDFLAGS was set to LDFLAGS_DEFAULT. Removed --enable-64bit support for AIX-4 because it wasn't correct. Added -MT or -MD Windows linker switches to properly support symbols-enabled builds. 2002-03-28 Jeff Hobbs * tcl.m4: called AC_MSG_ERROR when SC_TEA_INIT wasn't called first instead of calling it as that inlines it each time in shell code. Changed Windows CFLAGS_OPTIMIZE to use -O2 instead of -Oti. Noted TCL_LIB_VERSIONS_OK=nodots for Windows builds. A few changes to support itcl (and perhaps others): Added support for making your own stub libraries to SC_MAKE_LIB. New SC_PATH_CONFIG and SC_LOAD_CONFIG that take a package name arg and find that ${pkg}Config.sh file. itk uses this for itcl. 2002-03-27 Jeff Hobbs * tcl.m4: made SC_LOAD_TKCONFIG recognize when working with a Tk build dir setup. Added EXTRA_CFLAGS and SHLIB_LD_LIBS substs to SC_CONFIG_CFLAGS. Added XLIBSW onto LIBS when it is defined. Remove TCL_LIBS from MAKE_LIB and correctly use SHLIB_LD_LIBS instead to not rely as much on tclConfig.sh cached info. Add TK_BIN_DIR to paths to find wish in SC_PROG_WISH. These move towards making TEA much more independent of *Config.sh. 2002-03-19 Jeff Hobbs * tcl.m4: corrected forgotten (UN)SHARED_LIB_SUFFIX and SHLIB_SUFFIX defines for Win. (SC_PATH_X): made this only do the check on unix platforms. 2002-03-12 Jeff Hobbs * README.txt: updated to reflect fewer files 2002-03-06 Jeff Hobbs * config.guess (removed): * config.sub (removed): removed unnecessary files * installFile.tcl (removed): * mkinstalldirs (removed): these aren't really necessary for making TEA work * tcl.m4 (SC_PUBLIC_TCL_HEADERS, SC_PUBLIC_TK_HEADERS): don't check /usr(/local)/include for includes on Windows when not using gcc 2002-03-05 Jeff Hobbs * tcl.m4: added warnings on Windows, removed RELPATH define and added TCL_LIBS to MAKE_LIB macro. This import represents 2.0.0, or a new start at attempting to make TEA much easier for C extension developers. **** moved from tclpro project to core tcl project, **** **** renamed to 'tclconfig' **** 2001-03-15 Karl Lehenbauer * installFile.tcl: Added updating of the modification time of the target file whether we overwrote it or decided that it hadn't changed. This was necessary for us to be able to determine whether or not a module install touched the file. 2001-03-08 Karl Lehenbauer * installFile.tcl: Added support for converting new-style (1.1+) Cygnus drive paths to Tcl-style. 2001-01-15 * tcl.m4: Added FreeBSD clause. 2001-01-03 * tcl.m4: Fixed typo in SC_LIB_SPEC where it is checking for exec-prefix. 2000-12-01 * tcl.m4: Concatenated most of the Ajuba acsite.m4 file so we don't need to modify the autoconf installation. * config.guess: * config.sub: * installFile.tcl: Added files from the itcl config subdirectory, which should go away. 2000-7-29 * Fixed the use of TCL_SRC_DIR and TK_SRC_DIR within TCL_PRIVATE_INCLUDES and TK_PRIVATE_INCLUDES to match their recent change from $(srcdir) to $(srcdir)/.. rivet-3.0.0/tests/broken.rvt000664 001750 001750 00000000044 15224454746 016607 0ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/packages/asciiglyphs/000775 001750 001750 00000000000 15224454746 020660 5ustar00manghimanghi000000 000000 rivet-3.0.0/genconf.sh000775 001750 001750 00000000414 15224454746 015407 0ustar00manghimanghi000000 000000 #!/bin/sh # Be sure to use a recent autotools set. 1.9 works for me. VERSION="1.10" if [ "$VERSION" != "" ] then # Add the dash VERSION="-$VERSION" fi libtoolize -f -c && aclocal${VERSION} && autoheader && automake${VERSION} --add-missing && autoconf rivet-3.0.0/doc/examples/hello1.rvt000664 001750 001750 00000000025 15224454746 017733 0ustar00manghimanghi000000 000000 rivet-3.0.0/src/mod_rivet_ng/rivet_worker_mpm.c000664 001750 001750 00000057542 15224454746 022451 0ustar00manghimanghi000000 000000 /* rivet_worker_mpm.c: dynamically loaded MPM aware functions for threaded MPM */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #include #include #include #include #include #include #include "rivet.h" #include "mod_rivet.h" #include "mod_rivet_common.h" #include "mod_rivet_generator.h" #include "rivetChannel.h" #include "apache_config.h" #include "rivet_config.h" #include "worker_prefork_common.h" #define BRIDGE_SUPERVISOR_WAIT 1000000 #define MOD_RIVET_QUEUE_SIZE 100 #ifdef RIVET_SERIALIZE_HTTP_REQUESTS #define HTTP_REQUESTS_PROC(request_proc_call) \ apr_thread_mutex_lock(module_globals->mpm->req_mutex);\ request_proc_call;\ apr_thread_mutex_unlock(module_globals->mpm->req_mutex); #else #define HTTP_REQUESTS_PROC(request_proc_call) request_proc_call; #endif extern DLLIMPORT mod_rivet_globals* module_globals; extern DLLIMPORT apr_threadkey_t* rivet_thread_key; extern DLLIMPORT module rivet_module; // apr_threadkey_t* handler_thread_key; #ifdef RIVET_NO_HAVE_ROUND int round(double d) { return (int)(d + 0.5); } #endif /* RIVET_NO_HAVE_ROUND */ rivet_thread_private* Rivet_VirtualHostsInterps (rivet_thread_private* private); void Rivet_RunChildScripts (rivet_thread_private* private,bool init); typedef struct mpm_bridge_status { apr_thread_t* supervisor; int server_shutdown; apr_thread_cond_t* job_cond; apr_thread_mutex_t* job_mutex; apr_array_header_t* exiting; /* */ apr_uint32_t* threads_count; apr_uint32_t* running_threads_count; apr_queue_t* queue; /* jobs queue */ void** workers; /* thread pool ids */ int max_threads; int min_spare_threads; int max_spare_threads; #ifdef RIVET_SERIALIZE_HTTP_REQUESTS apr_thread_mutex_t* req_mutex; #endif int skip_thread_on_exit; /* To exclusively handle the * * WorkerBridge_Shutdown */ } mpm_bridge_status; /* * data structure to work as communication * between Tcl worker thread and HTTP request handler */ typedef struct _handler_private { apr_thread_cond_t* cond; apr_thread_mutex_t* mutex; request_rec* r; /* request rec */ int code; int status; rivet_req_ctype ctype; } handler_private; typedef int rivet_thr_status; enum { init, idle, request_processing, done, child_exit }; /* * -- WorkerBridge_Shutdown * * Child process shutdown: no more requests are served and we * pop from the queue all the threads sitting for work to do. * In case some Tcl worker threads are still running and don't * get back to the queue we wait for 1 sec max before returning * anyway * * Arguments: * * none * * Returned value: * * none * * Side effects: * * - The whole pool of worker threads is shut down and either they * must be restared or (most likely) the child process can exit. * */ static void WorkerBridge_Shutdown (void) { int waits; void* v; handler_private* thread_obj; apr_status_t rv; apr_uint32_t threads_to_stop = 0; int not_to_be_waited; not_to_be_waited = module_globals->mpm->skip_thread_on_exit; apr_thread_mutex_lock(module_globals->mpm->job_mutex); module_globals->mpm->server_shutdown = 1; /* We wake up the supervisor who is now supposed to stop * all the Tcl worker threads */ apr_thread_cond_signal(module_globals->mpm->job_cond); apr_thread_mutex_unlock(module_globals->mpm->job_mutex); waits = 5; do { rv = apr_queue_trypop(module_globals->mpm->queue,&v); /* We wait for possible threads that are taking * time to serve requests and haven't had a chance to * see the signal yet */ if (rv == APR_EAGAIN) { waits--; apr_sleep(200000); continue; } thread_obj = (handler_private*)v; apr_thread_mutex_lock(thread_obj->mutex); thread_obj->status = init; apr_thread_cond_signal(thread_obj->cond); apr_thread_mutex_unlock(thread_obj->mutex); threads_to_stop = apr_atomic_read32(module_globals->mpm->threads_count); } while ((waits > 0) && (threads_to_stop > not_to_be_waited)); return; } /* * -- request_processor */ static void* APR_THREAD_FUNC request_processor (apr_thread_t *thd, void *data) { rivet_thread_private* private; handler_private* thread_obj; apr_thread_mutex_lock(module_globals->mpm->job_mutex); private = Rivet_ExecutionThreadInit(); private->ext = apr_pcalloc(private->pool,sizeof(mpm_bridge_specific)); private->ext->keep_going = 1; private->ext->interps = apr_pcalloc(private->pool,module_globals->vhosts_count*sizeof(rivet_thread_interp)); /* So far nothing differs much with what we did for the prefork bridge */ /* At this stage we have to set up the private interpreters of configured * virtual hosts (if any). We assume the server_rec stored in the module * globals can be used to retrieve the reference to the root interpreter * configuration and to the rivet global script */ if (Rivet_VirtualHostsInterps(private) == NULL) { *(apr_thread_t **) apr_array_push(module_globals->mpm->exiting) = thd; apr_thread_cond_signal(module_globals->mpm->job_cond); apr_thread_mutex_unlock(module_globals->mpm->job_mutex); apr_thread_exit(thd,APR_SUCCESS); return NULL; } /* The ng model allocates here the handler_private data */ thread_obj = apr_pcalloc(private->pool,sizeof(handler_private)); ap_assert(apr_thread_cond_create(&(thread_obj->cond), private->pool) == APR_SUCCESS); ap_assert(apr_thread_mutex_create(&(thread_obj->mutex),APR_THREAD_MUTEX_UNNESTED,private->pool) == APR_SUCCESS); thread_obj->status = idle; apr_thread_mutex_unlock(module_globals->mpm->job_mutex); /* unlock job initialization stage */ /* eventually we increment the number of active threads */ apr_atomic_inc32(module_globals->mpm->threads_count); apr_thread_mutex_lock(thread_obj->mutex); do { apr_status_t rv; rv = apr_queue_push(module_globals->mpm->queue,thread_obj); if (rv != APR_SUCCESS) { private->ext->keep_going = 0; continue; } while (thread_obj->status != init) { apr_thread_cond_wait(thread_obj->cond,thread_obj->mutex); } if (module_globals->mpm->server_shutdown) { private->ext->keep_going = 0; continue; } /* we set the status to request_processing */ thread_obj->status = request_processing; /* we proceed with the request processing */ apr_atomic_inc32(module_globals->mpm->running_threads_count); /* these assignements are crucial for both calling Rivet_SendContent and * for telling the channel where stuff must be sent to */ private->ctype = thread_obj->ctype; private->req_cnt++; private->r = thread_obj->r; HTTP_REQUESTS_PROC(thread_obj->code = Rivet_SendContent(private)); thread_obj->status = done; // if (private->thread_exit) thread_obj->status = child_exit; apr_thread_cond_signal(thread_obj->cond); while (thread_obj->status != idle) { apr_thread_cond_wait(thread_obj->cond,thread_obj->mutex); } apr_atomic_dec32(module_globals->mpm->running_threads_count); } while (private->ext->keep_going > 0); Rivet_RunChildScripts(private,false); apr_thread_mutex_unlock(thread_obj->mutex); ap_log_error(APLOG_MARK,APLOG_DEBUG,0,module_globals->server,"processor thread orderly exit"); /* We reestablish the single thread and interpreter cleanup */ Rivet_ProcessorCleanup(private); apr_thread_mutex_lock(module_globals->mpm->job_mutex); *(apr_thread_t **) apr_array_push(module_globals->mpm->exiting) = thd; apr_thread_cond_signal(module_globals->mpm->job_cond); apr_thread_mutex_unlock(module_globals->mpm->job_mutex); /* the counter of active threads has to be decremented */ apr_atomic_dec32(module_globals->mpm->threads_count); /* this call triggers thread private stuff clean up by calling processor_cleanup */ 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, NULL, module_globals->pool); } static void start_thread_pool (int nthreads) { int i; for (i = 0; i < nthreads; i++) { apr_status_t rv; apr_thread_t* slot; rv = create_worker_thread(&slot); module_globals->mpm->workers[i] = (void *) slot; if (rv != APR_SUCCESS) { char errorbuf[RIVET_MSG_BUFFER_SIZE]; apr_strerror(rv, errorbuf,RIVET_MSG_BUFFER_SIZE); 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); } } } /* -- threaded_bridge_supervisor * * This function runs within a single thread abd manages the * Tcl worker thread pool. It could be extended also * to provide some basic monitoring data. * * As we don't delete Tcl interpreters anymore because it can lead * to seg faults or delays the supervisor threads doesn't restart * single threads anymore, but it basically stops and starts the whole * pool of Tcl worker threads. Nonetheless it still keeps a list of * the thread pool ids and it should be able to restart a thread when * it's notified (if the child process is not shutting down) * */ static void* APR_THREAD_FUNC threaded_bridge_supervisor (apr_thread_t *thd, void *data) { mpm_bridge_status* mpm = module_globals->mpm; server_rec* s = (server_rec *)data; #ifdef RIVET_MPM_SINGLE_TCL_THREAD int threads_to_start = 1; #else int threads_to_start = mpm->max_threads; #endif ap_log_error(APLOG_MARK,APLOG_INFO,0,s,"starting %d Tcl threads",threads_to_start); start_thread_pool(threads_to_start); do { apr_thread_t* p; apr_thread_mutex_lock(mpm->job_mutex); while (apr_is_empty_array(mpm->exiting) && !mpm->server_shutdown) { apr_thread_cond_wait (mpm->job_cond,mpm->job_mutex); } while (!apr_is_empty_array(mpm->exiting) && !mpm->server_shutdown) { int i; p = *(apr_thread_t **)apr_array_pop(mpm->exiting); for (i = 0; (i < module_globals->mpm->max_threads) && !mpm->server_shutdown; i++) { if (p == mpm->workers[i]) { apr_status_t rv; ap_log_error(APLOG_MARK,APLOG_DEBUG,0,s,"thread %d notifies orderly exit",i); mpm->workers[i] = NULL; /* terminated thread restart */ rv = create_worker_thread (&((apr_thread_t **)mpm->workers)[i]); if (rv != APR_SUCCESS) { char errorbuf[RIVET_MSG_BUFFER_SIZE]; /* we shouldn't ever be in the condition of not being able to start a new thread * Whatever is the reason we log a message and terminate the whole process */ apr_strerror(rv,errorbuf,RIVET_MSG_BUFFER_SIZE); ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, "Error starting request_processor thread (%d) rv=%d:%s",i,rv,errorbuf); exit(1); } break; } } } apr_thread_mutex_unlock(mpm->job_mutex); } while (!mpm->server_shutdown); ap_log_error(APLOG_MARK,APLOG_DEBUG,APR_SUCCESS,module_globals->server,"Worker bridge supervisor shuts down"); apr_thread_exit(thd,APR_SUCCESS); return NULL; } /* * -- WorkerBridge_ChildInit * * Child initialization function called by the web server framework. * For this bridge tasks are * * + mpm_bridge_status object allocation and initialization * + content generation callback private key creation * + supervisor thread creation * */ void WorkerBridge_ChildInit (apr_pool_t* pool, server_rec* server) { apr_status_t rv; apr_atomic_init(pool); #ifdef RIVET_SERIALIZE_HTTP_REQUESTS apr_thread_mutex_create(&module_globals->req_mutex, APR_THREAD_MUTEX_UNNESTED, pool); #endif /* First of all we allocate and initialize the mpm status */ module_globals->mpm = apr_pcalloc(pool,sizeof(mpm_bridge_status)); /* apr_calloc is supposed to allocate zeroed memory, * but we still make esplicit the initialization * of some of its fields */ module_globals->mpm->exiting = NULL; module_globals->mpm->max_threads = 0; module_globals->mpm->min_spare_threads = 0; module_globals->mpm->max_spare_threads = 0; module_globals->mpm->workers = NULL; module_globals->mpm->server_shutdown = 0; //module_globals->mpm->exit_command = 0; module_globals->mpm->skip_thread_on_exit = 0; /* We keep some atomic counters that could provide basic data for a workload balancer */ module_globals->mpm->threads_count = (apr_uint32_t *) apr_pcalloc(pool,sizeof(apr_uint32_t)); module_globals->mpm->running_threads_count = (apr_uint32_t *) apr_pcalloc(pool,sizeof(apr_uint32_t)); apr_atomic_set32(module_globals->mpm->threads_count,0); apr_atomic_set32(module_globals->mpm->running_threads_count,0); ap_assert(apr_thread_mutex_create(&module_globals->mpm->job_mutex,APR_THREAD_MUTEX_UNNESTED,pool) == APR_SUCCESS); ap_assert(apr_thread_cond_create(&module_globals->mpm->job_cond,pool) == APR_SUCCESS); /* This is the thread key for the framework thread calling the content generation callback */ // ap_assert (apr_threadkey_private_create(&handler_thread_key,NULL,pool) == APR_SUCCESS); /* This bridge keeps an array of the ids of threads about to exit. This array is protected by * the mutex module_globals->job_mutex and signals through module_globals->job_cond */ module_globals->mpm->exiting = apr_array_make(pool,100,sizeof(apr_thread_t*)); /* This APR-Util queue object is the central communication channel from the Apache * framework to the Tcl threads through the request handler */ if (apr_queue_create(&module_globals->mpm->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); } /* In order to set up some workload balancing let's * query apache some configuration parameters of * the worker MPM */ if (ap_mpm_query(AP_MPMQ_MAX_THREADS,&module_globals->mpm->max_threads) != APR_SUCCESS) { module_globals->mpm->max_threads = TCL_INTERPS; } if (ap_mpm_query(AP_MPMQ_MIN_SPARE_THREADS,&module_globals->mpm->min_spare_threads) != APR_SUCCESS) { module_globals->mpm->min_spare_threads = TCL_INTERPS; } if (ap_mpm_query(AP_MPMQ_MAX_SPARE_THREADS,&module_globals->mpm->max_spare_threads) != APR_SUCCESS) { module_globals->mpm->max_spare_threads = TCL_INTERPS; } /* We allocate the array of Tcl threads id. We require it to have AP_MPMQ_MAX_THREADS slots */ module_globals->mpm->workers = apr_pcalloc(pool,module_globals->mpm->max_threads * sizeof(void *)); rv = apr_thread_create( &module_globals->mpm->supervisor, NULL, threaded_bridge_supervisor, server, module_globals->pool); if (rv != APR_SUCCESS) { char errorbuf[RIVET_MSG_BUFFER_SIZE]; apr_strerror(rv, errorbuf,RIVET_MSG_BUFFER_SIZE); ap_log_error(APLOG_MARK, APLOG_ERR, rv, server, MODNAME "Error starting supervisor thread rv=%d:%s\n",rv,errorbuf); exit(1); } } /* * -- Worker_PrivateCleanup * * Pool cleanup function registered with the MPM controlled thread. Purpose * of this function is to properly get rid of data allocated on the * handler_private object * * Arguments: * * void* client_data: a generic pointer cast to a handler_private object pointer * */ apr_status_t Worker_RequestPrivateCleanup (void *client_data) { handler_private* req_private = (handler_private*)client_data; apr_thread_cond_destroy(req_private->cond); apr_thread_mutex_destroy(req_private->mutex); ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, module_globals->server, MODNAME ": request thread private data released"); /* we have to invalidate the data pointer */ // apr_threadkey_private_set (NULL,handler_thread_key); return APR_SUCCESS; } /* * -- WorkerBridge_Request * * Content generation callback. Actually this function is not * generating directly content but instead builds a handler_private * structure, which is a descriptor of the request to be placed on a * global thread safe queue (module_globals->mpm->queue). In this structure * are also a condition variable and associated mutex. Through this * condition variable a worker thread running a Tcl interpreter will tell * the framework thread the request has been served letting it return to the * HTTP server framework * * Arguments: * * request_rec* rec * * Returned value: * * HTTP status code (see the Apache HTTP web server documentation) */ int WorkerBridge_Request (request_rec* r,rivet_req_ctype ctype) { void* v; apr_queue_t* q = module_globals->mpm->queue; apr_status_t rv; handler_private* request_obj; int http_code; if (module_globals->mpm->server_shutdown == 1) { ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, MODNAME ": http request aborted during child process shutdown"); return HTTP_INTERNAL_SERVER_ERROR; } 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"); } return HTTP_INTERNAL_SERVER_ERROR; } request_obj = (handler_private *) v; apr_thread_mutex_lock(request_obj->mutex); request_obj->r = r; request_obj->ctype = ctype; request_obj->status = init; request_obj->code = OK; //request_obj->job_type = request; apr_thread_cond_signal(request_obj->cond); while (request_obj->status != done) { apr_thread_cond_wait(request_obj->cond,request_obj->mutex); } http_code = request_obj->code; request_obj->status = idle; apr_thread_cond_signal(request_obj->cond); apr_thread_mutex_unlock(request_obj->mutex); return http_code; } /* * -- WorkerBridge_Finalize * * */ apr_status_t WorkerBridge_Finalize (void* data) { apr_status_t rv; apr_status_t thread_status; server_rec* s = (server_rec*) data; WorkerBridge_Shutdown(); rv = apr_thread_join (&thread_status,module_globals->mpm->supervisor); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK,APLOG_ERR,rv,s, MODNAME": Error joining worker bridge supervisor thread"); } return OK; } /* * -- MPM_MasterInterp * * Arguments: * * server_rec* server: a server_rec pointer * * Results: * */ rivet_thread_interp* MPM_MasterInterp(server_rec* s) { rivet_thread_private* private; rivet_thread_interp* interp_obj; rivet_server_conf* rsc = RIVET_SERVER_CONF(s->module_config); RIVET_PRIVATE_DATA_NOT_NULL(rivet_thread_key,private) interp_obj = Rivet_NewVHostInterp(private->pool,rsc->default_cache_size); interp_obj->channel = private->channel; Rivet_PerInterpInit(interp_obj, private, s, private->pool); return interp_obj; } /* * -- WorkerBridge_ExitHandler * * Signals a thread to exit by setting the loop control flag to 0 * and by returning a Tcl error with error code THREAD_EXIT_CODE * * Arguments: * int code * * Side Effects: * * the thread running the Tcl script will exit */ int WorkerBridge_ExitHandler(rivet_thread_private* private) { /* This is not strictly necessary, because this command will * eventually terminate the whole processes */ /* This will force the current thread to exit */ private->ext->keep_going = 0; if (!module_globals->single_thread_exit) { module_globals->mpm->skip_thread_on_exit = 1; /* We now tell the supervisor to terminate the Tcl worker thread pool */ WorkerBridge_Finalize(private->r->server); exit(private->exit_status); } /* * If single thread exit is enabled we continue and let the * thread exit on its own interrupting the main loop */ return TCL_OK; } /* * -- WorkerBridge_Interp * * Either returns the rivet_thread_interp object that's going * to run the script or stores in the bridge data the interpreter * associated to a specific rivet_server_conf record * * Arguments: - rivet_thread_private* private: thread private data * - rivet_server_conf* conf: virtual host configuration * - rivet_thread_interp* interp: If not NULL stores the interpreter * in the bridge data. * Returned value: rivet_thread_interp* * In any case the function returns * the rivet_thread_interp * object associated with the virtual host * configuration * */ rivet_thread_interp* WorkerBridge_Interp (rivet_thread_private* private, rivet_server_conf* conf, rivet_thread_interp* interp) { if (interp != NULL) { private->ext->interps[conf->idx] = interp; } return private->ext->interps[conf->idx]; } /* * -- WorkerBridge_ServerInit * * Bridge server wide inizialization: * * We set the default value of the flag single_thread_exit * stored in the module globals * */ int WorkerBridge_ServerInit (apr_pool_t* pPool,apr_pool_t* pLog,apr_pool_t* pTemp,server_rec* s) { if (module_globals->single_thread_exit == SINGLE_THREAD_EXIT_UNDEF) { module_globals->single_thread_exit = 1; } return OK; } /* Table of bridge control functions */ DLLEXPORT RIVET_MPM_BRIDGE { .server_init = WorkerBridge_ServerInit, .thread_init = WorkerBridge_ChildInit, .request_processor = WorkerBridge_Request, .child_finalize = WorkerBridge_Finalize, .exit_handler = WorkerBridge_ExitHandler, .thread_interp = WorkerBridge_Interp }; rivet-3.0.0/src/parser/000775 001750 001750 00000000000 15224454746 015515 5ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/rivet-tcl/load_response.tcl000664 001750 001750 00000001572 15224454746 022042 0ustar00manghimanghi000000 000000 ### ## ## load_response ?arrayName? ## Load any form variables passed to this page into an array. ## ## arrayName - Name of the array to set. Default is 'response'. ## ## $Id$ ## ### namespace eval ::rivet { proc load_response {{arrayName response}} { upvar 1 $arrayName response foreach {var elem} [::rivet::var all] { if {[info exists response(__$var)]} { # we have seen var multiple times already, add to the list lappend response($var) $elem } elseif {[info exists response($var)]} { # second occurence of var, convert response(var) list: set response($var) [list $response($var) $elem] set response(__$var) "" } else { # first time seeing this var set response($var) $elem } } } } rivet-3.0.0/doc/xml/installation.xml000664 001750 001750 00000032672 15224454746 020234 0ustar00manghimanghi000000 000000
Apache Rivet &version; Installation Rivet &version; runs with the Apache 2.4.x HTTP web server. It is known to build and run on various Linux distributions (Debian & Ubuntu, Redhat, SuSE and CentOS), FreeBSD and OpenBSD. For some of these Unix-like operative systems binary packages are already available for download. Rivet &version2-generic; was restricted to work with the prefork MPM of the Apache HTTP webserver. MPM modules are fundamental components of the webserver architecture. They provide multiple implementations of multiprocessing in order to better suit specific OS features and scalability requirements. The prefork MPM exploited the UNIX traditional approach to multiprocess server applications based on the fork system call. This model has several limitations but also some advantages. The solution we adopted tries to attain the best from any MPM as much as possible and Rivet &version; is now able to run with the worker and the event MPMs. Rivet &version; has not been ported to OS of the Windows family but we feel that the current design would fit just fine with the Windows specific MPMs such as winnt. If you need to build Apache Rivet yourself this is the procedure to follow Building Tcl: requirements Installing Rivet is about endowing the Apache HTTP webserver with the ability of running scripts written with the Tcl programming language. Therefore the Tcl language with its runtime, development libraries and shell (≥8.5.10 required, ≥8.6.0 recommended) have to be installed. Building Rivet you will have to tell the scripts where the Tcl libraries are located via the option of the configure script (see below). Several Tcl packages shipped with rivet need also the Itcl OOP extension of Tcl. If you need to run any of the Session or DIO packages you need to install this language extension but you don't need it to build mod_rivet The Apache HTTP Webserver development files and libraries are required along with the Apache Portable Runtime and the libapreq library. Building Rivet Getting and Installing the Apache Sources You can build Rivet either statically (compiled into the Apache web server) or dynamically (as a loadable shared library). We recommend that you build Rivet as a shared library, for maximum flexibility. We will tell Rivet where it the Apache development files and libraries are located via the option to configure (see below). Most modern Unix OS (Linux and FreeBSD systems included) come with their own packages of the Apache Web Server executables, runtime libraries and development files and libraries. Check the documentation of the package manager of your OS to find out how to install this software Uncompress Sources Download the sources at . We will assume that you have Apache installed at this point. You must uncompress the Rivet sources in the directory where you wish to compile them. gunzip rivet-&fullversion;.tar.gz tar -xvf rivet-&fullversion;.tar.gz Building Rivet Rivet uses the standard ./configure ; make ; make install sequence which installs to their target directories the Apache module, the binary libraries and the Tcl code There are several rivet specific options to configure that might be useful (or needed): --with-apache Defines the configure internal variable 'apache_base'. This variable points to the root of the Apache web server directory hierarchy --with-tcl This points to the directory where the tclConfig.sh file is located. --with-tclsh This points to the location of the tclsh executable. --with-apxs The location of the apxs program that provides information about the configuration and compilation options of Apache modules. --with-apache-include[=DIR] Locates the Apache include files on your computer, if they're not in standard directory. --enable-version-display=[yes|no] This option enables Rivet to display its version in the logfiles when Apache is started. The default is to keep the Rivet version hidden. --with-rivet-target-dir=DIR This option is for fine tuning of the installation final directories. Rivet Tcl packages, commands and loadable libraries go into the same directory hierarchy (by default is ${apache_base}/lib/rivet${PACKAGE_VERSION}, where $apache_base takes the value set by --with-apache) --with-upload-dir=DIR Configures Rivet's default upload directory. It can be overridden in the configuration either globally or specifically for a virtual host --with-post-max=BYTES The value to this option establishes a default for the maximum size of POST data. Default: 0 (unlimited size) --enable-head-requests By default HEAD requests don't go through the usual request processing which leads to script execution and therefore resource consumption and Rivet returns a standard hardcoded HTML header to save CPU time. --enable-head-requests can change the default. --enable-rivet-commands-export By default Rivet's commands are put on the export list of the ::rivet namespace. With this option you may prevent it thus forcing the programmers to fully qualify in their code. By default this option is enabled and it can be changed in the configuration with the directive ExportRivetNS. Disabling this option can be also reverted to 'On' with the --enable-import-rivet-commands switch --enable-import-rivet-commands Rivet's namespace is by default imported into the global namespace. Enabling the import of Rivet's commands overrides the switch and forces --enable-rivet-commands-export=yes thus demanding the commands to be exported (otherwise it would generate errors at run-time). This option is disabled by default and it can be changed in the configuration with the ImportRivetNS directive --enable-rivet-debug-build Enable definition of the preprocessor symbol RIVET_DEBUG_BUILD. This is used to conditionally include code into the build for development and debugging purposes --enable-virtual-interps-separation This option changes the default for the SeparateVirtualInterps configuration variable. Default: 0 (no separation among interpreters) Example: configuring the build system to compile Rivet for an Apache HTTP server custom installation, using tcl8.6. In this specific case the determination of the apxs path is redundant and it could be omitted since it could be inferred from the --with-apache option value ./configure --with-tcl=/usr/lib/tcl8.6/ --with-tclsh=/usr/bin/tclsh8.6 \ --with-apxs=/usr/local/apache2/bin/apxs --with-apache=/usr/local/apache2 \ --with-rivetlib-target-dir=/usr/local/apache2/rivet&version; Run make At this point, you are ready to run make, which should run to completion without any errors (a warning or two is OK, generally). Install Now, you are ready to run the make install to install the resulting files. The install target actually fires the install-binaries and install-packages targets which in turn copy the binary modules and Tcl packages to their destination directories. This commands create a functional Rivet environment with its core language. Apache Configuration Files Rivet is relatively easy to configure - we start off by adding the module itself: LoadModule rivet_module /usr/lib/apache2/modules/mod_rivet.so This tells Apache to load the Rivet shared object, wherever it happens to reside on your file system. Now we have to tell Apache what kind of files are "Rivet" files and how to process them: AddType application/x-httpd-rivet rvt AddType application/x-rivet-tcl tcl These tell Apache to process files with the .rvt and .tcl extensions as Rivet files. The characters encoding can be changed using the header type command, but you can also change the default charset for the whole site: AddType 'application/x-httpd-rivet;charset=utf-8' rvt All the pages generated by Rivet on this site will be sent with a Content-Type:'text/html;charset=utf-8' header. You may also wish to use Rivet files as index files for directories. In that case, you would do the following: DirectoryIndex index.html index.htm index.shtml index.cgi index.tcl index.rvt For other directives that Rivet provides for Apache configuration, please see .
rivet-3.0.0/doc/xml/examples.xml000664 001750 001750 00000035332 15224454746 017345 0ustar00manghimanghi000000 000000
Examples and Usage Some examples of Rivet usage follow. Some prior Tcl knowledge is assumed. If you don't know much Tcl, don't worry, it's easy, and there are some good resources available on the web that will get you up to speed quickly. Go to the web sites section and have a look. Hello World As with any tool, it's always nice to see something work, so let's create a small "Hello World" page. Assuming you have Apache configured correctly, create a file called hello.rvt where Apache can find it, with the following content: &hello.rvt; If you then access it with your browser, you should see a blank page with the text "Hello World" (without the quotes) on it. The command puts is the good old Tcl command for terminal printing, which appends to the argument string the control characters needed to open a newline. When you don't have to run through complex elaboration and the output can be lumped in a single string (just like in the 'Hello World' example) you can draw on the popular shorthand syntax for string output that comes handy in many cases &hello1.rvt; which is translated into puts -nonewline "Hello World" Generate a Colorful Table In another simple example, we dynamically generate a table selecting a different background color for each cell. The font color is determined through a simple CSS rule embedded in a HTML <style> element. Create the file colortable.rvt and put the following code in it &colortable; If you read the code, you can see that this is pure Tcl. We could take the same code, run it outside of Rivet, and it would generate the same HTML The result should look something like this: Variable Access Here, we demonstrate how to access variables set by GET or POST operations. Given an HTML form like the following: &vars.html; We can use this Rivet script to get the variable values: &vars.rvt; The first statement checks to make sure that the boss variable has been passed to the script, and then does something with that information. If it's not present, an error is added to the list of errors. In the second block of code, the variable salary is fetched, with one more error check - because it's a number, it needs to be composed of digits. The boss variable isn't required to have been sent - we set it to "Mr. Burns" if it isn't among the information we received. The last bit of variable handing code is a bit trickier. Because skills is a listbox, and can potentially have multiple values, we opt to receive them as a list, so that at some point, we could iterate over them. The script then checks to make sure that errlist is empty and outputting a thankyou message. If errlist is not empty, the list of errors it contains is printed. File Upload The ::rivet::upload command endows Rivet with an interface to access files transferred over http as parts of a multipart form. The following HTML in one file, say, upload.html creates a form with a text input entry. By clicking the file chooser button the file browser shows up and the user selects the file to be uploaded (the file path will appear in the text input). In order to make sure you're uploading the whole file you must combine the action of the enctype and method attributes of the <form...> tag in the way shown in the example. Failure to do so would result in the client sending only the file's path, rather than the actual contents. &upload.html; In the script invoked by the form (upload.rvt) upload argument ... commands can be used to manipulate the various files uploaded. &upload.rvt; Don't forget that the apache server must have write access to the directory where files are being created. The Rivet Apache directives have a substantial impact on the upload process, you have to carefully read the docs in order to set the appropriate directives values that would match your requirements. It is also important to understand that some upload commands are effective only when used in a mutually exclusive way. Apache stores the data in temporary files which are read by the upload save upload namefilename or by the upload data upload name command. Subsequent calls to these 2 commands using the same upload name argument will return no data on the second call. Likewise upload channel upload name will return a Tcl file channel that you can use in regular Tcl scripts only if you haven't already read the data, for example with a call to the upload data upload name command. File Download In general setting up a data file for being sent over http is as easy as determining the file's URI and letting Apache's do all that is needed. If this approach fits your design all you have to do is to keep the downloadable files somewhere within Apache's DocumentRoot (or in any of the directories Apache has right to access). When a client sends a request for a file, Apache takes care of determining the filetype, sends appropriate headers to the client and then the file content. The client is responsible for deciding how to handle the data accordingly to the "content-type" headers and its internal design. For example when browsers give up trying to display a certain "content-type" they display a download dialog box asking for directions from the user. Rivet can help if you have more sofisticated needs. For instance you may be developing an application that uses webpages to collect input data. This information might be passed on to scripts or programs for processing. In this case a real file representing the data doesn't exist and the content is generated on demand by the server. In other circumstances you may need to dynamically inhibit the download of specific files and hide them away, Your scripts may expunge from the pages every link to these files (your pages are dynamic, aren't they?) and move them out of way, but it looks like a cumbersome solution. Putting Tcl and Rivet in charge of the whole download mechanism helps in building cleaner and safer approaches to the download problem. In this example a procedure checks for the existence of a parameter passed in by the browser. The parameter is the name (without extension) of a pdf file. Pdf files are stored in a directory whose path is in the pdf_repository variable. This code is reported as an example of how to control the protocol using the headers command. &download.tcl; Before the pdf is sent the procedure sets the Content-Type, Content-Disposition, Content-Description and Content-Length headers to inform the client about the file type, name and size. Notice that in order to set the Content-Type header Rivet uses a specialiezed form of the headers command. Headers must be sent before data gets sent down the output channel. Messing with this prescription causes an error to be raised (in fact the protocol itself is been violated) More information about the meaning of the mime headers in the http context can be found at XML Messages and Ajax The headers command is crucial for generating XML messages that have to be understood by JavaScript code used in Ajax applications. Ajax is a web programming technique that heavily relies on the abilty of a web browser to run in backround JavaScript functions. JavaScript functions can be run as callbacks of events generated by a user interaction but they can also react to other I/O events, for example network events. Modern browsers endow JavaScript with the ability to build http GET/POST requests to be sent to a remote webserver. Generally these requests refer to scripts (e.g. Tcl scripts run by Rivet) which inherit as variables the arguments encoded in the request. The output produced by these scripts is sent back to the browser where callbacks functions extract information and hand it down to functions that directly manipulate a page's DOM. Therefore through Ajax becomes possible to build web applications that are more responsive and flexible: instead of going through the cycle of request-generation-transfer-display of a whole page, Ajax scripts request from a webserver only the essential data to be displayed. Ajax emphasizes the requirement of separation between data and user interface, saves the server from sending over the same html code and graphics if only a fraction of a page has to be updated, allows the programmer to design flexible solutions for complex forms and makes possible to find new innovative approaches to simple problems (e.g. Google tips that show up as you type in a query). A downside of this approach is the large number of complexities, subtleties and incompatibilities that still exist in the way different versions of popular browsers handle the DOM elements of a page. JavaScript can handle the communication between client and server through an instance of a specialized object. For quite a long time 2 approaches existed, the non-IE world (Firefox,Safari,Opera...) used the XMLHttpRequest class to create this object, whereas IE (before IE7) used the ActiveXObject class. With the release of IE7 Microsoft introduced native support for XMLHttpRequest class objects thus enabling programmers with a unique method for the development of dynamic pages. By creating an instance of this class a POST or GET request can be sent to the server and the response is stored in a property ('returnedText') of the communication object. It's become widely customary to encode these responses in XML messages. You can invent your own message structure (either based on XML or anything else), but one has to be aware that if the http headers are properly set and the message returned to the client is a well formed XML fragment, also the property XMLResponse is assigned with a reference to an object that represents the DOM of the XML response. By means of the XML W3C DOM interface the programmer can easily manipulate the data embedded in the XML message. In this example a Rivet script initializes an array with the essential data regarding a few of the major composers of the european music. This array plays the role of a database. The script sends back to the client two types of responses: a catalog of the composers or a single record of a composer. &rivet_web_service.tcl; For sake of brevity the JavaScript and HTML will not listed here. They can be downloaded (along with the Tcl script) stored in the rivet-ajax.tar.gz archive. By simply opening this tar archive in a directory accessible by your apache server and pointing your browser to the rivetService.html page you should see a page with a drop-down list. Every time a different name is picked from the list a new query is sent and logged in the apache access.log file, even though the html is never reloaded. A Calendar Utility Rivet comes with a Calendar package that provides classes for printing calendar tables in various forms. The HtmlCalendar class prints a calendar table in a similar form the Unix program 'cal' does. Example: the following code package require Calendar proc ::cal_cell_attributes { day month year weekday } { if {$weekday == 3} { return [list class curr_wkday] } } set htmlc [HtmlCalendar #auto] set html_txt [$htmlc emit -container {table class calendar} -current_weekday 3 \ -cell_function cal_cell_attributes ] puts $html_txt with some CSS styling would print
rivet-3.0.0/doc/html/images/caution.png000644 001750 001750 00000002342 15224455140 020544 0ustar00manghimanghi000000 000000 PNG  IHDRשPLTE!!11BBZZcckkss{{sss{s{cZcc19B191_\bKGDHIDATxuێ@ b̮IcAP`bxsBEU_Oh<`'1wp Wȝt:%su&w,Hȯf 59v:\^ F;`HJ'871ZJ+b2B8Q$wRK v)nRpt}VbTzDv@=rPduvz{Nl;a*CtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignaturec70387830aa4ecd5a4a32a852283b3d6PtEXtPage24x24+0+0r[ 1IENDB`rivet-3.0.0/doc/html/parse.html000664 001750 001750 00000007027 15224455137 017144 0ustar00manghimanghi000000 000000 parse

Name

parse — parses a Rivet template file.

Synopsis

::rivet::parse ?-encoding encoding? ?-virtual? ?filename?
::rivet::parse -string template_string

Description

Like the Tcl source command, but also parses for Rivet <? and ?> processing tags. Using this command, you can use one .rvt file from another. The optional -encoding argument selects the external character encoding used to read the file. When omitted, the Tcl system encoding is retained for compatibility. Newline translation is disabled when an explicit encoding is selected. The -string form accepts an existing Tcl string and therefore performs no character decoding.

rivet-3.0.0/tests/exit.tcl000664 001750 001750 00000000211 15224454746 016243 0ustar00manghimanghi000000 000000 # -- exit.tcl # # testing the effects of calling the core exit command which # actually is being shadowed by ::rivet::exit # ::exit 100 rivet-3.0.0/tests/makeurl.rvt000664 001750 001750 00000000572 15224454746 016775 0ustar00manghimanghi000000 000000 rivet-3.0.0/tclconfig/depcomp000775 001750 001750 00000056020 15224454746 016762 0ustar00manghimanghi000000 000000 #! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2018-03-07.03; # UTC # Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program 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, 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. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: rivet-3.0.0/doc/html/internals.html000664 001750 001750 00000061552 15224455140 020026 0ustar00manghimanghi000000 000000 Rivet Internals

Rivet Internals

This section easily falls out of date, as new code is added, old code is removed, and changes are made. The best place to look is the source code itself. If you are interested in the changes themselves, the Subversion revision control system (svn) can provide you with information about what has been happening with the code.

Rivet approach to Apache Multiprocessing Models

The Apache HTTP web server has an extremely modular architecture that made it very popular among web developers. Most of the server features can be implemented in external modules, including some of the way the server interfaces to the operative system. The multiprocessing modules are meant to provide different models for distributing the server workload but also to cope with different operative systems having their specific architectures and services.

From the very beginning mod_rivet was designed to work with the prefork MPM MPM (Multi Processing Module) which assumes the OS to have 'fork' capabilities. This prerequisite basically restricted mod_rivet to work only with Unix-like operative systems. Starting with version 3.0 we reorganized mod_rivet to offer a design that could work together with more MPM and hopefully pave the way to support different OS that have no 'fork' call. At the same time we tried to preserve some of the basic features of mod_rivet when working with the prefork MPM, chiefly the feature of the Unix fork system call of 'cloning' a parent process memory into its child, thus allowing fast initialization of interpreters.

The central design of mod_rivet now relies on the idea of MPM bridges, loadable modules that are responsible to adapt the module procedural design to a given class of Apache MPMs. This design is open to the development of more MPM bridges coping with different multi-processing models but also to the development of different approaches to resource consumption and workload balance. Currently we have 3 bridges:

  • rivet_prefork_mpm.c: a bridge for the prefork MPM
  • rivet_worker_mpm.c: a threaded bridge creating a pool of threads each running Tcl interpreters and communicating with the worker MPM threads through a thread safe queue. This bridge is needed by the worker MPM and by any the winnt MPM on Windows.
  • rivet_lazy_mpm.c: a threaded bridge where Tcl threads are started on demand. The bridge creates no threads and Tcl interpreters at start up, only when requests come in Tcl execution threads are created. This bridge is explained in detail in the the section called “Example: the Lazy bridge”. Since the resource demand at startup is minimal this bridge should suit development machines that go through frequent web server restarts.

mod_rivet MPM Bridge callbacks

A bridge is a loadable library implementing different ways to handle specific features needed to mod_rivet. It was originally meant as a way to handle the prefork/worker/event MPM specificities, at the same time avoiding the need to stuff the code with conditional statements that would have implied useless complexity (an instance of the Apache web server can run only an MPM at a time), error prone programming and performance costs. New bridges could be imagined also to implement different models of workload and resource management (like the resources demanded by the Tcl interpreters). We designed an interface between the core of mod_rivet and its MPM bridges based on a set of functions defined in the rivet_bridge_table structure.

typedef struct _mpm_bridge_table {
    RivetBridge_ServerInit    *server_init;
    RivetBridge_ThreadInit    *thread_init;
    RivetBridge_Request       *request_processor;
    RivetBridge_Finalize      *child_finalize;
    RivetBridge_Exit_Handler  *exit_handler;
    RivetBridge_Thread_Interp *thread_interp;
} rivet_bridge_table;

  • mpm_server_init: pointer to any specific server inititalization function. This field can be NULL if no bridge specific initialization is needed. The core of mod_rivet runs the ServerInitScript before calling this function.
  • mpm_child_init: Bridge specific child process initialization. If the pointer is assigned with a non-NULL value the function is called by Rivet_ChildInit.
  • mpm_request: This pointer must be a valid function pointer to the content generator implemented by the bridge. If the pointer is not defined the Apache web server will stop at start up. This condition is motivated by the need of avoiding useless testing of the pointer. The fundamental purpose of a content generator module (like mod_rivet) is to respond to requests creating content, thus whatever it is a content generating function must exist (during the early stages of development you can create a simple test function for that). In a threaded MPM this function typically prepares the request processing stuffing somewhere the pointer to the request_rec structure passed by the web server and then it calls some method to communicate these data to the Tcl execution thread waiting for result to be returned. The prefork bridge is an exception since there are no threads and the bridge calls directly Rivet_SendContent
  • mpm_finalize: pointer to a finalization function called during a child process exit. This function is registered as child process memory pool cleanup function. If the pointer is NULL the pool is given a default cleanup function (apr_pool_cleanup_null) defined in src/mod_rivet/mod_rivet.c. For instance the finalize function in the worker MPM bridge notifies a supervisor thread demanding the whole pool of threads running Tcl interpreters to orderly exit. This pointer can be NULL if the bridge has no special need when a child process must exit (unlikely if you have multiple threads running)
  • mpm_exit_handler: mod_rivet replaces the core exit command with a new one (::rivet::exit). This command must handle the process exit in the best possible way for the bridge and the threading model it implements (for the 2 current threaded bridges this implies signaling the threads to exit). The ::rivet::exit actually doesn't terminate the process, but interrupts execution returning a specific error code commands ::rivet::catch and ::rivet::try can detect. Before the process is terminated the AbortScript script is fired and ::rivet::abort_code returns a message describing the exit condition. For instance the worker MPM bridge the finalize function is called after the current thread itself is set up for termination. See function Rivet_ExitCmd in rivetCore.c to have details on how and at what stage this callback is invoked.
  • mpm_thread_interp must be a function returning the interpreter object (a pointer to record of type rivet_thread_interp) associated to a given configuration as stored in a rivet_server_conf* object. This element was temporarily introduced in the mpm_bridge_table table and should be accessed through the macro RIVET_PEEK_INTERP.
    interp_obj = RIVET_PEEK_INTERP(private,private->conf);
    Every bridge implementation should have its own way to store interpreter data and manage their status. So this macro (and associated function) should hide from the module core function the specific approach followed in a particular bridge

Server Initialization and MPM Bridge

RivetChan

The RivetChan system was created in order to have an actual Tcl channel that we could redirect standard output to. This enables us use, for instance, the regular puts command in .rvt pages. It works by creating a channel that buffers output, and, at predetermined times, passes it on to Apache's I/O system. Tcl's regular standard output is replaced with an instance of this channel type, so that, by default, output will go to the web page.

The global Command

Rivet aims to run standard Tcl code with as few surprises as possible. At times this involves some compromises - in this case regarding the global command. The problem is that the command will create truly global variables. If the user is just cut'n'pasting some Tcl code into Rivet, they most likely just want to be able to share the variable in question with other procs, and don't really care if the variable is actually persistant between pages. The solution we have created is to create a proc ::request::global that takes the place of the global command in Rivet templates. If you really need a true global variable, use either ::global or add the :: namespace qualifier to variables you wish to make global.

Page Parsing, Execution and Caching

When a Rivet page is requested, it is transformed into an ordinary Tcl script by parsing the file for the <? ?> processing instruction tags. Everything outside these tags becomes a large puts statement, and everything inside them remains Tcl code.

Each .rvt file is evaluated in its own ::request namespace, so that it is not necessary to create and tear down interpreters after each page. By running in its own namespace, though, each page will not run afoul of local variables created by other scripts, because they will be deleted automatically when the namespace goes away after Apache finishes handling the request.

[Note]Note
One current problem with this system is that while variables are garbage collected, file handles are not, so that it is very important that Rivet script authors make sure to close all the files they open.

After a script has been loaded and parsed into it's "pure Tcl" form, it is also cached, so that it may be used in the future without having to reload it (and re-parse it) from the disk. The number of scripts stored in memory is configurable. This feature can significantly improve performance.

Extending Rivet by developing C code procedures

Rivet endows the Tcl interpreter with new commands serving as interface between the application layer and the Apache web server. Many of these commands are meaningful only when a HTTP request is under way and therefore a request_rec object allocated by the framework is existing and was passed to mod_rivet as argument of a callback. In case commands have to gain access to a valid request_rec object the C procedure must check if such a pointer exists and it's initialized with valid data. For this purpose the procedure handling requests (Rivet_SendContent) makes a copy of such pointer and keeps it in an internal structure. The copy is set to NULL just before returning to the framework, right after mod_rivet's has carried out its request processing. When the pointer copy is NULL the module is outside any request processing and this condition invalidates the execution of many of the Rivet commands. In case they are called (for example in a ChildInitScript, GlobalInitScript, ServerInitScript or ChildExitScript) they fail with a Tcl error you can handle with a catch command.

For this purpose in src/rivet.h the macro CHECK_REQUEST_REC was defined accepting two arguments: the thread private data object and the command name. If the pointer is NULL the macro calls Tcl_NoRequestRec and returns TCL_ERROR causing the command to fail. These are the steps to follow in order to write a new C language command for mod_rivet

  • Define the command and associated C language procedure in src/mod_rivet_ng/rivetCore.c using the macro RIVET_OBJ_CMD
    RIVET_OBJ_CMD("mycmd",Rivet_MyCmd,private)
    This macro ensures the command is defined as ::rivet::mycmd and its ClientData pointer is defined with the thread private data
  • Add the code of Rivet_MyCmd to src/mod_rivet_ng/rivetCore.c (in case the code resides in a different file also src/Makefile.am should be changed to tell the build system how to compile the code and link it into mod_rivet.so)
  • If the code must have access to the request record in private->r use the macro THREAD_PRIVATE_DATA in order to claim the thread private data, then check for the validity of the pointer using the macro CHECK_REQUEST_REC(private,"::rivet::<cmd_name>")
    TCL_CMD_HEADER(Rivet_MyCmd)
    {
        /* we have to get the thread private data */
        
        THREAD_PRIVATE_DATA(private)
    
    	/* if ::rivet::mycmd works within a request processing we have
    	 * to check if 'private' is carrying a non null request_rec pointer
    	 */
        
        CHECK_REQUEST_REC(private,"::rivet::mycmd");
        ....
        
        return TCL_OK;
    }
  • Add a test for this command in tests/checkfails.tcl. For instance
    ...
    check_fail no_body
    check_fail virtual_filename unkn
    check_fail my_cmd <arg1> <arg2>
    ....
    Where <arg1> <arg2> are optional arguments in case the command has different forms depending on the arguments. Then, if ::rivet::mycmd must fail also tests/failtest.tcl should modified as
    virtual_filename->1
    mycmd->1
    The value associated to the test must be 0 in case the command doesn't need to test the private->r pointer.

Debugging Rivet and Apache

If you are interested in hacking on Rivet, you're welcome to contribute! Invariably, when working with code, things go wrong, and it's necessary to do some debugging. In a server environment like Apache, it can be a bit more difficult to find the right way to do this. Here are some techniques to try.

The first thing you should know is that Apache can be launched as a single process with the -X argument:

httpd -X
.

On Linux, one of the first things to try is the system call tracer, strace. You don't even have to recompile Rivet or Apache for this to work.

strace -o /tmp/outputfile -S 1000 httpd -X

This command will run httpd in the system call tracer, which leaves its output (there is potentially a lot of it) in /tmp/outputfile. The -S option tells strace to only record the first 1000 bytes of a syscall. Some calls such as write can potentially be much longer than this, so you may want to increase this number. The results are a list of all the system calls made by the program. You want to look at the end, where the failure presumably occured, to see if you can find anything that looks like an error. If you're not sure what to make of the results, you can always ask on the Rivet development mailing list.

If strace (or its equivalent on your operating system) doesn't answer your question, it may be time to debug Apache and Rivet. To do this, you will need to rebuild mod_rivet. First of all you have to configure the build by running the ./configure script with the -enable-symbols option and after you have set the CFLAGS and LDFLAGS environment variables

export CFLAGS="-g -O0"
export LDFLAGS="-g"
./configure --enable-symbols ......
make
make install

Arguments to ./configure must fit your Apache HTTP web server installation. See the output produced by

./configure --help

And check the the section called “Apache Rivet 3.3 Installation” page to have further information. Since it's easier to debug a single process, we'll still run Apache in single process mode with -X:

@ashland [~] $ gdb /usr/sbin/apache.dbg
GNU gdb 5.3-debian
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "powerpc-linux"...
(gdb) run -X
Starting program: /usr/sbin/apache.dbg -X
[New Thread 16384 (LWP 13598)]
.
.
.

When your apache session is up and running, you can request a web page with the browser, and see where things go wrong (if you are dealing with a crash, for instance).

rivet-3.0.0/doc/html/examples.html000664 001750 001750 00000067226 15224455137 017657 0ustar00manghimanghi000000 000000 Examples and Usage

Examples and Usage

Some examples of Rivet usage follow. Some prior Tcl knowledge is assumed. If you don't know much Tcl, don't worry, it's easy, and there are some good resources available on the web that will get you up to speed quickly. Go to the web sites section and have a look.

Example 1. Hello World

As with any tool, it's always nice to see something work, so let's create a small "Hello World" page.

Assuming you have Apache configured correctly, create a file called hello.rvt where Apache can find it, with the following content:

<?
puts "Hello World"
?>

If you then access it with your browser, you should see a blank page with the text "Hello World" (without the quotes) on it. The command puts is the good old Tcl command for terminal printing, which appends to the argument string the control characters needed to open a newline. When you don't have to run through complex elaboration and the output can be lumped in a single string (just like in the 'Hello World' example) you can draw on the popular shorthand syntax for string output that comes handy in many cases

<?= "Hello World" ?>

which is translated into

puts -nonewline "Hello World"


Example 2. Generate a Colorful Table

In another simple example, we dynamically generate a table selecting a different background color for each cell. The font color is determined through a simple CSS rule embedded in a HTML <style> element. Create the file colortable.rvt and put the following code in it

<html><head>
    <style>
        td { 
            font-size: 12px;
            font-family: monospace;
            text-align: center;
            padding-left: 3px;
            padding-right: 3px
        }
        td.bright { color: #eee; }
        td.dark   { color: #222; }
    </style>
</head>
<body>
    <table>
<?
# we create a 9x9 table selecting a different background for each cell

for {set i 0} { $i < 9 } {incr i} {
    puts "<tr>"
    for {set j 0} {$j < 9} {incr j} {

        set r [expr int(255 * ($i + $j) / 16)] 
        set g [expr int(255 * (8 + $j - $i) / 16)]
        set b [expr int(255 * (abs (4 - $i) + abs(4 - $j)) / 8)]

# determining the background luminosity (YIQ space of NTSC) and choosing
# the foreground color accordingly in order maintain maximum contrast

        if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 148.0} {
            set cssclass "dark"
        } else {
            set cssclass "bright"
        }

        set cell [format "%3d %3d %3d" $r $g $b]

        puts [format \
            "<td bgcolor=\"%02x%02x%02x\" class=\"%s\">%s</td>" \
                                            $r $g $b $cssclass $cell]
    }
    puts "</tr>"
}
?>
    </table>
</body></html>

If you read the code, you can see that this is pure Tcl. We could take the same code, run it outside of Rivet, and it would generate the same HTML

The result should look something like this:


Example 3. Variable Access

Here, we demonstrate how to access variables set by GET or POST operations.

Given an HTML form like the following:

<form action="vars.rvt">
  <table>
    <tbody>
      <tr>
        <td><b>Title:</b></td>
        <td><input name="title" /></td>
      </tr>
      <tr>
        <td><b>Salary:</b></td>
        <td><input name="salary" /></td>
      </tr>
      <tr>
        <td><b>Boss:</b></td>
        <td><input name="boss" /></td></tr>
      <tr>
        <td><b>Skills:</b></td>
        <td>
          <select name="skills" multiple="multiple">
            <option>C</option>
            <option>Java</option>
            <option>Tcl</option>
            <option>Perl</option>
          </select>
        </td>
      </tr>
      <tr>
        <td><input type="submit" /></td>
      </tr>
    </tbody>
  </table>
</form>

We can use this Rivet script to get the variable values:

<?
set errlist {}
if { [::rivet::var exists title] } {
    set title [::rivet::var get title]
} else {
    set errlist "You need to enter a title"
}

if { [::rivet::var exists salary] } {
    set salary [::rivet::var get salary]
    if { ! [string is digit $salary] } {
        lappend errlist "Salary must be a number"
    }
} else {
    lappend errlist "You need to enter a salary"
}

if { [::rivet::var exists boss] } {
    set boss [::rivet::var get boss]
} else {
    set boss "Mr. Burns"
}

if { [::rivet::var exists skills] } {
    set skills [::rivet::var list skills]
} else {
    lappend errlist "You need to enter some skills"
}

if { [llength $errlist] != 0 } {
    foreach err $errlist {
        puts "<b> $err </b>"
    }
} else {
    puts "Thanks for the information!"
    ?>
    <table>
      <tbody>
        <tr>
          <td><b>Title:</b></td>
          <td><?= $title ?></td>
        </tr>
        <tr>
          <td><b>Boss:</b></td>
          <td><?= $boss ?></td>
        </tr>
        <tr>
          <td><b>Salary:</b></td>
          <td><?= $salary ?></td>
        </tr>
        <tr>
          <td><b>Skills:</b></td>
          <td><?= $skills ?></td>
        </tr>
      </tbody>
    </table>
    <?
}
?>

The first statement checks to make sure that the boss variable has been passed to the script, and then does something with that information. If it's not present, an error is added to the list of errors.

In the second block of code, the variable salary is fetched, with one more error check - because it's a number, it needs to be composed of digits.

The boss variable isn't required to have been sent - we set it to "Mr. Burns" if it isn't among the information we received.

The last bit of variable handing code is a bit trickier. Because skills is a listbox, and can potentially have multiple values, we opt to receive them as a list, so that at some point, we could iterate over them.

The script then checks to make sure that errlist is empty and outputting a thankyou message. If errlist is not empty, the list of errors it contains is printed.


Example 4. File Upload

The ::rivet::upload command endows Rivet with an interface to access files transferred over http as parts of a multipart form. The following HTML in one file, say, upload.html creates a form with a text input entry. By clicking the file chooser button the file browser shows up and the user selects the file to be uploaded (the file path will appear in the text input). In order to make sure you're uploading the whole file you must combine the action of the enctype and method attributes of the <form...> tag in the way shown in the example. Failure to do so would result in the client sending only the file's path, rather than the actual contents.

<form action="foo.rvt" enctype="multipart/form-data" method="post">
<input type="file" name="MyUpload"></input>
<input type="submit" value="Send File"></input>
</form>

In the script invoked by the form (upload.rvt) upload ?argument ...? commands can be used to manipulate the various files uploaded.

<?
::rivet::upload save MyUpload /tmp/uploadfiles/file1
puts "Saved file [::rivet::upload filename MyUpload] \
	([::rivet::upload size MyUpload] bytes) to server"
?>

Don't forget that the apache server must have write access to the directory where files are being created. The Rivet Apache directives have a substantial impact on the upload process, you have to carefully read the docs in order to set the appropriate directives values that would match your requirements.

It is also important to understand that some upload commands are effective only when used in a mutually exclusive way. Apache stores the data in temporary files which are read by the upload save ?upload name? ?filename? or by the upload data ?upload name? command. Subsequent calls to these 2 commands using the same ?upload name? argument will return no data on the second call. Likewise upload channel ?upload name? will return a Tcl file channel that you can use in regular Tcl scripts only if you haven't already read the data, for example with a call to the upload data ?upload name? command.


Example 5. File Download

In general setting up a data file for being sent over http is as easy as determining the file's URI and letting Apache's do all that is needed. If this approach fits your design all you have to do is to keep the downloadable files somewhere within Apache's DocumentRoot (or in any of the directories Apache has right to access).

When a client sends a request for a file, Apache takes care of determining the filetype, sends appropriate headers to the client and then the file content. The client is responsible for deciding how to handle the data accordingly to the "content-type" headers and its internal design. For example when browsers give up trying to display a certain "content-type" they display a download dialog box asking for directions from the user.

Rivet can help if you have more sofisticated needs. For instance you may be developing an application that uses webpages to collect input data. This information might be passed on to scripts or programs for processing. In this case a real file representing the data doesn't exist and the content is generated on demand by the server. In other circumstances you may need to dynamically inhibit the download of specific files and hide them away, Your scripts may expunge from the pages every link to these files (your pages are dynamic, aren't they?) and move them out of way, but it looks like a cumbersome solution.

Putting Tcl and Rivet in charge of the whole download mechanism helps in building cleaner and safer approaches to the download problem.

In this example a procedure checks for the existence of a parameter passed in by the browser. The parameter is the name (without extension) of a pdf file. Pdf files are stored in a directory whose path is in the pdf_repository variable.

This code is reported as an example of how to control the protocol using the headers command.

# Code example for the transmission of a pdf file. 

if {[::rivet::var exists pdfname]} {
    set pdfname [::rivet::var get pdfname]

# let's build the full path to the pdf file. The 'pdf_repository'
# directory must be readable by the apache children

    set pdf_full_path [file join $pdf_repository ${pdfname}.pdf]
    if {[file exists $pdf_full_path]} {

# Before the file is sent we inform the client about the file type and
# file name. The client can be proposed a filename different from the
# original one. In this case, this is the point where a new file name
# must be generated.

        ::rivet::headers type                       "application/pdf"
        ::rivet::headers add Content-Disposition    "attachment; filename=${pdfname}.pdf"
        ::rivet::headers add Content-Description    "PDF Document"

# The pdf is read and stored in a Tcl variable. The file handle is
# configured for a binary read: we are just shipping raw data to a
# client. The following 4 lines of code can be replaced by any code
# that is able to retrieve the data to be sent from any data source
# (e.g. database, external program, other Tcl code)

        set paper       [open $pdf_full_path r]
        fconfigure      $paper -translation binary
        set pdf         [read $paper]
        close $paper

# Now we got the data: let's tell the client how many bytes we are
# about to send (useful for the download progress bar of a dialog box)

        ::rivet::headers add Content-Length  [string length $pdf]

# Let's send the actual file content

        puts $pdf
    } else {
        source pdf_not_found_error.rvt
    }
} else {
    source parameter_not_defined_error.rvt
}

Before the pdf is sent the procedure sets the Content-Type, Content-Disposition, Content-Description and Content-Length headers to inform the client about the file type, name and size. Notice that in order to set the Content-Type header Rivet uses a specialiezed form of the headers command. Headers must be sent before data gets sent down the output channel. Messing with this prescription causes an error to be raised (in fact the protocol itself is been violated)

More information about the meaning of the mime headers in the http context can be found at http://www.w3.org/Protocols/rfc2616/rfc2616.html


Example 6. XML Messages and Ajax

The headers command is crucial for generating XML messages that have to be understood by JavaScript code used in Ajax applications.

Ajax is a web programming technique that heavily relies on the abilty of a web browser to run in backround JavaScript functions. JavaScript functions can be run as callbacks of events generated by a user interaction but they can also react to other I/O events, for example network events. Modern browsers endow JavaScript with the ability to build http GET/POST requests to be sent to a remote webserver. Generally these requests refer to scripts (e.g. Tcl scripts run by Rivet) which inherit as variables the arguments encoded in the request. The output produced by these scripts is sent back to the browser where callbacks functions extract information and hand it down to functions that directly manipulate a page's DOM. Therefore through Ajax becomes possible to build web applications that are more responsive and flexible: instead of going through the cycle of request-generation-transfer-display of a whole page, Ajax scripts request from a webserver only the essential data to be displayed. Ajax emphasizes the requirement of separation between data and user interface, saves the server from sending over the same html code and graphics if only a fraction of a page has to be updated, allows the programmer to design flexible solutions for complex forms and makes possible to find new innovative approaches to simple problems (e.g. Google tips that show up as you type in a query). A downside of this approach is the large number of complexities, subtleties and incompatibilities that still exist in the way different versions of popular browsers handle the DOM elements of a page.

JavaScript can handle the communication between client and server through an instance of a specialized object. For quite a long time 2 approaches existed, the non-IE world (Firefox,Safari,Opera...) used the XMLHttpRequest class to create this object, whereas IE (before IE7) used the ActiveXObject class. With the release of IE7 Microsoft introduced native support for XMLHttpRequest class objects thus enabling programmers with a unique method for the development of dynamic pages.

By creating an instance of this class a POST or GET request can be sent to the server and the response is stored in a property ('returnedText') of the communication object. It's become widely customary to encode these responses in XML messages. You can invent your own message structure (either based on XML or anything else), but one has to be aware that if the http headers are properly set and the message returned to the client is a well formed XML fragment, also the property XMLResponse is assigned with a reference to an object that represents the DOM of the XML response. By means of the XML W3C DOM interface the programmer can easily manipulate the data embedded in the XML message.

In this example a Rivet script initializes an array with the essential data regarding a few of the major composers of the european music. This array plays the role of a database. The script sends back to the client two types of responses: a catalog of the composers or a single record of a composer.

#
# Ajax query servelet: a pseudo database is built into the dictionary 'composers' with the
# purpose of emulating the role of a real data source. 
# The script answers with  2 types of responses: a catalog of the record ids and a database 
# entry matching a given rec_id. The script obviously misses the error handling and the
# likes. Just an example to see rivet sending xml data to a browser. The full Tcl, JavaScript
# and HTML code are available from http://people.apache.org/~mxmanghi/rivet-ajax.tar.gz

# This example requires Tcl8.5 or Tcl8.4 with package 'dict' 
# (http://pascal.scheffers.net/software/tclDict-8.5.2.tar.gz)
# 

# A pseudo database. rec_id matches a record in the db

set composers [dict create  \
                1 {first_name Claudio middle_name "" last_name Monteverdi   \
                    lifespan 1567-1643 era Renaissance/Baroque}             \
                2 {first_name Johann middle_name Sebastian last_name Bach   \
                    lifespan 1685-1750 era Baroque }                        \
                3 {first_name Ludwig middle_name "" last_name "van Beethoven" \
                    lifespan 1770-1827 era Classical/Romantic}              \
                4 {first_name Wolfgang middle_name Amadeus last_name Mozart \
                    lifespan 1756-1791 era Classical }                      \
                5 {first_name Robert middle_name "" last_name Schumann      \
                    lifespan 1810-1856 era Romantic} ]

# we use the 'load' argument in order to determine the type of query
#
# load=catalog:         we have to return a list of the names in the database
# load=composer&amp;res_id=<id>: the script is supposed to return the record
#               having <id> as record id

if {[::rivet::var exists load]} {

# the xml declaration is common to every message (error messages included)

    set xml "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n"
    switch [::rivet::var get load] {
        catalog {
            append xml "<catalog>\n"
            foreach nm [dict keys $composers] {
                set first_name  [dict get $composers $nm first_name]
                set middle_name [dict get $composers $nm middle_name]
                set last_name   [dict get $composers $nm last_name]
                append xml "    <composer key=\"$nm\">$first_name "
                if {[string length [string trim $middle_name]] > 0} {
                    append xml "$middle_name "
                }
                append xml "$last_name</composer>\n"
            }
            append xml "</catalog>\n"
        }
        composer {
            append xml "<composer>\n"
            if {[::rivet::var exists rec_id]} {
                set rec_id [::rivet::var get rec_id]
                if {[dict exists $composers $rec_id]} {
                    foreach {k v} [dict get $composers $rec_id] {
                        append xml "<$k>$v</$k>\n"
                    }
                }
            }
            append xml "</composer>\n"
        }
    }

# we have to tell the client this is an XML message. Failing to do so
# would result in an XMLResponse property set to null

    ::rivet::headers type "text/xml"
    ::rivet::headers add Content-Length [string length $xml]
    puts $xml
}


For sake of brevity the JavaScript and HTML will not listed here. They can be downloaded (along with the Tcl script) stored in the rivet-ajax.tar.gz archive. By simply opening this tar archive in a directory accessible by your apache server and pointing your browser to the rivetService.html page you should see a page with a drop-down list. Every time a different name is picked from the list a new query is sent and logged in the apache access.log file, even though the html is never reloaded.


Example 7. A Calendar Utility

Rivet comes with a Calendar package that provides classes for printing calendar tables in various forms.

The HtmlCalendar class prints a calendar table in a similar form the Unix program 'cal' does. Example: the following code

package require Calendar

proc ::cal_cell_attributes { day month year weekday } {
    if {$weekday == 3} {
        return [list class curr_wkday]
    }
}

set htmlc [HtmlCalendar #auto]
set html_txt [$htmlc emit -container {table class calendar} -current_weekday 3 \
                          -cell_function cal_cell_attributes ]
puts $html_txt

with some CSS styling would print


rivet-3.0.0/doc/examples.rvt000664 001750 001750 00000006762 15224454746 016565 0ustar00manghimanghi000000 000000 Rivet examples
Rivet examples

These are some examples, rather limited ones, of what can be done with Rivet.

\n" for {set j 1} {$j <= 8} {incr j} { set num [ expr {$i * $j * 4 - 1} ] puts [ format "\n" $num $num $num ] } incr i puts "\n" } puts "

Hello world

<?
cookie "foo" "bar" # we have to put this before any 'puts' statements

puts "Hello world"
?>

Produces:


Conditionals:

<? if { 1 } { ?>

<h2> True </h2>

<? }  ?>

Produces:

True


Loops:

<? 
set x 0 
while { $x < 5 } { 
 puts "\$x = $x<br>"
 incr x
?>

LOOP<br>

<? }  ?>

Produces:

" incr x ?> LOOP


Variables (environmental as well as those passed to the script)


<? 
 hgetvars
if { [ array exists VARS ] } {
    puts "< ul>"
    foreach { vr } [ array names VARS ]  {
        puts "<li>(VARS) $vr = $VARS($vr)"
    }
    puts "</ul>"
}

if { [ array exists ENVS ] } {
    
    puts "<ul>"
    foreach { vr } [ array names ENVS ]  {
        puts "<li>(ENVS) $vr = $ENVS($vr)"
    }
    puts "</ul>"
}

if { [ array exists COOKIES ] } {
    
    puts "<ul>"
    foreach { vr } [ array names COOKIES ]  {
        puts "<li>(COOKIES) $vr = $COOKIES($vr)"
    }
    puts "</ul>"
}

?>

Produces:

" foreach { vr } [ array names VARS ] { puts "

  • (VARS) $vr = $VARS($vr)" } puts "" } if { [ array exists ENVS ] } { puts "
      " foreach { vr } [ array names ENVS ] { puts "
    • (ENVS) $vr = $ENVS($vr)" } puts "
    " } if { [ array exists COOKIES ] } { puts "
      " foreach { vr } [ array names COOKIES ] { puts "
    • (COOKIES) $vr = $COOKIES($vr)" } puts "
    " } ?>

  • Create a table on the fly

    
    <?
    set i 1
    puts "<table>\n"
    
    while { $i <= 8 } {
        puts "<tr>\n"
        for {set j 1} {$j <= 8} {incr j} {
    	set num [ expr $i * $j * 4 - 1]
    	puts [ format "<td bgcolor=%2x%2x%2x > $num $num $num </td>\n" $num $num $num ]
        }
        incr i
        puts "</tr>\n"
    }
    
    puts "</table>\n"
    ?>
    
    Produces:

    \n" while { $i <= 8 } { puts "

    $num $num $num
    \n" ?>


    In addition
    There are many, many other things you can do with Rivet. You can, if everything is compiled right, load tcl modules, like libpgtcl.so (the Postgresql interface), so that you can interact with a database!

    Return to the Rivet homepage

    rivet-3.0.0/rivet/rivet-tcl/read_file.tcl000664 001750 001750 00000000563 15224454746 021116 0ustar00manghimanghi000000 000000 ### ## read_file ## Read the entire contents of a file and return it as a string. ## ## file - Name of the file to read. ## ## $Id$ ## ### namespace eval ::rivet { proc read_file {file args} { set fp [open $file] if {[llength $args]} { eval fconfigure $fp $args } set x [read $fp] close $fp return $x } } rivet-3.0.0/doc/xml/packages.xml000664 001750 001750 00000002607 15224454746 017304 0ustar00manghimanghi000000 000000
    Rivet Tcl Packages In addition to the core Apache module, Rivet provides a number of Tcl packages that include potentially useful code. dio is a database abstraction layer. form - for creating forms. calendar - a package providing a simple configurable calendar generator rivet entities - an UTF-8 / HTML entities converter formbroker - a form data validators broker ASCII Glyphs - prints most of the ASCII character set as large ASCII art glyphs
    rivet-3.0.0/tests/env.test000664 001750 001750 00000003441 15224454746 016267 0ustar00manghimanghi000000 000000 # # testing how the environment variables resolution # is handled by mod_rivet # set rvttestfilename env.rvt ::tcltest::test env-1.1 {Environment variable} { set page [ ::http::geturl "${urlbase}$rvttestfilename?load_env=true" ] regexp -line "^env\\(DOCUMENT_NAME\\) = $rvttestfilename\$" [::http::data $page] match ::http::cleanup $page set match } "env(DOCUMENT_NAME) = $rvttestfilename" ::tcltest::test env-1.2 {Environment variable} { set page [ ::http::geturl "${urlbase}$rvttestfilename?load_env=false" ] regexp -line "^env\\(DOCUMENT_NAME\\) = $rvttestfilename\$" [::http::data $page] match ::http::cleanup $page set match } "env(DOCUMENT_NAME) = $rvttestfilename" ::tcltest::test env-1.2.1 {CGI Environment variable double translation} { set page1 [ ::http::geturl "${urlbase}$rvttestfilename?protocol=1"] set match1 [string trim [::http::data $page1]] set page2 [ ::http::geturl "${urlbase}$rvttestfilename?protocol=1"] set match2 [string trim [::http::data $page2]] #puts "proto: $match1 $match2" ::http::cleanup $page1 ::http::cleanup $page2 expr [string match $match1 $match2] } "1" set envmethod env_methods.tcl set env_vars [list "DATE_LOCAL" "DATE_GMT" "LAST_MODIFIED" "DOCUMENT_URI" "DOCUMENT_PATH_INFO" "DOCUMENT_NAME" \ "QUERY_STRING_UNESCAPED" "RIVET_CACHE_FREE" "RIVET_CACHE_SIZE" "HTTP_ACCEPT" "HTTP_HOST" \ "QUERY_STRING" "SCRIPT_FILENAME" "SERVER_NAME" "SERVER_PORT" "SERVER_PROTOCOL"] puts "comparing ::rivet::env and ::rivet::load_env for variable resolution" foreach v $env_vars { puts -nonewline "$v " ::tcltest::test env-1.3 {Environment variable methods} { set page [::http::geturl "${urlbase}$envmethod?envvar=$v"] ::http::data $page } "$v: OK" } puts "" rivet-3.0.0/tests/post.rvt000664 001750 001750 00000001570 15224454746 016321 0ustar00manghimanghi000000 000000 0 } { # get/post variables 1.1 if { [ ::rivet::var exists foobar ] } { puts "\[::rivet::var get foobar\] = [::rivet::var get foobar]\n" puts "\[::rivet::var_post get foobar\] = [::rivet::var_post get foobar]\n" } # get/post variables 1.{2,3} if { [ ::rivet::var exists Más ] } { puts "\[::rivet::var get Más\] = [::rivet::var get Más]\n" } if { [::rivet::var exists lstvar1] } { puts "\[::rivet::var get lstvar1\] = [::rivet::var get lstvar1]\n" } if { [::rivet::var exists lstvar2] } { puts "\[::rivet::var list lstvar2\] = [::rivet::var list lstvar2]\n" } } elseif {[string match "POST" $env(REQUEST_METHOD)]} { # Return the raw body encoded as ascii puts -nonewline "\[::rivet::raw_post\] = [binary encode hex [::rivet::raw_post]]" } ?> rivet-3.0.0/rivet/packages/rivet_ncgi/000775 001750 001750 00000000000 15224454746 020472 5ustar00manghimanghi000000 000000 rivet-3.0.0/src/mod_rivet_ng/rivetChannel.h000664 001750 001750 00000002627 15224454746 021477 0ustar00manghimanghi000000 000000 /* rivetChannel.h - definitions for the Rivet Tcl channel */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #ifndef _RIVET_CHANNEL_H_ #define _RIVET_CHANNEL_H_ /* Functions for mod_dtcl Tcl output channel .*/ extern int closeproc(ClientData, Tcl_Interp *); extern int inputproc(ClientData, char *, int, int *); extern int outputproc(ClientData, char *, int, int *); extern int setoptionproc(ClientData, Tcl_Interp *, char *, char *); /* extern int getoptionproc(ClientData, Tcl_Interp *, char *, Tcl_DString *); */ extern void watchproc(ClientData, int); extern int gethandleproc(ClientData, int, ClientData *); extern Tcl_ChannelType RivetChan; #endif rivet-3.0.0/tests/rivetlib.test000664 001750 001750 00000001711 15224454746 017315 0ustar00manghimanghi000000 000000 package require rivetlib ::tcltest::test rivetlib-1.1 {lassign_array basic assignement} { set array_vars {a b c d} set list_vals {1 2 3 4} ::rivet::lassign_array $list_vals assigned_array {*}$array_vars set l {} foreach av $array_vars { lappend l $assigned_array($av) } set l } {1 2 3 4} ::tcltest::test rivetlib-1.2 {lassign_array returned values} { set array_vars {a b c d} set list_vals {1 2 3 4 5 6 7} set rem [::rivet::lassign_array $list_vals assigned_array {*}$array_vars] set rem } {5 6 7} ::tcltest::test rivetlib-2.1 {lremove regexp removal} { set rem [::rivet::lremove -all -regexp {aa e111 bab aa} aa] } {e111 bab} ::tcltest::test rivetlib-2.1 {lremove multiple regexp removal} { set rem [::rivet::lremove -all -regexp {aa e111 bab aa} aa "e\\d+"] } {bab} ::tcltest::test rivetlib-2.2 {lremove glob style multiple removal} { set rem [::rivet::lremove -all -glob {aa e111 bab aa} e* b*] } {aa aa} rivet-3.0.0/tests/post.test000664 001750 001750 00000006105 15224454746 016464 0ustar00manghimanghi000000 000000 # $Id$ set testfilename1 post.rvt ::tcltest::test postvariables-1.1 {POST variables} { set page [ ::http::geturl "${urlbase}$testfilename1" -query foobar=goober ] regexp -line {^\[::rivet::var get foobar\] = goober$} [ ::http::data $page ] match set match } {[::rivet::var get foobar] = goober} ::tcltest::test postvariables-2.1 {POST variables + I18N} { set page [ ::http::geturl "${urlbase}$testfilename1" -query Más=Tú ] regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match set match } {[::rivet::var get Más] = Tú} ::tcltest::test postvariables-2.2 {POST variables + I18N + encoding} { set page [ ::http::geturl "${urlbase}$testfilename1" -query [ ::http::formatQuery Más Tú ] ] regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match set match } {[::rivet::var get Más] = Tú} ::tcltest::test postvariables-3.1 {POST multi-value variable} { set page [ ::http::geturl "${urlbase}get.rvt" -query [::http::formatQuery lstvar1 a lstvar1 b lstvar1 {c d}]] regexp -line {\[::rivet::var get lstvar1\] = a b c d$} [ ::http::data $page ] match set match } {[::rivet::var get lstvar1] = a b c d} ::tcltest::test postvariables-3.2 {POST multi-value variable as list} { set page [ ::http::geturl "${urlbase}get.rvt" -query [::http::formatQuery lstvar2 a lstvar2 b lstvar2 {c d}]] regexp -line {\[::rivet::var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match set match } {[::rivet::var list lstvar2] = a b {c d}} ::tcltest::test postvariables-4.1 {var_post} { set page [ ::http::geturl "${urlbase}$testfilename1" -query foobar=goober ] regexp -line {^\[::rivet::var_post get foobar\] = goober$} [ ::http::data $page ] match set match } {[::rivet::var_post get foobar] = goober} set rivetscript "${urlbase}fqrivet_var.tcl" ::tcltest::test postvariables-5.1 {::rivet::var_qs and ::rivet::var_post} { set page [::http::geturl "${rivetscript}?qsarg1=val1&qsarg2=val2&t1=1" \ -query [::http::formatQuery postarg1 val1 postarg2 val2]] set match [::http::data $page] set match } {var_qs = qsarg1 val1 qsarg2 val2 var_post = postarg1 val1 postarg2 val2} ::tcltest::test postvariables-5.2 {::rivet::var_post and ::rivet::var_qs crosstalk 1} { set page [::http::geturl "${rivetscript}?qsarg1=val1&qsarg2=val2&t1=2"] set match [::http::data $page] set match } {OK} ::tcltest::test postvariables-5.3 {::rivet::var_post and ::rivet::var_qs crosstalk 2} { set page [::http::geturl "${rivetscript}?t1=3" \ -query [::http::formatQuery postarg1 val1 postarg2 val2]] set match [::http::data $page] set match } {OK} ::tcltest::test postvariables-6.1 {::rivet::raw_post} { set payload "\x00\x00\x00\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39" set page [::http::geturl "${urlbase}post.rvt" \ -query $payload \ -type application/octet-stream] regexp -line {^\[::rivet::raw_post\] = 00000030313233343536373839$} [ ::http::data $page ] match set match } {[::rivet::raw_post] = 00000030313233343536373839} rivet-3.0.0/doc/images/prev.png000664 001750 001750 00000001461 15224454746 017130 0ustar00manghimanghi000000 000000 PNG  IHDR ꂣAsBIT|d pHYsGGGtEXtSoftwarewww.inkscape.org<IDATHK@K6-ݔTed>A'ފ1pc!mL|3j\7 Z2O.ra@J$ɠSH8Ù\pS8CalG`၄ !QDy?]QU .?Y0;~T\^2بϖpxTC5Kjur><vpx{:Z Z;_i O H3Yn4?Z]RK։?<GEY^MK҄U3OE"Q\?'tѺ8~e$ҟ8ִ:}1 R!dn?vmzEqUuw'P3ch|_q.W8oQ6+Uqne7ǝ^*!1R.rY 0^jy;. 7 K1!) lĬvX,vn;oy-Axmk`8,[h=x+D%f+,[lӴ@ F~.Sv969D4Um!ʶ|.QA0{5]ilcyt1W./tJsnw KXR': C9EYD@\ nU0^38KIENDB`rivet-3.0.0/rivet/packages/aida/sql.tcl000664 001750 001750 00000001520 15224454746 020540 0ustar00manghimanghi000000 000000 # sql.tcl -- SQL code generator # Copyright 2024 The Apache Tcl Team # # 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. # This class provides a way to abstract to some extent the # SQL code generation. It's supposed to provide a bridge to # different implementation in various backends for specific # functionalities # namespace eval ::aida { } rivet-3.0.0/tests/docroot1/basic1.rvt000664 001750 001750 00000000023 15224454746 020220 0ustar00manghimanghi000000 000000 Virtual Host1 Test rivet-3.0.0/m4/lt~obsolete.m4000664 001750 001750 00000013774 15224454746 016602 0ustar00manghimanghi000000 000000 # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software # Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN), # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) rivet-3.0.0/doc/examples/colortable.rvt000664 001750 001750 00000002306 15224454746 020701 0ustar00manghimanghi000000 000000 " for {set j 0} {$j < 9} {incr j} { set r [expr int(255 * ($i + $j) / 16)] set g [expr int(255 * (8 + $j - $i) / 16)] set b [expr int(255 * (abs (4 - $i) + abs(4 - $j)) / 8)] # determining the background luminosity (YIQ space of NTSC) and choosing # the foreground color accordingly in order maintain maximum contrast if { [expr ($r*0.29894)+($g*0.58704)+($b*0.11402)] > 148.0} { set cssclass "dark" } else { set cssclass "bright" } set cell [format "%3d %3d %3d" $r $g $b] puts [format \ "" \ $r $g $b $cssclass $cell] } puts "" } ?>
    %s
    rivet-3.0.0/src/request/apache_request.c000664 001750 001750 00000046506 15224454746 021061 0ustar00manghimanghi000000 000000 /* apache_request.c -- Apache multipart form data handling */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #include #include #include #include #include #include "apache_request.h" #include "apache_multipart_buffer.h" int fill_buffer(multipart_buffer *self); /* needed for mozilla hack */ static void req_plustospace(char *str) { register int x; for(x=0;str[x];x++) if(str[x] == '+') str[x] = ' '; } static int util_read(ApacheRequest *req, const char **rbuf, int *rlen) { request_rec *r = req->r; int rc = OK; if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) { return rc; } if (ap_should_client_block(r)) { char buff[HUGE_STRING_LEN]; int len_read; apr_off_t rpos; apr_off_t rsize; apr_off_t length = r->remaining; rpos = 0; if (length > req->post_max && req->post_max > 0) { ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)", (int)length, req->post_max); return HTTP_REQUEST_ENTITY_TOO_LARGE; } *rbuf = apr_pcalloc(r->pool, length + 1); *rlen = length; while ((len_read = ap_get_client_block(r, buff, sizeof(buff))) > 0) { if ((rpos + len_read) > length) { rsize = length - rpos; } else { rsize = len_read; } memcpy((char*)*rbuf + rpos, buff, rsize); rpos += rsize; } } return rc; } char *ApacheRequest_script_name(ApacheRequest *req) { request_rec *r = req->r; char *tmp; if (r->path_info && *r->path_info) { int path_info_start = ap_find_path_info(r->uri, r->path_info); tmp = (char*) apr_pstrndup(r->pool, r->uri, path_info_start); } else { tmp = r->uri; } return tmp; } char *ApacheRequest_script_path(ApacheRequest *req) { return ap_make_dirstr_parent(req->r->pool, ApacheRequest_script_name(req)); } const char *ApacheRequest_param(ApacheRequest *req, const char *key) { ApacheRequest_parse(req); return (char*) apr_table_get(req->parms, key); } static int make_params(void *data, const char *key, const char *val) { //array_header *arr = (array_header *)data; apr_array_header_t *arr = (apr_array_header_t *)data; //*(char **)apr_push_array(arr) = (char *)val; *(char **)apr_array_push(arr) = (char *)val; return 1; } //array_header *ApacheRequest_params(ApacheRequest *req, const char *key) apr_array_header_t *ApacheRequest_params(ApacheRequest *req, const char *key) { //array_header *values = ap_make_array(req->r->pool, 4, sizeof(char *)); apr_array_header_t *values = apr_array_make(req->r->pool, 4, sizeof(char *)); ApacheRequest_parse(req); apr_table_do(make_params, (void*)values, req->parms, key, NULL); return values; } char *ApacheRequest_params_as_string(ApacheRequest *req, const char *key) { char *retval = NULL; //array_header *values = ApacheRequest_params(req, key); apr_array_header_t *values = ApacheRequest_params(req, key); int i; for (i=0; inelts; i++) { retval = (char*) apr_pstrcat(req->r->pool, retval ? retval : "", ((char **)values->elts)[i], (i == (values->nelts - 1)) ? NULL : ", ", NULL); } return retval; } //table *ApacheRequest_query_params(ApacheRequest *req, ap_pool *p) apr_table_t *ApacheRequest_query_params(ApacheRequest *req, /*ap_pool*/apr_pool_t *p) { //array_header *a = ap_palloc(p, sizeof *a); //array_header *b = (array_header *)req->parms; apr_array_header_t *a = apr_palloc(p, sizeof *a); apr_array_header_t *b = (apr_array_header_t *)req->parms; a->elts = b->elts; a->nelts = req->nargs; a->nalloc = a->nelts; /* COW hack: array push will induce copying */ //a->elt_size = sizeof(table_entry); //return (table *)a; a->elt_size = sizeof(apr_table_entry_t); return (apr_table_t *)a; } apr_table_t *ApacheRequest_post_params(ApacheRequest *req, apr_pool_t *p) { apr_array_header_t *a = apr_palloc(p, sizeof *a); apr_array_header_t *b = (apr_array_header_t *)req->parms; a->elts = (void *)( (apr_table_entry_t *)b->elts + req->nargs ); a->nelts = b->nelts - req->nargs; a->nalloc = a->nelts; /* COW hack: array push will induce copying */ a->elt_size = sizeof(apr_table_entry_t); return (apr_table_t *)a; } ApacheUpload *ApacheUpload_new(ApacheRequest *req) { ApacheUpload *upload = (ApacheUpload *) apr_pcalloc(req->r->pool, sizeof(ApacheUpload)); upload->next = NULL; upload->name = NULL; upload->info = NULL; upload->fp = NULL; upload->size = 0; upload->req = req; return upload; } ApacheUpload *ApacheUpload_find(ApacheUpload *upload, char *name) { ApacheUpload *uptr; for (uptr = upload; uptr; uptr = uptr->next) { if (strEQ(uptr->name, name)) { return uptr; } } return NULL; } ApacheRequest *ApacheRequest_new(apr_pool_t *pool) { ApacheRequest *req = (ApacheRequest *) apr_pcalloc(pool, sizeof(ApacheRequest)); req->status = OK; req->parms = apr_table_make(pool, DEFAULT_TABLE_NELTS); req->upload = NULL; req->post_max = -1; req->disable_uploads = 0; req->upload_hook = NULL; req->hook_data = NULL; req->temp_dir = NULL; req->raw_post = NULL; req->raw_length = 0; req->parsed = 0; req->r = NULL; req->nargs = 0; return req; } ApacheRequest *ApacheRequest_init(ApacheRequest* req, request_rec *r) { req->status = OK; apr_table_clear(req->parms); req->upload = NULL; req->post_max = -1; req->disable_uploads = 0; req->upload_hook = NULL; req->hook_data = NULL; req->temp_dir = NULL; req->raw_post = NULL; req->raw_length = 0; req->parsed = 0; req->r = r; req->nargs = 0; return req; } static char x2c(const char *what) { register char digit; #ifndef CHARSET_EBCDIC digit = ((what[0] >= 'A') ? ((what[0] & 0xdf) - 'A') + 10 : (what[0] - '0')); digit *= 16; digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A') + 10 : (what[1] - '0')); #else /*CHARSET_EBCDIC*/ char xstr[5]; xstr[0]='0'; xstr[1]='x'; xstr[2]=what[0]; xstr[3]=what[1]; xstr[4]='\0'; digit = os_toebcdic[0xFF & ap_strtol(xstr, NULL, 16)]; #endif /*CHARSET_EBCDIC*/ return (digit); } static unsigned int utf8_convert(char *str) { long x = 0; int i = 0; while (i < 4 ) { if ( apr_isxdigit(str[i]) != 0 ) { if( apr_isdigit(str[i]) != 0 ) { x = x * 16 + str[i] - '0'; } else { str[i] = tolower( str[i] ); x = x * 16 + str[i] - 'a' + 10; } } else { return 0; } i++; } if(i < 3) return 0; return (x); } static int ap_unescape_url_u(char *url) { register int x, y, badesc, badpath; badesc = 0; badpath = 0; for (x = 0, y = 0; url[y]; ++x, ++y) { if (url[y] != '%'){ url[x] = url[y]; } else { if(url[y + 1] == 'u' || url[y + 1] == 'U'){ unsigned int c = utf8_convert(&url[y + 2]); y += 5; if(c < 0x80){ url[x] = c; } else if(c < 0x800) { url[x] = 0xc0 | (c >> 6); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x10000){ url[x] = (0xe0 | (c >> 12)); url[++x] = (0x80 | ((c >> 6) & 0x3f)); url[++x] = (0x80 | (c & 0x3f)); } else if(c < 0x200000){ url[x] = 0xf0 | (c >> 18); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x4000000){ url[x] = 0xf8 | (c >> 24); url[++x] = 0x80 | ((c >> 18) & 0x3f); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } else if(c < 0x8000000){ url[x] = 0xfe | (c >> 30); url[++x] = 0x80 | ((c >> 24) & 0x3f); url[++x] = 0x80 | ((c >> 18) & 0x3f); url[++x] = 0x80 | ((c >> 12) & 0x3f); url[++x] = 0x80 | ((c >> 6) & 0x3f); url[++x] = 0x80 | (c & 0x3f); } } else { if (!apr_isxdigit(url[y + 1]) || !apr_isxdigit(url[y + 2])) { badesc = 1; url[x] = '%'; } else { url[x] = x2c(&url[y + 1]); y += 2; if (url[x] == '/' || url[x] == '\0') badpath = 1; } } } } url[x] = '\0'; if (badesc) return HTTP_BAD_REQUEST; else if (badpath) return HTTP_NOT_FOUND; else return OK; } //static int urlword_dlm[] = {'&', ';', 0}; static char *my_urlword(apr_pool_t *p, const char **line) { char *res = NULL; const char *pos = *line; char ch; while ( (ch = *pos) != '\0' && ch != ';' && ch != '&') { ++pos; } res = (char*) apr_pstrndup(p, *line, pos - *line); while (ch == ';' || ch == '&') { ++pos; ch = *pos; } *line = pos; return res; } static void split_to_parms(ApacheRequest *req, const char *data) { request_rec *r = req->r; const char *val; while (*data && (val = my_urlword(r->pool, &data))) { const char *key = ap_getword(r->pool, &val, '='); req_plustospace((char*)key); ap_unescape_url_u((char*)key); req_plustospace((char*)val); ap_unescape_url_u((char*)val); apr_table_add(req->parms, key, val); } } int ApacheRequest___parse(ApacheRequest *req) { request_rec *r = req->r; const char *ct = apr_table_get(r->headers_in, "Content-type"); int result; if (r->args) { split_to_parms(req, r->args); req->nargs = ((apr_array_header_t *)req->parms)->nelts; } if ((r->method_number == M_POST) && ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) { // //ap_log_rerror(REQ_INFO, "content-type: `%s'", ct); // result = ApacheRequest_parse_multipart(req,ct); } else { result = ApacheRequest_parse_urlencoded(req); } req->parsed = 1; return result; } int ApacheRequest_parse_urlencoded(ApacheRequest *req) { request_rec *r = req->r; int rc = OK; if (r->method_number == M_POST || r->method_number == M_PUT || r->method_number == M_DELETE) { const char *data = NULL; int length = 0; /* const char *type; type = apr_table_get(r->headers_in, "Content-Type"); if (!strncaseEQ(type, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH) && !strncaseEQ(type, TEXT_XML_ENCTYPE, TEXT_XML_ENCTYPE_LENGTH)) { return DECLINED; } */ if ((rc = util_read(req, &data, &length)) != OK) { return rc; } if (data) { req->raw_post = (char*) data; /* Give people a way of getting at the raw data. */ req->raw_length = length; split_to_parms(req, data); } } return OK; } static apr_status_t remove_tmpfile(void *data) { ApacheUpload *upload = (ApacheUpload *) data; // ApacheRequest *req = upload->req; //TODO: fix ap_pfclose //if( ap_pfclose(req->r->pool, upload->fp) ) //TODO: fix logging apr_log_rerror //apr_log_rerror(REQ_ERROR,"[libapreq] close error on '%s'", upload->tempname); #ifndef DEBUG if( remove(upload->tempname) ) { //TODO: fix logging apr_log_rerror //apr_log_rerror(REQ_ERROR,"[libapreq] remove error on '%s'", upload->tempname); } #endif // free(upload->tempname); return 0; } apr_file_t *ApacheRequest_tmpfile(ApacheRequest *req, ApacheUpload *upload) { request_rec *r = req->r; apr_file_t *fp = NULL; char *name = NULL; char *file = NULL ; const char *tempdir; apr_status_t rv; tempdir = req->temp_dir; /* file = (char *)apr_palloc(r->pool,sizeof(apr_time_t)); */ file = apr_psprintf(r->pool,"%u.XXXXXX", (unsigned int)r->request_time); rv = apr_temp_dir_get(&tempdir,r->pool); if (rv != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "No temp dir!"); return NULL; } rv = apr_filepath_merge(&name,tempdir,file,APR_FILEPATH_NATIVE,r->pool); if (rv != APR_SUCCESS) { ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "File path error!"); return NULL; } rv = apr_file_mktemp(&fp,name,0,r->pool); if (rv != APR_SUCCESS) { char* errorBuffer = (char*) apr_palloc(r->pool,256); ap_log_perror(APLOG_MARK, APLOG_ERR, rv, r->pool, "Failed to open temp file: %s",apr_strerror(rv,errorBuffer,256)); return NULL; } upload->fp = fp; upload->tempname = name; apr_pool_cleanup_register (r->pool, (void *)upload, remove_tmpfile, apr_pool_cleanup_null); return fp; } int ApacheRequest_parse_multipart(ApacheRequest *req,const char* ct) { request_rec* r = req->r; int rc = OK; apr_off_t length; char* boundary; multipart_buffer* mbuff; ApacheUpload* upload = NULL; apr_status_t status; char error[1024]; if ((rc = ap_setup_client_block(r, REQUEST_CHUNKED_ERROR))) { return rc; } if (!ap_should_client_block(r)) { return rc; } if ((length = r->remaining) > req->post_max && req->post_max > 0) { ap_log_rerror(REQ_ERROR,"entity too large (%d, max=%d)", (int)length,req->post_max); return HTTP_REQUEST_ENTITY_TOO_LARGE; } do { size_t blen; boundary = ap_getword(r->pool, &ct, '='); if (boundary == NULL) return DECLINED; blen = strlen(boundary); if (blen == 0 || blen < strlen("boundary")) return DECLINED; boundary += blen - strlen("boundary"); } while (strcasecmp(boundary,"boundary") != 0); boundary = ap_getword_conf(r->pool, &ct); if (!(mbuff = multipart_buffer_new(boundary, length, r))) { return DECLINED; } while (!multipart_buffer_eof(mbuff)) { apr_table_t* header = (apr_table_t*) multipart_buffer_headers(mbuff); const char* cd; const char* param = NULL; const char* filename=NULL; char buff[FILLUNIT]; size_t blen; if (!header) { #ifdef DEBUG ap_log_rerror(REQ_ERROR,"Silently dropping remaining '%ld' bytes", r->remaining); #endif do { } while ( ap_get_client_block(r, buff, sizeof(buff)) > 0 ); return OK; } if ((cd = apr_table_get(header, "Content-Disposition"))) { const char *pair; while (*cd && (pair = ap_getword(r->pool, &cd, ';'))) { const char *key; while (apr_isspace(*cd)) { ++cd; } if (ap_ind(pair, '=')) { key = ap_getword(r->pool, &pair, '='); if(strcaseEQ(key, "name")) { param = ap_getword_conf(r->pool, &pair); } else if(strcaseEQ(key, "filename")) { filename = ap_getword_conf(r->pool, &pair); } } } if (!filename) { char *value = multipart_buffer_read_body(mbuff); apr_table_add(req->parms, param, value); continue; } if (!param) continue; /* shouldn't happen, but just in case. */ if (req->disable_uploads) { #if DEBUG ap_log_rerror(REQ_ERROR, "[libapreq] file upload forbidden"); #endif return HTTP_FORBIDDEN; } apr_table_add(req->parms, param, filename); if (upload) { upload->next = ApacheUpload_new(req); upload = upload->next; } else { upload = ApacheUpload_new(req); req->upload = upload; } if (! req->upload_hook && ! ApacheRequest_tmpfile(req, upload) ) { return HTTP_INTERNAL_SERVER_ERROR; } upload->info = header; upload->filename = (char*)apr_pstrdup(req->r->pool, filename); upload->name = (char*)apr_pstrdup(req->r->pool, param); /* mozilla empty-file (missing CRLF) hack */ fill_buffer(mbuff); if( strEQN(mbuff->buf_begin, mbuff->boundary, strlen(mbuff->boundary)) ) { r->remaining -= 2; continue; } while ((blen = multipart_buffer_read(mbuff, buff, sizeof(buff)))) { apr_size_t bytes_to_write = (apr_size_t) blen; status = apr_file_write(upload->fp,buff,&bytes_to_write); if (status != 0) { apr_strerror(status,error,1024); return HTTP_INTERNAL_SERVER_ERROR; } upload->size += blen; } } } return OK; } #define Mult_s 1 #define Mult_m 60 #define Mult_h (60*60) #define Mult_d (60*60*24) #define Mult_M (60*60*24*30) #define Mult_y (60*60*24*365) static int expire_mult(char s) { switch (s) { case 's': return Mult_s; case 'm': return Mult_m; case 'h': return Mult_h; case 'd': return Mult_d; case 'M': return Mult_M; case 'y': return Mult_y; default: return 1; }; } static time_t expire_calc(char *time_str) { int is_neg = 0, offset = 0; char buf[256]; int ix = 0; if (*time_str == '-') { is_neg = 1; ++time_str; } else if (*time_str == '+') { ++time_str; } else if (strcaseEQ(time_str, "now")) { /*ok*/ } else { return 0; } /* wtf, ap_isdigit() returns false for '1' !? */ while (*time_str && (apr_isdigit(*time_str) || (*time_str == '1'))) { buf[ix++] = *time_str++; } buf[ix] = '\0'; offset = atoi(buf); return time(NULL) + (expire_mult(*time_str) * (is_neg ? (0 - offset) : offset)); } char *ApacheUtil_expires(apr_pool_t *p, char *time_str, int type) { time_t when; struct tm *tms; int sep = (type == EXPIRES_HTTP) ? ' ' : '-'; if (!time_str) { return NULL; } when = expire_calc(time_str); if (!when) { return (char*) apr_pstrdup(p, time_str); } tms = gmtime(&when); return (char*) apr_psprintf(p, "%s, %.2d%c%s%c%.2d %.2d:%.2d:%.2d GMT", apr_day_snames[tms->tm_wday], tms->tm_mday, sep, apr_month_snames[tms->tm_mon], sep, tms->tm_year + 1900, tms->tm_hour, tms->tm_min, tms->tm_sec); } char *ApacheRequest_expires(ApacheRequest *req, char *time_str) { return ApacheUtil_expires(req->r->pool, time_str, EXPIRES_HTTP); } char *ApacheRequest_get_raw_post(ApacheRequest *req, int *len) { if (len) *len = req->raw_length; return req->raw_post; } rivet-3.0.0/rivet/packages/tclrivet/tclrivet.tcl000664 001750 001750 00000002257 15224454746 022543 0ustar00manghimanghi000000 000000 # Tcl versions of Rivet commands. # Copyright 2003-2004 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. package provide tclrivet 0.1 #load [file join [file dirname [info script]] .. .. \ # librivetparser[info sharedlibextension]] proc include { filename } { set fl [ open $filename ] fconfigure $fl -translation binary puts -nonewline [ read $fl ] close $fl } # We need to fill these in, of course. proc makeurl {} {} proc headers {} {} proc load_env {} {} proc load_headers {} {} proc var {} {} proc var_qs {} {} proc var_post {} {} proc upload {} {} proc parse {} {} proc no_body {} {} proc env {} {} proc abort_page {} {} proc virtual_filename {} {} rivet-3.0.0/src/mod_rivet_ng/worker_prefork_common.c000664 001750 001750 00000031400 15224454746 023450 0ustar00manghimanghi000000 000000 /* worker_prefork_common.c: function common to both the prefork and worker bridges */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #include #include #include #include #include "mod_rivet.h" /* Function prototypes are defined with EXTERN. Since we are in the same DLL, * no need to keep this extern... */ #ifdef EXTERN # undef EXTERN # define EXTERN #endif /* EXTERN */ #include "mod_rivet_common.h" #include "mod_rivet_cache.h" #include "worker_prefork_common.h" extern DLLIMPORT mod_rivet_globals* module_globals; extern DLLIMPORT apr_threadkey_t* rivet_thread_key; extern DLLIMPORT module rivet_module; extern rivet_thread_interp* MPM_MasterInterp(server_rec* s); /* * Rivet_DuplicateVhostInterp * * */ static rivet_thread_interp* Rivet_DuplicateVHostInterp(apr_pool_t* pool, rivet_thread_interp* source_obj) { rivet_thread_interp* interp_obj = apr_pcalloc(pool,sizeof(rivet_thread_interp)); interp_obj->interp = source_obj->interp; interp_obj->channel = source_obj->channel; interp_obj->cache_free = source_obj->cache_free; interp_obj->cache_size = source_obj->cache_size; /* An intepreter must have its own cache */ if (interp_obj->cache_size) { RivetCache_Create(pool,interp_obj); } interp_obj->pool = source_obj->pool; interp_obj->scripts = (running_scripts *) apr_pcalloc(pool,sizeof(running_scripts)); interp_obj->per_dir_scripts = apr_hash_make(pool); interp_obj->flags = source_obj->flags; return interp_obj; } /* -- Rivet_RunChildScripts * * */ void Rivet_RunChildScripts (rivet_thread_private* private,bool init) { server_rec* vhost_server; server_rec* root_server; rivet_server_conf* root_server_conf; void* parentfunction; /* this is topmost initialization script */ void* function; root_server = module_globals->server; root_server_conf = RIVET_SERVER_CONF (root_server->module_config); parentfunction = (init ? root_server_conf->rivet_child_init_script : root_server_conf->rivet_child_exit_script); for (vhost_server = root_server; vhost_server != NULL; vhost_server = vhost_server->next) { rivet_thread_interp* rivet_interp; rivet_server_conf* myrsc; rivet_interp_globals* globals = NULL; myrsc = RIVET_SERVER_CONF(vhost_server->module_config); rivet_interp = RIVET_PEEK_INTERP(private,myrsc); function = (init ? myrsc->rivet_child_init_script : myrsc->rivet_child_exit_script); if (function && (vhost_server == root_server || module_globals->separate_virtual_interps || function != parentfunction)) { char* errmsg = MODNAME ": Error in Child init script: %s"; Tcl_Obj* tcl_script_obj = Tcl_NewStringObj(function,-1); Tcl_IncrRefCount(tcl_script_obj); Tcl_Preserve (rivet_interp->interp); /* before we run a script we have to store the pointer to the * running configuration in the thread private data. The design has * to improve and running a script must have everything sanely * prepared TODO */ globals = Tcl_GetAssocData(rivet_interp->interp, "rivet", NULL); /* * The current server record is stored to enable ::rivet::apache_log_error and * other commands to log error messages in the virtual host's designated log file */ globals->server = vhost_server; private->running_conf = myrsc; if (Tcl_EvalObjEx(rivet_interp->interp,tcl_script_obj,0) != TCL_OK) { ap_log_error(APLOG_MARK,APLOG_ERR,APR_EGENERAL,vhost_server,errmsg, function); ap_log_error(APLOG_MARK,APLOG_ERR,APR_EGENERAL,vhost_server, "errorCode: %s", Tcl_GetVar(rivet_interp->interp,"errorCode",0)); ap_log_error(APLOG_MARK,APLOG_ERR,APR_EGENERAL,vhost_server, "errorInfo: %s", Tcl_GetVar(rivet_interp->interp,"errorInfo",0)); } Tcl_Release (rivet_interp->interp); Tcl_DecrRefCount(tcl_script_obj); } } } /* -- Rivet_VirtualHostsInterps * * The server_rec chain is walked through and server configurations are read to * set up the thread private configuration and interpreters database * * Arguments: * * rivet_thread_private* private; * * Returned value: * * a new rivet_thread_private object * * Side effects: * * GlobalInitScript and ChildInitScript are run at this stage * */ rivet_thread_private* Rivet_VirtualHostsInterps (rivet_thread_private* private) { server_rec* vhost_server; server_rec* root_server = module_globals->server; rivet_server_conf* root_server_conf; rivet_server_conf* myrsc; rivet_thread_interp* root_interp; root_server_conf = RIVET_SERVER_CONF (root_server->module_config); root_interp = MPM_MasterInterp(module_globals->server); /* we must assume the module was able to create the root interprter */ ap_assert (root_interp != NULL); /* The inherited interpreter has an empty cache since * evalutating a server_init_script does not require * parsing templates that need to be stored in it. * We need to create it */ if (root_server_conf->default_cache_size > 0) { root_interp->cache_size = root_server_conf->default_cache_size; } else if (root_server_conf->default_cache_size < 0) { root_interp->cache_size = RivetCache_DefaultSize(); } RivetCache_Create(root_interp->pool,root_interp); /* Using the root interpreter we evaluate the global initialization script, if any */ if (root_server_conf->rivet_global_init_script != NULL) { Tcl_Obj* global_tcl_script; global_tcl_script = Tcl_NewStringObj(root_server_conf->rivet_global_init_script,-1); Tcl_IncrRefCount(global_tcl_script); if (Tcl_EvalObjEx(root_interp->interp, global_tcl_script, 0) != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, module_globals->server, MODNAME ": Error running GlobalInitScript '%s': %s", root_server_conf->rivet_global_init_script, Tcl_GetVar(root_interp->interp, "errorInfo", 0)); } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, module_globals->server, MODNAME ": GlobalInitScript '%s' successful", root_server_conf->rivet_global_init_script); } Tcl_DecrRefCount(global_tcl_script); } /* then we proceed assigning/creating the interpreters for each virtual host */ // parentfunction = root_server_conf->rivet_child_init_script; for (vhost_server = root_server; vhost_server != NULL; vhost_server = vhost_server->next) { rivet_thread_interp* rivet_interp; myrsc = RIVET_SERVER_CONF(vhost_server->module_config); /* by default we assign the root_interpreter as * interpreter of the virtual host. In case of separate * virtual interpreters we create new ones for each * virtual host */ rivet_interp = root_interp; if (vhost_server == root_server) { Tcl_RegisterChannel(rivet_interp->interp,*rivet_interp->channel); } else { if (module_globals->separate_virtual_interps) { rivet_interp = Rivet_NewVHostInterp(private->pool,myrsc->default_cache_size); if (module_globals->separate_channels) { rivet_interp->channel = Rivet_CreateRivetChannel(private->pool,rivet_thread_key); Tcl_RegisterChannel(rivet_interp->interp,*rivet_interp->channel); } else { rivet_interp->channel = private->channel; } } else { rivet_interp = Rivet_DuplicateVHostInterp(private->pool,root_interp); } } /* interpreter base running scripts definition and initialization */ rivet_interp->scripts = Rivet_RunningScripts (private->pool,rivet_interp->scripts,myrsc); RIVET_POKE_INTERP(private,myrsc,rivet_interp); /* Basic Rivet packages and libraries are loaded here */ if ((rivet_interp->flags & RIVET_INTERP_INITIALIZED) == 0) { Rivet_PerInterpInit(rivet_interp,private,vhost_server,private->pool); } /* It seems that allocating from a shared APR memory pool is not thread safe, * but it's not very well documented actually. In any case we protect this * memory allocation with a mutex */ /* this stuff must be allocated from the module global pool which * has the child process' same lifespan */ apr_thread_mutex_lock(module_globals->pool_mutex); myrsc->server_name = (char*) apr_pstrdup (private->pool,vhost_server->server_hostname); apr_thread_mutex_unlock(module_globals->pool_mutex); } /* the child init scripts get evaluated */ Rivet_RunChildScripts(private,true); return private; } /* * -- Rivet_ProcessorCleanup * * Thread private data cleanup. This function was meant to be * called by the worker and prefork MPM bridges to release resources * owned by thread private data and pointed in the array of rivet_thread_interp * objects. It has to be called just before an agent, either thread or * process, exits. We aren't calling this function anymore as we rely entirely * on the child process termination * * Arguments: * * data: pointer to a rivet_thread_private data structure. * * Returned value: * * none * * Side effects: * * resources stored in the array of rivet_thread_interp objects are released * and interpreters are deleted. * */ void Rivet_ProcessorCleanup (void *data) { int i; rivet_thread_private* private = (rivet_thread_private *) data; ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, module_globals->server, "Thread exiting after %d requests served (%d vhosts)", private->req_cnt,module_globals->vhosts_count); /* We are about to delete the interpreters and release the thread channel. * Rivet channel is set as stdout channel of Tcl and as such is treated * by Tcl_UnregisterChannel is a special way. When its refCount reaches 1 * the channel is released immediately by forcing the refCount to 0 * (see Tcl source code: generic/TclIO.c). Unregistering for each interpreter * causes the process to segfault at least for certain Tcl versions. * We unset the channel as stdout to avoid this */ Tcl_SetStdChannel(NULL,TCL_STDOUT); /* there must be always a root interpreter in the slot 0 of private->interps, * so we always need to run this cycle at least once */ i = 0; do { RivetCache_Cleanup(private,private->ext->interps[i]); if ((i > 0) && module_globals->separate_channels) Rivet_ReleaseRivetChannel(private->ext->interps[i]->interp,private->channel); /* if separate_virtual_interps == 0 we are running * the same interpreter instance for each vhost, * thus we need to delete only the first occurrence of * the interpreter but we need to release the scripts * stored in Tcl_Obj instances */ if ((i == 0) || module_globals->separate_virtual_interps) { Tcl_DeleteInterp(private->ext->interps[i]->interp); } /* Release interpreter scripts */ Rivet_ReleaseRunningScripts(private->ext->interps[i]->scripts); /* Release scripts defined within conf blocks */ Rivet_ReleasePerDirScripts(private->ext->interps[i]); } while (++i < module_globals->vhosts_count); } rivet-3.0.0/tests/try.rvt000664 001750 001750 00000002022 15224454746 016143 0ustar00manghimanghi000000 000000 rivet-3.0.0/doc/html/tcl_packages.html000664 001750 001750 00000005401 15224455137 020444 0ustar00manghimanghi000000 000000 Rivet Tcl Packages

    Rivet Tcl Packages

    In addition to the core Apache module, Rivet provides a number of Tcl packages that include potentially useful code.

    • dio is a database abstraction layer.
    • form - for creating forms.
    • calendar - a package providing a simple configurable calendar generator
    • rivet entities - an UTF-8 / HTML entities converter
    • formbroker - a form data validators broker
    • ASCII Glyphs - prints most of the ASCII character set as large ASCII art glyphs
    rivet-3.0.0/ChangeLog000664 001750 001750 00000776375 15224454746 015235 0ustar00manghimanghi000000 000000 2026-07-11 Massimo Manghi * src/mod_rivet_ng/mod_rivet_common.c: Now explicitly scoping in the global namespace the array 'server' that ships some information about mod_rivet (legacy array inherited from early versions for Apache 1.x). This is needed by the change introduced by Tcl9 in the variable name resolution mechanism that doesn't lookup in the global namespace anymore 2026-07-03 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: implement 1st class C level commands ::rivet::write_binary and ::rivet::with_binary_output for consistent handling of binary output * src/mod_rivet_ng/TclWebapache.c: Configure the Tcl output channel from the response charset for every request. * src/mod_rivet_ng/rivetCore.c: Add -encoding support to ::rivet::parse and include the selected encoding in parser cache keys. * src/parser/rivetParser.c: Add encoding-aware template loading while preserving the existing default system-encoding behavior. * tests/README: Declare UTF-8 as the encoding for textual test files. * tests/channelencoding.[rvt|test]: New test to report the active Rivet output-channel encoding. Verify that the response channel follows the declared UTF-8 charset. * tests/get.rvt: Convert internationalized variable names to UTF-8. * tests/headers.test: Update expected request headers for the bundled HTTP client. * tests/hello.rvt: Convert internationalized Spanish and Japanese text to UTF-8. * tests/hello.test: Convert internationalized expected values to UTF-8. * tests/include.html: Convert the Japanese include fixture to UTF-8. * tests/include.test: Update the UTF-8 include expectation and emitted whitespace. * tests/inspect.test: Make ChildInitScript inspection checks robust against additional configuration commands. * tests/parse.rvt: Parse the included template explicitly as UTF-8. * tests/parse.test: Convert parser expectations to UTF-8, normalize the trailing newline and test explicit ISO-8859-1 input decoding. * tests/parseencoding.rvt: Exercise ::rivet::parse with an explicit ISO-8859-1 encoding. * tests/parsepackage.test: Convert parser-package expectations to UTF-8. * tests/parsestring.rvt: Read the string template explicitly as UTF-8. * tests/post.rvt: Convert internationalized POST variable names to UTF-8. * tests/post.test: Convert internationalized POST requests and expectations to UTF-8. * tests/rivet.test: Enable the complete regular test list and add the response-channel encoding test. * tests/runtests.tcl: Establish UTF-8 for the test interpreter and Rivet child interpreters, replacing the obsolete UTF-8 warning. * tests/tclfile.tcl: Convert the plain Tcl internationalized fixture to UTF-8. * tests/tclfile.test: Convert the plain Tcl file expectation to UTF-8. * doc/xml/commands.xml: Document the ::rivet::parse -encoding, -virtual and -string forms. 2026-04-19 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: trimming sql command string before testing the presence of a terminating ';' 2026-03-10 Massimo Manghi * src/mod_rivet_ng/rivet_[worker|prefork|lazy]_mpm.c: Fully expressing fields in bridge structure definition * src/mod_rivet_ng/mod_rivet_common.c: Reformat lines defining the 'server' array * src/mod_rivet_ng/worker_prefork_common.c: Possible memory leak fixed in Rivet_ProcessorCleanup 2026-03-03 Massimo Manghi * rivet/packages/dio/dio_Sqlite.tcl: override method create_field_formatter to match the name of the correspondig formatter class 2026-03-02 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: fix missing instance variable resultid 2026-01-04 Massimo Manghi * src/librivet/rivetList.c: modernize old style function declaration as recent compiler complain about it and it doesn't mix with code profilers * src/mod_rivet_ng/rivetChannel.c: support for channel version 5 * src/mod_rivet_ng/rivet_types.h: move here Tcl_Size compatibility definition as actual typedef definition * tclconfig/tcl.m4: update tcl.m4 to latest version 2025-11-20 Massimo Manghi * rivet/packages/dio/formatters.tcl: The Sqlite3 field formatter class must be named Sqlite3 likewise 2025-11-01 Massimo Manghi * rivet/packages/dio/formatters.tcl: fixed misplaced comment that let a switch...case constuct fail * rivet/packages/session/session-class.tcl: place messages to debug session update times computations 2025-10-26 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: version number updated to 1.2.5 2025-10-24 Massimo Manghi * doc/rivet.xml.in: reformat and align entities definitions * doc/xml/commands.xml: changed 'inspect' command definition in reference list * rivet/packages/dio/dio_Tdbc.tcl: fix wrong serial number management 2025-10-23 Massimo Manghi * rivet/packages/dio/formatters.tcl: a typo slipped in and spoiled for formatter class name for Posgresql connectors * rivet/packages/dio/dio_Tdbc.tcl: missing increment of a connector serial number 2025-10-16 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: tdbc methods consolidation into tdbc_exec, method 'fetch' reimplemented to allow TDBC argument substitution 2025-10-15 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: reimplementing methods update, delete and insert to enable DIO Tdbc driver to handle also SQL queries using the TDBC named argument substitution * rivet/packages/dio/dio.tcl: better handling of the special field formatter. The special fields formatter usage disables on specific tables the SQL queries with named arguments substitution 2025-10-07 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: removing method insert from class ::DIO::Tdbc, the real responsible of honoring SQL statements with bound variables was method exec 2025-10-06 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: Reimplementing also method insert as named parameters requires an SQL statement to be evaluated where the array of key-value pairs lives. 2025-10-06 Massimo Manghi * VERSION: Preparing RC as 3.2.7 (which was correctly set on 2024-11-26) 2025-10-05 Massimo Manghi * rivet/packages/dio/[dio|dio_Tdbc.tcl|formatters.c]: fix missing argument in field formatter call * rivet/packages/session/session-class.tcl: add debug output method to allow overriding of it 2025-10-03 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3 respectively. Adopting a specific tdbc connector creator form when creating a sqlite3 handle 2025-10-02 Massimo Manghi * rivet/packages/dio/dio.tcl: definining command ::rivet::lempty if not present as it's extensively used but available only when running from mod_rivet (DIO package version number bumped to 1.2.1) 2025-08-19 Massimo Manghi * src/mod_rivet_ng/rivet_types.h,src/parser/rivetParser.c: Introducting definition of Tcl_Size when TCL_MAJOR_VERSION == 8 in order to provide backward compatibility with Tcl 8 builds 2025-07-13 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: fixed error in variable name made impossible to actually pass TDBC specific options to a DBMS connector. Package version is bumped to 1.2.1 2025-05-05 Massimo Manghi * VERSION: Version 3.3.0. Merging tcl-novem into master after branching current Tcl8.6 only development to branch 3.2. Development continues on a Tcl9 ready master branch * rivet/packages/aida: reset development with the purpose of refactoring DIO and rebase the code on TclOO supporting only tdbc connectors 2025-04-13 Massimo Manghi * src/Makefile.am: wrap long definitions for improved readability 2025-04-10 Massimo Manghi * configure.ac: defined m4 variable for rivet version. 2024-11-26 Massimo Manghi * ChangeLog: reordered log entries that some past merge had misplaced * VERSION: new version 3.2.7 * src/mod_rivet_ng/mod_rivet.h: Removed macro THREADED_TCL since unused and since Tcl is now only threaded * src/mod_rivet_ng/mod_rivet_cache.[h|c]: Introducing macro RIVET_CACHE_SIZE_MINIMUM. This is the absolute minimum for the rivet cache size also when the estimated size based on the ap_max_requests_per_child value drops below it 2024-09-09 Massimo Manghi * rivet/packages/dio: merging branch tdbc with DIO 1.2 and new dio connectors using class Formatter descendands to print special fields and introducing new dio_Tdbc.tcl connector, a portmanteau class switching among tdbc connectors 2024-08-23 Massimo Manghi * rivet/packages/dio/dio_Mysql.c,dio_Tdbc.c: fixed wrong argument list construction and wrong argument to legacy mysqltcl connector 2024-08-22 Massimo Manghi * rivet/packages/dio: further development for supporting tdbc based connectors 2024-05-19 Massimo Manghi * rivet/packages/dio/formatters.tcl: add formatters class to provide common special fields formatting for both Tdbc based and legacy connectors * rivet/packages/dio/dio_*.tcl: removed special fields formatting code and endowing these classes with special field formatter object instances 2024-05-15 Massimo Manghi * rivet/packages/dio/tdbc.tcl,dio.tcl: add early support for tdbc database interface 2024-05-11 Massimo Manghi * rivet/packages/aida/aida.tcl,sql.tcl: experimental files moved from packages/dio * rivet/packages/rivet_ncgi/rivet_ncgi.tcl: fully qualifying rivet commands * Makefile.am: Remove svn Id: 2024-04-12 Massimo Manghi * src/mod_rivet_ng/mod_rivet_common.c: Determining the server_rec also for ServerInitScripts. * doc/rivet.xml: update version number 2024-02-18 Massimo Manghi * doc/xml/commands.xml: fixed misspelled command ::rivet::thread_id * VERSION: new version 3.2.5 2024-02-04 Massimo Manghi * doc/rivet.xml: new version 3.2.4 * src/mod_rivet_ng/rivet_prefork_mpm.c: * src/mod_rivet_ng/rivet_worker_mpm.c: * src/mod_rivet_ng/worker_prefork_common.c: now calling the new function Rivet_RunChildScripts to execute both rivet_child_init_script and rivet_child_exit_script 2024-02-03 Massimo Manghi * doc/xml/lazybridge.xml: escaping some character that needed their corresponding SGML/HTML entities 2024-02-02 Massimo Manghi * doc/xml/dio.xml: Documenting the support of Tdbc series of DBMS connectors * doc/xml/lazybridge.xml: update with latest version of code * src/mod_rivet_ng/rivet_lazy_mpm.c: cleaned code removing lines that had been commented out 2024-01-05 Massimo Manghi * VERSION: bumped version number as 3.2.4 2023-11-19 Massimo Manghi * src/mod_rivet_ng/*.c: changing code to comply with the Tcl 9.0 new requirements 2023-11-12 Massimo Manghi * .appveyor.yml: Attemping to fix Visual Studio generator version 2023-10-28 Massimo Manghi * .appveyor.yml: Fix Windows compiler download URL 2023-10-03 Massimo Manghi * tests/rivet.tcl: fixed regression bug in the controlling environment variables 2023-09-12 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: expanded comments * doc/xml/formbroker.xml: documenting variable type validators error codes 2023-06-14 Massimo Manghi * tests/channel.test: indenting code for improved readability * src/mod_rivet_ng/mod_rivet.c,mod_rivet_generator.c: Removed unused code that has been commented out long ago * rivet/rivet-tcl/parray.tcl: ::rivet::parray now accepting alternative way to return data or generate output. 2023-05-18 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: * src/mod_rivet_ng/mod_rivet.h: * src/mod_rivet_ng/mod_rivet_common.c: * src/mod_rivet_ng/rivetCore.c: * src/mod_rivet_ng/worker_prefork_common.c: now storing the server record in the intepreter globals to be used by Rivet_LogErrorCmd instead of module_globals->server when threads private data are not available (like when ChildInitScript is executed) 2023-05-04 Massimo Manghi * tests/rivet.test: more contributions provided by Scott Pitcher ) * tests/apachetest/apachetest.tcl: More improvements to the test script. Now handling also Apache directive IncludeOptional and enabling execution control through environment variables * tests/post.rvt: * tests/post.test: add a test for ::rivet::raw_post 2023-04-11 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: * src/mod_rivet_ng/rivetCore.c: * src/mod_rivet_ng/rivet_types.h: * src/request/apache_request.c: * src/request/apache_request.h: handling length of data in POST requests. It fixes ::rivet::raw_post when the POSTed data don't have variable sections (patch provided by Scott Pitcher ) 2023-01-11 Massimo Manghi * src/TclWeb.h: also this headers file had a CONST84 specifier that needed to be converted as CONST86 2023-01-09 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: * src/mod_rivet_ng/rivetChannel.c: * src/mod_rivet_ng/rivetCore.c: Replaced CONST84 with CONST86 that should allow for a smooth transition to Tcl8.7 2022-11-05 Massimo Manghi * VERSION: new version 3.2.3 * src/*.[hc]: Thoroughly removed trailing spaces 2022-06-21 Massimo Manghi * Changelog: logging release of Rivet 3.2.2. 2022-06-10 Massimo Manghi * doc/xml/directives.xml: moved misplaced text in table * configure.ac: Changed default for HonorHeadRequests to 'yes' * src/mod_rivet_ng/mod_rivet_generator.c: rephrased comment documenting the exit handler behavior 2022-05-31 Massimo Manghi * src/mod_rivet_ng/*.c: Directive HonorHeaderOnlyReqs renamed as HonorHeadRequests, which sounds more consistent with the common parlance regarding HTTP 2022-03-01 Massimo Manghi * tests/getall.rvt: add new test for the 2 forms of [::rivet::var_qs all] 2022-02-19 Massimo Manghi * tclconfig/tcl.m4: patched tcl.m4 distributed by core.tcl.tk as it doesn't work with Makefile.am files in nested directories. Patch submitted upstream * tclconfig/: commit several autoconf generated scripts * m4/: add new files automatically copied by autoconf 2022-02-18 Massimo Manghi * src/TclWeb.h: Add copyright notice, remove SVN id keyword * rivet/rivet-tcl/xml.tcl: correct wrong comment showing command xml arguments * src/mod_rivet_ng/rivet_lazy_mpm.c: adopting boolean values defined in bool.h * src/mod_rivet_ng/mod_rivet.[c|h]: expand comments, fix typo * rivet/packages/form/form22.tcl: Using ::rivet::xml instead of the class method argstring 2022-02-14 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: New feature of the '::rivet::var all' commands. An extra optional argument is interpreted as a dictionary of default values * tclconfig/tcl.m4,tclconfig/install-sh: install latest version from Tclconfig repository * doc/xml/commands.xml: update page manual for ::rivet::var 2022-02-13 Massimo Manghi * VERSION: bumping new version number to 3.2.2 * src/mod_rivet_ng/rivetCore.c: fixed possible memory leak in Rivet_Var. A Tcl_Obj was created to return empty strings replacing an already existing Tcl_Obj losing track of it. * tclconfig/tcl.m4,tclconfig/install-sh: install latest version from Tclconfig repository 2022-01-06 Massimo Manghi * configure.ac: changing obsolete macro AC_PROG_LIBTOOL into LT_INIT 2021-11-13 Massimo Manghi * Changelog: release as Rivet 3.2.1 2021-11-06 Massimo Manghi * configure.ac: remove duplicated call of macro AM_AUTOMAKE_INIT. Add macro AC_CONFIG_SRCDIR * rivet/packages/form*.tcl: Update copyright lines, removed old svn symbols * doc/xml/form.xml: documenting new switch -emit 2021-11-05 Massimo Manghi * doc/xml/lazybridge.xml: update examples with latest modifications done to the lazy bridge 2021-11-04 Massimo Manghi * doc/xml/installation.xml: documenting new configure switch --enable-rivet-debug-build 2021-11-03 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: removed unnecessary call to TclWeb_InitEnvVars when loading input headers * tests/env.test: cleaning up http tokens resources 2021-11-01 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: expanded comments to newly introduced functions 2021-10-25 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: extended comments * src/rivet.h: new macro MINSTRLEN 2021-10-20 Massimo Manghi * src/mod_rivet_ng/Tclwebapache.c: new environment variable handling. Command ::rivet::env doesn't necessarily trigger the whole environment load into request_rec, it tries to resolve a variable incrementally. Need to recommend the usage of ::rivet::env instead of ::rivet::load_env * tests/env.rvt: adding new tests to environment variable resolution 2021-09-06 Massimo Manghi * rivet/packages/session/session-create-*.sql: making cache fields larger 2021-07-30 Massimo Manghi * src/mod_rivet_ng/TclWebapache.c: integrating the current scant Tcl error info returned by the various ::rivet::upload subcommands * rivet/packages/dio/: Removing references to subversion's tags 2021-04-13 Massimo Manghi * src/mod_rivet_ng/rivetInspect.c: add server current loglevel. Removed unneeded ref count management in the server array construction 2021-03-07 Massimo Manghi * VERSION: bumped version as 3.2.1 * src/mod_rivet_ng/mod_rivet.c: more linear determination of the bridge name * rivet/packages/formbroker.tcl: introduced key maxlength 2020-11-19 Massimo Manghi * rivet/packages/dio/dio.tcl,dio_Mysql.tcl: adding support for connector specific client arguments * rivet/packages/form/form22.tcl: New form 2.2 package can be configured to return HTML code instead of printing it to stdout 2020-11-02 Massimo Manghi * doc/xml/directives.xml: SingleThreadExit entry re-elaborated * tests/runtest.tcl: Document new command line options * README: Removed obsolete warning about scgi scripts 2020-10-04 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: forcing variable assignment in condition 2020-10-03 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: Documenting the Rivet_SeekMPMBridge function 2020-10-01 Massimo Manghi * src/mod_rivet_ng/rivet_prefork_mpm.c: Fixed trivial bug in checking the rivet cache size * configure.ac: add macro to define preprocessor symbol RIVET_DEBUG_CODE 2020-09-29 Massimo Manghi * src/mod_rivet_ng/mod_rivet.[c|h]: * src/mod_rivet_ng/rivet_[prefork|worker|lazy]_mpm.c: * src/mod_rivet_ng/worker_prefork_common.c: * src/mod_rivet_ng/mod_rivet_commit.c: * src/mod_rivet_ng/apache_config.[c|h]: moving also rivet_server_init out of the server configuration and into the module_globals 2020-09-28 Massimo Manghi * src/mod_rivet_ng/mod_rivet.[c|h]: * src/mod_rivet_ng/rivet_[prefork|worker|lazy]_mpm.c: * src/mod_rivet_ng/worker_prefork_common.c: * src/mod_rivet_ng/mod_rivet_commit.c: * src/mod_rivet_ng/apache_config.[c|h]: moving real global setting out of the server configuration record into the module_globals structure, because they're global in the first place * doc/xml/directives.xml: extended revision of the directive scope documentation 2020-09-27 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: add method form_exists to check for registration of a form * test/apachetest/apachetest.tcl,test/runtests.tcl: add support for testing with various MPMs and bridges 2020-02-03 Massimo Manghi * src/request/: Update obsolete copyright statements * src/mod_rivet_ng/rivetCore.c: update comments to upload command * tests: changed upload file test 2020-04-02 Massimo Manghi * doc/xml/formbroker.xml: fixed examples * src/mod_rivet_ng/rivet_lazy_mpm.c: resolved access to shared counter that was causing segfaults when child process was terminated 2020-03-04 Massimo Manghi * src/librivet/rivetList.c: declaring function with macro TCL_CMD_HEADER * src/mod_rivet_ng/TclWebapache.c: removed svn related keyword * src/mod_rivet_ng/mod_rivet_common.[c|h]: adopting standard C syntax for variable * src/mod_rivet_ng/rivetChannel.c: obsolete CONST84 macro turned into standard 'const' * src/parser/parserPkgInit.c: declaring function with macro TCL_CMD_HEADER * src/rivet.h: Changed obsoleted CONST macro, remove svn related keyword 2020-01-19 Massimo Manghi * doc/xml/commands.xml: remove entry for command incr0 (dropped in 3.0) 2019-12-30 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: fixed bug in 'upload filename' that caused segfaults instead of Tcl errors when called without arguments * src/request/: Adding latest Copyright statements to files in this directory * tests/upload.rvt,upload.test: revised upload tests (need expansion to test multiple uploads) 2019-12-12 Massimo Manghi * src/mod_rivet_ng/apache_config.c: copying also upload_files_to_var in Rivet_MergeConfig 2019-12-06 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: expanded error info data in Rivet_Upload * doc/rivet.css: new color scheme for docbook manual 2019-12-04 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: new branch uploadcmdfix with improved argument checking in Rivet_Upload that was the cause of random crashes 2019-11-29 Brice Hamon * src/mod_rivet_ng/mod_rivet_cache.h: added RivetCache_DeleteEntry * src/mod_rivet_ng/mod_rivet_cache.c: * src/mod_rivet_ng/rivetCore.c: fixed crash when rvt file not readable 2019-10-13 Massimo Manghi * doc/xml/directives.xml: configuration directives table expanded * doc/examples/ 2019-09-30 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: revised argument checking 2019-09-29 Massimo Manghi * doc/xml/commands.xml: Completed manual page for command ::rivet::thread_id * src/mod_rivet_ng/rivetCore.c: Rivet_GetThreadId rewritten. Now the command accepts an optional argument to select decimal or hexadecimal (default) output 2019-08-05 Massimo Manghi * doc/xml/directives.xml: Documenting SingleThreadExit directive 2019-07-27 Massimo Manghi * doc/xml/commands.xml,src/mod_rivet_ng/rivetCore.c: Add ::rivet::thread_id manual page 2019-06-25 Massimo Manghi * : Single thread exit implementation for mod_rivet 3.2 * src/mod_rivet_ng/rivet_[.*]_mpm.c: further simplified code by removing redundant flags. Changing function names scheme 2019-05-24 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: Add Tcl_DecrRefCnt after RivetCache_StoreScript as this function itself calls Tcl_IncrRefCnt to preserve the Tcl_Obj with the script code 2019-04-13 Massimo Manghi * doc/xml/commands.xml: Correct wrong header in ::rivet::http_accept code example 2019-04-12 Massimo Manghi * INSTALL: wrong references corrected 2019-02-19 Massimo Manghi * .appveyor.yml: merging from master in order to have new tags generate artifacts 2019-02-16 Georgios Petasis * .appveyor.yml: Added support for creating a zip with the installed rivet files (both module and library), and create an artifact. If a tag is added (in all branches), the zip will be added to the release. 2019-01-21 Massimo Manghi * src/rivet.h: Add error message buffer size definition (was still hardcoded here and there) * src/mod_rivet_ng/rivetCore.c,rivet_worker_mpm.c: hardcoded buffer size into their correct macro definitions 2019-01-14 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: add experimental ::rivet::thread_id command 2019-01-05 Massimo Manghi * doc/: merging from 3.1 fixes to various broken docbook elements and new entities to external resources' URLs 2018-12-24 Georgios Petasis * README.md: Added badges also for the GitHub fork at: https://github.com/petasis/tcl-rivet. * .appveyor.yml: Enhancements to not rely on hard-coded paths. 2018-12-23 Massimo Manghi * cmake/CMakeLists.txt: starting with rivet 3 we need Tcl > 8.6.1 2018-12-20 Georgios Petasis * cmake/CMakeLists.txt: Set policy behaviour of CMP0074, only if policy is defined (i.e. cmake version >= 3.12). 2018-12-19 Georgios Petasis * cmake/CMakeLists.txt: Added support for regenerating pkgIndex.tcl in the installation directory of rivetlib, after files have been installed. This executes "tclsh". 2018-12-17 Georgios Petasis * Readme.md: Added a separate badge for winbuild branch. 2018-12-17 Massimo Manghi * src/request/apache_request.c,src/request/apache_multipart_buffer.[c|h]: explicit cast to int wherever needed by calls to Tcl_* functions and changed int to size_t wherever required * src/mod_rivet_ng/rivet_types.h,rivetCore.c: field 'size' in structure typed as size_t * src/mod_rivet_ng/TclWebapache.c: argument to Tcl_ReadChars explicitly cast to int 2018-12-16 Georgios Petasis * Readme.md: Added a Markdown README file, which shows the build status from Appveyor, for Windows. * .appveyor.yml: Started a build configuration for Appveyor: https://ci.appveyor.com/project/petasis/tcl-rivet * cmake/CMakeLists.txt: Set policy CMP0074 to new behaviour. Rivet version is read from file VERSION. * cmake/README.cmake: Some changes in directories used. * src/mod_rivet_ng/mod_rivet.h: Removed statement "APLOG_USE_MODULE(rivet);" from the module header file. 2018-12-07 Massimo Manghi * rivet/pkgIndex.tcl: completed with actual list of packages 2018-12-04 Massimo Manghi * configure.ac: now infer the version number from VERSION. * doc/rivet.xml,doc/xml/examples.xml: modified example "color table" 2018-12-03 Massimo Manghi * cmake/CMakeList.c: we infer the version number from the file VERSION assumed to reside in the project root directory * src/parser/rivetParser.c: * src/mod_rivet_ng/mod_rivet_common.c: type cast of pointer arithmetics into int 2018-11-23 Massimo Manghi * VERSION,configure,ac: version number bumped to 3.2.0 as we created 3.1 out of branch 3.0 in order to highlight possible regressions that may surface as a consequence of fixing bug #62926 2018-11-20 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: patching from 3.0 to fix bug #62926 * tests/post.rvt,fqrivet_var.tcl: add tests to prevent post and get variables crosstalk (bug #92926) * doc/rivet.xml.in: displaying full version associated to the manual 2018-11-11 Massimo Manghi * configure.ac: correct macro description * src/mod_rivet_ng/rivetChannel.c: new copyright notice * doc/xml/commands.xml: correct sentence in ::rivet::exit manual page 2018-11-02 Massimo Manghi * src/mod_rivet_ng/mod_rivet.[c|h]: add macro RIVET_MPM_BRIDGE to compose rivet bridge names 2018-10-17 Massimo Manghi * tests/commands.tcl: changing test on self closing element * [doc/rivet.xml.in|doc/rivet.xml]: removed delimiters of symbols expanded by svn * doc/xml/commands.xml: fixed entities in ::rivet::xml manual page 2018-08-16 Massimo Manghi * rivet/rivet-tcl/xml.tcl: changing form to support single self closing XML elements such as when if the text string is empty * tests/commands.tcl: changing ::rivet::xml test accordingly * doc/xml/commands.xml: documenting new ::rivet::xml feature 2018-08-07 Massimo Manghi * VERSION,configure.ac: first commit after svn to git migration. The trunk branch is now the master branch of the git repository. setting the master branch version as 3.1.0. * .gitignore: untracking Makefile.in and putting in .gitignore autools generated files * doc/rivet.xml.in: removing references to now unsupported svn keywords substitutions 2018-06-25 Massimo Manghi * rivet/init.tcl.in: the error handler of error scripts requires ::Rivet::script to keep the actual 'script' being run (reintegrated into trunk from branches/3.0) 2018-06-18 Massimo Manghi * rivet/packages/dio/*.tcl: fully qualifying calls to ::rivet::lempty 2018-06-14 Massimo Manghi * rivet/init.tcl: fixed bug in error scripts' error handling (the case of handling an error that occurs in the default error script may need the introduction of a new test 2018-04-09 Massimo Manghi * src/mod_rivet_ng/mod_rivet.h: changing argument list of function *mpm_thread_interp in the bridge interface. It must work as an accessor to the interpreter database when both getting and storing an interpreter pointer 2018-02-28 Massimo Manghi * Makefile.am: default_request_handler.tcl and init.tcl can be installed without the exec bit set 2018-02-17 Massimo Manghi * NOTICE: update copyright statement * src/mod_rivet_ng/worker_prefork_common.c: Rivet_CleanupProcessor to call RivetCache_Cleanup * doc/rivet.xml: new version in docs 2018-02-08 Massimo Manghi * VERSION,configure.ac: bumping version to 3.0.2 2018-02-08 Ronnie Brunner * doc/apachetest.tcl: make independent from TclX adding our own 'kill' procedure. Changing signal to stop the http webserver as KILL * doc/runtests.tcl: removing depend on the prefork module 2018-02-03 Massimo Manghi * src/librivet/rivetPkgInit.c: changing way we determine the namespace pointer in order to avoid the necessity of gaining access to the module globals and therefore avoid including mod_rivet.h. The macro APLOG_USE_MODULE introduced in mod_rivet.h makes the library load fail outside mod_rivet and Apache * rivet/pkgIndex.tcl: recreated from scratch 2018-01-23 Massimo Manghi * VERSION,configure.ac: bumping version number to 3.0.1 * doc/rivet.xml.in,doc/xml/request.xml: wrong links and information about MPM support fixed * src/mod_rivet_ng/mod_rivet.h: add APLOG_USE_MODULE macro * src/mod_rivet/ng/rivet_worker_mpm.c: number of threads waited on exit by the supervisor was wrong and it's now the acutal number of threads available, variable uninitalized in loop fixed 2018-01-23 Massimo Manghi * doc/xml/lazybridge.xml: more improvements and inclusion of new comments to the code * doc/xml/commands.xml: rather cosmetic improvment to the page of ::rivet::try * src/mod_rivet_ng/rivet_lazy_mpm.c: more comments 2018-01-19 Massimo Manghi * doc/xml/installation.xml: various broken links fixed * doc/xml/internals.xml: expanding some explanations and changing links to the Apache server from version 2.2 to 2.4 * doc/xml/lazybridge.xml: expanding code explanations * src/mod_rivet_ng/rivet_lazy_mpm.c: commenting code in various functions 2018-01-17 Massimo Manghi * : Released as 3.0.0 2018-01-09 Massimo Manghi * tests/virtualhost.test,tests/channel.test: changed virtual hosts declarations. Now accepting '*' as host name prevents test from failing with certain set ups (a DNS related problem) * doc/xml/intro.xml: add ackowledgements to George * win/: old Windows scripts removed * src/mod_rivet: old mod_rivet code removed 2018-01-01 Massimo Manghi * doc/xml/: more error checking and several improvements to the manual 2017-12-29 Massimo Manghi * doc/rivet.xml.in: more entities to extend documentation * doc/xml/intro.xml: introduction revised and extended * doc/xml-2: files used to generate the manual removed or moved into doc/xml * doc/rivet.css: changed color palette 2017-12-22 Massimo Manghi * doc/: more changes to manual pages 2017-11-29 Massimo Manghi * NOTICE, README: expanded and obsolete information amended 2017-10-31 Massimo Manghi * merging branch cmake back into trunk * tests/broken.test: the error message form has changed with the Tcl based new request handling procedure 2017-10-28 Massimo Manghi * docs/xml/cmake.xml: draft manual page for cmake build system 2017-10-22 Massimo Manghi * rivet/init.tcl.in: Following Jeff Lawson's suggestion we check if init.tcl is loaded from within mod_rivet. If we're not running from it we don't divert the [exit] command * src/librivet/rivetPkgInit.c: removing code kept in the file that had been commented because not needed. 2017-10-18 Massimo Manghi * doc/: add new cmake.xml file, further manual developments 2017-10-12 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: add preprocessor test on variable declaration for the WIN32 build * src/librivet/rivetWWW.c: fixed subtle buffer overflow mistakenly assuming snprintf printed a byte less than * doc/xml/processing.xml,command.xml: further elaboration of the Rivet 3.0 manual. Update ::rivet::redirect manual entry * tcl/rivet-tcl/redirect.tcl: now handling generic boolean arguments or any integer > 0 (as for the HTTP status codes) 2017-09-17 Massimo Manghi * doc/xml/examples.xml: moved into final directory 2017-09-15 Massimo Manghi * rivet/packages/dio/dio.tcl: new version 1.1 of class Database new method mkdir for class Result * docs/Makefile.am: removed automatic manual creation upon installation 2017-09-03 Massimo Manghi * rivet/packages/dio/dio_Mysql.c: unqualified string command conflicted with Database class same method 2017-08-18 Massimo Manghi * rivet/packages/dio/dio.tcl: method build_where_clause treated single value key differently, but this failed to remove braces for the representation of a single element list containing space characters. The method has been changed the have an uniform way to handle this 2017-08-12 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: moving to Rivet_RunServerInit the call to the bridge specific server initialization script. Confining compilation of the code checking AP_PARENT_PID to Windows systems 2017-08-10 Georgios Petasis * cmake/CMakeLists.txt: Modified also variable CMAKE_PREFIX_PATH, as TCL_ROOT and TclStub_ROOT are specific to CMake 3.9.0, and will be removed. See https://gitlab.kitware.com/cmake/cmake/issues/17158. 2017-08-11 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: add check on environment variable AP_PARENT_PID to prevent server Tcl init script from running in winnt controlled child processes (as per Apache HTTP server documentation) 2017-08-10 Georgios Petasis * src\mod_rivet_ng\apache_config.c: * src\mod_rivet_ng\mod_rivet.c: * src\mod_rivet_ng\mod_rivet_common.c: * src\mod_rivet_ng\mod_rivet_generator.c: * src\mod_rivet_ng\rivet_lazy_mpm.c: * src\mod_rivet_ng\worker_prefork_common.c: Locally declared symbol rivet_module as extern (DLLIMPORT). * branches\cmake\src\mod_rivet_ng\mod_rivet.h: Symbol rivet_module removed from header file. * branches\cmake\src\mod_rivet_ng\mod_rivet_common.c: Used ckalloc() instead of apr_pcalloc() for variable globals, in Rivet_PerInterpInit(). * cmake\README.cmake: * cmake\CMakeLists.txt: Added support for picking a Tcl installed at a non-standard location. Updated README.cmake with an example. Also disabled the switch to export all symbols from mod_rivet.so (WINDOWS_EXPORT_ALL_SYMBOLS). * src\mod_rivet_ng\mod_rivet_common.c: * src\mod_rivet_ng\rivetCore.c: Fixes in DLLEXPORT. 2017-08-07 Massimo Manghi * src/mod_rivet_ng/mod_rivet.c: Rivet_ServerInit is now implementing the recommended mechanism to avoid the double load of external modules 2017-08-05 Georgios Petasis * cmake\CMakeLists.txt: rivetparser/rivetlib shared libraries now have the prefix "lib" under all platforms. * cmake\cmake_extra_modules\rivet_config.h.cmake: RIVET_RIVET_CORE or RIVET_CORE? Added also support for RIVET_CORE, but disabled, as it causes compilation errors (in C preprosessor, two strings are compared, which is not supported). * rivet\pkgIndex.tcl: Dropped ".so" in favour of "info sharedlibextension". * src\librivet\rivetCrypt.c: * src\librivet\rivetList.c: * src\librivet\rivetPkgInit.c: * src\librivet\rivetWWW.c: Definition of EXTERN and exported symbols through DLLEXPORT. * src\mod_rivet_ng\mod_rivet.c: * src\mod_rivet_ng\mod_rivet_cache.c: * src\mod_rivet_ng\mod_rivet_common.c: * src\mod_rivet_ng\mod_rivet_generator.c: * src\mod_rivet_ng\rivetCore.c: * src\mod_rivet_ng\rivetCore.h: * src\parser\parserPkgInit.c: Definition of EXTERN and exported symbols through DLLEXPORT. 2017-08-05 Georgios Petasis * src\mod_rivet_ng\rivet_lazy_mpm.c: * src\mod_rivet_ng\rivet_prefork_mpm.c: * src\mod_rivet_ng\rivet_worker_mpm.c: Added DLLEXPORT for the symbol defined with RIVET_MPM_BRIDGE macro. * cmake\CMakeLists.txt: Exported all symbols for mod_rivet.so under Windows, to copy the behaviour in UNIX systems (where all symbols are exported from shared libraries). * cmake\cmake_extra_modules\checks.cmake: * cmake\cmake_extra_modules\config.h.cmake: * cmake\cmake_extra_modules\rivet_config.h.cmake: Under VC11, round() has not been implemented. Added checks in CMake build, for detecting round()'s absence. * src\mod_rivet_ng\rivetCore.c: * src\mod_rivet_ng\rivet_lazy_mpm.c: * src\mod_rivet_ng\rivet_prefork_mpm.c: * src\mod_rivet_ng\rivet_worker_mpm.c: * src\mod_rivet_ng\worker_prefork_common.c: * src\parser\parserPkgInit.c: Changes for avoiding link error under Windows (mostly) related to importing exported symbols from mod_rivet.so. 2017-08-05 Georgios Petasis * src/mod_rivet_ng/mod_rivet_common.c: Reordered header files, so (and its check) to come after "mod_rivet.h" that includes "rivet_config.h". 2017-08-04 Georgios Petasis * cmake\CMakeLists.txt: * cmake\cmake_extra_modules\FindAPR.cmake: * src\mod_rivet_ng\TclWebapache.c: * src\mod_rivet_ng\mod_rivet.c: * src\mod_rivet_ng\mod_rivet.h: * src\mod_rivet_ng\mod_rivet_cache.c: * src\mod_rivet_ng\mod_rivet_common.c: * src\mod_rivet_ng\mod_rivet_generator.c: * src\mod_rivet_ng\rivetCore.c: * src\parser\rivetParser.c: Changes for fixing compilation errors under Windows. 2017-08-04 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: changes demanded by windows compiler * rivet/pkgIndex.tcl: recreated with a up to date list of packages 2017-08-04 Georgios Petasis * cmake\CMakeLists.txt: Various changes for better support build under Windows. * cmake\README.cmake: Added a section for building under Windows. * cmake\cmake_extra_modules\FindAPACHE.cmake: Enhanced customisability. The user can guide detection with variables APACHE_INCLUDE_DIR_HINTS, APACHE_MODULE_DIR_HINTS, APACHE_LIB_DIR_HINTS, APACHE_ROOT. * cmake\cmake_extra_modules\FindAPR.cmake: Enhanced customisability. The user can guide detection with variables APR_INCLUDE_DIR_HINTS, APACHE_INCLUDE_DIR_HINTS, APACHE_ROOT, APR_LIBRARY_HINTS, APRUTIL_INCLUDE_DIR_HINTS, APRUTIL_LIBRARY_HINTS. 2017-08-03 Georgios Petasis * CMake build system: Removed "lib" prefix from some libraris. 2017-08-03 Georgios Petasis * CMake build system: Added support for installing Rivet. Added more checks for various definitions in config.h/rivet_config.h. 2017-08-03 Georgios Petasis * CMake build system: Added missing source files, enabled as default the build of shared libraries, added needed link libraries. Also extended build system for all Rivet libraries (librivetlib.so, librivetparser.so, librivet_worker_mpm.so, librivet_prefork_mpm.so, librivet_lazy_mpm.so), and checked their linked libraries and missing symbols with their versions when build with autoconf. 2017-08-02 Massimo Manghi * Changed references in cmake/CMakeList.txt to build with code in src/mod_rivet_ng. 2017-08-02 Georgios Petasis * Created a new branch (cmake) for the CMake build system. 2017-07-24 Massimo Manghi * xml/rivet.xml.in: reflects rivet.xml having been moved to doc/xml * rivet/default_request_handler.tcl: code of the default request handler read by mod_rivet * Makefile.am: now installing also rivet/default_request_handler.tcl * src/mod_rivet_ng/mod_rivet.c: add function for creation of the module_globals strucuture. This structure is not assumed anymore to be inherited through a fork operation and it's now in case re-created at child process initialization * src/mod_rivet_ng/rivet_lazy_mpm.c: removing reference to unused global variable * src/mod_rivet_ng/mod_rivet_common.c: Rivet_RunningScripts handling default request procedure specified in the configuration 2017-07-20 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: now using Tcl [string is boolean ...] 2017-07-19 Massimo Manghi * doc/xml/internals.xml: moving the internals chapter to its final directory * doc/xml/processing.xml: more proof reading corrections 2017-07-13 Massimo Manghi * doc/xml/: further developments of the 3.0 manual * src/mod_rivet_ng/mod_rivet.c: better coding of bridge module search and determination * rivet/default_request_handler.tcl: proposed file to store the actual request handling code 2017-06-22 Massimo Manghi * doc/rivet.xml.in: introducing rivet.xml.in for automatic and consistent definition of versioning entities * doc/xml/commands.xml: moved into final directory * doc/xml/processing.xml: add new file to separate request processing from MPM bridge interface documentation 2017-06-19 Massimo Manghi * doc/xml/directives.xml: first rewriting into a new page. Still more directives to be documented * doc/convert_examples.tcl.in: changed message * doc/rivet.css: add directives for styling the directives page 2017-06-09 Massimo Manghi * doc/xml/: manual rewriting started 2017-06-07 Massimo Manghi * doc/xml-2/: XML manual moved to xml-2 to make rewriting easier 2017-05-15 Massimo Manghi * src/mod_rivet_ng/rivet_prefork_mpm.c: server root interpreter needs to re-seed the random number generator 2017-05-11 Massimo Manghi * rivet/init.tcl.in: apply Damon's patch concerning some tests and error handling. Removed call to the undocumented procedure ::Rivet::cleanup_request * configure.ac: better wording of some configure messages 2017-04-07 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: Fixed bug in argument list passed to RivetCache_MakeKey 2017-04-06 Massimo Manghi * src/mod_rivet_ng/rivet_lazy_mpm.c: server_rec argument in error logging changed to global root server. Passing the virtual host server rec makes the call to ap_log_error quiet and if something goes wrong in the thread's Tcl interp initialization we don't read anything! 2017-04-05 Massimo Manghi * doc/xml/formbroker.xml: better wording of a few concepts. Add documentation for the boolean data type * doc/xml/internals.xml: fixed incomplete sentence 2017-02-10 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: now handling natively also boolean in the form y|n or 0|1 2017-02-01 Massimo Manghi * configure.ac: defining and substituting RIVETLIB_VERSION * rivet/init.tcl.in: the ::rivet namespace is created already in src/mod_rivet_ng/mod_rivet_common.c Package rivetlib is loaded here now * src/mod_rivet_ng/mod_rivet_common.c: in function Rivet_PerInterpInit more code is devolved to the Tcl initialization 2017-01-18 Massimo Manghi * doc/Makefile.am: integration of the automake infrastructure and rules * src/Makefile.am: removed prefixing of library names with DESTDIR 2017-01-17 Massimo Manghi * Makefile.am: removing the mpm shared library directory only if exists (it's removed by the libtool generated rules by the src/Makefile.am) * src/Makefile.am: installation directories have been prepended by DESTDIR 2017-01-16 Massimo Manghi * Makefile.am: removing the _configs.sed file generated by configure in distclean target rule fulfills now entirely the 'distcheck' target 2017-01-04 Massimo Manghi * Makefile.am,src/Makefile.am: now handling the 'dist' and 'distcheck' targets of the automake generated Makefile * configure.ac: add RIVET_CORE definition * src/mod_rivet_ng/rivetCore.c: now calls the alternate form of RivetParse * src/parser/parserPkgInit.c: altenate form of function Rivet_Parser elimianates the need of enclosing the code in the namespace ::request 2016-12-19 Massimo Manghi * rivet/mod_rivet_ng/mod_rivet_cache.c: better wording of cache functions names. 2016-12-12 Massimo Manghi * rivet/init.tcl.in: [url_script] now evaluated explicitly in the ::request name space. We don't need the Rivet parser to place a script in this namespace * rivet/mod_rivet_ng/rivetCore.c: now Rivet_GetRivetFile is called with the flag 'toplevel' set to zero. The code handling this flag could be removed if we abandoned the traditional mod_rivet core 2016-12-07 Massimo Manghi * src/librivet/rivetWWW.c: enlarging buffer allocated in ::rivet::escape_sgml_chars * configure.ac: removed test on the apache version (we don't support apache-1 anymore) 2016-12-06 Massimo Manghi * configure.ac: mod_rivet_ng now default for builing mod_rivet * src/mod_rivet_ng/rivetCore.c: safer condition testing should avoid assumptions about how the compiler builds pointer comparisons * src/mod_rivet_ng/worker_prefork_common.c: before running the child init script the running configuration pointer is the thread private data has to be set * tests/broken.test: new error message structure * tests/checkfails.tcl, failtest.tcl: changed value returned by one of the tests 2016-12-05 Massimo Manghi * rivet/packages/session/session-class.tcl: new method synch saves in the session cache data coming from form * src/mod_rivet_ng/mod_rivet_common.c: more careful design assign to a single function the task of determining the current configuration when an interpreter is initialized 2016-11-30 Massimo Manghi * src/mod_rivet_ng/rivet_lazy_mpm.c: * src/mod_rivet_ng/worker_prefork_mpm.c: setting the running_conf pointer in the thread private data enables ::rivet::inspect to return meaningful data even outside of request processing (in the forms that make sense) * src/mod_rivet_ng/rivetCore.c: more accurate determination of the rivet_server_rec makes possible to determine the pointer also outside a request processing 2016-11-28 Massimo Manghi * src/mod_rivet_ng/: new configuration directives RequestHandler (request handling procedure), ImportRivetNS and ExportRivetNS (override parameters for build options). RequestHandler enables rivet to run an application specific request handler. * src/mod_rivet_ng/rivetInspect.c: now runs also during the server initialization stage. The whole rivet core is setup during that phase but only a few commands are actually operational (most of them make sense only during an HTTP request processing) 2016-11-23 Massimo Manghi * rivet/packages/form/form.tcl,form2.tcl: fix full qualification of the ::rivet::lempty command * src/mod_rivet_ng/mod_rivet_common.c: changed or removed old comments that don't apply to the current code * configure.ac: now quoting strings when passed to macro AC_MSG_CHECKING 2016-11-22 Damon J. Courtney * rivet/init.tcl.it: Rewrite init.tcl.in from the top down 2016-11-22 Massimo Manghi * rivet/packages/session/session-class.tcl: * rivet/packages/form/form.tcl,form2.tcl: now fully qualifying mod_rivet commands, fixed 'file' method that emits an 'email' HTML input element * doc/xml/formbroker.xml: correct coding example 2016-11-19 Massimo Manghi * src/mod-rivet/rivetInspect.c: now returning an empty string if a value is undefined * configure.ac: now defaults to non automatic import of ::rivet namespace into global namespace 2016-11-17 Massimo Manghi * rivet/packages/dio/dio_Postgresql.tcl: applied consistent single quote character handling by calling PgTcl function pg_quote (closes bug #60378) * rivet/packages/formbroker/formbroker.tcl: fixed bug in method response. Package version number bumped up to 1.0 * doc/xml/formbroker.xml: first draft of the manual page of package formbroker with example of implementation of a validator * doc/xml/commands.xml: fixed type in page of ::rivet::xml 2016-11-15 Massimo Manghi * rivet/init.tcl.in: trimming error buffer to make test message matching easier * rivet/rivet-tcl/catch.tcl|try.tcl: better script evaluation is catch/try construct, complete error codes in case ::rivet::abort_page is to be handled * src/mod_rivet_ng/rivetCore.c: direct result object handling in [::rivet::inspect script] * try.rvt: changed test expression matching 2016-11-12 Massimo Manghi * rivet/init.tcl.in: removed debugging messages, request handling made much simpler after ::rivet::inspect changed its behavior when a script is undefined * src/mod_rivet_ng/rivetInspect.c: changed to an empty string the value returned when a configuration script is undefined * src/mod_rivet_ng/mod_rivet_common.c: we don't need to handle at C level the error handler and the request cleanup Tcl scritps: they are called from Tcl * src/mod_rivet_ng/mod_rivet_generator.c: removed code unused by this version of the module 2016-11-11 Massimo Manghi * rivet/init.tcl.it: further development of the url processing procedures allows script level overriding of both request handling and error handling * src/mod_rivet_ng/rivetCore.c: ::rivet::inspect C code argument handling improved 2016-11-09 Massimo Manghi * src/mod_rivet/mod_rivet_common.c: the request_rec field to be checked in order to determine whether we are serving the request is 'header' non 'content_type'. This bug didn't surface because it's set to the same string when a request is handed down to the module chain, but it's been around ever since. 2016-11-08 Massimo Manghi * src/mod_rivet_ng/apache_config.c: fixed conf merge that didn't assign the correct cache size * rivet/init.tcl: fixed exception scripts checks * src/mod_rivet_ng/rivetCore.c: command 'parse -string' composes the script and calls directly Tcl_EvalObjEx * src/mod_rivet/apache_config.c: fixed same bug found in Rivet_MergeConf developing mod_rivet_ng 2016-11-07 Massimo Manghi * src/mod_rivet_ng/rivetCore.c: changed also code of command ::rivet::parse, now handling the cache and calling directly Tcl * src/mod_rivet_ng/mod_rivet_generator.c: now calling Tcl_EvalObjEx instead of Rivet_ParseExec * src/mod_rivet_ng/mod_rivet_common.c: now initializing the thread interpreter private cache with the new calls to the cache handler * rivet/init.tcl.in: tested also call to AbortScript 2016-11-03 Massimo Manghi * src/mod_rivet/mod_rivet_cache.[c|h]: new file for the cache code created to have uniform file structure in order to build the module * src/mod_rivet_ng/mod_rivet_cache.c: completed code for cache management * src/mod_rivet_ng/rivetCore.c: new command ::rivet::url_script returns the full URL referenced script to be parsed subsequently * src/mod_rivet/mod_rivet_generator.c: we are now calling the cache routines, but it won't be needed any longer as the cache control and interaction are devolved to the parse routines 2016-10-28 Massimo Manghi * src/mod_rivet/[lazy|worker|prefork]_mpm_bridge.c: new Rivet_ExecutionThreadInit unifies thread initialization common to each bridge * src/mod_rivet/apache_config.c: the Rivet_MergeConfig method did not merge the cache size value * src/mod_rivet/mod_rivet_common.c: New function Rivet_ExecutionThreadInit 2016-10-24 Massimo Manghi * rivet/mod_rivet_ng: new directory to develop new module having a Tcl based content generation script * rivet/packages/formbroker/formbroker.tcl: new method 'reset' restores a form internal status * rivet/rivet-tcl/try.tcl: tab expansion to fix indentation * doc/xml/formbroker.xml: add XML manual page for the form broker package 2016-10-20 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: new method 'response' returns an array with the last processed response or an array with the defaults value 2016-10-18 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: add response copy and default value management 2016-10-17 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: add global quoting switch, add method for single form variable method (untested) 2016-10-15 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: add quote mechanism 2016-10-12 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: removed need for a form_name argument. Now forms receive automatic names. The list of fields whose validation failed is now a flat list of field_name - validation_error pairs suitable to be put in dictionary or array 2016-10-11 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: first stable version of the FormBroker package. The package checks and validates form data stored in response array as produced by ::rivet::response * contrib/validate_mac.tcl: example of validator checking and mangling a network mac address. This function is meant to work with the FormBroker 2016-10-09 Massimo Manghi * src/mod_rivet/mod_rivet_generator.c: improved comments in view of branching for new version of content generation script * rivet/packages/formbroker/formbroker.tcl: inital reworking for a transaction type form broker and validator 2016-09-24 Massimo Manghi * rivet/packages/formbroker/formbroker.tcl: add proposed form broker * rivet/packages/dio/dio.tcl: now returning also results in a dictionary * rivet/packages/dio/dio_Mysql.tcl: supporting also NULL as keyword for NULL values of a column * doc/xml/commands.xml: further elaboration of ::rivet::exit command by adding alink to MaxRequestsPerChild parameter in Apache docs 2016-09-19 Massimo Manghi * rivet/rivet.tcl.in,rivet.tcl: fixed errors in comments 2016-09-08 Massimo Manghi * tests/runtests.tcl: support for Apache 1.3 dropped. Add modules needed by Apache 2.4 * tests/apachetests/apachetests.tcl: Dropped support for Apache 1.3 * tests/shorthand.test: shorthand notation test versioning added * tests/virtualhost.test: removed NameVirtualHost directive no longer supported * tests/bailout.test: add tests for ::rivet::catch and ::rivet::try * tests/catch.rvt,try.rvt: script testing handling various conditions * rivet/rivet-tcl/url_query.tcl: add new command ::rivet::url_query 2016-09-07 Massimo Manghi * rivet/rivet-tcl/catch.tcl: fixed argument management in ::catch call 2016-09-06 Massimo Manghi * doc/xml/lazybridge.xml: further lazybridge documentation development 2016-07-11 Massimo Manghi * rivet/packages/form/form2.tcl,rivet/pkgIndex.tcl: bump up package form version to 2.1 2016-07-04 Massimo Manghi * doc/xml/commands.xml: ::rivet::catch man page example corrected * rivet/packages/form/form2.tcl: fixed output in code for the form element method * src/mod_rivet/mod_rivet_generator.c: removed code commented away * src/mod_rivet/rivetCore.c: FQ var command name 2016-06-16 Massimo Manghi * doc/xml/commands.xml: rephrasing the ::rivet::catch manual page 2016-03-18 Massimo Manghi * tclconfig/: reverting to previous release 2016-03-17 Massimo Manghi * tclconfig/tcl.m4,install-sh,ltmain.sh,libtool.m4: updating autotools and libtool macros to the latest versions available 2016-02-16 Massimo Manghi * src/doc/xml/lazybridge.xml: further elaboration of the lazy bridge 2016-02-05 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: removed code implmenting the old model of inter thread communication. This should fix the problem of redundant mutex/cond variable creation/destruction needed by the former model to avoid memory leaks 2016-02-01 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: upon process shutdown thread status has to be set to 'init' to force thread exit 2016-01-25 Massimo Manghi * src/mod_rivet/rivetInspect.c: adding handling of the MpmBridge directive to the ::rivet::inspect command * doc/xml/lazybridge.xml: more development to lazy bridge manual page * rivet/packages/calendar/: preparing new version of package calendar 2016-01-19 Massimo Manghi * src/mod_rivet/rivet_lazy_mpm.c: removed unused field structures, boolean for process shutdown moved to process wide module status * doc/lazybridge.xml: started documentation of the lazy bridge 2016-01-17 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: removed variable needed only when built with the old thread communication model 2016-01-14 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: new communication method between bridge controlled Tcl threads and handler threads. This method was inspired by the experiment done with the lazy bridge and proved to have simpler code and avoids the need to rely on the handler thread memory pool that gets destroyed too often * src/mod_rivet/mod_rivet.h: removed definition specific to the worker bridge 2016-01-07 Massimo Manghi * src/mod_rivet/: fixed aimed at consistently determining the virtual host associated to a thread 2016-01-05 Massimo Manghi * src/mod_rivet/mod_rivet_generator.[h|c]: files holding the output generation procedures on which all the bridges rely (previously stored in mod_rivet.c) * src/mod_rivet/rivet_lazy_mpm.c: purged of redundant locking code and unused variables * src/mod_rivet/worker_prefork_mpm.c: new file with thread private data extension to bridge status * doc/xml/internals.xml: update to amend out of date explanations 2015-12-28 Massimo Manghi * src/mod_rivet/rivet_lazy_mpm.c: fixed missing interpreter scripts initialization * doc/xml/internals.xml: documenting bridge interpreter accessor function 2015-12-26 Massimo Manghi * src/mod_rivet/worker_prefork_common.c: functions common to both the prefork and worker bridges, but not general enough bur rather specific to the worker model adopted by them * src/mod_rivet/rivet_lazy_mpm.c: further development, now capable of serving rivet requests, but needs to be completed. * src/mod_rivet/mod_rivet_common.c: more stuff moved from mod_rivet to this file * src/mod_rivet/mod_rivet.h: new data organization with bridge specific thread private data * src/mod_rivet/Tclwebapache.c: API changed from Tclwebreq pointers to thread private data that is supposed to store most of the thread environment 2015-12-22 Massimo Manghi * src/mod_rivet/rivet_lazy_mpm.c: taking a snapshot of the current development as this code proved to be quite robust when stressed using 'ab' 2015-12-20 Massimo Manghi * src/mod_rivet/rivet_lazy_mpm.c: first prototype of a threaded bridge with reduced start up time and thread number optimization 2015-12-15 Massimo Manghi * src/mod_rivet/rivet_lazy_mpm.c: new lazy MPM bridge with a smoother workload balancing (should work better for low to middle workloads) * src/mod_rivet/rivet_worker_mpm.c: improved code comments * src/mod_rivet/mod_rivet.c: handling of mpm_bridge configuration parameter. New bridge module search method * src/mod_rivet/rivet_config.c: new MpmBridge configuration directive 2015-12-13 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: changed in order to have a better handling of ::rivet::exit (the call to exit( ) is now carried out from within the supervising thread * src/mod_rivet/rivet_prefork_mpm.c: Adding exit command handler * src/mod_rivet/mod_rivet.c: new central Rivet_Finalize method that calls any bridge module finalization. The function deletes the thread key to access private data 2015-12-08 Massimo Manghi * doc/xml/commands.xml,asciiglyphs.tcl: adding documentation for ::rivet::try and AsciiGlyphs 2015-12-06 Massimo Manghi * rivet/packages/asciiglyphs.tcl: Package HexGlyphs renamed as AsciiGlyphs 2015-12-05 Massimo Manghi * rivet/rivet-tcl/try.tcl: new command ::rivet::try wraps core same command to trap ::rivet::abort_code and ::rivet::exit interruptions * src/mod_rivet/rivetCore.c: removed semicolons in macro CHECK_REQUEST_REC calls * rivet/rivet-tcl/catch.tcl: using [uplevel] to control Tcl core [catch] command (as it's been customary with Tcl ever since) 2015-12-03 Massimo Manghi * doc/xml/internals.xml: explaining the MPM bridge jump table * doc/rivet.css: changing colors adopting 2.3 style temporarily * doc/images: new images with new colors * doc/xml/intro.xml,install.xml: removing reference no longer valid for version 3.0 * packages/hexglyphs/hexglyphs.tcl: new glyphs for more punctuation characters 2015-11-27 Massimo Manghi * VERSION,configure.ac: Major version number increased to 3.0.0 2015-11-25 Massimo Manghi * src/rivet.h: defined RIVET_CMD_EXPORT as wrapper to Tcl_Export * tests/bailout.test: redirect.test renamed as bailout.test. It's meant to gather all the tests concerning exceptions like abort_page and ::rivet::exit * src/librivet/rivet[Crypt|WWW|List].c: command export mechanism changed as we are now explicitly exporting commands * rivet/rivet-tcl/catch.tcl: new (non-exported) command ::rivet::catch * rivet/init.tcl[.in]: command export mechanics changed * src/mod_rivet/rivetCore.c: command export made explicit through RIVET_CMD_EXPORT. Abort page command now handling also [::rivet::abort_page -exiting] test 2015-10-27 Massimo Manghi * rivet/init.tcl.in: actually was this file that had to be changed 2015-10-22 Massimo Manghi * rivet/init.tcl: now renaming the [exit] core command into ::Rivet::tclcore_exit and replacing with a Tcl scripts that calls ::rivet::thread_exit * rivet/packages/hexglyphs/hexglyphs.tcl: package generating ASCII glyphs of hexadecimal characters and punctuation character : and - 2015-10-18 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: returning HTTP_INTERNAL_SERVER_ERROR to requests coming in during a process shutdown. This is required by the exit command handling * src/mod_rivet/mod_rivet.c: changed some log message calls in order to have ap_log_rerror when an error occurs during a request processing 2015-10-17 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c,rivet_prefork_mpm.c,mod_rivet.c: bridge jump table macro definition 2015-10-14 Massimo Manghi * rivet/packages/hexgliphs/hexgliphs.tcl: new package HexGliphs to print hexadecimal character gliphs as ascii art 2015-10-04 Massimo Manghi * src/mod_rivet/mod_rivet.c: moving Rivet_ProcessorCleanup in mod_rivet_common.c * src/mod_rivet/mod_rivet.h: add exit status code to thread private data * src/mod_rivet/mod_rivet_common.c: Rivet_ProcessorCleanup now in this file * src/mod_rivet/rivet_worker_mpm.c: thread exit handling now calling the finalize handling function. Functions naming scheme reformed. Since the exit_thread command forces the whole child process to exit the check on the thread counter in the supervisor thread was changed as the thread executing thread_exit brings about can't exit before the supervisor itself terminates * src/mod_rivet/rivet_prefork_mpm.c: function naming scheme changed. 2015-09-04 Massimo Manghi * src/mod_rivet/rivet_prefork_mpm.c: fix message severity in finalize method * src/mod_rivet/rivet_worker_mpm.c: passing actual error code to log message if thread join fails 2015-08-30 Massimo Manghi * src/mod_rivet/mod_rivet.c: bringing the request type check back to Rivet_Handler shook quite a bit the build process as it required to create a new file rivet_types.h to store various definitions * src/mod_rivet/TclWebapache.c: changed definition of TclWeb_InitRequest. The thread private data must have stored the whole request processing status * src/mod_rivet/rivet_prefork_mpm.c: Request type check moved to mod_rivet.c (Rivet_Handler) * src/mod_rivet/rivet_worker_mpm.c: Request type stored now in the request private data * src/parser/parsePkgInit.c: was still including config.h instead rivet_config.h. Add mandatory Apache standard copyright statement * src/mod_rivet/mod_rivet_common.c: Rivet_CheckType definition changed to return a rivet_req_ctype value * src/mod_rivet/rivet_types.h: add new file with definition used by various files that don't need mod_rivet.h * src/mod_rivet/apache_request.h: removed definition that went into rivet_types.h * src/Makefile.am: libparser needed to have also LDFLAGS to build correctly * src/rivet.h: ASF copyright statement, including also rivet_types.h 2015-08-18 Massimo Manghi * src/mod_rivet/mod_rivet.[c|h]: now calling MPM through a bridge_jump_table structure with all the functions exported by a bridge implementation. Created default exit handler so that only if a special exit handler is needed it has to be defined * src/mod_rivet/rivet_worker_mpm.c: exporting through the bridge_jump_table the names of bridge functions * src/mod_rivet/rivet_prefork_mpm.c: export of the bridge function through the jump table. Removed the empty server init function (it's field in the jump table set to NULL). Removed exit handler (we rely on the default exit handler) * src/mod_rivet/rivetCore.c: using the jump table to call the exit handler 2015-07-15 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: when thread private data are released the correponding pointer is set to NULL in APR threadkey database. It turned out a thread pool is very often deleted and data allcoated from it invalidated * src/mod_rivet/mod_rivet.c: handler private data key is now local to rivet_worker_mpm.c 2015-07-07 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: hopefully a method to determine the thread id portable across Apache versions 2015-06-30 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: thread id determination method changed to support Apache 2.2 2015-06-28 Massimo Manghi * src/mod_rivet/mod_rivet.c: fixed errors in comments * src/mod_rivet/rivet_worker_mpm.c: Binding release of mutex and condition variable to MPM thread pool cleanup, hopefully fixing this potential memory leak 2015-06-21 Massimo Manghi * configure.ac: add creation of config variable RIVET_CONFIGURE_CMD * src/mod_rivet/mod_rivet_common.c: add RIVET_CONFIGURE_CMD handling in 'server' array 2015-06-06 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: found a solution for determining the current thread pool. Mutex and cond variable are allocated from it but never destroyed. Still have to understand if letting the pool go is enough for a clean deletion of them * src/mod_rivet/rivetInspect.c: a pesky 'static' declaration of a local variable was still existing and under intense request firing threads stumbled on it. 2015-06-03 Massimo Manghi * doc/rivet.css: changing selector for namespace table as DocBook seems not to honor the id attribute anymore * doc/xml/request.css: changing the id "namespaces" as class 2015-05-25 Massimo Manghi * src/Makefile.am: disabled build of aprthread experimental bridge * src/mod_rivet/mod_rivet.h: introduced opaque datatype mpm_bridge_status and removed bridge specific variables from mod_rivet_globals. * src/mod_rivet/mod_rivet.c: removed handling of bridge specific status * src/mod_rivet/rivet_worker_mpm.c: devolving to this file all the handling of its internal status * src/mod_rivet/rivet_prefork_mpm.c: changes imposed by modification of the APIs and also new responsabilities devolved to Rivet_CreatePrivateData. 2015-05-21 Massimo Manghi * src/mod_rivet/rivet_prefork_mpm.c: child processes created by fork calls inherit an interpreter that needs to import the ::rivet namespace when configured that way 2015-05-19 Massimo Manghi * src/rivet.h: macro THREAD_PRIVATE_DATA now simply casts ClientData pointer to a rivet_thread_private pointer * src/mod_rivet/mod_rivet.h: type vhost_interp renamed as rivet_thread_interp * src/mod_rivet/mod_rivet.c: Server root interpreter not initialized with mod_rivet core as it's pointless to have the rivet commands for a ServerInitScript. Rivet core deferred to child process initialization for the same interpreter when the OS supports the fork system call, thus to rivet_prefork_mpm.c. Changed argument list of Rivet_PerInterpInit in that the function handles a whole rivet_thread_interp object. New function Rivet_RunServerInit controls and runs ServerInitScript. Thread private key creation devolved to child process initialization * src/mod_rivet/rivet_prefork_mpm.c: Rivet_MPM_ServerInit emptied Rivet core commands initialized in Rivet_MPM_ChildInit * src/mod_rivet/rivetCore.c: removed dependence from rivet_interp_globals, status devolved to rivet_thread_private as it's thread specific not interpreter specific. Pointer to the rivet_thread_private cast as client data when core commands are create calling Tcl_CreateCommand (see macros THREAD_PRIVATE_DATA and RIVET_OBJ_COMMAND) 2015-05-18 Massimo Manghi * src/mod_rivet/mod_rivet_common.c: fixed call to apr_palloc which allocated dirty ram, changed as apr_pcalloc 2015-05-15 Massimo Manghi * src/mod_rivet/mod_rivet.h: further reorganization removes duplication of status variables between rivet_thread_worker and rivet_interp_globals * src/mod_rivet/rivetCore.c: completed transition from interpreter globals to thread private data which now stores per request status * src/mod_rivet/mod_rivet.c: removed globals variable initialization * src/mod_rivet/TclWebapache.c: charset determination stored now done in TclWeb_InitRequest 2015-05-14 Massimo Manghi * src/mod_rivet/mod_rivet.h: removing redundant variable from handler_private structure * src/mod_rivet/rivet_worker_mpm.c: removing unnecessary call to TclWeb_InitRequest which is called in Rivet_SendContent. 2015-05-12 Massimo Manghi * src/mod_rivet/mod_rivet.[c|h]: moving some request processing status objects (request_rec, TclWebapache etc) from the interpreter globals (mod_rivet_globals) to the thread private data (rivet_thread_private) * src/mod_rivet/rivet_[prefork|worker]_mpm.c: Rivet channel creation is now removed from Rivet_CreatePrivateData, Private data must be allocated indipendtly from the RivetChannel * src/mod_rivet/rivetCore.c: setting up status variables storage transition from mod_rivet_globals to rivet_thread_private * src/rivet.h: Rivet command macro changed to accept a new argument to be passed to a command implementation as ClientData. Currently the value passed must be the pointer to the thread private data * src/mod_rivet/mod_rivet_common.c: New function Rivet_ReleaseChannel and initialization of status variables moved to thread private data * src/mod_rivet/rivetCore.c: changes needed after we moved to rivet_thread_private fields driven by C code implementing ::rivet::abort_page. Adding bridge name to server array variables. * src/librivet/rivetCrypt.c: * src/librivet/rivetWWW.c: * src/librivet/rivetList.c: * src/parser/parserPkgInit.c: Changing command creation macro to follow new 3 arguments form 2015-05-05 Massimo Manghi * src/mod_rivet/mod_rivet.c: porting error and abort_page handling implemented in branches/2.2 (fixes bug #57501). * src/mod_rivet/mod_rivet.h: abort_page related fields moved to rivet_thread_private from interpreter globals 2015-04-16 Massimo Manghi * src/mod_rivet/rivet_worker_mpm.c: now we assume thread private data exist already * rivet/init.tcl.in,rivet/init.tcl: new method Rivet::exit now replaces Tcl ::exit and calls ::rivet::exit_thread which has an implementation in the MPM bridges * docs/xml/install.xml: removed documentation for obsolete configure switch --with-apache-version 2015-03-28 Massimo Manghi * src/mod_rivet/mod_rivet.[c|h]: moved Tcl panic procedure data from mod_rivet_globals to rivet_thread_private * src/mod_rivet/mod_rivet_common.[c|h]: new procedure Rivet_SetupTclPanicProc and Rivet_PanicProc fixed to handle thread private data to get valid and thread safe information about the module status. New procedure Rivet_CreatePrivateData should provide a common method for all bridges to create thread private data * src/mod_rivet/rivet_[prefork|worker]_mpm.c: exploiting Rivet_CreatePrivateData and Rivet_SetupTclPanicProc makes code more localized, removes redundancy and improves readability 2015-03-18 Massimo Manghi * INSTALL: update installation and configuration examples 2015-03-11 Massimo Manghi * doc/xml/internals.xml: Improved paragraph on how to extend mod_rivet * src/apache-2/mod_rivet.c: Improper handling of 'HTTP_NOT_FOUND' and HTTP_INTERNAL_SERVER_ERROR caused mod_rivet to access a non existing memory location (Bug #57686) 2015-02-20 Massimo Manghi * INSTALL: updating examples and version * src/mod_rivet/mod_rivet.c: Restoring usual Rivet/VERSION signature 2015-02-07 Massimo Manghi * src/apache-2/: removed, now maintained only in branches/2.2 * src/mod_rivet: new directory with code for MPM aware mod_rivet * src/experimental: removed 2015-02-03 Massimo Manghi * src/experimental/rivet_worker_mpm.c: assigning to base server interpreter the channel referenced in private->channel (was dangling and caused segfaults) 2015-02-02 Massimo Manghi * src/experimental/rivet_worker_mpm.c: removing commented code and adding new function Rivet_MPM_Shutdown aimed at forcing ancillary thread to exit * src/experimental/rivetCore.c: in Rivet_Parse returned value of Rivet_ParseExecFile is propagated up to the caller. Probably unnecessary now, but just in case we want to have special handling of TCL_CONTINUE or TCL_BREAK * src/experimental/mod_rivet.c: moving call to after_every_script out of Rivet_ParseExecFile and into Rivet_SendContent. Any call to ::rivet::abort_page is now trapped by abort_script * src/experimental/TclWebapache.c: if charset is set in the configuration then it's set in the headers just before HTTP headers are sent (moved from mod_rivet.c 2015-01-19 Massimo Manghi * src/experimental/mod_rivet.c: Channel ref count fixed 2015-01-13 Massimo Manghi * src/experimental/mod_rivet.c,mod_rivet_common.c: improved some comments * rivet_worker_bridge.c: fixed channel wrong handling 2015-01-12 Massimo Manghi * src/experimental/mod_rivet.c,mod_rivet_common.c,rivet_[prefork|worker]_bridge.c: fixed various bugs with separate channel handling * tests/channel.test,channel.tcl: adding test for SeparateChannels 2015-01-11 Massimo Manghi * tests/redirect.test,redirect.rvt: adding test for command ::rivet::redirect 2015-01-08 Massimo Manghi * src/experimental/rivetInspect.c: add SeparateChannels directive introspection * doc/xml/command.xml,directives.xml: add explanation of new command ::rivet::redirect and new directive SeparateChannel 2015-01-06 Massimo Manghi * src/experimental/mod_rivet.c: handling separate_channels flag for virtual host private Rivet Channels * src/experimental/mod_rivet_common.c: new function Rivet_CreateRivetChannel * src/experimental/apache_config.c: Conf directive SeparateChannels * src/experimental/rivet_worker_mpm.c,rivet_prefork_mpm.c: Channel creation code moved to mod_rivet_common.c * configure.ac: apache utils configuration split from APR configuration * Makefile.am: new symbols APU_INCLUDES and APU_LDFLAGS 2014-12-21 Massimo Manghi * rivet/rivet-tcl/redirect.tcl: passing a meaningful dictionary as error descriptor * src/experimental/rivetCore.c: supporting also method 'get' * src/experimental/Tclwebapache.c: new function TclWeb_OutputHeader[Get|Set] to explicitly suggesting they are accessing the output headers 2014-12-17 Massimo Manghi * src/experimental/rivetCore.c: new 'headers sent' introspection command to understand whether headers have been sent already * rivet/rivet-tcl/redirect.tcl: command didn't fail with a meaningful message if headers had been sent already because of ::rivet::no_body that blocks output to the socket. The procedure now returns an error if ::rivet::headers sent returns 1 2014-12-16 Massimo Manghi * configure.ac: bumping version number to 2.3.0 * rivet/init.tcl: recreated by automake * rivet/rivet-tcl/redirect.tcl: add new command ::rivet::redirect * src/experimental/mod_rivet.c: Tcl_Flush call moved from Rivet_ExecuteAndCheck to the very end of Rivet_SendContent, also TclWeb_PrintHeader is now unique just before the I/O buffer is flushed 2014-12-06 Massimo Manghi * src/experimental/mod_rivet.c,src/apache-2/mod_rivet.c: Rivet init package bound to be $(RIVET_MAJOR_VERSION).$(RIVET_MINOR_VERSION) and defined in autotool variable INIT_VERSION (to be transformed into RIVET_INIT_VERSION for C code includes) * rivet/rivet-tcl/read_file.c: argument lists admit a variable number of extra arguments to be evaluated as argument of 'fconfigure' call * configure.ac: Macro symbol TCL_PACKAGE_VERSION renamed as INIT_VERSION 2014-11-28 Massimo Manghi * src/experimental/mod_rivet.c: Rivet channel is set as stdout and as such is released when its refCount drops below 2. Therefore we cannot unregister it for each interpreter unless we remove it as stdout when terminating the thread just before unregistering the channel and deleting the intepreters 2014-11-05 Massimo Manghi * src/experimental/mod_rivet.c: fixed wrong call to Tcl_GetString passing a void argument that actually wasn't a Tcl_Obj pointer 2014-10-28 Massimo Manghi * rivet/packages/form/form2.tcl: how comes the method 'file' emits the same output of method email and nobody noticed it? 2014-10-06 Massimo Manghi * src/experimental/mod_rivet.c: handling exception generated by ::rivet::exit_thread * src/experimental/rivetCore.c: adding experimental ::rivet::inspect exit form for detection of ::rivet::exit_thread call 2014-09-29 Massimo Manghi * src/experimental/mod_rivet.c: adding mpm_exit_handler function pointer handling. Completed draft solution for RivetUserConf directives. Scripts cannot be cached though and the whole mechanism has to be redesigned * src/experimental/rivetCore.c: Add new command ::rivet::exit_thread * src/experimental/rivet_prefork_mpm.c,rivet_worker_mpm.c: add function for mpm_exit_handler hook definition 2014-09-26 Massimo Manghi * tests/apachetest/apachetest.tcl: phasing out TclX calls as the web server seems not to respond to QUIT signals sent by Tclx's kill. Likewise in apachetcl the httpd binary is used to control execution 2014-09-26 Massimo Manghi * src/experimental/mod_rivet.c: Add user scripts handling. Fixed bug in per dir and per user scripts when virtual interpreters are off. * src/experimental/mod_rivet.h: add macros for user configuration flags handling * src/experimental/apache_config.h: add user configuration handling * tests/inspect.test: trimming tests in order to make them independent for the final CR. Carriage returns should now be appended when needed * tests/virtualhost.test: adding returned string space class character trimming * tests/rivet.test: changing localhost into 127.0.0.1 as it breaks in certain cases 2014-09-08 Massimo Manghi * src/experimental/mod_rivet.c: handling per dir configurations that have no Rivet directives in them, thus leaving the 'path' field NULL. * src/experimental/TclWebapache.c: reenabling CACHE_SIZE and CACHE_FREE in the environment array 2014-09-07 Massimo Manghi * src/experimental/mod_rivet.h: add field path to rivet_server_conf. This field carries a copy of the 'path' field in cmd_parms. This field is NULL for global and sections whereas for sections points to the argument (the pattern matching a certain directory) * src/experimental/mod_rivet.c: handling of rdc->path to store configuration scripts * src/experimental/rivet_prefork_mpm.c: defining request_init and request_cleanup in the thread private data * src/experimental/apache_config.h: handling of the path field in rivet_server_conf 2014-09-05 Massimo Manghi * src/experimental/apache_config.h: removed handling of lines unneeded by this version of mod_rivet * src/experimental/rivet_worker_mpm.c: * src/experimental/rivet_aprthread_mpm.c: * src/experimental/rivet_prefork_mpm.c: moving reference to configurations scripts into their new location on rivet_thread_private * src/experimental/mod_rivet.h: running_scripts object defined to store running configurations script wrapped in Tcl_Obj instances and allow construction of database of Tcl scripts bound to per-directory configuration. Adding variables for storing running configuration in rivet_thread_private. Configuration records now store references to pristine char* buffers for scripts * src/experimental/mod_rivet.c: changed referenced to configured scripts to their new location, removed redundant calls to Rivet_GetConf. Configuration is now built and stored in thread private data * src/experimental/rivetInspect.c: code in Rivet_ReadConfParameter adapted to reflect changes in configuration record definitions 2014-08-31 Massimo Manghi * src/experimental/rivet_prefork_mpm.c: removing commented code * src/experimental/mod_rivet.c: removing unnecessary Tcl mutex declaration * src/experimental/mod_rivet.h: adding new aggregate structure for conf scripts 2014-08-29 Massimo Manghi * src/experimental/mod_rivet.c: added control on Tcl object stored in the variable auto_path and duplicate it in case it's shared. Removed callback to Rivet_ProcessorCleanup: this call back is called by APR in a thread different from the one that allocated a specific private data record. Thus Tcl thread specific data cannot be released consistently when calling Tcl_DeleteInterp. * src/experimental/rivet_worker_mpm.c: request_init and request_cleanup made thread private. Supervisor wait time definition moved here. 2014-08-27 Massimo Manghi * src/experimental/mod_rivet.h: request_init and request_cleanup moved from static into rivet_thread_private * src/experimental/rivet_aprthread_mpm.c,rivet_worker_mpm.c: request_init and request_cleanup are initialized during thread private data set up 2014-08-19 Massimo Manghi * src/experimental/mod_rivet.c: mutex serializing request processing now controlled by RIVET_SERIALIZE_HTTP_REQUEST. * src/experimental/mod_rivet.h: mutex req_mutex conditional to definition of RIVET_SERIALIZE_HTTP_REQUESTS. Also defined macro HTTP_REQUESTS_PROC macro to protect execution of code by module_globals->req_mutex * src/experimental/rivet_aprthread_mpm.c: new simplified bridge rivet_aprthread_mpm.c which creates Tcl interpreters within thread private data. * configure.ac: introducing HTTP_REQUESTS_MUTEX for handling of request serialization 2014-08-18 Massimo Manghi * src/apache-2/mod_rivet.c: fixed old symbols now renamed as 'module_globals' 2014-08-16 Massimo Manghi * src/experimental/mod_rivet.c: reinstated big mutex aroud Rivet_SendContent (where originally Tcl_Mutex lock/unlock were called. The module is usable but way too slow wrt prefork because of the locking * configure.ac,src/apache-2/Makefile.am: fixed mismatch between symbols 2014-08-15 Massimo Manghi * src/experimental/mod_rivet.c: Tcl protecting mutex localized in order to restrict as much as possible the protected code and reduce the size of the bottleneck. Still, this is not OK and the current implementation is going to be kept to provide functionality of mod_rivet with the worker MPM. We have to explore the possibility of calling directly Tcl threading functions. 2014-08-14 Massimo Manghi * src/experimental/mod_rivet.c: implemented automatic bridge load mechanism. * src/experimental/rivet_worker_mpm.c: starting maximal number of threads (as per mpm_worker configuration) * configure.ac: automated parameters when build experimental module. 2014-08-12 Massimo Manghi * src/experimental/rivet_[prefork|worker]_mpm.c: bridges integrated. Removed substantial code from rivet_prefork_mpm.c and merged with the current approach handling hosts interpreters using vhost_interp objects and storing everything in a child process/thread private data * src/experimental/apache_config.[c|h]: eventually these files had to be copied here from common and modified to reflect the new model for handling server records * src/experimental/mod_rivet_common.c: same for this file * src/experimental/mod_rivet.c: further generalization of the code to provide consistent support for the bridges. Adding a new hook for mpm_master_interp, a function implemented by a bridge responsible for returning the child process/thread master interpreter. 2014-08-11 Massimo Manghi * src/experimental/rivet_worker_mpm.c: redesigning virtual hosts resource management for threads * src/experimental/mod_rivet[c|h]: implementing thread private interpreters management * src/experimental/rivetCore.c,rivetInspect.c: I had to move here these files as some API has changed and perhaps it's better if we stick into the interp globals a reference to the thread private data 2014-08-10 Massimo Manghi * src/experimental/rivet_prefork_mpm.c: handling also server initialization * src/experimental/rivet_worker_mpm.c: doing server initialization from the threaded MPM perspective * src/experimental/mod_rivet.c: server initialization loads symbols from the bridge module and then defers the initialization task to the specific bridge. 2014-08-09 Massimo Manghi * src/apache-2/mod_rivet.c: Various functions moved to src/common/mod_rivet_common.c * configure.ac: --with-rivet-core switch simplified * Makefile.am: preparing for installation of MPM bridges which have not to be scanned for Tcl packages * NOTICE: now Apache policy compliant * src/apache-2/Makefile.am: reenabled and reworked to make paths relative * src/apache-2/mod_rivet.h: reworked to reflect the new code organization. Also some definitions moved here from mod_rivet.c * src/common/mod_rivet_common.c: this is now the place where mod_rivet implementation independent function must go * src/experimental/Makefile.am: adding build for rivet_prefork_mpm.so * src/experimental/mod_rivet.[c|h]: placing here only the hopefully necessary code. The module resolves the bridge module symbols and actually calls those function to initialize, respond to requests and exit child processes * src/experimental/rivet_prefork_mpm.c: first sccessful implementation of the prefork bridge * src/experimental/rivet_worker_mpm.c: stuffing code into this module. It doesn't build now * src/common/mod_rivet_common.h: definitions for functions stored here. 2014-08-05 Massimo Manghi * 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 /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 * src/common: renaming src/config to a more specific name 2014-07-31: Massimo Manghi * src/experimental/mod_rivet.[c|h],rivetChannel.c: better implementation where Tcl interpreters are running within their own threads communicating to a supervisor. Also implemented APR callback functions to cleanup memory and interpreters data * src/config/parse_exec.c: adding this file which is to hold most of model independent code: Rivet_ParseExecFile, Rivet_chdir_file, Rivet_CheckType, Rivet_ParseExecString * src/apache-2/mod_rivet.c: Removed code to be common to the experimental module * src/Makefile.am: now compiling also new files needed to build the module. * src/rivet.h: adding preprocessor checks to avoid recursive includes 2014-07-14 Massimo Manghi * src/experimental/mod_rivet.c: working toy module capable of running Tcl scripts with a worker MPM * src/experimental/rivetChannel.c: now depending on the thread private data 2014-07-17 Massimo Manghi * src/channel/rivetChannel.[c|h]: add preprocessor symbol to prevent multiple includes 2014-07-16 Massimo Manghi * src/experimental: add experimental code for threaded module 2014-07-10 Massimo Manghi * src/apache-2/apache_config.[h|c]: moved to src/config * src/apache-2/TclWebapache.c: this file moved temporarily into src/config to separate it from the specific module implementation * src/experimental: making room to a new implementation of mod_rivet * src/channel/rivetChannel.c: the request_rec pointer is passed through another pointer as this channel is now the only channel handled by mod_rivet and it's shared across virutal hosts * src/apache-2/mod_rivet.c: now creating only one Rivet channel instance and storing a pointer to the current request_rec in the structure mod_rivet_globals, as the running the prefork MPM we can only handle a request at a time. * src/apache-2/*.tcl: removing obsolete tcl files 2014-07-09 Massimo Manghi * m4/ax_split_version.m4: adding macro for version number manipulation 2014-06-22 Massimo Manghi * configure.ac: new macros MOD_RIVET_CORE and RIVET_CHANNEL. Macro APACHE_VERSION preserved but not called anymore * rivet/init.tcl.in: Add template for rivet/init.tcl * src/Makefile.am: building mod_rivet with code entirely selected by autoconf defined symbols * src/apache-2/mod_rivet.c: comments added. Rivet package version depends now on preprocessor symbol RIVET_TCL_PACKAGE_VERSION 2014-06-10 Massimo Manghi * tests/rivet.test: removed lang.test as it was testing just a tautology 2014-06-04 Massimo Manghi * doc/images/color-table.png, doc/xml/examples.xml,doc/examples/color-table-tcl: Changing old table.rvt example in a more enticing colorful table generation 2014-06-03 Massimo Manghi * doc/xml/intro.xml: Acknowledgements reworded into a list * doc/images/: logo has now a transparent background, navigation icons colors turned into a greenish tint * rivet.xsl,rivet.css: new style based on a green gamut to make pages visually different from Rivet 2.1 2014-06-02 Massimo Manghi * VERSION,configure.ac: tagging this code as 2.2.0 * src/rivet.h,src/rivetcmds/rivetCore.c: macro CHECK_REQUEST_REC moved from rivetCore.c to rivet.h * doc/xml/internals.xml: New section documenting how to extend mod_rivet with new commands written in C 2014-05-22 Massimo Manghi * rivet/packages/dio/aida.sql: redifining responsability of class Aida (not to be officially released) 2014-04-17 Massimo Manghi * src/: reintegrating modularization branch. Now every subsystem mod_rivet is made of (module, channel, parser, commands, request multipart handling) can be developed separately * src/rivetcmds/rivetCore.c: reintroduced handling of the -string argument that disappeared from Rivet_ParseCmd probably because of the merge with modular. * src/apache-2/mod-rivet.c: Corrected comments to Rivet_ParseExecString 2014-04-16 Massimo Manghi * rivet/packages/dio/aida.tcl,dio_Tdbc.tcl,sql.tcl: more methods implemented in aida.tcl * doc/xml/commands.xml: new form '::rivet::inspect server' documented * src/rivetcmds/rivetInspect.c: adding is_virtual flag to dictionary returned by '::rivet::inspect server' * branches/modular: merging latest changes in trunk * trunk/src/rivetcmds/rivetInpect.c: adding is_virtual flag to dictionary returned by '::rivet::inspect server' 2014-04-11 Massimo Manghi * src/rivetcmds/rivetCore.c: misplaced check on request_rec in Rivet_InspectCmd * tests/failtest.tcl,failtest.test,checkfail.tcl: adding tests for ::rivet::inspect 2014-04-07 Massimo Manghi * tests/failtest.[test|tcl],failcheck.tcl: implementing test for consistent error handling by commands that are supposed to refuse execution outside of a request processing * tests/inspect.tcl: implementing test of command '::rivet::inspect script' * src/rivetcmds/rivetCore.c: typo in command ::rivet::apache_table 2014-04-04 Massimo Manghi * tests/failtest.tcl,failtest.test,checkfail.tcl: adding script for commands that must fail outside of a request processing (to be completed) * src/rivetcmds/rivetCore.c: comment rephrased 2014-03-30 Massimo Manghi * src/rivetcmds/rivetInspect.c: Add function Rivet_CurrentServerRec returning a dictionary of some field values stored in the server_rec object * src/rivetcmds/rivetCore.c: Add support for 'server' argument returning the dictionary built by Rivet_CurrentServerRec * src/TclWeb.h: adding declaration of function constructor of a TclWebRequest object * src/apache-2/TclWebapache.c: Add functions TclWeb_NewRequestObject and TclWeb_InitRequest to reinitialize a TclWebRequest object on each request * src/apache-2/apache_request.[c|h]: API change for ApacheRequest_new taking now an apr_pool_t object instance for creating an ApacheRequest oject pointer. Task to reset this object to initial values is now delegated to ApacheRequest_init. * src/apache-2/mod_rivet.[c|h]: new field in globals stores the current server_rec object pointer. This pointer is used in RivetInspect.c to access to field of the object for introspection 2014-03-26 Massimo Manghi * doc/xml/commands.xml: wrong example for lassign_array corrected * src/apache-2/mod_rivet.c: Adding comment explaining the meaning of setting/resetting globals->r as a way to detect if a script is running in the context of a request processing * src/rivetcmds/rivetCore.c,rivetInspect.c: Tcl object handling improved. Code simplified and ap_assert call added in Rivet_CurrentConfDict if there is no handling of a configuration parameter by Rivet_ReadConfParameter (which should never happen) * configure.ac, VERSION: version number bumped to 2.1.5 2014-03-16 Massimo Manghi * doc/images/Rivetlogo_small.png: removed because already in doc/ and duplicate to home.png 2014-02-28 Massimo Manghi * doc/xml/upgrading.xml: Adding Karl's note about upgrading from NeoWebScript 2014-02-24 Massimo Manghi * doc/xml/commands.xml: completed reworking of manual page for command ::rivet::inspect. * .: Preparing RC1 archive for version 2.1.4 2014-02-22 Massimo Manghi * doc/xml/commands.xml: further elaboration of the section about command ::rivet::inspect 2014-02-21 Massimo Manghi * tests/inspect.[test|tcl]: adding tests for introspection command 2014-02-19 Massimo Manghi * src/rivetcmds/rivetCore.c: spurious ref count decrement caused random crashes * src/rivetcmds/rivetInspect.c: fixed behaviour when inspect is passed with an undefined argument value * configure.ac: reindented some function to improve readability and editor independence 2014-02-19 Massimo Manghi * src/rivetcmds/rivetInspect.c,src/librivet/rivetList.c: removing lines of code commented and unused * doc/xml/commands.xml: documenting command lremove * tests/rivetlib.test: adding more tests for lremove 2014-02-11 Massimo Manghi * tests/rivetlib.test: adding tests for rivetlib * rivet/packages/dio/aida.tcl,sql.tcl: new files for development of DIO compatible interface to tdbc * rivet/rivet-tcl/lassign_array.tcl: removed since already provided in rivetlib * docs/xml/commands.xml: documenting features of lassign_array.tcl rivetlib version 2014-02-06 Massimo Manghi * ChangeLog: timestamps of latest entries of this file carried the wrong year (2013) * rivet/packages/dio/dio_Mysql.tcl: fixed comment lines placed within the switch construct that have become incompatibile with Tcl8.6. * configure.ac: add AC_C_INLINE macro 2014-02-04 Massimo Manghi * src/rivetcmd/rivetCore.c: testing globals->r against NULL and in case return a null string * src/apache-2/mod_rivet.c: using only globals->r to flag a request processing under way 2014-02-03 Massimo Manghi * src/apache-2/mod_rivet.c: globals->req had to be set to NULL in Rivet_PerInterpInit! 2014-02-02 Massimo Manghi * src/apache-2/mod_rivet.[c|h]: further optimizing code avoiding to allocate a TclWebRequest structure on every request. This structure is allocate when the interpreter is initialized and a pointer stored in rivet globals * src/rivetcmd/rivetInspect.c: impoved consistence if Tcl objects handling 2014-01-30 Massimo Manghi * src/apache-2/mod_rivet.c: this ChangeLog entry is meant to amend the 2014-01-27 entry that missed to point out as small still important change in mod_rivet.c. Rivet_SendContent is not calling Tcl anymore to coax command 'info script' to return the current Rivet script full path. This will soon be solved by adding a new functionality to command '::rivet::inspect' 2014-01-27 Massimo Manghi * src/apache-2/apache_config.[c|h]: new file with Apache module configuration procedures moved here from mod_rivet.c. This code is likely to be Apache 2.x but totally independent from the running MPM. Therefore it was moved here to improved size and manageability of mod_rivet.c * src/apache-2/mod_rivet.c: The module central code, from which configuration handling procedures were removed 2014-01-08 Massimo Manghi * rivet/packages/dio/aida.tcl: adding aida.tcl experimental file for a DIO compatible interface to TDBC. * rivet/packages/dio/sql.tcl: now able to produce same basic SQL queries ::DIO::Database class is doing now 2013-12-19 Massimo Manghi * rivet/packages/dio/dio_Postgresql.tcl: reindented and tabs converted to spaces * rivet/packages/dio/sql.tcl: class DIO::Sql now returning basic SELECT SQL statements 2013-12-18 Massimo Manghi * rivet/packages/dio/sql.tcl: further developments. Class Sql is now able to build an abstract representation of a SELECT query * rivet/packages/dio/dio.tcl: typo in a comment 2013-12-16 Massimo Manghi * rivet/packages/dio/sql.tcl: trying to redesign rivet in order to comply with Tdbc and aiming at making DIO a pure interface to Tdbc dropping the dependency with DBMS specific drivers 2013-12-13 Massimo Manghi * rivet/packages/dio/dio_Tdbc.tcl: first version of Tdbc driver for DIO. This class is able to execute basic queries and needs further development 2013-12-08 Massimo Manghi * configure.ac: version number bumped up to 2.1.4 2013-12-06 Massimo Manghi * rivet/packages/dio/dio_Postgres.tcl: minor changes (code indentation revised) * rivet/packages/dio/dio_Tdbc.tcl: experimental support for the tdbc abstraction library * doc/xml/install.xml: the manual still suggested to call make install-packages, whereas 'make install' does everything now as it was before 2.1.2 2013-12-04 Massimo Manghi * src/apache-2/apache_request.c: log message in ApacheRequest___parse() commented out (Bug #55845) 2013-12-03 Massimo Manghi * src/apache-2/mod_rivet.c: Rivet template preprocessor symbols renamed in the more expressive RIVET_TEMPLATE and RIVET_TCLFILE * rivet/rivet-tcl/lassing_array.tcl: new command lassing_array taken from DIO's result set class (inspired by Tclx) * doc/xml/commands.xml: lassign_array documented in the manual * rivet/packages/dio/dio.tcl: reformatted during analysis for supporting tdbc based driver 2013-11-04 Massimo Manghi * src/Makefile.am: this Makefile.am is now in charge for building mod_rivet librivet.so and librivetparser.so. This fixes and problem with the 'distclean' target and keeps us from further customization of automake (subdir-objects property) * src/runtests.tcl: changed path to mod_rivet.so and librivetparser.so 2013-10-15 Massimo Manghi * src/rivetcmds/rivetCore.c: 'headers redirect' used to return TCL_RETURN to force the caller to terminate and interrupt the processing. It didn't actually worked exactly that way and starting with Tcl 8.6.1 it also failed returning a Tcl invalid error code (Bug #55583). Turning it into TCL_OK seems to cure the problem 2013-09-26 Massimo Manghi * doc/xml/session.xml: fixed code example indentation * rivet/packages/calendar.xml: fixed class and tag for calendar banner 2013-09-23 Massimo Manghi * rivet/packages/calendar/calendar.tcl: fixed zero length argument list calling method emit 2013-09-22 Massimo Manghi * modular: committing changes from last merge 2013-09-21 Massimo Manghi * contrib/tcl.vim: list of subcommands completed 2013-09-20 Massimo Manghi * contrib/tcl.vim: Vim's syntax highlighting extension including also rivet's command set (experimental) 2013-09-18 Massimo Manghi * rivet/init.tcl: removed paranoid debugging log messages 2013-09-17 Massimo Manghi * src/[parser|apache-2|librivet]/Makefile.am: AM_CPPFLAGS are not a transparent replacement for INCLUDES at least when a Makefile.am is in a subdirectory. Placing include directory switches in the target specific _CPPFLAGS variable 2013-09-15 Massimo Manghi * tclconfig/missing: new version of 'missing' taken from automake 1.14 * src/[parser|apache-2|librivet]/Makefile.am: depracated INCLUDES variables replaces with their recommended counterparts AM_CPPFLAGS * configure.ac: new message about the notifier failing to start in child processes after the child processes fork 2013-09-14 Massimo Manghi * rivet/packages/calendar/calendar.tcl: too restrictive test on Tcl versione fixed * rivet/rivet-tcl/parray_table.tcl: also the parray putting out an HTML table is now escaping SGML characters * INSTALL: new installation instruction amending the rejected installation approach done in 2.1.2 and restoring old target 'install' to get everything moved to their final directory * doc/xml/install.xml: same for INSTALL * doc/xml/commands.xml: new 'parse -string' form documented 2013-09-13 Massimo Manghi * rivet/packages/dio/dio_Mysql.tcl: attempting to correct detection of SELECT query by checking if a SELECT keyword exists at the beginning of query either following a '(' or only space characters (their trimmed away in any case) 2013-08-30 Massimo Manghi * rivet/rivet-tcl/parray.tcl: escaping SGML characters that might appear in the output to avoid cross scripting 2013-08-29 Massimo Manghi * branches/modular: merging latest changes from trunk 2013-08-26 Massimo Manghi * configure.ac: expanded warning message about broken implementations of Tcl when using forks and the event loop * Makefile.am: target 'install' now depends on targets install-binaries and install-packages, thus install the whole Rivet code as it did before 2.1.2. Packagers wanting to separated binary and Tcl code can draw on those 2 targets * INSTALL,doc/xml/install.xml: changed documentation to reflect the restored organization of install targets 2013-08-12 Massimo Manghi * rivet/packages/form/form2.tcl,form.tcl: form packages called Rivet's command '::rivet::env' in its unqualified form. Fixed adding the ::rivet namespace specification. * src/apache-2/rivetCore.c: errata corrige for entry added on 2013-07-19: command 'parse -string' superseded test command parsestr, thus removed from rivetCore.c 2013-08-07 Massimo Manghi * ./: merging changes done in trunk 2013-08-07 Massimo Manghi * src/apache-2/mod_rivet.c: adding MPM descripting fields to the 'server' array * configure.ac: warning message about Tcl version not supporting fork correctly moved to the end of configure.ac, so that it's more readable by the user 2013-08-06 Massimo Manghi * rivetcmds/rivetCore.c,rivetInspect.c: moved core commands into this new directory. Their code is (nearly) independent from Apache version and in future it might be shared between different versions/branches of the module * src/apache-2/Makefile.am: changed reference to rivetCore.c and rivetConf.c to their new position and new names * src/apache-2/mod_rivet.c: conditional compilation to Tcl_InitIdentifier might help preserving event loop on Unices where no pthreads_atfork call exists (Bug #55153) * configure.ac: Tcl version checked to detect when the notifier might not be working (Tcl < 8.5.15 and Tcl < 8.6.1). In case a warning message is printed 2013-07-19 Massimo Manghi * tests/parse.test,parsestring.rvt: adding test for 'parse -string' variant to Rivet command 'parse' 2013-07-17 Massimo Manghi * src/apache-2/mod_rivet.[h|c],rivetCore.c: reverting new command 'parsestr' and turning string parsing command into the support for the new -string modifier of the ordinary parse command 2013-07-06 Massimo Manghi * src/parser/parserPkgInit.c: commands are created through the RIVET_OBJ_CMD macro * rivet/packages/tclrivet/tclrivet.tcl: loading the rivetparser library caused weird side effects and the interpreter failed when this package was required by a script. It's still to be understood why librivetparser was loaded using command 'load' in tclrivet.tcl * src/apache-2/mod_rivet.c: reverting an attempt to include rivetparser as package required by default. 2013-07-05 Massimo Manghi * configure.ac: changed the default path for installation dir * doc/xml/commands.xml: add manual page for command ::rivet::xml 2013-06-28 Massimo Manghi * src/apache-2/mod_rivet.c,rivetCore.c: command 'parsestr' to parse templates stored in Tcl objects coded * doc/Makefile.am: 'clean' target made a little terser 2013-06-26 Massimo Manghi * Makefile.am: forcing install/unistall targets to recreate pkgIndex.tcl in order to have a coherent directory of packages actually available 2013-06-24 Massimo Manghi * INSTALL: It must be made explicit installation is a two stage operation now 2013-06-24 Massimo Manghi * rivet/packages/session/session-class.tcl: two new methods 'load' (loads a whole package data for a given package and session) and 'clear' (it deletes either a whole package or a single data like for a session) 2013-06-22 Massimo Manghi * src/apache-2/mod_rivet.c: cleanup of unused code in mod_rivet.c. Adding comments to undocumented functions * src/parser/rivetParse.c: New TODO comment added 2013-06-12 Massimo Manghi * Makefile.am: splitting install targets into 'make install' (mod_rivet.so, librivet.so,librivetparser.so + Tcl commands in rivet/rivet-tcl) and 'make install-packages' (whole content of rivet/packages), thus decoupling binary and non binary installs. Notice: 'make install' creates a fully functional install of Rivet in case packages such as 'form', 'session', 'DIO' aren't needed. * rivet/rivet-tcl/xml.tcl: Adding svn:keywords Id to svn properties * doc/xml/install.xml: updating manual to document the new installation command sequence 2013-06-04 Massimo Manghi * tclconfig/* : merging into this branch the latest commits done from trunk 2013-06-03 Massimo Manghi * tclconfig/[ltmain.sh,compile,depcomp]: more libtool scripts updated 2013-06-03 Massimo Manghi * src/parser/Makefile.am: adding include paths to INCLUDE * src/Makefile.am: Rivet library build moved to this script * src/librivet/Makefile.am: Rivet library build removed from this file 2013-06-02 Massimo Manghi * src/Makefile.am: including librivet.so build in this file * src/librivet/Makefile.am: kept for reference but without effective code now * tclconfig/[install-sh,config.sub,config.guess]: new versions for script used by the autoconf/automake/libtool toolchain 2013-05-24 Massimo Manghi * src/: branching trunk to branches/modular to reorganize mod_rivet in a way that should enable the development of single components (apache request, Rivet channel, parser) with minimal branching 2013-05-21 Massimo Manghi * src/apache-2/apache_request.c: ApacheRequest___parse further simplified and made less restrictive about the combination of method and mimetype of the request * src/apache-2/mod_rivet.c: add debug message in exit handler 2013-05-06 Massimo Manghi * src/apache-2/rivetCore.c: call to 'panic' changed to fulfill the hardening flags that (quite oddly) fail when building against Tcl8.6 on some platforms or Linux distros 2013-04-30 Massimo Manghi * doc/xml/commands.xml: improved entry for ::rivet::var with an explanation and example provided by Harald * configure.ac,VERSION: version number bumped to 2.1.2 2013-02-12 Massimo Manghi * src/apache-2/mod_rivet.c: To avoid clash on freeing resources Tcl_Finalize is removed from child process cleanup (Bug #54162) 2013-02-11 Massimo Manghi * rivet/packages/dio/dio.tcl: fixing nasty bug introduced with Rivet 2.1. When method 'store' is updating the call to method update needs a flat list as last argument, not just a sigle valued list argument * doc/xml/commands.xml: Improved explanation for command abort_page * src/apache-2/rivetConf.c: corrected typo in header * src/apache-2/apache_request.c: new handling of apache requests largely relaxes checks on the 'Content-Type' header (Bug #53661) 2013-02-02 Massimo Manghi * src/apache-2/apache_request.c,src/apache-2/mod_rivet.c: extending request handling also for PUT and DELETE. Applied patch provided by Jeff Lawson in bug report #53892 2013-02-01 Massimo Manghi * src/apache-2/Makefile.am, src/Makefile.am: removed -v flag from rm command in install-data-hook: target to avoid incompatibility with same command's implementation in Solaris (Bug: #54181) 2013-01-28 Massimo Manghi * src/apache-2/mod_rivet.[c|h],rivetCore.c: removed hardcoded error code generated by abort_page and defined in the preprocessor symbol ABORTCODE. 2013-01-25 Massimo Manghi * rivet/rivet-tcl/xml.tcl,rivet/rivet-tcl/tclIndex: New command for XML fragments composition 2013-01-20 Massimo Manghi * Makefile.am: added removal of libool created .la files for librivetparser and librivet 2012-12-30 Massimo Manghi * rivet/rivet-tcl/xml.tcl: revised command for simple XML string mark up 2012-12-18 Massimo Manghi * src/librivet/rivetPkgInit.c: package version taken from preprocessor symbol RIVET_VERSION so that it's guaranteed mod_rivet.c will get the right library version. * src/apache-2/mod_rivet.c: removed trailing spaces from various lines (offends some patch management tools such as quilt) 2012-12-17 Massimo Manghi * doc/xml/install.xml: fixed link to download page on the website * rivet/packages/dio/dio.tcl: method store uses internally methods 'insert' or 'update' (depending on the existence of a row having the same keyfield). The latest version of DIO shipped a 'store' method that returns the very same value returned either by 'insert' or 'update'. Previous versions of DIO returned invariably 1, which was undocumented and not very well thought out (handled errors in 'store' return a -code error, not necessarily 0). Previous behavior is reinstated (bug #54313) 2012-12-16 Massimo Manghi * rivet/packages/session/session-class.tcl: method 'store' had an hardcoded 'parray' the ran when an error occurred. It also printed a message using 'puts' instead of 'debug' 2012-12-15 Massimo Manghi * src/apache-2/rivetCore.c: command 'headers' returns a meaningful error in case a subcommand is invalid 2012-12-12 Massimo Manghi * src/apache-2/mod_rivet.c: Tcl_PkgRequire for packages Rivet and rivetlib are exchanged so that commands in librivet.so can be imported when they are on the export list and a programmer issues a 'package require ::rivet' (fixes bug #54290) * rivet/init.tcl: this script is now providing package 'Rivet' instead of 'RivetTcl'. init.tcl initializes the Tcl core of Rivet and a package rivet has to exists for compatibility with version 2.0 where it was provided rather pointelessly by librivet.so. 2012-12-03 Massimo Manghi * doc/Makefile.am: Manual pages output encoding set to UTF-8 2012-11-13 Massimo Manghi * doc/xml/form.xml: subcommand 'checkboxes' documented 2012-11-09 Harald Oehlmann * rivet/packages/form/form2.tcl: Checkboxes with no value and an arbitrary default value are initialy checked. *** POTENTIAL INCOMPATIBILITY *** The default value is not taken as checkbox value any more. This was IMHO a security hole. (reported on rivet-dev by Jeff Lawson) 2012-11-05 Harald Oehlmann * rivet/packages/form/form2.tcl: Bug fixed: method textarea did not honor default values. (reported on rivet-dev by Jeff Lawson) 2012-10-29 Massimo Manghi * rivet/packages/session/[session-create-mysql.sql|session-create-sqlite.sql]: index riv_sess_cache_ix had a incomplete unique key definition that missed the 'package_' column (fixes bug #54063) 2012-10-28 Massimo Manghi * doc/xml/commands.xml: Manual entry for makeurl extented to clarify how the protocol is determined. 2012-10-16 Massimo Manghi * doc/xml/directives.xml,doc/xml/commands.xml,doc/xml/install.xml,doc/xml/examples.xml, doc/xml/request.xml,doc/convert_examples.tcl.in,doc/examples-sgml/hello1.rvt: Trying to improve the manual revising and extending it 2012-10-01 Massimo Manghi * doc/xml/request.xml,doc/xml/install.xml: attempting to improve the documentation * doc/images/: Adding missing icons 2012-09-30 Massimo Manghi * tests/parsepackage.test: changed path to librivetparser.so 2012-09-29 Massimo Manghi * rivet/rivet-tcl/xml.tcl: Adding command for simple quick XML fragments generation 2012-09-22 Massimo Manghi * rivet/packages/dio/dio.tcl: various methods used as accessors to some property variables of the class Database were not returning their values as expeected. This also surfaced a bug in method 'string' where a result object wasn't used correctly. Method 'count' failed when no keyfield was set. Since it should be possible to call this method also when there is no keyfield defined private method table_check is returning specific error codes making possible to catch this error and ignore it in 'count' (fixed bugs #53733 and #53732) * rivet/packages/dio/dio_Sqlite.tcl: Class Sqlite did not set the variable 'interface' to value 'Sqlite' as expected. 2012-09-21 Massimo Manghi * doc/README: improved instruction for code examples inclusion into XML manual * doc/rivet-full.xml: removed 2012-09-18 Massimo Manghi * rivet/pkgIndex.tcl: index file regenerated 2012-09-17 Massimo Manghi * src/librivet/rivet[Crypt|WWW|List|pkgInit].c,src/parser/rivetParser.[c|h], src/parser/parserPkgInit.c: files for librivet and the Rivet parser moved into src/librivet and src/parser. * src/Makefile.am,src/librivet/Makefile.am, src/parser/Makefile.am: new automake conf files reflect libraries reorganization. * src/apache-2/Makefile.am: mod_rivet builds from the newly located parser code. Is it sensible to let the module depend on a real package (provided by libparser.c)? * configure.ac: add variable substitution for newly created Makefile.am 2012-09-16 Massimo Manghi * tests/runtests.tcl,tests/apachetest.tcl: User and Group directives removed from conffile template to make test suite independent from the output of command 'id' from which the values for this parameters were inferred (Bug #53396) * tests/shorthand.rvt: oddly enough the template output the same line twice. 2012-09-03 Harald Oehlmann * Thank you accepting me as committer 2012-08-19 Massimo Manghi * src/apache-2/mod_rivet.c: the module returns now a HTTP_INTERNAL_SERVER_ERROR when a request namespace cannot be created 2012-08-16 Massimo Manghi * src/rivetPkgInit.c: improved namespace structure pointer handling (contributed by Georgios Petasis) 2012-08-15 Massimo Manghi * rivet/packages/dio/dio_Oracle.tcl: fixed method makeDBFieldValue in class Oracle (Bug #53703) 2012-08-15 Massimo Manghi * doc/xml/dio.xml: Fixed wrong declariation of 'insert' subcommand in page manual (Bug #53670) * rivet/packages/dio/dio_Postgresql.tcl: method makeDBFieldValue implemented and tested with package Sessiona (Bug #53703). * rivet/packages/session/session-create.sql: file renamed as session-create-postgresql.sql. Schema tested with package Session. * Changelog: entry of Aug 12 corrected: the method of Database (dio.tcl) in question was 'store' not 'fetch' * rivet/packages/session/session-class.tcl: removed 'conf' variable that could clash with application code (and in at least one case it did) (Fixes bug #53544) 2012-08-13 Massimo Manghi * rivet/packages/dio/dio_Sqlite.sql,rivet/packages/dio/dio_Mysql.tcl: These connector classes didn't compute correctly the number of seconds as unix timestamp to be returned for comparison with the same information returned by [clock seconds] (Bug #53703) * rivet/packages/session/session-class.tcl: special datetime field were registered associated to the rivet_session and rivet_session_cache names, whereas the class has member variables for storing these definitions (Bug #53543) 2012-08-12 Massimo Manghi * rivet/packages/dio/dio.tcl: Database's class 'store' method was rewritten on a more simple assumption that methods 'insert' and 'update' know how to actually .... insert and update rows * rivet/packages/dio/dio_Sqlite.tcl: The class was found to fail in various circumstances determining the number of rows affected by a query and determining the set of fields in a table involved by a query. Since a 'select' query is treated in a rather distinctive way from other SQL queries, a new public variable 'select' was added to the properties of the class in order to handle consistently the 2 cases within SqliteResult. The number of rows affected rows is obtained from the 'changes' subcommand of Sqlite3 connector. * rivet/packages/dio_Mysql.tcl: wrong special field handling fixed 2012-08-11 Massimo Manghi * rivet/packages/session/session-create-sqlite.sql: new file with schema of session package tables for Sqlite. 2012-08-07 Massimo Manghi * doc/rivet.css: text in monospace characted made a little smaller * rivet/packages/form/form.tcl: Workaround to avoid wrong parsing of form data when parameter values have spaces in them * src/apache-2/mod_rivet.c: 'server' array uses RIVET_VERSION instead of the lengthy RIVET_PACKAGE_VERSION 2012-07-31 Massimo Manghi * rivet/packages/dio/dio_Sqlite.tcl: Add search case for package sqlite3. Add method makeDBFieldValue to handle time and date special fields support. Add method 'quote' which overrides the same method in Database, as correct way to escape quotes (') characters for Sqlite is doubling them ('') 2012-07-04 Massimo Manghi * doc/examples/download.tcl: The example has been having ever since an error in calling 'source' instead of 'parse'. The multitude of the userbase never realized. 2012-07-03 Massimo Manghi * CHANGES: file emptied from obsolete notes * src/apache-2/mod_rivet.c: Add UploadDirectory to the list of handled options for RivetUserConf 2012-06-27 Massimo Manghi * configure.ac: Version number set as 1.2.0b1 * rivet/packages/form/form.tcl: form package 1.0 taken from branches/2.0 * doc/xml/commands.xml: improved page manual about incr0 being declared deprecated 2012-06-20 Massimo Manghi * contrib/form.tcl: Requiring package TclOO making explicit it's needed to run this version of form.tcl 2012-06-01 Massimo Manghi * rivet/packages/form/form2.tcl: New form2.tcl providing form 2.0 package (proposed name for the file) 2012-05-18 Massimo Manghi * doc/xml/intro.xml: add acknowledgments for contributions made by Cyril, Jeff and Harald * doc/xml/commands.xml: add page manual for ::rivet::inspect * src/apache-2/mod_rivet.c: add handling for Debug, DebugIp and DebugSeparator in user conf table. * rivet/rivet-tcl/debug.tcl: Array ::RivetUserConf (which is used to convey control parameters for the command) is now created on demand using command ::rivet::inspect * doc/rivet.css: adjustments needed to make characters size consistent and nice looking 2012-05-17 Massimo Manghi * doc/xml/examples.xml: "Hello World" example reworked * rivet/packages/dio/dio.tcl: fixed SQL syntax that would break compatibility with Oracle (fixes reopened bug #53222) 2012-05-15 Massimo Manghi * doc/hello1.rvt: add new "Hello World!" example to explain the new shorthand syntax 2012-05-14 Massimo Manghi * doc/rivet.xsl,doc/rivet.css,doc/images/[prev.png,next.png,up.png]: new stylesheet and icons for the page manual 2012-05-13 Massimo Manghi * rivet/packages/tclrivet/tclrivetparser.tcl: Tcl parser implements new shorthand echo syntax (closes bug #53217) * doc/xml/entities.xml: New manual page for package RivetEntities * rivet/packages/tclrivet/parse.tcl: auto_path handling improved (closes bug #52898) * rivet/packages/form/form.tcl: indentation converted to spaces to improve editing across different editors. Fixed problem with variable clash in constructor. Also removed unneeded [expr ...] in conditions that prevented byte compiling (Closes bug #52650) * doc/xml/commands.xml: improved manual entry for 'var list' (Fixes bug #52911) 2012-05-12 Massimo Manghi * src/rivetParser.c: add shorthand expression for (contributed by Jeff Lawson, addresses #53217, tclrivetparser still to be fixed) * tests/shorthand.[test|rvt]: add test of shorthand notation for string output * rivet/rivet-tcl/cookie.tcl: add support for HttpOnly flag (contributed by Cyril Shtumf, fixes bug #53224) * rivet/packages/session/session-class.tcl: support for HttpOnly flag improves security and reduces the risk of cross-site scripting attacks (contributed by Cyril Shtumf, fixes #52224) * rivet/packages/dio/dio.tcl: wrong SQL syntax generated in delete method when multiple fields are used in the selection clause (contributed by Cyril Shtumf, fixes bug #53222) * rivet/packages/dio/dio_Mysql.tcl: Mysql connection must be checked when connection reference is reused because it could have dropped (contributed by Cyril Shtumf, fixes #53221) 2012-05-09 Massimo Manghi * rivet/rivet-tcl/http_accept.tcl: new command ::rivet::http_accept * doc/xml/commands.xml: new manual entry for ::rivet::http_accept * doc/rivet.xml: Add new file entities.xml describing package 'RivetEntities' (only a stub, to be elaborated) * doc/xml/entities.xml: New manual page for package 'RivetEntities' 2012-05-08 Massimo Manghi * src/rivetPkgInit.c: reinstated safe interpreters initialization * doc/xml/install.xml: corrections and further elaboration of explanation for the --disable-import-rivet-commands 2012-05-07 Massimo Manghi * src/apache-2/rivetCore.c: new command ::rivet::inspect implementing function Rivet_InspectCmd * src/apache-2/rivetConf.c: Ancillary functions for instrospection procedure Rivet_InspectCmd * src/apache-2/Makefile.am: Added handling of rivetConf.c * src/apache-2/mod_rivet.c: Handling of configuration directives restricted to meaningful options when RivetDirConf or RivetUserConf directives are set. An error message is printed when child process initialization directives are set by RivetDirConf and RivetUserConf. Rivet_PropagatePerDirConfArrays and Rivet_PropagateServerConfArray functions disabled as the ::rivet::inspect command can work out a better alternative creating the RivetServerConf, RivetDirConf and RivetUserConf on demand. * src/apache-2/mod_rivet.h: Added declaration for functions in rivetConf.c * rivet/rivet-tcl/lassign.tcl: removed, since Tcl 8.5 lassign implements and extends the same functionalities 2012-04-30 Massimo Manghi * rivet/packages/form/form.tcl: Patch provided by Jeff Lawson to manage -label switches. The package now requires package uuid from Tcllib. * : Entry of 2012-04-07 amended as the path to mod_rivet.[c|h] was clearly wrong 2012-04-07 Massimo Manghi * rivet/apache-2/mod_rivet.[c|h]: One more change to an ap_log_error call suggested by the compilation hardening flags 2012-03-26 Massimo Manghi * rivet/packages/entities.tcl: new package RivetEntities, replacement for tcllib ::html::entities but with no extra dependecies (as a matter of fact it works without Rivet too) 2012-03-13 Karl Lehenbauer * configure.ac: Default separate virtual interps to "no". (--enable-virtual-interps-separation option implies disabled if not set.) * rivet/packages/form/form.tcl: In the forms package, stop bleeding the raw value of radio buttons and checkboxes into the generated HTML. * src/apache-2/mod_rivet.c: Rework ap_log_error calls to include the mod_rivet module name. Emit debug-level messages for successful execution of GlobalInitScript and ServerInitScript. * README.freebsd: Update to reflect the modern world. * README.configure: Document how to regenerate the configure script, etc. * tclconfig/depcomp, tclconfig/missing, tclconfig/config.guess, tclconfig/config.sub, tclconfig/ltmain.sh: Update from newer libtools, etc. 2012-03-08 Massimo Manghi * rivet/rivet-tcl/,/rivet/packages/simpledb: various changes suggested by code profiler (thanks to Harald Oehlmann) * rivet/packages/tclrivetparse.tcl: wrong handling of swich cases made method 'parse' unusable * src/rivet.h: obsolete comment amended 2012-01-16 Massimo Manghi * rivet/rivet-tcl/tclIndex.tcl: regenerated with auto_mkindex. 2012-01-15 Massimo Manghi * rivet/rivet-tcl/parray_table.tcl: this file was erroneously introduced as tablearray.tcl. Renamed. * rivet/rivet-tcl/putsnnl.tcl: experimental putsnnl command rewritten to improve features and make it more flexible by adding option for padding with   entities. 2012-01-10 Massimo Manghi * rivet/rivet-tcl/parray_table.tcl: New command parray_table to print the content of an array into an HTML table * rivet/rivet-tcl/putsnnl.tcl: More consistent form for 'putsnnl'. If the second argument is given and it's an integer then the string is at most characters long. If > [string lenghth ] then the output is still wide. If is a positive integer the string is printed right-aligned, if negative the string is left-aligned 2011-12-26 Massimo Manghi * rivet/rivet-tcl/putsnnl.tcl: Add new command 'putsnnl', a wrapper for 'puts -nonewline' with the extra optional feature of prepending the output with a definite number of spaces (it helps pretty printing of HTML) 2011-12-09 Massimo Manghi * src/rivetPkgInit.c,src/parserPkgInit.c: libs now are fully based on stubs and the tcl version parameter passed with Tcl_InitStubs is the same Tcl version their linked against. Probably too strict, but a cautious point as we are moving towards Tcl8.6 and Tcl9, which will probably require recompilation of the whole Tcl software 2011-12-08 Massimo Manghi * trunk/: Final commit merging changes to scoping commands in the ::rivet namespace 2011-12-07 Massimo Manghi * doc/examples, doc/convert_examples.tcl.in: Add ::rivet namespace to examples and examples code converter * doc/examples/*.rvt: removed unneeded sgml chars escaping * doc/xml/install.xml: removed duplicated entry of a 'configure' switch 2011-12-06 Massimo Manghi * rivet/rivet-tcl/tablearray.tcl: new procedure 'tablearray' prints an array content in an HTML construct. Test procedure, we maybe want to have something more general for printing also dictionaries. 2011-12-06 Massimo Manghi * configure_ac: add new test on Tcl version using AX_VERSION_COMPARE. 2011-12-06 Massimo Manghi * doc/xml/request.xml,doc/xml/install.xml: documenting new configure switches 2011-12-05 Massimo Manghi * src/apache-2/mod_rivet.c: child init sets also the array module_conf to signal the compilation flags --enable-rivet-commands-export and --enable-import-namespace-commands for the benefit of init.tcl * configure.ac: new macro created to handle --enable-rivet-commands-export and --enable-import-namespace-commands * rivet/init.tcl: module_conf signals when commands have to be exported from ::rivet and when they have to be implicitly imported into the global namespace for compatibility with previous versions of Rivet. 2011-11-21 Massimo Manghi * doc/xml/directives.xml,doc/xml/commands.xml: removed note about 'rivetlib' package no more needed. Notes about ServerInitScript not having effect when virtual hosts have their own private slave interpreters. 2011-11-20 Massimo Manghi * doc/xml/commands.xml,doc/xml/install.xml: documentation for building Rivet updated. * configure.ac: corrected help message for --disable-rivet-commands-export 2011-11-20 Massimo Manghi * src/rivet.h: Macro definition for Rivet command objects has rolled back to its previous form and doesn't call Tcl_Export anymore. In case commands are exported by calling Tcl_Export in rivetCore.c and rivetPkgInit.c * tests/*: test suite reviewed for new tests 2011-11-16 Massimo Manghi * src/apache-2/rivetCore.c: code rationalization. namespace reference will not be passed to the RIVET_OBJ_COMMAND macro and commands are exported by calling Tcl_Export on the whole command set in ::rivet. The whole process is controlled by the macro symbol RIVET_NAMESPACE_EXPORT * src/rivet.h: only one RIVET_OBJ_COMMAND object exists now. Call to Rivet_WWWInit, Rivet_CryptInit and Rivet_ListInit haved changed. Rivet namespace pointer in not passed around anymore and it's handled only in rivetPkgInit.c * src/rivetPkgInit.c: 2011-11-14 Massimo Manghi * configure.ac: new switch --enable-rivet-commands-export to enable/disable commands in ::rivet namespace 2011-11-12 Massimo Manghi * src/apache-2/rivetCore.c: reindented to improve readability. * doc/xml/commands.xml: typo corrected * tclconfig/ltmain.sh: new script from recently released libtools * configure.ac: new macro AC_CONFIG_MACRO_DIR to include macros in m4 2011-10-12 Massimo Manghi * debian/*: actually removed from trunk (yesterday it was removed from branches/2.0) 2011-10-11 Massimo Manghi * debian/*: removed from trunk and moved into parent directory. Maintaining scripts and configuration for Debianizing a package in the same package repository is deprecated and error prone. 2011-10-09 Massimo Manghi * debian/*: preparing to move the debian stuff away from development branches of Rivet. I'm committing the latest changes done in the process of releasing the Debian package for 2.0.4 2011-09-26 Massimo Manghi * m4/ax_compare_version.m4: add macro for version comparison from the GNU macro archive 2011-09-23 Massimo Manghi * src/apache-2/rivetCore.c,src/apache-2/TclWebapache.c: merging changes made to fix bugs and requests to command 'makeurl', 'load_env' and 'load_headers' 2011-09-07 Massimo Manghi * doc/xml/commands.xml: Add existing undocumented commands - import_keyvalue_pairs - lempty - lmatch - lassign (consider to remove, as it overlaps for name and features with identical Tcl core command) - read_file - wrap - wrapline Changed 'makeurl' documentation to account for new features recently committed 2011-09-06 Massimo Manghi * src/apache-2/mod_rivet.c: Add Id svn keyword. * src/apache-2/TclWebapache.c: Command load_env and load_headers now resolve the array name parameter following the default method (removed TCL_NAMESPACE_ONLY flag that prevented creation of an array in a proc's scope). Still default values for the arguments create such arrays in the ::request namespace * src/apache-2/rivetCode.c: preprocess macros ENV_ARRAY_NAME and HEADERS_ARRAY_NAME modified to explicitly put in ::request namespace the default arrays. Procedure Rivet_MakeURL chages so that command 'makeurl' now accepts relative paths and prepends them with the value of the SCRIPT_NAME environment variable. When run without arguments 'makeurl' returns the value in the SCRIPT_NAME env variable. 2011-06-03 Massimo Manghi * tclconfig/ltmain.sh: new version shipped with libtool 2011-06-01 Massimo Manghi * tclconfig/libtool.m4: autoconf 2.68 has a new IF..ELSE.. statement in m4 macros and libtool.m4 needs to get along it. New version copied into tclconfig. 2011-05-09 Massimo Manghi * src/apache-2/mod_rivet.c: fixed misleading error message displayed when rivet_abort_script fails 2011-05-05 Massimo Manghi * configure.ac: APACHE_VERSION returns an error message for--with-apache-version=1. * src/apache-1/: removed from trunk 2011-04-14 Massimo Manghi * src/Makefile.am,src/apache-2/Makefile.am: Add target install-data-hook with command line for removing unneeded .la files from target directories * configure.ac: doc/convert_examples.tcl is generated from template: added to AC_CONFIG_FILES * debian/changelog,debian/control: changed to reflect improvement in the script for Debian 2011-06-07 Massimo Manghi * rivet/init.tcl: because of bug #3216070 of Tcl we cannot preload rivetlib, so it doesn't make sense to import the rivet namespace, because we cannot have all the command set loaded in and an import has to be done for them in the application scripts * rivet/rivet-tcl/incr0.tcl: Tcl8.5 provides identical functionalities, so this command is now aliased in the interpreter by the native incr command. * rivet/rivet-tcl/tclIndex: recreated 2011-04-06 Massimo Manghi * configure.ac: Added doc/convert_examples.tcl to files created from its .in template 2011-04-03 Massimo Manghi * doc/convert_examples.tcl.in,doc/convert_examples.tcl: Added script to convert code examples from their native form to a sgml escaped form. * doc/Makefile.am: Target 'examples' added * doc/xml/install.xml: Expanded --with-apxs explanation. * doc/README: expanded with instructions for adding new examples to the docs. 2011-04-01 Massimo Manghi * doc/: new directory doc/examples-sgml. This is the directory where examples ready for inclusion in the manual must stay. The directory doc/examples is now meant to keep examples suitable for actual test and exectution * doc/convert_examples.tcl: New procedure that check for changes in doc/examples and, if needed, creates/recreates the corrisponding file in doc/examples-sgml escaping characters 2011-03-03 Massimo Manghi * rivet/rivet-tcl/*.tcl: all the commands in here moved into ::rivet namespace. File tclIndex recreated * doc/xml/directives.xml,doc/xml/commands.tcl: Documentation changed to reflect the new scoping of the command set. Commands in rivet-tcl/ not yet documented have been briefly explained with some examples. * src/apache-2/mod_rivet.[c|h],src/apache-2/rivetCore.c: changes in trunk merged into the rivet-namespace branch 2011-03-01 Massimo Manghi * src/apache-2/rivetCode.c: 'abort_code' command is now created through the RIVET_CMD_OBJ macro 2011-02-18 Massimo Manghi * src/rivet.h,src/apache-2/rivetCore.c,src/rivetPkgInit.c: Core commands namespace is now '::rivet' and the package provided by the core module is "::rivet". Also package RivetLib was renamed as 'rivetlib'. 2011-02-14 Karl Lehenbauer * src/apache-2/mod_rivet.c: Only create root interpreter once, not twice. In Rivet_CopyConfig cache_size and cache_free were getting copied twice. Only once now. * src/apache-2/rivetCore.c: Remove unused command var from Rivet_Upload. Remove unneeded loglevel var from Rivet_LogErrorCmd. 2011-02-14 Massimo Manghi * src/apache-2/mod_rivet.[h|c],src/apache-2/rivetCore.c: Removed loading of RivetLib by default. Getting RivetLib into the module keeps Apache to segfault in other calls. In order to gain access to commands provided by RivetLib (formerly called Rivet) a 'package require RivetLib' must be in a Rivet script or in one of the initialization script (e.g. ServerInitScript ChildInitScript or GlobalInitScript). Notice: RivetLib exports the commands to the '::Rivet' namespace. * src/rivetCrypt.c, src/rivetWWW.c, src/rivetList.c: they now export their commands to the '::Rivet' 2011-02-11 Massimo Manghi * src/apache-2/mod_rivet.[c|h]: new conf scripts rivet_abort_script and rivet_force_script. rivet_abort_script is run when an abort_page command is called in the page content generation * src/apache-2/rivetCode.c: add new command abort_code that returns the code passed to abort_page 2011-02-08 Massimo Manghi * src/apache-2/rivetCore.c: call to Rivet_InitWWW to include into Rivet's core the commands provided in src/rivetWWW.c * src/apache-2/mod_rivet.c: the inclusion into the module of RivetLib through Tcl_PkgRequire proved to cause segfaults in Rivet_ServerConf. The commands in rivetWWW.c are temporarily loaded by rivetCore.c * src/apache-2/Makefile.am: build of mod_rivet.so includes also code from src/libWWW.o 2011-02-07 Massimo Manghi * branches/rivet-namespace: new branch to experiment with the Rivet namespace and Rivet package * src/rivetPkgInit.c: Provides RivetLib package now when loaded by mod_rivet. Commands are now in the ::Rivet namespace * src/rivet.h: new macro RIVET_OBJ_CMD creates a command in the ::Rivet namespace and puts the command object on the namespace export list * src/apache-2/mod_rivet.h: the globals structure now holds a pointer to the Tcl_Namespace object representing ::Rivet namespace * src/apache-2/rivetCore.c: commands are now created with the RIVET_OBJ_CMD macro * rivet/init.tcl: provides package RivetTcl 2.1. This makes possible to consistently peek the init.tcl associated to the module. Command 'incr0' is now aliased by Tcl standard 'incr' * rivet/apache-2/mod_rivet.c: Rivet_PerInterpInit loads package RivetTcl 2.1 and package RivetLib 1.2. the latter ships the commands in rivetWWW.c rivetCrypt.c and rivetList.c * rivet/rivet-tcl/tclIndex: Command 'incr0' removed (see init.tcl) 2011-01-31 Massimo Manghi * configure.ac: default value for directive SeparateVirtualInterps changed to 'yes'. * VERSION: version number set as 2.1.0r1 ('r' is for 'revision') * doc/xml/directives.xml: New directive ServerInitScript is documented. 2011-01-23 Massimo Manghi * src/apache-2/mod_rivet.[c|h]: Created new ServerInitScript configuration directive: it assigns rivet_server_init_script with a script run in Rivet_InitHandler after configuration has been built and before server children are forked. A master interpreter is created in Rivet_InitHandler. Children interpreters should hopefully be pure clones of this interpreter created by 'fork' 2011-01-09 Massimo Manghi * configure.ac: fixed AC_DEFINE_UNQUOTED macro call for definition of proprocessor symbol RIVET_MAX_POST, an integer valued symbol which was put in quotation marks. File indentation was fixed and tabs replaced with spaces 2010-12-03 Massimo Manghi * configure.ac: new macros to set default values of configuration parameters. * src/apache-2/mod_rivet.c,mod_rivet.h: Default values are set in rivet_config.h through autotools. The Tcl Rivet environment is now loaded from mod_rivet by calling Tcl_PackageRequire("RivetTcl","1.1"); after auto_path is properly set. Configuration scripts are now stored in Tcl_Obj objects * doc/xml/install.xml: Add documentation for new 'configure' switch. * rivet/init.tcl: the path to RIVETLIB_DESTDIR is added to auto_path in mod_rivet. 2010-12-02 Massimo Manghi * debian/libapache2-mod-rivet.*,debian/changelog: removed redundant lines from postist script (Debian package) * rivet/rivet-tcl/cookie.tcl: add command "cookie unset" * contrib/form.tcl,contrib/README: add a form.tcl based on TclOO. New README explanatory file * doc/xml/commands.xml: new command "cookie unset" explained 2010-10-27 Massimo Manghi * branches/2_0: changes done in branches 2_0 reintegrated into trunk. This implied the following changes in trunk * debian/[clean,docs,*.substvars,dirs,files,install]: not needed, hence removed from repository * debian/[changelog,copyright,rules]: files changed to produce a clean package out of the source tree * VERSION,configure.ac: version number bumped up to 2.0.2 * doc/rivet-chunk.xsl: obsolete and misplaced copyright statement removed 2010-10-20 Massimo Manghi * debian/[clean,install,docs,dirs]: removed because not needed or redundant * debian/copyright: completed to include also the Tcl license. Added copyright notes for stuff in win/ 2010-10-19 Massimo Manghi * debian/control,debian/Makefile.am: Minor adjustments to debian/control to fulfill Debian policy * debian/libapache2-mod-rivet-doc.docs: the 'contrib' directory is installed now in this package. * src/apache-2/rivetCore.c: In Rivet_ApacheTable the variable table is initialized to NULL to silence a compilation warning * doc/Makefile.am: the 'distclean' target must remove the Makefile * Makefile.am: rivet_config.h removal added to 'distclean-local' 2010-10-18 Massimo Manghi * rivet/packages/tclrivet/parse.tcl: add svn:executable property as suggested by the debian consistency scripts * debian/*: more changes to remove unnecessary files from the binary packages of Debian 2010-10-14 Massimo Manghi * debian/: more adjustments in the way of getting a working setup for Debian. Some information was moved to make it 'package specific'. More tweaking on debian/control and /debian/changelog 2010-10-13 Massimo Manghi * src/buildscripts: trying to keep the source tree as tidy as possible. src/buildscripts/* are removed because they were\ then initial and later abandoned Rivet build scripts * branches/2_0/src/buildscripts: removed also from the branch development * branches/2_0/debian/*: merging the debian scripts largely rewritten in trunk. Added control files to build 2 packages for debian (binary module and docs) 2010-10-11 Massimo Manghi * tclconfig/config.sub,tclconfig/config.guess: Debian package build system signalled that these 2 files were too old and suggested to update them with newer versions shipped by automake-1.11 * debian/*: various stuff was changed trying to shape scripts to make debian packages as uneventful as possible * doc/Makefile.am: The 'clean' target in doc/Makefile was renamed as 'distclean'. HTML files are deleted only when a deep cleaning is required. 2010-10-07 Massimo Manghi * debian/*: various changes that fix some consistency faults in the debian packages 2010-10-06 Massimo Manghi * debian/*: most files in this directory have been modified to comply with the latest version of debian packaging system. Some files were deleted because superseded by others which have been added to produce 2 separate packages: one for the module and the Tcl library, the other for the html manual. 2010-09-20 Massimo Manghi * debian/*: changing some info in files needed by the debian 2010-09-18 Massimo Manghi * debian/*: files modified and added in the process to build a debian package * doc/Makefile.am: comments added. Better target handling 2010-09-15 Massimo Manghi * debian/README.Debian, debian/rivet.load: add files needed to build a Debian package * debian/rules, debian/changelog, debian/control: experimental versions of files needed by .deb packages 2010-09-14 Massimo Manghi * doc/html/*: directory removed from repository * doc/Makefile.am: New targets for creating the doc/html/ directory and copying new or modified graphic files from doc/images to doc/html/images 2010-08-30 Massimo Manghi * doc/images: Graphics displayed in the manual is copied in this directory. This is a first step in the transition to a manual generation procedure that should achieve a cleaner repository structure 2010-08-26 Massimo Manghi * configure.ac: removed AC_DEFINE(BUILD_rivet....) as the tcl.m4 providing TEA 3.9 makes redundant this definition. Argument to TEA_INIT changed accordingly * tclconfig/tcl.m4: overwritten by the new tcl.m4 and made a couple of adjustments that make it autoreconf/autoheader friendly. 2010-07-20 Massimo Manghi * doc/examples/rivet_web_service.tcl,doc/html/*.html: Improved example of Ajax servlet. Manual changed accordingly. 2010-07-18 Massimo Manghi * src/apache-2/mod_rivet.c: static void ap_chdir_file renamed as static int Rivet_chdir_file. Rivet_chdir_file returns the value returned by chdir. This value is checked and in case of error the request aborts with an HTTP_INTERNAL_ERROR and a message is printed in the log file. * VERSION,configure.ac: version number changes as 2.0.1 (temporarily) 2010-07-13 Massimo Manghi * doc/rivet.xml,doc/html/*.html: Latest minor changes before releasing * VERSION,configure.ac: Release number changed as 2.0.1 2010-07-12 Massimo Manghi * branches/2_0: Merge of trunk changes into the 2_0 branch. 2010-07-12 Massimo Manghi * rivet/packages/calendar/calendar.tcl: new comments added. Fixed misspelled -errorinfo option in a return statement. * rivet/packages/session/session-create.sql: columns 'key' and 'package' are renamed as 'key_" and 'package_'. * rivet/packages/dio/dio_Postgresql.tcl: fixed typo in variable name * doc/xml/calendar.xml: More correction made on calendar.xml * doc/html/*.html: The whole manual has been rebuilt with the latest changes 2010-07-07 Massimo Manghi * INSTALL: improved installation instructions before merging trunk into branches/2_0 2010-07-03 Massimo Manghi * rivet/package/calendar/calendar.tcl: Add check on tcl version. If Tcl8.4 is being used we also need 'dict' backport as Calendar uses a dictionary to store some internal data. * doc/xml/calendar.xml: Wrong header corrected. Added explicit note about the requirements of the package 2010-07-03 Massimo Manghi * rivet/packages/calendar/calendar.tcl: Fixed indentation in weekdays row * doc/html/: Manual pages regenerated to include latest changes in section about package Calendar 2010-07-02 Massimo Manghi * rivet/packages/calendar/calendar.tcl: Add experimental package Calendar 2010-07-02 Massimo Manghi * doc/html/calendar.html, doc/html/xml_calendar.html: Add html manual pages for Calendar * doc/xml/calendar.xml: more changes to calendar.xml 2010-07-02 Massimo Manghi * doc/xml/calendar.xml: Add manual page for package Calendar (package still to be added to repository) * doc/xml/form.xml: Page for package 'form' written with a more structured docbook organization that allows finer styling of a manual page. * doc/rivet.xsl: Add xsl configurations for elements refsect1,refsect2 and refsect3 * configure.ac: Add message when building for Apache 1.x 2010-07-01 Massimo Manghi * doc/xml/Makefile.am: removed target 'html/rivet.html" from 'docs' depends. The no-chunks version of the manual can be build running 'make docs-nochunk' 2010-06-30 Massimo Manghi * doc/xml/form.xml: Add 'checkbox' subcommand documentation * doc/html/*.html: Updated manual pages 2010-06-30 Massimo Manghi * rivet/packages/form/form.tcl: fixed various methods in package form: 'field' method must treat checkboxes and radiobuttons alike, so that labels are printed next to the button. 'radiobuttons' specialized method should not propagate the '-labels' switch to the attributes of the tag. * doc/rivet.xml: add new documentation in file doc/xml/form.xml * doc/xml/form.xml: add to repository * doc/html/form.html,doc/html/form_package.html: add to repository * doc/html/*.html: new manual pages including the form package 2010-06-22 Massimo Manghi * Makefile.am: Rivet install target deletes every pkgIndex.tcl file that might have been left around in the Rivet directory tree, before calling pkg_mkIndex.tcl to regenerate the library index file in the root directory. * rivet/packages/tclrivet/parse.tcl,rivet/packages/commserver/server.tcl: add existence test on argv variable that wept during the installation process. If not set exits silently (variable is required for a sensible use of the procedures) * rivet/packages/tclrivet/tclrivet.tcl: wrong path to librivetparser.[so|dll] corrected 2010-06-19 Massimo Manghi * src/apache-2/mod_rivet.c: filled SERVER_CONF variable in the 'server' array with value generated by the build system of the directory holding the conf files. This fulfills a TODO comment in the code. The array server is undocumented and is not clear if it was added for the benefit of the programmer or for debugging of the module. * src/apache-2/mod_rivet.h: structure definitions beautified and aligned. 2010-05-14 Massimo Manghi * BUGS,INSTALL,Changelog: small improvements in the documentation 2010-05-14 Massimo Manghi * tclconfig/install-sh: the install-sh script is replaced with the same script shipped with automake-1.11 2010-05-13 Massimo Manghi * src/apache-1/TclWebapache.c: call to ap_send_http_headers centralized in TclWeb_SendHeaders * src/apache-2/TclWebapache.c: bugfix for string assigned to the content_type field that has to be duplicated to preserve from memory deallocation by Tcl, includes to modules from apache APR library added, call to ap_send_http_headers centralized in TclWeb_SendHeaders 2010-04-29 Massimo Manghi * src/apache-2/apache_multipart_buffer.c: Add include to silence a compilation warning. * src/apache-2/apache_multipart_buffer.h: set svn property to enable $Id: keyword expansion * doc/xml/session.xml: Commented line about a 'CookieDomain' command of Session that appears to be non coded yet. To be added to the TODO file. 2010-04-29 Massimo Manghi * configure.ac,VERSION: Pre-branching operations: AC_INIT now uses 2.0.0 as version number to be used across the build system. Also the file VERSION has been updated to reflect the release number. 2010-04-27 Massimo Manghi * src/apache-1/TclWebapache.c,src/apache-1/rivetCore.c,src/apache-1/mod_rivet.c, src/apache-1/apache_request.c,src/apache-1/apache_multipart_buffer.c: changes and additions made for apache 2 added to the code for apache 1.x 2010-04-22 Massimo Manghi * rivet/init.tcl: add to auto_path the directory where init.tcl is located, as this is also the directory for package Rivet 2010-04-19 Massimo Manghi * tests/upload.[rvt|test]: fix upload message sent to server. The end boundary went undetected and Rivet added it to the uploaded file. Thus the problem affected only the test, not the module. Added delimiter to the returned message to allow easy spotting of an empty string. 2009-12-08 Karl Lehenbauer * rivet/packages/form/form.tcl, form.txt: Add new form methods for HTML 5 form elements "color", "date", "datetime", "datetime_local", "email", "file", "image", "month", "number", "range", "search", "tel", "time", "url", "week" 2009-11-03 Massimo Manghi * src/apache-2/rivetCore.c: in function Rivet_Upload the list of subcommands had 2 entries for 'tempname" leading Tcl_GetIndexfromObject to mismatch the entry for the 'names' subcommand with its numerical counterpart. This caused the child process to segfault when processing a 'upload names' command. 2009-11-02 Massimo Manghi * tests/apachetest/apachetest.tcl: apachetest::getallincludes failed to properly handle glob style file patterns. 2009-09-17 Karl Lehenbauer * rivet/packages/form/form.tcl, form.txt: Add a new form method, "button", that's just like "submit" except pressing enter doesn't cause it to be invoked. Add quick doc, form.txt, on the forms package. Terminate in form selectors. 2009-09-15 Karl Lehenbauer * rivet/packages/form/form.tcl: If the array containing default values for the form is passed in when the form is created (for instance: form myform -defaults response -method post), make sure form classes public variable "defaults" is set to that array name. 2009-09-03 Karl Lehenbauer * src/apache-2/rivetCore.c: Add new command, apache_log_error, which allows consistent logging to the Apache error log file. 2009-06-24 Karl Lehenbauer * acinclude.m4: Include m4/ax_prefix_config_h.m4 to define the AX_PREFIX_CONFIG_H macro. * tclconfig/libtool.m4, tclconfig/config.guess, tclconfig/config.sub, tclconfig/ltmain.sh: Freshened these files with the latest versions from libtool. * configure.ac, tclconfig/tcl.m4, tclconfig/ChangeLog, tclconfig/README.txt, tclconfig/install-sh: Updated to Tcl Extension Architecture (TEA) 3.7. 2009-05-05 Karl Lehenbauer * src/apache-2/mod_rivet.c: When Rivet is shutting down and per-vhost separate virtual interpreters were in use, the shutdown code deleted the master interpreter and all of the slave interpreters using Tcl_DepeteInterp(). This was an error as it should only delete the mater interpreter, as deleting the master interpreter causes its slaves to be deleted. It now does this. (Had it checked using Tcl_InterpDeleted to see if the interpreter was already marked as deleted, it probably would have been OK.) * src/rivetChannel.c - update Tcl channel handler to channel version 4. 2009-05-05 Karl Lehenbauer * Add new Rivet Tcl command,apache_table, which can query, get and set values in the Apache "notes", "headers_in", "headers_out", "err_headers_out" and "subprocess_env" tables. * Add new "upload" option "tempname" that'll return the name of the temporary file containing the upload. * When instantiating separate virtual interpreters, postpend an interpreter count to the self-created slave interpreter name, to keep Tcl_CreateSlave from failing if two or more virtual hosts have the same ServerName and don't have a port defined in the ServerName directive. * Detect and report failure of Tcl_CreateSlave rather than assuming it succeeded and dereferencing a null pointer when it didn't. Also added asserts to detect null interpreter pointer. * Slightly improved error messages when a child init or exit function fails. 2009-05-01 Karl Lehenbauer * Rename global request rec pointer from globalrr to rivet_panic_request_rec, add rivet_panic_pool and rivet_panic_server_rec, grabbing those values from Rivet initialization rather than request handling so that they are initialized enough that Rivet_Panic can use them. (Previously Rivet_Panic or Tcl_Panic at initialization time caused a null-pointer-dereference segmentation violation because no request was being served. In Rivet_Panic, avoid emitting the unparsed URI unless a request is being processed. 2009-04-27 Karl Lehenbauer * src/apache-2/mod_rivet.c: In Rivet_SendContent, when checking to see if the file doesn't exist, check r->finfo.filetype rather than r->finfo.protection. (The prior check failed to detect that the Rivet source file did not exist, causing zero length webpages to be sent rather than 404's.) 2009-01-16 Massimo Manghi * Makefile.am: Add DESTLIB variable handling as suggested by kikusz@gmail.com and accordingly with Automake directives for local install rules. 2008-12-21 Massimo Manghi * src/apache-2/rivetCode.c: add handling for subcommand 'tempname' 2008-12-15 Massimo Manghi * src/apache-2/TclWebapache.c: fixed test on configuaration flag 'upload_files_to_var' 2008-12-11 Massimo Manghi * src/apache-2/mod_rivet.c: fixed call to apr_strcat in function Rivet_ExecuteAndCheck (the corresponding call in the apache-1 code has been checked and appears to be correct). * doc/xml/internals.xml: Removed broken external link pointing to a no more existing gdb tutorial. 2008-12-03 Massimo Manghi * doc/rivet.xml: document timestamp is generated with the EXSLT datetime() function controlled through the element. The timestamp now reflects the actual time when the xsl processor is run, instead of time when the svn commit is carried out. * doc/rivet.xsl: customization added to make a list of examples appear at the end of the table of contents. * doc/html/*.html: manual pages rebuilt and committed to repository 2008-11-21 Massimo Manghi * doc/rivet.xml: file broken up into chunks containing the toplevel sections of the manual. For every file an xml entity was created. * doc/xml/*.xml: added xml files containing every toplevel section of the manual. * doc/Makefile.am: added dependency from xml/*.xml for html pages generation 2008-11-17 Karl Lehenbauer * src/apache-2/TclWebapache.c: Make TclWeb_UploadChannel open the uploaded file and make the file handle available through standard Tcl mechanisms, removing OS depdendencies. Make TclWeb_UploadData access the uploaded file through standard Tcl mechanisms, making the uploaded data available and also removing OS dependencies. Add TclWeb_UploadTempname to get the name of the temp file the uploaded file was saved to. Include apr_strings.h to remove compiler warning of implicit definitions of apr_pstrdup and apr_psprintf as well as multiple warnings about casts to pointer from integer of different size. Force rsc->upload_files_to_var to be set, temporarily, pending figuring out why the configuration directive to set that is not working. * src/apache-2/rivetCore.c: Check return from Tcl_GetIndexFromObj call in "upload" command processing (Rivet_Upload command). Return an error when the subcommand (channel, save, data, exists, size, type, filename, tempname, or names) is invalid. Add "tempname" option to "upload" command. "upload tempname" will return the name of the temporary file a file uploaded via a POST command was saved to. * src/apache-2/mod_rivet.c: Change "char *" arguments to Rivet_ServerConf, Rivet_DirConf and Rivet_UserConf to be "const char *" to bring them in line with what Apache expects, fixing compiler warnings warnings about "assignment discards qualifiers from pointer target type". Use a "void *" argument where expected in calls to AP_INIT_TAKE2 for Rivet_DirConf and Rivet_UserConf and do an assigment to the Rivet-desired types of rivet_server_conf to eliminate "initialization from incompatible pointer type" compiler warnings. Make Rivet_SetScript's script and string arguments be const char * instead of char *. * src/apache-2/apache_request.c: Change "char *error[1024]" to "char error[1024]" to fix "incompatible pointer type" error in the call to apr_strerror. * src/apache-2/apache_request.h - make temp_dir be a const char * instead of a char *. * src/apache-2/apache_multipart_buffer.c: Add include of apr_strings.h to remove compiler warning of implicit definitions of apr_pstrcat and warnings about casts to pointer from integer of different size (which occurred on 64-bit machines, anyway.) * doc/rivet.xml: added the "tempname" option to "upload". 2008-11-13 Massimo Manghi * src/apache-2/rivetCore.c: In function 'Rivet_Parse' the call to Tcl_FSStat was turned into the corresponding apr function 'apr_stat'. This change was motivated by a possibile mismatch between Rivet's allocation of the structure 'Tcl_StatBuf' and the handling of the structure done within the Tcl C library. This seems to have healed a pointer corruption that caused segfaults when the 'parse' command was executed. 2008-10-07 Massimo Manghi * src/apache-2/apache_multipart_buffer.c, src/apache-2/rivetCore.c, src/apache-2/TclWebapache.c,src/rivetChannel.c,src/rivetCrypt.c: Inclusion of config.h changed to reflect renaming of config.h. * configure.ac: new AX_PREFIX_CONFIG_H added to 'configure' generation. Added switch --enable-display-version for having Rivet's version printed in Apache signature * m4/ax_prefix_config_h: added macro for renaming config.h into rivet_config.h (or whatever we deem a good name for this file). Preprocessor symbols in this file are also prefixed with RIVET_ * Makefile.am: added handling of the macros in the 'm4' directory. * src/apache-2/mod_rivet.h: removed definition of preprocessor symbol for hiding version number in apache logs (feature now controlled in 'configure') * src/apache-2/mod_rivet.c: Changed preprocessor symbols that are now prefixed by 'RIVET_'. Moved misplaced #ifdef APACHE2 test. Maybe this test is useless as we certainly are building against APACHE2 when compiling this file 2008-09-06 Massimo Manghi * INSTALL: instructions for builing Rivet expanded with examples taken from real builds for Debian and Slackware. * src/apache-2/apache_request.[c|h]: removed TODO comments concerning ap_hard_timeout and ap_kill_timeout as these functions doesn't not exist anymore in the apache 2.x api. Added the Content-type as a new argumento to ApacheRequest_parse_multipart for parts boundary determination. The correctness of the content type has to be done before calling in order to do the check only once. Commented declarations of variables not used. The 'tempname' string is allocated now from the apache pool. Changed template for temporary file name generation. If apr_file_mktemp fails a more descriptive error is logged. * src/apache-2/apache_multipart_buffer.[c|h]: removed line in multipart_buffer_read that lead the buffer pointer to fail following the parsing process. Input buffer size changed to a larger and more common size of 8192 bytes 2008-08-30 Massimo Manghi * doc/rivet.[xml|xsl], doc/html/*.html: changed a couple of rule in rivet.xsl: they basically make example boxes a bit more flexible for html browsing and made their background color a bit more "neutral". I also made the character in them slighly smaller in order to have more space for code lines. 2008-08-28 Massimo Manghi * src/apache-2/mod_rivet.c: using the 'parse' command twice within the innermost nested level would trick rivet into treating the second template as a Tcl script. Condition on the flag 'toplevel' has been reintroduced in the on the file type (Rivet_ParseExecFile), but the whole mechanism has to be revised. Adopting a reverse logic in this test should achive the same result in more linear way if (Rivet_CheckType(req->req) == TCL_FILE) { ---> Tcl script } else { ---> Rivet template } 2008-07-03 Massimo Manghi * src/apache-1/mod_rivet.[c|h]: done modifications needed to replicate for the apache 1 code the functionalities added to the apache 2 module 2008-07-01 Massimo Manghi * src/rivet.h: added macro STRNEQU(s1,s2) which efficiently compares 2 strings. Unlike STREQU(s1,s2) this new macro compares at most strlen(s2) characters. * src/TclWeb.h: added charset field to TclWebRequest. This new property gets initialized to NULL every time this structure is instantiated. If used it stores a pointer to a string that specifies a header value fragment for the page being generated. * src/apache-2/TclWebapache.c: request_rec is treated as an opaque structure and the field 'content_type' is set by calling the ap_set_content_type apache core function * src/apache-2/mod_rivet.h: a 'honor_header_only_reqs' is added to the rivet_server_conf for handling of the HonorHeaderOnlyRequests configuration option * src/apache-2/mod_rivet.c: Every content_type is checked for possible charset specifications. When found this is stored in the TclWebRequest structure to be processed later. If a script or template doesn't set a content type on its own (with the 'headers type ' command) the charset is written in the http headers. Added support for the 'HonorHeaderOnlyRequests' switch. Other minor changes include better code formatting in some functions and commenting out some cruft left around. 2008-01-08 Massimo Manghi * rivet/packages/dio/dio.tcl: auto_path shouldn't be set or modified outsite init.tcl * rivet/init.tcl: We want the Tcl code specific to an installation to take precedence over other Tcl packages or other versions of the same stuff. Therefore I put the references to the rivetlib directory in the first positions in auto_path. 2008-01-07 Massimo Manghi * src/apache-2/TclWebapache.c: Fixed timestamp printed in the DATE_LOCAL and DATE_GMT fields of the environment table. * src/apache-2/mod_rivet.h: Fixed definitions for RIVET_INIT and RIVET_DIR. I couldn't fix SERVER_CONF though 2008-01-06 Massimo Manghi * Makefile.am: target 'uninstall-local' added. Stuff in RIVETLIB_DESTDIR gets removed upon deinstallation * rivet/packages/dio/dio_Mysql.tcl: small fixes for 2 methods. In method 'open' the switch '-host' was not handled. In method 'exec' the handling of 'select' queries has been changed because the previous method failed in certain circumstances (queries build with lists) * src/apache-[1|2]/mod_rivet.c: Status returned by Tcl_EvalFile is now checked explicitly against TCL_ERROR * doc/html/*.en.html: Html pages regenerated after changes in rivet.xml * src/rivetCore.c: Moved into src/apache-1. This file was compiled by src/apache-1/Makefile.am, whereas src/apache-2 had its own rivetCore.c module. * src/apache-1/Makefile.am: Changed to reflect rivetCore's new location. rivetWWW.c removed from module's compilation: stuff in it has to be loaded into the interpreter with 'package require Rivet' * src/apache-2/Makefile.am: Reordered list of files to allow better comparison with apache-1 build. 2008-01-05 Massimo Manghi * src/apache-[1|2]/mod_rivet.c: Added comments as per David Welton's suggestion. 2007-12-03 Valery Masiutsin * tests/apachetest/: multiple changes has been made to tests to get them working with apache2 * src/apache-2/mod_rivet.c, src/apache-2/apache_multipart_buffer.c: fixes for issues that has been discovered with tests, mostly there were problems with multipart buffer parsing during POST * configure.ac: minor issue with apache includes handling has been fixed 2007-11-18 Massimo Manghi * doc/rivet.xml: note added to description of commands listed in the 'Rivet' package. 2007-11-05 Massimo Manghi * configure.ac: the macro rivet_target_dir was added to 'configure'. This macro generates a name for the directory where Rivet libraries must be copied during the installation phase. User is enabled to change the default value by feeding 'configure' with the switch '--with-rivet-target-dir'. This macro defines also the variable RIVET_TCL_TARGET and calls AC_SUBST on it. The target directory gets inserted also in the auto_path list variable of every script run by the module. Defined configuration symbol RIVETLIB_DESTDIR in config.h. * Makefile.am,src/Makefile.am: RIVET_TCL_TARGET variable propagation. * src/apache-1/Makefile.am: rivetWWW.c removed from linking into mod_rivet.so (this requires docs to be updated, as commands in this file have to be loaded explicitly using 'package require Rivet') * src/apache-1/mod_rivet.c: Tcl_DeleteInterp called upon child exit. ${RIVETLIB_DESTDIR)/init.tcl is run during the interpreter initialization. * src/apache-2/mod_rivet.c: Exit handler reenabled, and Tcl_DeleteInterp called upon child exit. ${RIVETLIB_DESTDIR)/init.tcl is run during the interpreter initialization. Code clean up in Rivet_GetConf. Minor changes in order to get rid of some compilation warnings. * src/apache-2/TclWebapache.c: Test checking for null values in the table of environment variables has been extended to the value field. Failure to do so caused a child to segfault when rivet was used in conjuction with dir_module 2007-10-19 Massimo Manghi * src/apache-2/mod_rivet.c: Included a more correct statement in aknowledgement of mod_ruby (BSD license) for the code in ap_chdir_file. * ChangeLog: the whole batch of patches described in the previous entry (2007-10-17), came from Valery Masiutsin . I forgot to mention it in this document. My fault. 2007-10-17 Massimo Manghi * configure.ac: added APACHE2 define to config.h, added also a message when the apxs program is found. * doc/Makefile.am: 'clean' target fixed * src/apache-2/Makefile.am: added -I"." to the INCLUDE symbol * src/apache-2/mod_rivet.c: Changed function that determines if this is a request rivet must serve. We now correctly rely on the module configuration and on the headers handed on to us by apache. Added also a ap_chdir_file implementation. This function was dropped by the apache developers: we are reintroducing it using a code snippet inspired by mod_ruby. * src/apache-2/apache_request.h: Changed prototype of ApacheRequest_tmpfile function to return apr_file_t instead of FILE, also modified ApacheUpload structure * src/apache-2/apache_request.c: ApacheRequest_tmpfile rewritten using calls to apr_* functions * src/apache-2/TclWebapache_c: TclWeb_UploadSave in a more robust way using apr_* calls 2007-10-14 Massimo Manghi * doc/rivet.xml: Front page updated, page for the 'load_response' command updated and extended, link to the Italian and Russian translations removed, html pages in Italian and Russian removed from repository * rivet/rivet-tcl: new 'load_response.tcl'. This version deals in a more consistent way with the case of parameters that receive multiple values (see docs) 2007-10-12 David N. Welton * doc/rivet.xml: Fixed "dio" id's. 2007-10-11 David N. Welton * doc/rivet.xml: Added missing ID's. * doc/Makefile.am (docs): Removed Russian and Italian translations from the build. * doc/norefchunk.xsl, doc/refentry.xsl: Ditch fancy-pants XSLT stuff. 2007-09-19 Massimo Manghi * configure.ac: TEA_INIT argument was changed to 3.6 to match the new TEA version in the tcl.m4. Macro for --with-apache was simplified. Macro for --with-apxs changed in order to check for possible multiple version of apxs installed. Defined compilation parameters generated by apxs. Same for apr-1-config that returns compilation parameters for apr. * Makefile.am src/Makefile.am src/apache-[12]/Makefile.am: changed to handle new symbols and parameters * src/apache-1/mod_rivet.[hc] rivet version logging enabled: I enabled this to check if I was loading the expected module but maybe can be used to generate, at least for the code in trunk, more refined version numbers to be used in the development cycle. * src/rivetCore.c: added call to initialize commands in rivetWWW. 2007-09-09 David N. Welton * src/apache-2/Makefile.am: Another patch from Valery Masiutsin : Propagated variables from configure.ac, did some cleanups. * src/apache-1/Makefile.am: More of Valery's patch: Propogate variables from configure.ac. * configure.ac: More of Valery's patch: Separated cases for apache-1 and apache-2 in APACHE function. Added handling for apache-2 for platforms i am developing on. Probably it will need to be unified later. Touched CHECK_APXS a bit. Replaced APR_INCLUDES function with APR_HANDLING, now we are requiring full path for apr-1-config and getting cppflags and includes from it. APR tool has platform specific set of cppflags, just includes is not enough. Added GET_RIVET_BASE function, which allows us to get rid of relative pathes in include flags. Rearranged functions a bit - mostly to find out version of apache we are building for, before doing any substitutions. * src/Makefile.am: More of Valery's patch: Propagated variables introduced in configure.ac. * src/apache-2/mod_rivet.c (Rivet_TranslateUri): More of Valery's patch: Changed a bit Rivet_ParseFileArgString a bit, it fixed segfaults, but still needs some work. I've added apr_pool_t pointer to parameters we are passing to function. 2007-08-29 David N. Welton * src/apache-1/Makefile.am: Another patch from Valery correcting a mistaken application of his patches on my part. 2007-08-27 David N. Welton * configure.ac: Added missing quote. * configure.ac: Another patch from Valery, making compilation smoother on Debian. * src/apache-1/Makefile.am: Accepted patch from Valery for improved compilation. * src/apache-1/apache_multipart_buffer.c: Accepted patch from Valery to make this file compile. * tclconfig/tcl.m4: Moved to latest tcl.m4 at Valery's suggestion. 2007-08-22 David N. Welton * configure.ac: Added patch from Valery Masiutsin improving the configure setup. 2006-07-03 Karl Lehenbauer * rivet/packages/dio/dio_Postgresql.tcl: when handling a PostgreSQL result, if numrows is zero, see if cmdTuples (Pg_result $resultHandle -cmdTuples) contains anything, and if it does, put that in of numrows, hiding a PostgreSQL interface quirk from DIO. 2006-06-07 David N. Welton * rivet/packages/session/session-create-mysql.sql: Minor update from Massimo Manghi for Mysql 4. * rivet/packages/session/session-class.tcl: Minor update from Massimo Manghi. 2006-05-14 David N. Welton * rivet/packages/session/, rivet/packages/dio/: Added Mysql and Oracle session creation packages. Updates to dio and session packages. Modifications to the Mysql driver. Added an Oracle driver. Thanks to Arnulf Wiedemann (arnulf@wiedemann-pri.de) and Massimo Manghi (manghi@biol.unipr.it). 2006-02-03 Karl Lehenbauer * rivet/packages/dio/[dio,diodisplay].tcl: Uncovered a serious flaw in DIO -- there is no way to update a row in a way that changes the key value. As a result, DIOdisplay punts and deletes the row then reinserts it with the new key. This is not the same thing as the delete can trigger integrity checks that fail because of constraints from other tables. Added the somewhat kludgey update_with_explicit_key method to let us specify the key rather than having the key always be dug out of the data array (so that the key in the data array can be different) and altered the row edit code in DIOdisplay to use this rather than doing the delete/insert thing. 2006-01-25 Karl Lehenbauer * rivet/packages/dio/diodisplay.tcl: When editing, made select boxes have the current value selected by default. 2006-01-14 Eckhard Lehmann * configure.ac: edited for 2 directories src/apache-1 and src/apache-2 to be the source directory for either Apache1.x or Apache2.x. Added new autoconf macros to check for apache base directory, apache/apr include directories (on debian for instance, they are in /usr/include/apache1.3 resp. /usr/include/apache2 and /usr/include/apr-0) and apache version ( --apache-version=1 or --apache-version=2). According to the macros, the sources either in src/apache-1 or src/apache-2 are compiled. * src/: put all sources for rivet for Apache1.x into a subdirectory apache-1, left the Makefile.am unchanged. Copied the files to a subdirectory apache-2 and started port of rivet to Apache2.2 with these files. * Checked in by davidw. 2005-12-12 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Reverted change to "store" method that removed fields from the store array that were part of the key and took out this behaviour from the update method. The problem was that "DIO store" or "DIO update" could cause fields to disappear from the data array as a side effect, and the caller had no reason to expect that, hence it broke some code. 2005-11-08 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Add new "update" method that works just like "store" except that it assumes you're doing an update and, unlike store, does not check to see if the row is already there or not. Also modified the "store" method, when doing an update, to not attempt to change row fields that are specified in the where clause. * doc/rivet.xml: Documented all undocumented public DIO methods, such as count, db, forall, interface, insert, makekey, quote, search and update. 2005-11-08 Pat Thoyts * win/makefile.vc: Update for new version. * win/Rivet.nsi: Update for new version. * src/apache_request.c: Cast aways some warnings. * src/rivetCore.c: Make it work with MSVC (wierd bug). * src/TclWeb.h: Declare TclWeb_GetRawPost (MSVC complains). 2005-11-03 David N. Welton * src/Makefile.am (lib_libexecdir): Install everything to rivet@VERSION@. * tests/runtests.tcl (runtests_usage): Check for utf-8 environment - this causes some problems with a number of tests. I'm not sure precisely why, but it causes a large portion of otherwise successful tests to choke. 2005-10-31 David N. Welton * doc/rivet.xml: Woops, fix spelling error: Seperate->Separate. 2005-10-01 David N. Welton * rivet/pkgIndex.tcl: Added a package index here so that when used for tests, something exists. * tests/runtests.tcl: Add local path to TCLLIBPATH, add CoreDumpDirectory so that we can get any core files generated by bad tests. * src/mod_rivet.c (Rivet_PerInterpExit): Run any per-interp child exit things that need taking care of. (Rivet_ChildExit): Walk through the list of interpreters and do any shut down work necessary prior to shutting the whole thing down. * src/rivetChannel.c (outputproc): If the AssocData is NULL, we don't try and output anything. This is probably some residual data stuck in the channel. 2005-09-29 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Fix typo in "DIO insert" method 2005-09-25 Karl Lehenbauer * src/rivetCore.c, src/mod_rivet.c, src/mod_rivet.h: Updated code comments. In particular, every function in src/mod_rivet.c now has a standard header. * rivet/rivet-tcl: README, cookie.tcl, debug.tcl, html.tcl, import_keyvalue_pairs.tcl, import_switch_args.tcl, incr0.tcl, lassign.tcl, lempty.tcl, lmatch.tcl, load_cookies.tcl, load_response.tcl, parray.tcl, random.tcl, read_file.tcl, rivet_command_document.tcl, wrap.tcl: Updated code comments and added subversion "Id" tags where they weren't present. 2005-09-23 David N. Welton * genconf.sh: Added autoheaders. * doc/Makefile.am (docs): Documentation is now its own target - this means it doesn't get run as part of 'all'. 2005-09-22 Karl Lehenbauer * rivet/packages/dio/dio.tcl: "DIO insert" method is much more efficient than "DIO store" when you know you want an insert and not an update and now actually works. * README.MacOSX: GNU autoconf/configure script does not actually work to make the Rivet module on Mac OS X so the README has been reverted to show it the old-school way using the Tcl build scripts. 2005-08-21 David N. Welton * doc/html/rivet.css: CSS tweaks for documentation. * doc/rivet.xml: Updated build directions to ./configure ; make ; make install. * src/rivetCore.c (Rivet_Upload): Fixed a line that is complained about in newer GCC's (casting lvalues). 2005-08-19 David N. Welton * src/mod_rivet.c (Rivet_InitTclStuff): Use both the hostname and the port in creating names for the slave. This fixes a bug where you have different virtual hosts running on the same server name but different ports. 2005-08-13 David N. Welton * tests/apachetest/apachetest.tcl: Make sure we get our own version of http.tcl. Tcl Feature request 928154 means that we need our own copy of http.tcl for now. * tests/runtests.tcl (runtests_usage): Print out an error message if the arguments aren't right. Fixed paths to load .so files, as the auto tools put them in a different place. * tests/apachetest/apachetest.tcl (apachetest::getbinname): Check to make sure the server is executable. * src/apache_request.c (ApacheRequest_parse_urlencoded): Patch from Arnulf Wiedemann to allow XML POST data. * src/rivetCore.c (Rivet_RawPost): Tcl command implementation to fetch raw POST data or an empty string if none is available. * src/apache_request.h: Added element to struct, and accessor function. * src/apache_request.c (ApacheRequest_parse_urlencoded): Save a pointer to the raw data. * src/TclWebapache.c (TclWeb_GetRawPost): Added a raw POST data fetcher here. 2005-08-12 David N. Welton * configure.ac: Bump the version to 0.6.0. * src/apache_request.c (ApacheRequest_parse_multipart): Added code from httpd-apreq that supposedly deals with a problem in Opera file uploads. 2005-08-01 Karl Lehenbauer * : abort_page was, for all intents and purposes, completely and utterly broken -- it forced a return from whatever called it, as if it was a "return" statement, but it didn't stop evaluating Tcl beyond that, which was broken, and it discarded output by setting an "aborted" flag in Apache which, under certain circumstances caused browsers to render blank pages, apparently related to keep-alive connections. It now works correctly by causing the interpreter to stop interpreting, and doesn't mess up keep-alive connections, etc. How it does this is it unwinds the interpreter by generating an error with the errorCode set to "RIVET ABORTPAGE". The error handling code in Rivet checks for this, and if this is received, it completes the page in the normal manner without executing the user-registered or built-in error handlers. One potential incompatibility is that abort_page's execution can now be caught with Tcl's "catch" routine, although this could also be considered a feature -- Rivet coders who use "catch" should check errorCode to see if the first element of the list is RIVET and the second is ABORTPAGE and either regenerate the abort_page, pass the error up, or handle it in some custom manner in their catch handler. 2005-07-15 David N. Welton * src/mod_rivet.c (Rivet_ServerConf): Use Tcl_GetBoolean on the *val*, not the *var*. Big difference! 2005-06-14 Karl Lehenbauer * configure.ac, src/Makefile.am, tclconfig/config.guess, config.sub, ltmain.sh: Updated with libtoolize 1.5.18 -- Rivet now builds cleanly under Mac OS X. 2005-06-06 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Delete now returns the number of records that were deleted rather than just a 1 if it deleted one or more and a 0 if it didn't. The forall method now does the forall on the result handle prior to checking for an error, in case an error occurs inside the forall. From Peter da Silva. * rivet/packages/dio/dioSQLite.tcl: SQLite implementation for DIO. From Peter da Silva. 2005-04-14 Pat Thoyts * win/Makefile.vc: Update the makefile and installer script * win/Rivet.nsi: for the 0.5.0 release. 2005-03-24 David N. Welton * Makefile.am (EXTRA_DIST): Added the doc, rivet and debian directories to the distribution. 2005-03-23 David N. Welton * doc/norefchunk.xsl: Removed chunk-first-section-with-parent and chunk-all-sections. * genconf.sh: Updated to use 1.8 autotools. 2005-03-12 David N. Welton * src/mod_rivet.c (Rivet_SendContent): Use static objects for scripts that are used for each request, in order to keep reusing them. (Rivet_PerInterpInit): Switch back to using Tcl_PkgRequire. 2005-01-08 Karl Lehenbauer * rivet/packages/dio/diodisplay.tcl: Accept arguments to the showform_prolog method that are passed through to the form's start method. This allows things like naming the form and accessing the fields from javascript by name. * rivet/packages/form/form.tcl: Allow start method to take key-value arguments that will be expressed in the
    tag. 2005-01-07 Karl Lehenbauer * /rivet/packages/dio/diodisplay.tcl: Factor showform prolog and epilog code into showform_prolog and showform_epilog methods so that when a derived DIODisplay class is overriding, for example, an Add or Edit method, the author doesn't have to dup all of showform's functionality. * rivet/packages/form/form.tcl: Commented the package. 2005-01-03 David N. Welton * doc/rivet.xml: Use 'mail-archives' instead of nagoya. 2004-12-22 David N. Welton * Makefile.am (install-data-local): Added this target to install the Tcl packages and generate a pkgIndex.tcl file. 2004-12-16 David N. Welton * src/Makefile.am (lib_libexecdir): Did some rearanging of things to get the directories in a better state. * configure.ac: Added TCL_PACKAGE_PATH. 2004-12-14 David N. Welton * doc/Makefile.am: Added html doc targets. 2004-12-08 David N. Welton * Makefile.am, configure.ac: Added the doc/ directory. 2004-12-07 Karl Lehenbauer * rivet/packages/dio/dio.tcl: "DIO delete" method now return the number of rows affected. 2004-12-03 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Cause fatal database errors such as bad syntax, etc, to raise a Tcl error in many methods that used to just return 1 or 0 (like DIO store). * configure.ac: Remove superfluous commented-out lines * Add BUGS file. Update STATUS and VERSION files. 2004-12-02 David N. Welton * Removed libtool - it appears to be under the GPL! * Removed aclocal.m4 configure Makefile.in src/Makefile.in to avoid CVS churn. * configure.ac: Commented out AC_DEFINE(USE_TCL_STUBS), as it was causing some problems for mod_rivet.so. 2004-12-02 Karl Lehenbauer * Collected some build notes in README.configure * : Clean up presentation of --with-apxs and --with-tclsh and have them show up when configure --help is run. * tclconfig/tcl.m4, configure.ac, config.h, src/*.c: Switch most autoconf-generated elements that get put on compiler command lines as -DHAVE_NET_ERRNO_H, etc, to put that stuff in config.h instead. This included altering all AC_DEFINE and AC_DEFINE_UNQUOTED macros to have three arguments, where the third argument is a description, so that autoheader can generate the config.h.in, significantly decluttering the compiler command lines. tcl.m4 changes should be fed back to the TEA project, as well as the technique for using automake to simplify the build * Move aclocal.m4 to acinclude.m4 -- we need the aclocal command to generate acinclude.m4 based on aclocal.m4 and stuff it gleans from the configure.ac script, etc. * configure.ac: A path to tclsh is automatically figured out by the TEA 3.1 build stuff. However it is also possible to override with --with-tclsh, and the configure script also makes sure there at least is a file there as well. * src/configure.ac et al: Get automake, aclocal, and autoconf to run without complaint, generating the configure script, Makefile.in files, etc. * configure.ac: Propagate the NAMEOFEXECUTABLE define via the autoconf scripts src/Makefile.am: (same) * configure: check in configure script, it's hard to make unless you have everything just right. We will probably revisit this later. * src/Makefile.in: (same) * Makefile.in: (same) * libtool: Added libtool and friends in tclconfig dir using libtoolize -- this is what figures out how to build shared libraries, etc. 2004-12-01 Karl Lehenbauer * Update autoconf build to TEA 3.1 * configure.am: Automatically locate apxs in the PATH if it hasn't been overridden by --with-apxs. Likewise automatically locate tclsh if it hasn't been overridden by --with-tclsh. * Add of README.freebsd for FreeBSD. 2004-11-17 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Fixed comments incorrectly placed outside of a switch body. 2004-11-11 Karl Lehenbauer * rivet/packages/dio/dio.tcl: Added "insert" method that doesn't try to see if it's there already all the other stuff that "store" does. * doc/rivet.xml: Documentation for above. 2004-11-05 Karl Lehenbauer * rivet/packages/session/session-class.tcl: Quote backslashes when storing so they won't be stripped by the database. Needs to be tested for MySQL and SQLlite. 2004-11-04 Karl Lehenbauer * rivet/packages/dio/*.tcl: Documented the code for DIO and DIOdisplay. 2004-11-04 David N. Welton * src/mod_rivet.c (Rivet_ServerConf): Use Tcl_GetBoolean, at Karl's suggestion. 2004-11-03 David N. Welton * src/mod_rivet.c (Rivet_ServerConf): Instead of just "on", accept "yes" and "1" as well. 2004-10-29 Karl Lehenbauer * rivet/packages/dio/dio_Mysql.tcl: The "DIO handle" method, which returns the underlying database's connection handle, now forces the database connection to be made, if it hasn't already been made, just like DIO exec. * rivet/packages/dio/dio_Postgresql.tcl: (same) 2004-09-29 David N. Welton * src/rivetCore.c (TestpanicCmd): Added command to test panics. * src/mod_rivet.c (Rivet_Panic): Added panic proc that tries to log the error to disk. 2004-09-20 David N. Welton * rivet/packages/rivet_ncgi/rivet_ncgi.tcl: Compatibility layer for tcllib's ncgi package. 2004-09-20 Karl Lehenbauer * src/mod_rivet.c (Rivet_PerInterpInit): Load the init.tcl file with an explicit path rather than using Tcl_PkgRequire. Previously, if Rivet was installed with a PREFIX/lib that wasn't already in Tcl's package search path (auto_path, probably because it was the same lib directory as Tcl used, typically /usr/local/lib), Tcl startup is unable to find the RivetTcl package, and Rivet is unable to start. 2004-09-17 Karl Lehenbauer * rivet/packages/rivet/pkgIndex.tcl: Removed. It had a hard-coded assumption about the shared library extensions (.so). This file is now generated in the target directory by the install node of make.tcl. * rivet/pkgIndex.tcl: Removed. It is generated by the make.tcl install process, as above. * src/make.tcl: The above changes, specifically the install node now generates the target rivet/pkgIndex.tcl and rivet/packages/rivet/pkgIndex.tcl file using pkg_mkIndex, causing all Tcl-defined and shared-library-defined packages to be discovered and generated into the pkgIndex.tcl. 2004-09-16 Karl Lehenbauer * src/parserPkgInit.c: Added a Rivetparser_SafeInit so the C-based standalone Rivet parser library can be loaded from safe interpreters. After inspection, we believe that rivet::parserivetdata can be loaded into safe interpreters without compromising their security. rivet::parserivet definitely cannot be made available to a safe interpreter -- it could be manipulated to read files. * src/rivetPkgInit.c: Added a Rivet_SafeInit so lib can be loaded from safe interpreters, which also makes it work better under Mac OS X. * src/rivetCrypt.c: Added function header to init routine. * src/rivetList.c: (same) * src/rivetWWW.c: (same) * README.MacOSX: Temporary file to document Mac OS X build quirks. * src/configure.tcl: If a configuration variable in tclConfig.sh ever had an equal sign in the "value" portion of the key=value pair, configure.tcl would malfunction. A missing variable caused a variable referencing that missing variable to be silently dropped. We now complain, although the right answer is probably to substitute an empty string for all missing variables. Still, this way at least gives a hint as to the problem. * src/Makefile: Add simple rules for "clean", "distclean", and "install" that simply invoke make.tcl appropriately. 2004-08-07 David N. Welton * rivet/packages/dtcl/dtcl.tcl (hgetvars): Added code from Arnulf Wiedemann to set up VARS array. 2004-08-03 Pat Thoyts * win/Rivet.nsi: Added a NSIS script. This is used with the Nullsoft scriptable installer system to create an installer for Rivet to install onto a Windows system. * win/makefile.vc: Added htmlhelp and installer targets. 2004-06-25 Pat Thoyts * src/rivetCrypt.c: Fix const-ness of resultBuffer to match apache's crypt function. * win/makefile.vc: Fixed the version string to match rivet project version. Support use of MSVC.NET or VC++Toolkit compilers. 2004-06-04 David N. Welton * contrib/two-mode-mode.el: Updated two-mode-mode. 2004-06-02 David N. Welton * src/buildscripts/aardvark.tcl: Use 'Output' instead of puts. It might be useful were we ever to do something like make an aardvark GUI. 2004-06-01 David N. Welton * Following changes by Pat Thoyts : * win/makefile.vc: Updated to deal with the START_TAG END_TAG macros. * src/rivetParser.h: Declare missing prototype. * tests/binary.rvt: The stdout channel under Windows needs to be told to use translation binary for binary data. 2004-05-18 David N. Welton * src/make.tcl: Quote Tcl argument. * doc/rivet.xml: Added clearer instructions for mailing list subscription. 2004-05-05 Karl Lehenbauer * src/rivetWWW.c: Made the escape_string command map spaces to plus signs (+) rather than %20. They're equivalent and unescape the same, but the plus signs are visually easier to take. 2004-05-05 Karl Lehenbauer * /rivet/packages/dio/diodisplay.tcl: Got "-type boolean" working. There's some problem with using a method that uses configvar to set a var as a method in a class where the class is being inherited by a subclass that redefines the variable. I had to substitute "cget -varName" style to get it to work. 2004-05-05 Karl Lehenbauer * /rivet/packages/dio/diodisplay.tcl: Added "-type select" option to DIOdisplay fields, and a new option, "-values $list" which takes a list of values to be made available with a form selector. 2004-05-05 Karl Lehenbauer * /rivet/packages/dio/diodisplay.tcl: When adding a new record, if they've typed anything into the "is" field, set the default value of the field specified in the "where" part to match. 2004-05-05 Karl Lehenbauer * doc/rivet.xml: Documented the escape_string, unescape_string, escape_sgml_chars, and escape_shell_command functions. 2004-05-04 Karl Lehenbauer * rivet/packages/dio/diodisplay.tcl: Added enhancements from Peter da Silva (peter@taronga.com): Add support for hidden variables. (This is so that you can have state variables that are maintained by the function outside of DIOdisplay, retained as you jump through DIOdisplay.) Added DIORowHeader to the style sheet. Turned the search table into a navigation bar. Added a filter method that allows you to edit the display of fields on the fly, for example, you have a time in integer seconds since 1970 and you can add a filter that does a "clock format" using -filter, or, for example, it can look up an IP address from a table. * rivet/packages/dio/dio.tcl: Added enhancements from Peter da Silva (peter@taronga.com): New "forall" method will apply a result across a code body for each record returned in the result and then delete the result handle, all in one fell swoop. 2004-04-24 David N. Welton * src/buildscripts/aardvark.tcl (aardvark::runbuildcommand): If the node doesn't exist, always "rebuild" it. * src/make.tcl: Make sure make install message is only printed when the correct target is called. 2004-04-21 David N. Welton * rivet/packages/dio/pkgIndex.tcl: Add sqlite interface. * rivet/packages/dio/dio_Sqlite.tcl: Added incomplete sqlite interface to DIO. 2004-04-14 David N. Welton * rivet/packages/dio/dio.tcl: Removed mysql and postgres specific code from main DIO package, which now loads the subclass package automatically. * rivet/packages/dio/dio_Mysql.tcl: Added new package to remove separate mysql DIO interface. * rivet/packages/dio/dio_Postgresql.tcl: Added new package to separate postgres DIO interface. 2004-04-12 Andy Doerr * rivet/packages/dio/diodisplay.tcl: - Modified searchBy form field to use the -labels and -values parallel lists in form.tcl class method (select). - Modified Search proc to not use FieldTextMap as the search now does not need to look up the db field name. 2004-04-05 David N. Welton * tests/docroot1/ tests/docroot2/: Files used to test virtual hosts with. * tests/virtualhost.test: New file: tests for virtual hosts. * tests/apachetest/apachetest.tcl: Require our own version of http.tcl, due to Tcl feature request #928154 (it's impossible to set the Host header). (apachetest::start): We now take 3 arguments. The new one is 'conftext', which is used to write to the test.conf file before running the test. * tests/runtests.tcl: Changed test config to add an "Include test.conf" directive. We can write out our own configs for each test with that. * src/mod_rivet.c (Rivet_PerInterpInit): New function that groups together everything that has to happen when a new interpreter is created - either the main one, or for virtual hosts. (Rivet_InitTclStuff): Redid the way virtual hosts are treated here: make sure there is a unique rivet_server_conf for each one, either because MergeConfig has been called, or we create one ourselves. (Rivet_CreateConfig): We don't initialize objCache and outchannel members of rivet_server_conf here anymore. They are now taken care of in Rivet_InitTclStuff. (Rivet_MergeConfig): Either take care of all members of rivet_server_conf struct, or include a comment explaining why it's not there. (Rivet_ChildHandlers): New function - takes care of either child init or exit scripts, depending on how it's called. * doc/rivet.xml: Describe how each RivetServerConf directive interacts with virtual hosts. 2004-02-26 David N. Welton * doc/rivet.xml: Added DIODisplay section. 2004-02-25 David N. Welton * src/rivetParser.h: start/end tags removed from here. * src/make.tcl: START_TAG and END_TAG are now defined here, so that they are easier to configure at build time. * doc/rivet.xml: Initial cut at including DIO docs in the main set of docs. 2004-02-23 David N. Welton * LICENSE: Switch to Apache 2.0 License. 2004-02-20 David N. Welton * src/TclWebapache.c (TclWeb_SetHeaderType): strdup object's string value so we have our own copy of it. 2004-02-19 David N. Welton * doc/rivet.xml: Added some additional comments regarding the installation. Thanks to Tom Krehbiel for the suggestions. 2004-02-17 David N. Welton * src/make.tcl: Created better dependency system for DocBook docs. * doc/html/rivet.*.html: Added non-chunked versions of the docs. * doc/rivet-nochunk.xsl: Change include of docbook.xsl to an import at the top of the file. Seems to make things work ok. 2004-02-11 David N. Welton * src/make.tcl: Don't delete rivet packages directory during install. This used to happen in order to keep things clean, but people are using this directory for local packages/modifications, so this is not a good thing to have. 2004-02-06 David N. Welton * tests/headers.test: Include current version of http package in result automatically, so as to avoid having to update it by hand. * tests/apachetest/apachetest.tcl (apachetest::getallincludes): Create function to fetch a conf file and all the files Included it from it. * doc/rivet.xml: Add section for session package. * doc/rivet.xml: Added SESSION documentation. * rivet/packages/session/README.txt: Removed text, indicate HTML/XML docs - I don't want to maintain the same docs in two places. * src/make.tcl: Create directory before installing. 2004-01-20 Karl Lehenbauer * rivet/packages/dio/diodisplay.tcl: Removed calls to abort_page when relatively benign conditions like no records matching a search occur. This allows us to emit all the code we need, like closing the table (
    ) and emiting our page trailer, etc, instead of having the page cut off somewhere in the middle. 2004-01-15 David N. Welton * rivet/rivet-tcl/load_response.tcl (load_response): Fixed a bug in load_response that was tickled by calling it multiple times. Thanks to Brad for catching it. 2004-01-15 Brad Morrison * rivet/rivet-tcl/load_response.tcl: Changed behavior from appending discovered values to existing elements in the response array to simple assignment. 2004-01-15 David N. Welton * rivet/packages/simpledb/simpledb.tcl (simpledb::synctostorage): Added fix from Massimo Manghi for bug in procedure to write database to disk. * rivet/packages/simpledb/simpledb.test (populatetables): Commented out stuff to add into the test later. 2004-01-08 David N. Welton * src/make.tcl: Added warning to default make.tcl target in order to encourage people to run ./make.tcl install. 2004-01-08 Karl Lehenbauer * src/buildscripts/findapxs.tcl: When the apxs program cannot be located, the message now mentions that the location of apxs can also be specified using the "-with-apxs" option on the command line. 2004-01-05 Karl Lehenbauer * rivet/packages/session/*: Checkin of session management code. This is a from-scratch rewrite of Superconnect's session management code, donated to Rivet under the terms of the Apache Software License. See rivet/packages/session/README.txt for details of what it does and how it works. 2004-01-02 Karl Lehenbauer * src/buildscripts/findapxs.tcl: Added /usr/local/bin and /usr/local/sbin to the directories that Rivet configuration looks in to find apxs, when the path to apxs wasn't specified on the configure command line. Changed findapxs::FindAPXS to generate an error if it couldn't find a working apxs utility, rather than just returning an empty string. Previously if apxs could not be found, the error message emitted by configure.tcl was: "Error in CFLAGS test: couldn't execute "": no such file or directory" Now it says it couldn't find the Apache Extension Tool apxs and lists everywhere it looked. 2003-12-20 David N. Welton * tests/parsepackage.test: Added tests for the Rivet parser standalone package and pure Tcl Rivet parser. * INSTALL: Added basic configuration directives to INSTALL file. * rivet/packages/tclrivet/tclrivetparser.tcl: Added pure Tcl Rivet parser. This doesn't have all the Rivet commands available, it just parses a style Rivet file into the corresponding Tcl script. * src/parserPkgInit.c (Parse_RivetData): We no longer automatically add the namespace. The user ought to be able to add that should they so choose. This makes the command more flexible. * src/rivetParser.c (Rivet_Parser): Removed an unnecessary Tcl_UtfNext from the parser. (Rivet_GetRivetFile): Removed useless 'inside' variable from this function. * doc/rivet.xml: Add abort_page, no_body and env commands, reordered the load_* commands. * doc/rivet.it.xml: Updated author. * doc/rivet.ru.xml: Updated author. * doc/rivet.xml: Changed documention author to "The Rivet Team". * src/rivetCore.c (Rivet_NoBody): Return an error if content has already been sent. * src/rivetCore.c: Added fancy headers to all functions. 2003-12-13 David N. Welton * tests/broken.test: Updated test results for what is actually returned on error. * src/rivetParser.c (Rivet_Parser): "export" function in that it's no longer static. * src/parserPkgInit.c (Parse_RivetData): New alpha-ish command to parse data passed to the script. * src/configure.in.tcl: Merge apxs and Tcl CFLAGS in order to include what we need from both. Hopefully there won't be any conflicts. 2003-11-27 David N. Welton * doc/rivet.xml: Added information about debugging Apache/Rivet. 2003-11-20 David N. Welton * src/make.tcl: Changed xsltproc lines to deal with new link styles. * doc/rivet.xml: Changed links as in Russian translation. * doc/rivet.it.xml: Changed links as in Russian translation. * doc/rivet.ru.xml: Changed links to use "en.html" style instead of "html.en". This will make google pick up the pages. 2003-10-22 David N. Welton * win/: Numerous updates from Pat Thoyts . 2003-09-30 David N. Welton * src/rivetCore.c (Rivet_Include): More ref count management. * src/mod_rivet.c (Rivet_PropagatePerDirConfArrays): Added more ref count management. * src/rivetParser.c (Rivet_GetRivetFile): Add ref counting for 'inbuf'. * src/mod_rivet.c (Rivet_ParseExecFile): Manage ref count for outbuf better. (Rivet_SendContent): Clean up 'info script' code. (Rivet_InitTclStuff): Rework 'if' to eliminate double assignment. * src/TclWebapache.c (TclWeb_GetEnvVars): Add ref counting for envvar. (TclWeb_GetHeaderVars): Fix ref counting for headersvar. * tests/headers.test: Added test for load_headers. * src/apache_request.h: Updates from httpd-apreq. * src/apache_request.c: Updates from httpd-apreq. 2003-09-29 David N. Welton * rivet/packages/commserver/server.tcl: Exit 1 on failure. * rivet/packages/commserver/commserver.tcl: Check to make sure the server is really running before returning from commserver::start. * rivet/packages/simpledb/simpledb.tcl: Added 'simpledb', although it's not ready for production use. * src/mod_rivet.c (Rivet_ChildInit): If we don't have separate virtual servers, we only need to run the ChildInitScript once. If we do have interpreters for each virtual server, each one gets to run the script. * doc/rivet.ru.xml: Big update of the Russian translation by Dmitry the Zuryanovich . Thanks! 2003-09-26 David N. Welton * src/mod_rivet.c: Spelling check: seperate->separate. 2003-09-24 David N. Welton * doc/rivet.xml: Mention the global command in the 'internals' section. 2003-08-30 David N. Welton * doc/rivet.xml: Added var_qs and var_post cmdsynopsis's. 2003-08-29 David N. Welton * doc/rivet.xml: Use refentry and sub-elements instead of variablelist. This is more correct. * doc/norefchunk.xsl: New file - handle refentries without making them new files. * doc/rivet.xsl: Scratch the last changes and go with refentry's for all commands. This is a more difficult solution to parse, but in the end is more correct. * doc/refentry.xsl: New file to handle refentry stuff. 2003-08-28 David N. Welton * doc/rivet.xsl: Minor changes to look and feel. * doc/rivet.xml: Added tags for commands, in order to create the index. * doc/rivet.xsl: Added XSL to parse , needed to create an index of commands on the index page. 2003-08-26 David N. Welton * doc/rivet.xml: Added section to documentation about emacs and vim modesl for Rivet files. * src/configure.in.tcl: -with-apxs option no longer takes a default. It should work that out on its own using the findapxs.tcl script. 2003-08-23 David N. Welton * src/configure.in.tcl: Remove test for broken Tcl installations on FreeBSD and MacOS X. Apparently, things work ok with 8.4. 2003-08-22 David N. Welton * src/configure.in.tcl: Add test for broken Tcl installations on FreeBSD and MacOS X. * doc/rivet.xml: Added installation instructions corresponding to the new ./configure.tcl system. Ran the spellchecker. * src/buildscripts/aardvark.tcl (aardvark::runbuildcommand): Rebuild only if file depended on is newer than the target, rather than >=. This prevents some files from being remade if make is run again. * src/configure.tcl (configure::ProcessOptions): Added 'verbose' flag to configure. (configure::test): Exit on tcl failure in test procedures. (configure::assert): Added assert command. Fail on error or 0. 2003-08-21 David N. Welton * src/configure.in.tcl: Changed INC variable to use TCL_INCLUDE_SPEC. * INSTALL: Updated instructions. * src/configure.tcl (configure::parsetclconfig): We need access to previously parsed variables, so we do this in the ::configs namespace. 2003-08-20 David N. Welton * src/buildscripts/aardvark.tcl (aardvark::getconfigs): Added new function to fetch the config info out of configs.tcl. * src/make.tcl: Removed debinstall target, because we can now accomplish the same thing by overriding configure options on make's command line. Removed the configure-style code at the top of the file. * src/configure.in.tcl: Specify the variables to test for/create, as well as some command line options specific to Rivet. * src/configure.tcl: Added new configure-like system to obtain information about the environment where Rivet is being compiled. Running ./configure.tcl creates a file, configs.tcl, with the its findings. make.tcl now uses those values as its defaults, unless they are overridden on make.tcl's command line. 2003-08-11 David N. Welton * src/make.tcl: Added fileutils Tcl package to buildscripts, in order to utilize the 'install' command. 2003-08-05 David N. Welton * contrib/rvt.vim: Added contributed vim mode for editing Rivet files. * contrib/two-mode-mode.el: Added emacs mode for editing Rivet files. 2003-07-22 David N. Welton * doc/rivet.ru.xml: Added lang=ru to article, so that markup like produces the correct language. * doc/rivet.it.xml: Added Italian translation of Rivet docs by Fabio Zanotti . 2003-07-16 David N. Welton * doc/rivet.xml: Explain example script just a bit more clearly. * src/make.tcl: Fix up clean target. Use MOD_SHLIB as target instead of explicit mod_rivet.so. 2003-07-08 David N. Welton * src/buildscripts/findapxs.tcl: Added /usr/local/sbin as a place to check for apxs. Thanks to Andy Doerr for pointing out that this is where it's kept on FreeBSD. 2003-07-07 David N. Welton * doc/examples/upload.html: Added submit button to file upload example. 2003-07-05 David N. Welton * src/rivetWWW.c (snprintf): Added snprintf define from Pat. * src/rivetParser.h: Added bit of defines for windows builds, declared some of the functions EXTERN's here. * src/rivetList.c: Make list commands created here 'static' - Pat. * src/rivetCrypt.c: Use ap_config.h to grab other header files we might need, like crypt.h. This is not an ideal solution, because it adds a dependency we didn't have before. Added change by Pat to conditionally compile or not the 'Rivet_Crypt' command. * src/rivet.h: Added EXTERN definitions for functions. * src/parserPkgInit.c (Rivetparser_Init): Added EXTERN decleration for win builds. * win/rules.vc: New file: include file for Microsoft makefile. * win/rivet.dsp: New file: Microsoft Developer Studio Project File. * win/nmakehlp.c: New file: helper for windows building. * win/makefile.vc: New file: makefile for windows. All from Pat Thoyts . * doc/examples/vars.html: Use a table to make the form look nicer. * doc/examples/vars.rvt: Now we display some results. 2003-07-01 David N. Welton * src/rivetCore.c (Rivet_Upload): Pass the correct element of objv to TclWeb_UploadSave. * tests/uploadsave.rvt: New file to test 'upload save'. * tests/upload.test: New test for 'upload save'. 2003-06-30 David N. Welton * src/mod_rivet.c (Rivet_ParseExecFile): Use Tcl_FSStat instead of Tcl_Stat. * src/rivetCore.c (Rivet_Parse): Use Tcl_FSStat instead of Tcl_Stat. 2003-06-29 David N. Welton * doc/rivet.xml: Add IRC reference to the help section of the manual. 2003-06-23 David N. Welton * doc/rivet.ru.xml: Updated Russian version to indicate which version of the original it was based on. * doc/rivet.xml: Added version string to English version. 2003-06-14 David N. Welton * doc/rivet.xml: Added CVS Id tag. * doc/rivet.ru.xml: Added comment to indicate the version of rivet.xml that the Russian translation is based on. 2003-06-12 David N. Welton * src/mod_rivet.c (Rivet_ParseExecFile): Rework checks for .htaccess file changes. This code was causing an obscure bug where a file would be in the cache twice, thus causing crashes. * Moved russian translation around again. * src/TclWebapache.c (TclWeb_GetEnvVars): Use TCL_NAMESPACE_ONLY here and in TclWeb_GetHeaderVars in order to set the variable in the correct place. * src/make.tcl: Added changes to build Russian documentation. * doc/rivet.xml: Added link to Russian translation. * doc/rivet.ru_UTF.xml: Added link back to English version. 2003-06-10 David N. Welton * doc/rivet_utf_ru.xml: Added Russian translation of documentation by Dmitry Zuryanovich. 2003-06-09 David N. Welton * doc/rivet.xml: Cleaned up docs about fetching the httpd sources. 2003-05-26 David N. Welton * src/rivetCore.c (Rivet_Headers): Change error message to better reflect that there is only one argument to 'headers numeric'. Thanks to "Dmitry Zuryanovich". * src/mod_rivet.c (Rivet_ParseExecFile): Updated Rivet_GetRivetFile and Rivet_GetTclFile to use the right arguments. 2003-05-24 David N. Welton * rivet/packages/tclrivet/tclrivet.tcl: Added commands that need to be filled in. * tests/runtests.tcl: Use apachetest::need_modules. * tests/apachetest/apachetest.tcl (apachetest::need_modules): New proc, utilized to tell the test suite which apache modules are needed. 2003-05-23 David N. Welton * src/buildscripts/aardvark.test: Do a version check on gcc. We used that for the tests, so we might as well be sure we're using the same version. * src/make.tcl: Use buildscripts.tcl to load up all the other scripts we need. Add PARSER_SHLIB as a dependency for the shared build. * src/buildscripts/aardvark.test: Updated aardvark tests to current GCC. * src/buildscripts/buildscripts.tcl: New file: use this file to load up all the other scripts. * src/buildscripts/findconfig.tcl: Moved all the functionality into parsetclConfig.tcl. * src/buildscripts/aardvark.tcl: Just source the graph.tcl file directly instead of dealing with packages. Thanks to Pat Thoyts. 2003-05-22 David N. Welton * src/rivetParser.c (Rivet_GetRivetFile): API Change: instead of taking a TclWebRequest argument, we just give this function a Tcl_Interp, which makes it easier to seperate this code from Rivet. * src/mod_rivet.h: STARTING_SEQUENCE and ENDING_SEQUENCE moved to rivetParser.h, in order to make that file independant of mod_rivet.h. * src/make.tcl: Use slightly more descriptive variable names. Add code to compile librivetparser.so. * src/parserPkgInit.c: New file. Provides a Tcl extension to the Tcl parser, so that regular (not running under Apache) scripts can access it. * doc/html/rivet.css: Updated a few stylesheet properties to make the docs look a bit classier. 2003-05-21 David N. Welton * doc/rivet.xsl: Switch on parameter to use images in HTML output from docbook. * doc/rivet.xml: Added c.l.t. newsgroup to resources section. 2003-05-20 David N. Welton * doc/html/rivet.css: Added CSS file. * src/make.tcl: Added parameter to xsltproc to link the html output to a CSS file. 2003-05-14 David N. Welton * src/make.tcl: Added PKGINDEX to the list of dependencies for rolling a distribution. Updated STATUS file. * rivet/packages/commserver/commserver.tcl: Added commserver package as one potential IPC method. * src/make.tcl: Target ../VERSION node correctly. New target $PKGINDEX to automatically generate a top-level (which is where Tcl searches) package index for all the sub-packages in the Rivet distribution. * src/buildscripts/aardvark.tcl (aardvark::runbuildcommand): A few stylistic changes: [ cmd ] -> [cmd]. 2003-05-13 David N. Welton * doc/rivet.xml: Added a few options - numeric and add to the header documentation. Removed 'setcookie', which has been replaced by the 'cookie' command. * src/make.tcl: Pass [info nameofexecutable] to mod_rivet.c compilation, in order to make Rivet aware of the location of tclsh. * src/mod_rivet.c (Rivet_InitTclStuff): Use name of tclsh executable passed in via the build script. This isn't really the name of the executable Rivet is part of (Apache), but I think this is more useful. 2003-05-11 David N. Welton * src/apache_request.c: Updated to the latest from the httpd-apreq package. 2003-04-07 David N. Welton * src/make.tcl: Make sure that auto_path gets extra stuff at the beginning, so as not to create problems when using it to fetch the prefix. * VERSION: Bump point number for new release. * src/make.tcl: Use package require to load aardvark. * src/buildscripts/graph.tcl: This file should provide the 'struct' package. 2003-03-30 David N. Welton * doc/rivet.xml: Fixed example configuration directive. 2003-03-27 David N. Welton * src/TclWebapache.c (TclWeb_UploadData): Comment out unused alloc. * src/rivetWWW.c (Rivet_UnescapeStringCmd): Free memory allocated with Tcl_Alloc. (Rivet_EscapeStringCmd): Free memory allocated with Tcl_Alloc. (Rivet_EscapeSgmlCharsCmd): Free memory allocated with Tcl_Alloc. (Rivet_EscapeShellCommandCmd): Free memory allocated with Tcl_Alloc. * src/rivetCrypt.c (Rivet_DecryptCmd): Free memory allocated with Tcl_Alloc. (Rivet_EncryptCmd): Free memory allocated with Tcl_Alloc. 2003-03-26 David N. Welton * Remove index.html and help.html. * rivet/pkgIndex.tcl: Added index file for RivetTcl package - i.e. init.tcl. 2003-03-25 David N. Welton * src/rivetPkgInit.c (Rivet_Init): Bump version number to 1.1. * src/mod_rivet.c (Rivet_InitTclStuff): Use Tcl_PkgRequire to load Rivet's init.tcl. * src/make.tcl: Use Tcl file location instead of Apache-based file location, in order to use Tcl_PkgRequire to load Rivet's init.tcl. * rivet/init.tcl: Provide 'RivetTcl' package. (init): Use [info script] instead of server(RIVET_DIR) variable. * src/make.tcl: Add a debinstall target as a temporary way to build .deb files. * debian/copyright: Added copyright file for debian. * debian/dirs: Added dirs file that lists directories used by Rivet on Debian. * debian/control: Added debian/control file with information about Rivet for the debian package. * debian/changelog: Added debian changelog file to track versions of the debian package. * debian/rules: Use 'rules' file from mod_dtcl. 2003-03-14 David N. Welton * src/mod_rivet.c (Rivet_AppendToScript): Don't append Before/After/Error scripts. Just override them. (Rivet_UserConf): Switch back to using Rivet_AppendToScript. (Rivet_SetScript): Change Rivet_AppendToScript to Rivet_SetScript to reflect the fact that it doesn't always append - specifically, in After/Before/Error scripts. * doc/rivet.xml: Use eyebrowse link instead of apachelabs for mailing list. 2003-03-13 David N. Welton * src/mod_rivet.h: Backed out extra entries in rivet_server_conf - they aren't necessary, as the overrides are taken care of for us. The only things we really need are 1) to use the flag user_scripts_updated to recompile scripts when UserConf variables have changed 2) to not append to existing scripts, but instead create new ones. 2003-03-12 David N. Welton * src/mod_rivet.c (Rivet_UserConf): Set user_scripts_updated flag. (Rivet_ParseExecFile): Check and clear flag. * src/mod_rivet.h: Added user_scripts_updated flag to signal that UserConf options have been set. This means that we need to recompile the script. 2003-03-01 David N. Welton * debian/debian.tcl: Helper file for generating .debs. 2003-02-28 David N. Welton * src/Makefile (all): Clean out Makefile - force use of make.tcl. * src/buildscripts/aardvark.tcl (aardvark::runbuildcommand): Use 'w' for shell command pipe, in order to not get broken pipes with commands that output something to stdout (such as tcl scripts!). 2003-02-21 David N. Welton * tests/config.test: Test to see if Rivet picks up changes in ".htaccess" files. * tests/README: Add descriptions of the various tests. * src/buildscripts/aardvark.tcl (aardvark::Nodes): Add command to return list of all nodes. * doc/rivet.xml: Add some information on the precedence of the different Conf options. Change information about DirConf - it isn't allowed in .htaccess files. 2003-02-19 David N. Welton * src/buildscripts/aardvark.test: Add test script and files for aardvark system. * src/buildscripts/graph.tcl: Include latest 'graph.tcl' from upstream. * src/make.tcl: We no longer force 'tcl' and 'sh' to take only one argument. In the case where we aren't forcing evaluation later with {}, this is nicer looking, as we don't have to quote everything with "". 2003-02-12 David N. Welton * src/mod_rivet.c: Mirror Craig Huckabee's mod_dtcl.c changes: - Use TCL_DECLARE_MUTEX to create the mutex, and change the mutex lock/unlock calls. - Remove the 'load only once' stuff from TclInitStuff. - InitTclStuff can now only be called from Child Init. 2003-01-17 David N. Welton * Added logos. 2003-01-08 David N. Welton * src/mod_rivet.c (Rivet_ChildInit): Patch from Karl Lehenbauer to print out errorInfo upon ChildInit failure. 2003-01-07 David N. Welton * src/TclWebapache.c (TclWeb_UploadData): Fix from Holger Zeinert that makes file uploads work on windows. 2002-12-30 David N. Welton * doc/examples/upload.html: Changed .ttml to .rvt - thanks to Holger Zeinert for catching this. 2002-12-18 David N. Welton * doc/rivet.xml: Noted the var_qs/var_post changes in the documentation. 2002-12-17 David N. Welton * tests/post.test: * tests/post.rvt: * tests/get.test: * tests/get.rvt: Added tests for David Brancato's var_qs and var_post improvements. * src/TclWebapache.c: Made "ugly" for loops into while loops. Created macro to set up loop parameters correctly. 2002-12-14 David N. Welton * src/TclWebapache.c: Redid indendation. * src/rivetCore.c: Implemented Tcl commands (via objv[0]) to retrieve variables from different, specified sources (query string, POST). (David Brancato). * src/mod_rivet.h: Added defines for variable sources. (David Brancato). * src/apache_request.c: Added functions to get query and post params. (David Brancato). * src/TclWebapache.c: Implemented TclWeb.h API change. (David Brancato). * src/TclWeb.h: Changed API to include a source option in order to indicate the origin (query string, POST) of a variable. (David Brancato). 2002-12-13 David N. Welton * src/mod_rivet.c (Rivet_InitTclStuff): Apache actually loads all the modules twice, just to see if it can. This is a pain, because things don't seem to get completely cleaned up on the Tcl side. So this little hack should make us *really* load only the second time around. 2002-12-10 David N. Welton * table.png: Transformed table.png so that it ought to display correctly on older(?) browsers. Thanks to Elchonon Edelson for his help. 2002-12-09 David N. Welton * src/mod_rivet.c (Rivet_SendContent): Switched from EvalObj to EvalObjEx. (Rivet_SendContent): EXPERIMENTAL: added Mutex locks on SendContent, in order to keep windows safe. This needs testing out! 2002-12-04 David N. Welton * src/TclWebapache.c (TclWeb_GetEnvVars): Put DecrRefCount back in - must have taken it out by mistake while hunting a previous memory leak. 2002-11-23 David N. Welton * src/mod_rivet.c (Rivet_SendContent): Set up information for [info script] by using r->filename. 2002-11-19 David N. Welton * doc/examples/table.rvt: Fixed up format operation to make nicer tables. 2002-11-18 David N. Welton * cvsversion.tcl (main): Added catch to make sure that VERSION has something in it and isn't. 2002-11-09 David N. Welton * doc/rivet.xml: Make docs reflect behavior of 'var get foobar' when foobar doesn't exist - "" is returned. * tests/apachetest/apachetest.tcl: Updates to testing utility procedures. 2002-11-04 David N. Welton * tests/get.test: Backed out changes to 'var get': no longer throws an error if the variable does not exist, but instead returns "". Use 'var exists' to see if it really exists or not. * src/mod_rivet.c (Rivet_ChildExit): Add call to Tcl_Finalize. This still needs more investigation. * tests/upload.test: Added proper end boundary to upload test. * src/apache_*: New apache request code from upstream. 2002-10-29 David N. Welton * src/rivetWWW.c (Rivet_EscapeStringCmd): Eliminate warning on Solaris by casting a char to an int. 2002-10-28 David N. Welton * src/rivetCore.c (Rivet_Include): Changed Tcl_Channel name to tclstdout to avoid any conflicts with the real stdout. 2002-10-23 David N. Welton * doc/rivet.xsl: Use
     tag for source code examples.
    
    2002-10-22  David N. Welton  
    
    	* src/TclWebapache.c (TclWeb_StringToUtf): One more CONST84 - now
    	we pass the tests!
    
    2002-10-21  David N. Welton  
    
    	* src/*.c: "CONST"ification.  See http://mini.net/tcl/3669 for
    	more information.
    
    	* src/: Minor build script updates.
    
    2002-10-20  David N. Welton  
    
    	* doc/rivet.xml: "make" needed to be "make.tcl".  Thanks to Makoto
    	SATOH.
    
    2002-10-18  David N. Welton  
    
    	* tests/get.test: Added tests for new "var get" behavior.
    
    	* doc/rivet.xml: Documented new "var get" behavior.
    
    	* src/rivetCore.c (Rivet_Var): Added ?default? option to "var
    	get".
    
    	* doc/examples/: Added examples for XML document.
    
    	* doc/rivet.xml: Several examples of how to use Rivet.
    
    2002-10-17  David N. Welton  
    
    	* doc/rivet.xml: Added Entities to deal with included files.  This
    	makes it easier to correctly format the source code that is to be
    	included.
    
    2002-10-09  David N. Welton  
    
    	* src/buildscripts/findapxs.tcl: Added /usr/sbin/ at the request
    	of David Brancato, who notes that Redhat often locates apxs there.
    
    2002-10-02  David N. Welton  
    
    	* doc/rivet.xml: Added 'Introduction' section.
    
    2002-09-29  David N. Welton  
    
    	* doc/rivet.xml: Reworked several elements to better utilize
    	docbook.
    
    	* doc/rivet.xsl: Major reworking of several elements, including
    	group and arg.  Added lots of style changes.
    
    	* src/make.tcl: Add commands and dependencies to build extensions
    	documents without chunks, and the main Rivet docs in chunks
    	(seperate HTML files are output).
    
    	* doc/rivet.xml: Updated docs to reflect new Apache directives.
    
    2002-09-27  David N. Welton  
    
    	* src/mod_rivet.c (Rivet_InitTclStuff): Change default CacheSize
    	to MaxRequestsPerChild / 5, which should still be plenty, but will
    	waste less space.
    
    	* src/rivetCore.c (Rivet_Include): "include" command now saves
    	channel encoding/translation, outputs the included file to stdout
    	with binary translation/encoding, and then resets the original
    	settings.  Fixes problem with EUC-JP characters in included
    	files.  Thanks to Makoto SATOH for his help in finding this.
    
    	* tests/lang.test: Added file to test LANG setting in server, to
    	check character encodings.
    
    	* tests/parse.test: Added EUC-JP characters to test that they come
    	through ok.
    
    	* tests/include.test: Added EUC-JP characters to test that they come
    	through ok.
    
    2002-09-11  David N. Welton  
    
    	* src/TclWebapache.c (TclWeb_InitEnvVars): Don't do an
    	ap_clear_table on the environmental variables.  The include module
    	no longer does this, and neither does PHP, so I guess it's safe to
    	remove, and it's useful for users of modules like mod_uniqe_id.
    
    2002-09-08  David N. Welton  
    
    	* src/TclWebapache.c: Fix up ObjSetVar2 use.
    
    	* src/mod_rivet.c: Fix up another instance of ObjSetVar2.
    
    2002-09-07  David N. Welton  
    
    	* src/mod_rivet.c (Rivet_PropagatePerDirConfArrays): Do the right
    	tricks with IncrRefCount and DecrRefCount to stop the leak.
    
    2002-08-03  David N. Welton  
    
    	* src/mod_rivet.c (Rivet_AppendToScript): Changed before, after,
    	and error scripts back to plain old ascii, in order to plug a
    	memory leak.
    
    	* src/mod_rivet.h: New macro: FILEDEBUGINFO off by default.
    	Useful for debugging the order of functions called.
    
    2002-07-28  David N. Welton  
    
    	* doc/rivet.xsl: Updated rivet.xsl from Websh's xsl.
    
    2002-07-21  David N. Welton  
    
    	* doc/rivet.xml: Several new sections.  We now have most of what
    	is in the HTML documents.
    
    2002-07-19  David N. Welton  
    
    	* src/buildscripts/aardvark.tcl (aardvark::runbuildcommand):
    	Attempt to use 'open' to execute shell commands, in order to both
    	catch the output as well as the return code.
    
    	* doc/rivet.xml: New file.  Removed directives.xml in favor of
    	this, which we will use to build individual HTML files and other
    	forms of documentation.
    
    2002-07-18  David N. Welton  
    
    	* src/rivetCore.c (Rivet_Upload): Changed format of 'upload'
    	command to be more like 'var'.  Changed relevant tests.
    
    2002-07-14  David N. Welton  
    
    	* doc/directives.xml: New file - XML version of directives.html.
    
    2002-07-12  David N. Welton  
    
    	* src/buildscripts/aardvark.tcl (aardvark::runbuildcommand):
    	Updated functionality to hopefully better handle errors, warnings,
    	and output.
    
    	* src/make.tcl: Created a 'dist' target which rolls a tarball.
    
    2002-07-11  David N. Welton  
    
    	* src/TclWebapache.c (TclWeb_GetHeaderVars): New function to get
    	client headers, which are now seperate from environmental
    	variables.
    
    2002-06-18  David N. Welton  
    
    	* cvsversion.tcl: Added tool to manage version numbers based on
    	CVS changes.
    
    2002-06-17  David N. Welton  
    
    	* src/make.tcl: Updated build scripts to build the HTML
    	documentation from XML files.
    
    	* src/buildscripts/aardvark.tcl: Changed commands to 'sh' for
    	shell commands and 'tcl' for Tcl commands.
    
    2002-06-10  David N. Welton  
    
    	* doc/packages/dio/dio.xml: Further updates.
    
    2002-06-08  David N. Welton  
    
    	* doc/packages/dio/dio.xml: Finished up adding material to
    	dio.xml.
    
    2002-06-06  David N. Welton  
    
    	* doc/packages/dio/dio.xml: Initial commit of (incomplete) docbook
    	documentation.
    
    	* doc/packages/dio/rivet.xsl: Added XSL file for docbook
    	documentation.
    
    2002-05-03  David N. Welton  
    
    	* src/TclWebapache.c (TclWeb_GetVarAsList): Added check to length
    	to make sure we fully compare the two variables.  Idem for
    	TclWeb_VarExists.
    
    2002-04-19  Damon J. Courtney 
    	* src/TclWebapache.c
    	    Added 'TclWeb_GetVirtualFile' command which returns the full
    	    path to a virtual file.
    
    	* src/rivetCore.c
    	    Added command 'virtual_filename' to return the full path to a
    	    virtual file.
    
    	    Added -virtual option to include and parse commands to enable
    	    them to parse a virtual file which is relative to the webserver.
    
    2002-03-26  Damon J. Courtney 
    
    	* rivet/packages/form
    	    Added a new package for handling forms in Rivet.
    
    2002-03-26  Damon J. Courtney 
    
    	* src/TclWebapache.c
    	    Moved the setting of include variables from LoadEnv to the
    	    InitEnv command.  This will allow us to retrieve these variables
    	    via the env command as well as load_env.
    
    2002-03-21  Damon J. Courtney 
    
    	* src/TclWebapache.c
    	* src/TclWeb.h
    	    Added new command 'TclWeb_HeaderAdd'.
    
    	* src/rivetCore.c
    	    Added 'add' option to headers command to add a header instead
    	    of just setting over one.
    
    	* rivet/rivet-tcl/cookie.tcl
    	    The cookie command adds a header instead of setting one.  This
    	    allows multiple cookies in a single page.
    
    2002-03-21  Damon J. Courtney 
    
    	* src/TclWebapache.c
    	    If the header being set is Set-Cookie, we add it to the table
    	    instead of overwriting it.  This allows us to set more than
    	    one cookie per page, which is legal to all browsers.
    
    2002-03-19  Damon J. Courtney 
    
    	* rivet/init.tcl
    	    Appended packages-local to the auto_path.  This will be a great
    	    place for people to place local packages that we won't mess with.
    
    2002-03-18  David N. Welton  
    
    	* tests/apachetest/apachetest.tcl: Added TclX to requirements.
    	Damn.
    
    2002-03-16  David N. Welton  
    
    	* tests/runtests.tcl: Updated to run with apachetest, eliminating
    	makeconf.tcl, and moving template.conf.tcl to the apachetest
    	directory.
    
    	* tests/apachetest/apachetest.tcl: New file, grouping together
    	the test functions in one place, and in a namespace.
    
    2002-03-15  David N. Welton  
    
    	* tests/config.test: Added some new, automatically generated
    	tests.
    
    	* src/mod_rivet.c (Rivet_MergeDirConfigVars): Make sure that both
    	arguments to overlay_tables exist!
    
    	* src/mod_rivet.h: Add a default error script.
    
    	* src/TclWebapache.c (TclWeb_GetEnvVars): DecrRef for the name of
    	the environment variable.
    
    	* rivet/rivet-tcl/cookie.tcl (make_cookie_attributes): Add an
    	interface to add the 'expire' field directly.
    	(cookie): "Set-Cookie" is uppercase for both words.
    
    2002-03-15  Damon J. Courtney 
    
    	* src/apache_cookie.c
    	* src/apache_cookie.h
    	    Removed in favor of doing cookies through a Tcl interface.
    
    	* src/channel.c
    	* src/channel.h
    	    Renamed to rivetChannel.c and rivetChannel.h
    
    	* src/rivetCore.c
    	* src/TclWebapache.c
    	    Removed references to Apache cookie functions.
    
    2002-03-14  Damon J. Courtney 
    
    	* src/TclWebapache.c
    	    Added a routine to setup the environment variables and mark
    	    that they have been set.  This will save us from having to
    	    reload them all the time.  Once they're loaded, they don't
    	    load again.
    
    	* rivet/rivet-tcl/cookie.tcl
    	    Added a new 'cookie' command for setting and getting cookies.
    
    	* rivet/rivet-tcl/import_keyvalue_pairs.tcl
    	    Added a command to import keyvalue pairs from arguments.
    
    	* rivet/rivet-tcl/load_cookies.tcl
    	    Made load_cookies use the env command to get the one variable
    	    it needs instead of load_env, which gets a bunch it doesn't
    	    need.
    
    	* rivet/rivet-tcl/debug.tcl
    	    Made debug use the env and import_keyvalue_pairs commands.
    
    2002-03-13  Damon J. Courtney 
    
    	* src/mod_rivet.c
    	    Cleaned up the error handling a little.  There was a really nasty
    	    bug that if the ErrorScript was defined, it wouldn't actually
    	    error out.  This had something to do with the header output and
    	    flush being before the ErrorScript was executed.
    
    	* rivet/init.tcl
    	    Changed the default error handler to a Tcl proc.
    
    2002-03-13  Damon J. Courtney 
    	* src/make.tcl
    	* src/TclWebapache.c
    	    Cleaned up the remainder of the compiler warnings.
    	    Rivet should build cleanly without warnings now.
    
    2002-03-13  David N. Welton  
    
    	* src/mod_rivet.c (Rivet_PropagatePerDirConfArrays): Clean up
    	arrayName object after we're done with it.
    
    	* src/TclWebapache.c (TclWeb_GetVar): Make sure to compare all of
    	the variable key.
    
    	* src/mod_rivet.c (Rivet_InitTclStuff): Moved creation of "rivet"
    	AssocData here.
    
    2002-03-12  Damon J. Courtney 
    
    	* src/mod_rivet.c
    	* src/mod_rivet.h
    	* src/rivetParser.c
    	* src/rivetCore.c
    	* src/TclWebapache.c
    	    Cleaned up a lot of memory leaks.  Still working on finding more.
    
    2002-03-12  David N. Welton  
    
    	* tests/makeurl.test: New test.
    
    	* src/TclWebapache.c (TclWeb_MakeURL): Use Tcl_SetStringObj
    	instead of creating a new object.
    
    	* src/rivetCore.c (Rivet_MakeURL): Pass already created object to
    	TclWeb_MakeURL.
    
    2002-03-11  Damon J. Courtney 
    
    	* src/TclWeb.h
    	    Added declaration for TclWeb_GetEnvVar.
    
    	* src/TclWebapache.c
    	    Added command TclWeb_GetEnvVar.  Gets a single environment
    	    variable.
    
    	* src/mod_rivet.c
    	    Added some extra stuff to the default error functions.
    	    If the error_script fails, we output the failure.
    
    	* src/rivetCore.c
    	    Added Tcl 'env' command to get a single environment variable.
    
    	* src/make.tcl
    	* src/buildscripts/aardvark.tcl
    	* src/buildscripts/graph.tcl
    	    Cleaning up a bug with the struct package.
    
    2002-03-10  Damon J. Courtney 
    
    	* src/mod_rivet.c
    	    The Scripts output to the UserConf arrays now properly display
    	    the scripts in their entirety.
    
    	    Cleaned up the handling of directory configuration merging.
    
    	    Fixed a bug where Rivet_GetRivetFile was stomping the BeforeScript.
    
    2002-02-23  David N. Welton  
    
    	* tests/upload.test: Added upload test.
    
    	* src/TclWebapache.c: Added functions: TclWeb_PrepareUpload,
    	TclWeb_UploadChannel, TclWeb_UploadSave, TclWeb_UploadData,
    	TclWeb_UploadSize, TclWeb_UploadType, TclWeb_UploadFilename,
    	TclWeb_UploadNames.
    
    	* src/rivetCore.c (Rivet_Upload): Offloaded functionality to
    	TclWebApache.c.
    
    2002-02-17  Damon J. Courtney 
    
    	* src/make.tcl
    	    Added a script to look around a little more for Apache's apxs tool.
    	    If we can't find it, we output an error message to the user.
    
    	* src/buildscripts/findapxs.tcl
    	    Added to repository.
    
    2002-02-12  David N. Welton  
    
    	* src/TclWebapache.c: Added some INLINE's.
    
    	* src/mod_rivet.c (Rivet_ParseExecFile): Tweaking of parameters to
    	enable the modification stated below.
    
    	* src/rivetCore.c (Rivet_Parse): Removed 'rsc' from this
    	function.
    
    2002-02-07  David N. Welton  
    
    	* src/TclWebapache.c (TclWebMakeURL): New command, extracted out
    	of rivetCore.c.
    
    2002-02-01  David N. Welton  
    
    	* src/rivetCore.c: Deleted rivet_info command.
    
    	* src/TclWebapache.c (TclWeb_GetEnvVars): Added RIVET_CACHE_FREE
    	# and RIVET_CACHE_SIZE as environmental variables.
    
    2002-01-29  David N. Welton  
    
    	* doc/help.html: Updated mailing list archive location.
    
    2002-01-28  David N. Welton  
    
    	* src/rivetCore.c (Rivet_Include): Get channel via Tcl_GetChannel
    	instead of through the apache config structure.
    
    2002-01-27  David N. Welton  
    
    	* tests/parse.test: Added test for 'parse' command.
    
    	* src/mod_rivet.c (Rivet_ParseExecFile): Moved the addition of
    	before and after scripts to this file, so that GetRivetFile is
    	independant of any Apache specific code.
    
    	* src/rivetParser.c, src/rivetParser.h: New files, which replace
    	parser.c and parser.h.
    	(Rivet_GetRivetFile): Moved from mod_rivet.c.  Now capable of
    	operating independantly of mod_rivet.  Use Tcl file functions
    	instead of Apache functions.
    	(Rivet_Parser): Parser now operates on a Tcl_Obj input buffer.
    
    	* src/mod_rivet.h: Moved content_sent to TclWebRequest in TclWeb.h
    
    2002-01-26  David N. Welton  
    
    	* tests/binary.test: Added test file for binary file handling.
    
    	* src/mod_rivet.c (Rivet_SendContent): Moved 'header_only' option
    	so that the request is set up and we don't segfault.
    	(Rivet_GetRivetFile): changed puts to puts -nonewline, so as to
    	not add spurious newlines.
    
    	* src/rivetCore.c (Rivet_Include): Simplified code some, with '-1'
    	argument to Tcl_ReadChars.  Eliminated "lf" -translation option.
    
    2002-01-24  David N. Welton  
    
    	* tests/include.test: Added test for 'include' command.
    
    2002-01-22  David N. Welton  
    
    	* src/mod_rivet.c, src/channel.c, src/rivetCore.c: Switched to
    	TclWeb functions for error, headers.
    
    	* src/mod_rivet.h: Moved headers_set and headers_printed out of
    	the rivet_server_conf struct and into the TclWebRequest struct.
    
    	* src/TclWebapache.c: Moved PrintHeaders, PrintError and
    	SetHeaderType from mod_rivet.c.
    
    	* src/TclWeb.h: Added ER1, ER2 and DEFAULT_HEADER_TYPE here.
    
    	* tests/get.test: Added some tests related to [var *].
    
    	* tests/post.test: Added some tests related to [var *].
    
    	* src/rivetList.c (Rivet_LassignArrayObjCmd): Use -1 instead of
    	NULL when doing NewStringObj.
    
    	* src/rivetCrypt.c: Added header file.
    
    	* src/make.tcl: Added slightly nicer apxs handling.
    
    	* src/mod_rivet.c: Moved StringToUtf to TclWeb.
    
    	* src/mod_rivet.h: Removed StringToUtf macro.
    
    	* src/TclWebapache.c: Lots of bug fixes and corrections.
    
    	* src/rivetCore.c (Rivet_LoadEnv): Switched to TclWeb API.
    	(Rivet_LoadCookies): Switched to TclWeb API.
    	(Rivet_Var): Switched to TclWeb API.
    
    2002-01-19  Damon J. Courtney 
    
    	* src/rivetCore.c
    	    Moved authorization from its own array into the env array as
    	    HTTP_USER and HTTP_PASS.
    
    	    Added an abort_page command which halts the sending of a request.
    
    2002-01-19  David N. Welton  
    
    	* src/TclWebapache.c: Added individual functions for CGI variable
    	access.  Much simpler than trying to devise a data structure to
    	pass them around with.
    
    	* src/rivetCore.c (Rivet_LoadEnv): Roll back authorization
    	information command.
    
    2002-01-18  David N. Welton  
    
    	* src/rivetCore.c (Rivet_LoadAuth): New command to load
    	authorization information in its own array.
    
    	* src/TclWebcgi.c: New file for stand-alone implementations of
    	common web API.
    
    	* src/TclWebapache.c: New file for apache-based implementations of
    	web API.
    
    	* src/TclWeb.c: Common code for TclWeb API.
    
    	* src/TclWeb.h: TclWeb web interaction API.
    
    2002-01-11  Damon J. Courtney 
    
    	* src/make.tcl
    	    Updated some of the make nodes.
    
    	    librivet.so now gets copied into the rivet package directory.
    
    
    	* src/mod_rivet.c
    	    Changed Rivet_Init to Rivet_InitCore to fix bug.
    
    	    All Script directives now append to each other instead of
    	    overwriting the last directive.  Directory directives still
    	    override in standard fashion though.
    
    	* rivet/packages/rivet
    	    Added as the default package of Rivet commands in C.
    
    2002-01-10  Damon J. Courtney 
    	* src/rivet.h
    	    Added macro 'TCL_CMD_HEADER'.  Prints the default command header
    	    for Tcl commands in Rivet.
    
    	    Added macro 'TCL_OBJ_CMD'.  Prints the default object command
    	    creation for Tcl commands in Rivet.
    
    	* src/rivetInit.c
    	    Renamed to rivetPkgInit.c
    
    	* src/rivetCrypt.c
    	    Added.  Contains commands for encryption and decryption.
    		encrypt
    		decrypt
    		crypt
    
    	* src/rivetWWW.c
    	    Added.  Contains commands for the world wide web.
    		escape_string
    		unescape_string
    		escape_sgml_chars
    		escape_shell_command
    
    	* src/rivetList.c
    	    Added the following commands:
    		comma_split
    		comma_join
    		lassign_array
    
    	* src/make.tcl
    	    Moved all of the Rivet Tcl commands into their own library
    	    called librivet.  This will be automatically loaded into Rivet
    	    as the default configuration.  Anyone who wants can take it
    	    out if they choose.
    
    2002-01-10  David N. Welton  
    
    	* tests/template.conf.tcl: Re-add srm.conf and access.conf - if
    	they aren't present, it tries to grab the ones from /etc/ - not
    	what we want.
    
    2002-01-09  Damon J. Courtney 
    	* src/tcl_commands.c
    	    Renamed to rivetCore.c
    
    	* src/tcl_commands.h
    	    Removed.
    
    	* src/rivet.h
    	    Added as the default header file for Rivet Tcl commands.
    
    	* src/rivetList.c
    	    Added.  Only contains 'lremove' right now.
    
    	* src/rivetInit.c
    	    Added.  Contains the Tcl initialization routine for Rivet's Tcl
    	    commands.
    
    	* src/make.tcl
    	    Added rivetCore.c, rivetList.c and rivetInit.c to the make.
    
    2002-01-08  Damon J. Courtney 
    	* src/mod_rivet.h
    	    Added RIVET_NEW_CONF macro to create a new rivet_server_conf.
    
    	* src/mod_rivet.c
    	    Added Rivet_MergeDirConfig to merge directory configurations.
    
    	    Fixed bug where RivetDirConf was giving erroneous information.
    
    2002-01-08  Damon J. Courtney 
    
    	* tests/makeconf.tcl
    	    Went ahead and copied over the entire rivet directory.
    
    	* tests/rivet.test
    	    Changed the default port to 8081.
    
    	* tests/template.conf.tcl
    	    Changed the default port to 8081.
    	    Removed access.conf and srm.conf.
    
    2002-01-08  David N. Welton  
    
    	* tests/makeconf.tcl (makeconf): Added a command to copy over the
    	    init.tcl file to the testing directory.  It would probably be
    	    best to copy the whole directory, though.
    
    2002-01-08  Damon J. Courtney 
    
    	* src/channel.c
    	    Just a text change.
    
    	* src/make.tcl
    	    Added a command to install that will copy the contents of the
    	    rivet/ directory into Apache's install location.
    
    	* src/mod_rivet.h
    	    Removed some superfluous code and deprecated options.
    
    	* src/mod_rivet.c
    	    Finished renaming the rest of the remaining commands into the
    	    standard Rivet_ naming scheme.  This will prevent any further
    	    interferance with other modules.
    
    	    Renamed namespacePrologue to request_init and re-coded the
    	    namespace initialization code in Tcl.
    
    	    Removed leftover references to the ::request::UPLOAD array.
    
    	    Added an array called 'server' to the global namespace which
    	    briefly contains important information about Apache and Rivet.
    
    	    Propagated RivetServerConf, RivetDirConf and RivetUserConf arrays
    	    at the tcl level.
    
    	    Gave RivetUserConf the ability to set BeforeScript, AfterScript
    	    and ErrorScript.
    
    	* src/tcl_commands.c
    	    Updated makeurl to use Tcl objects instead of the old Tcl_SetResult
    	    command.
    
    	* rivet/
    	    Added a rivet/ directory of Tcl code.
    
    	    Added init.tcl to rivet/.  This file contains initialization code
    	    in a ::Rivet namespace that is called when the server starts up.
    
    	* rivet/init.tcl
    	    Added a command for cleanup after each request.  It currently
    	    does nothing but could come in handy later.
    
    	* rivet/packages
    	    Created a rivet/packages directory for future Rivet packages.
    
    	* rivet/rivet-tcl
    	    Created a rivet/rivet-tcl directory containing a few procs.
    
    	* rivet/rivet-tcl/load_response.tcl
    	    Added 'load_response' command to rivet-tcl/.
    
    	* rivet/rivet-tcl/parray.tcl
    	    Added 'parray' command to rivet-tcl/.
    
    2002-01-07  David N. Welton  
    
    	* General: Renamed some more commands so that Rivet may be run
    	alongside mod_dtcl.
    
    	* src/mod_rivet.c (get_parse_exec_file): Oops - change httpd-tcl
    	to httpd-rivet in strcmp.
    
    2002-01-06  David N. Welton  
    
    	* Documentation: Big cleanup, updating everything from mod_dtcl.
    
    	* General: Changed .ttml to .rvt.  Also changed mime type to
    	x-httpd-rivet.  Changed all references in documentation to .rvt
    	from .ttml.
    
    2002-01-05  David N. Welton  
    
    	* src/parser.c (Rivet_Parser): A few, mostly cosmetic, cleanups in
    	the parser.
    
    	* src/make.tcl: Add nodes for testing library.
    
    	* src/channel.c (outputproc): Change printheaders to
    	Rivet_PrintHeaders.
    
    	* General: whitespace cleanups.
    
    2001-11-21  David N. Welton  
    
    	* src/channel.c: Almost all output is based on the ApacheChan
    	channel, and uses Tcl's buffering, flushing, etc...
    
    	* tests/rivet.test: Updated testing scheme to work with lots of
    	test files/ttml files.
    
    2001-11-21  Damon J. Courtney 
    
    	* src/mod_rivet.c
    	    Renamed more commands into the Rivet_ naming scheme.
    
    2001-11-20  Damon J. Courtney 
    
    	* src/tcl_commands.c
    	    load_env and load_cookies now accept an optional argument of
    	    ?arrayName?.
    	* src/tcl_commands.c
    	    Renamed a lot of the commands into a standard naming scheme.
    
    2001-11-20  Damon J. Courtney 
    
    	* src/tcl_commands.c
    	    Cleaned up some more code.  Just textual changes.
    	* src/mod_rivet.c
    	    Cleaned up some run-over lines and code.
    	* src/mod_rivet.c
    	    Changed module signature from "mod_rivet" to "Rivet"
    	* src/tcl_commands.c
    	    Changed hgetvars command to load_env command.
    	* src/tcl_command.c
    	    Moved loading of cookies to load_cookies command.
    	* src/tcl_command.c
    	    Renamed default load_env array from ENVS array to env.
    	* src/tcl_command.c
    	    Renamed default load_cookies array from COOKIES to cookies.
    
    2001-11-08  David N. Welton  
    
    	* src/mod_rivet.c (rivet_child_init): Fix loop, pass correct
    	parameter to RIVET_SERVER_CONF.
    
    2001-10-19  David N. Welton  
    
    	* src/mod_rivet.c (get_parse_exec_file): Fixed up problems with
    	Parse command.
    
    2001-09-30  David N. Welton  
    
    	* src/parser.c (rivet_parser): Quote { and } to avoid problems.
    
    2001-09-23  David N. Welton  
    
    	* Initial commit and cleanup of old mod_dtcl code.
    rivet-3.0.0/doc/html/import_keyvalue_pairs.html000664 001750 001750 00000006177 15224455137 022454 0ustar00manghimanghi000000 000000 import_keyvalue_pairs

    Name

    import_keyvalue_pairs — Import an argument list into the named array

    Synopsis

    ::rivet::import_keyvalue_pairs ?arrayName? ?argsList?

    Description

    key-value pairs, like "-foo bar" are stored in the array ?arrayName?. In that case, the value "bar" would be stored in the element "foo"

    If "--" appears or a key doesn't begin with "-", the rest of the arg list is stored in the special args element of the array.

    Example:

    ::rivet::import_keyvalue_pairs keyvalue_map [list -a1 v1 -a2 v2 -a3 v3 -- 1 2 3 4 5]
    parray keyvalue_map
    
    keyvalue_map(a1)   = v1
    keyvalue_map(a2)   = v2
    keyvalue_map(a3)   = v3
    keyvalue_map(args) = 1 2 3 4 5

    rivet-3.0.0/doc/html/encode.html000664 001750 001750 00000006114 15224455137 017263 0ustar00manghimanghi000000 000000 encode

    Name

    encode — encode a string replacing every occurrence of characters for which an SGML entity exists

    Synopsis

    ::rivet::encode string ?-encoding <encoding>?

    Description

    ::rivet::encode returns a copy of the input string after replacing every occurence of characters for which an SGML entity exists. By default the command assumes the string is encoded in UTF-8, other encodings are supported by passing the -encoding <encoding> argument. The list of available encodings is returned by command

    encoding names
    rivet-3.0.0/cmake/cmake_extra_modules/FindAPR.cmake000664 001750 001750 00000006716 15224454746 022764 0ustar00manghimanghi000000 000000 # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # - Find Apache Portable Runtime # Find the APR includes and libraries # This module defines # APR_INCLUDE_DIR and APRUTIL_INCLUDE_DIR, where to find apr.h, etc. # APR_LIBRARIES and APRUTIL_LIBRARIES, the libraries needed to use APR. # APR_FOUND and APRUTIL_FOUND, If false, do not try to use APR. # also defined, but not for general use are # APR_LIBRARY and APRUTIL_LIBRARY, where to find the APR library. # APR first. FIND_PATH(APR_INCLUDE_DIR apr.h /usr/local/include/apr-1 /usr/local/include/apr-1.0 /usr/include/apr-1 /usr/include/apr-1.0 ${APR_INCLUDE_DIR_HINTS} ${APACHE_INCLUDE_DIR_HINTS} ${APACHE_ROOT}/include ) SET(APR_NAMES ${APR_NAMES} libapr-1 apr-1) FIND_LIBRARY(APR_LIBRARY NAMES ${APR_NAMES} PATHS /usr/lib /usr/local/lib ${APR_LIBRARY_HINTS} ${APACHE_ROOT}/lib ) IF (APR_LIBRARY AND APR_INCLUDE_DIR) SET(APR_LIBRARIES ${APR_LIBRARY}) SET(APR_FOUND "YES") ELSE (APR_LIBRARY AND APR_INCLUDE_DIR) SET(APR_FOUND "NO") ENDIF (APR_LIBRARY AND APR_INCLUDE_DIR) IF (APR_FOUND) IF (NOT APR_FIND_QUIETLY) MESSAGE(STATUS "Found APR: ${APR_LIBRARIES}") ENDIF (NOT APR_FIND_QUIETLY) ELSE (APR_FOUND) IF (APR_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find APR library") ENDIF (APR_FIND_REQUIRED) ENDIF (APR_FOUND) # Deprecated declarations. SET (NATIVE_APR_INCLUDE_PATH ${APR_INCLUDE_DIR} ) GET_FILENAME_COMPONENT (NATIVE_APR_LIB_PATH ${APR_LIBRARY} PATH) MARK_AS_ADVANCED( APR_LIBRARY APR_INCLUDE_DIR ) # Next, APRUTIL. FIND_PATH(APRUTIL_INCLUDE_DIR apu.h /usr/local/include/apr-1 /usr/local/include/apr-1.0 /usr/include/apr-1 /usr/include/apr-1.0 ${APRUTIL_INCLUDE_DIR_HINTS} ${APACHE_INCLUDE_DIR_HINTS} ${APACHE_ROOT}/include ) SET(APRUTIL_NAMES ${APRUTIL_NAMES} libaprutil-1 aprutil-1 ) FIND_LIBRARY(APRUTIL_LIBRARY NAMES ${APRUTIL_NAMES} PATHS /usr/lib /usr/local/lib ${APRUTIL_LIBRARY_HINTS} ${APR_LIBRARY} ${APACHE_ROOT}/lib ${APR_LIBRARY_HINTS} ) IF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) SET(APRUTIL_LIBRARIES ${APRUTIL_LIBRARY}) SET(APRUTIL_FOUND "YES") ELSE (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) SET(APRUTIL_FOUND "NO") ENDIF (APRUTIL_LIBRARY AND APRUTIL_INCLUDE_DIR) IF (APRUTIL_FOUND) IF (NOT APRUTIL_FIND_QUIETLY) MESSAGE(STATUS "Found APRUTIL: ${APRUTIL_LIBRARIES}") ENDIF (NOT APRUTIL_FIND_QUIETLY) ELSE (APRUTIL_FOUND) IF (APRUTIL_FIND_REQUIRED) MESSAGE(FATAL_ERROR "Could not find APRUTIL library") ENDIF (APRUTIL_FIND_REQUIRED) ENDIF (APRUTIL_FOUND) # Deprecated declarations. SET (NATIVE_APRUTIL_INCLUDE_PATH ${APRUTIL_INCLUDE_DIR} ) GET_FILENAME_COMPONENT (NATIVE_APRUTIL_LIB_PATH ${APRUTIL_LIBRARY} PATH) MARK_AS_ADVANCED( APRUTIL_LIBRARY APRUTIL_INCLUDE_DIR ) rivet-3.0.0/doc/examples-sgml/upload.html000664 001750 001750 00000000423 15224454746 021126 0ustar00manghimanghi000000 000000 <form action="foo.rvt" enctype="multipart/form-data" method="post"> <input type="file" name="MyUpload"></input> <input type="submit" value="Send File"></input> </form> rivet-3.0.0/tests/binary.rvt000664 001750 001750 00000000704 15224454746 016616 0ustar00manghimanghi000000 000000 rivet-3.0.0/doc/xml/cmake.xml000664 001750 001750 00000004243 15224454746 016604 0ustar00manghimanghi000000 000000
    Building Rivet &version; with CMake
    Starting with &version; Rivet has adopted CMake as an alternate build system. The choice of introducing CMake was motivated by the need of an easy to use and reliable build system for Windows installations. Nonetheless the usability of CMake is by no means restricted to that OS and user familiar with this tool set can adopt it to build mod_rivet also on Linux and other systems. The current CMake script requires CMake 3.2 or later. The CMake documentation page has a complete reference of CMake features CMake build procedure and examples Before running the build script cd into the cmake directory cd cmake With default arguments run the following sequence of commands that prepare the build directory build the code and install the binary and application library cmake -E make_directory build cmake -E chdir build cmake .. cmake --build build --target all --clean-first cmake --build build --target install Installation on a Windows system with a custom installation of the Apache HTTP web server cmake -E make_directory build cmake -E chdir build cmake -DAPACHE_ROOT=G:/Apache24 .. cmake --build build --config Release --target install Building rivet on Windows with a 64 bit build of Apache requires specific directives to the Microsoft C compiler cmake -E make_directory build_64 cmake -E chdir build_64 cmake -DAPACHE_ROOT=G:/Apache24 -G "Visual Studio 15 2017 Win64" .. cmake --build build_64 --config Release --target install -G "..." can be set to any of the available 64-bit generators available under the platform depending on your Windows version and Apache build
    rivet-3.0.0/m4/ax_prefix_config_h.m4000664 001750 001750 00000020620 15224454746 020035 0ustar00manghimanghi000000 000000 # =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_prefix_config_h.html # =========================================================================== # # SYNOPSIS # # AX_PREFIX_CONFIG_H [(OUTPUT-HEADER [,PREFIX [,ORIG-HEADER]])] # # DESCRIPTION # # This is a new variant from ac_prefix_config_ this one will use a # lowercase-prefix if the config-define was starting with a # lowercase-char, e.g. "#define const", "#define restrict", or "#define # off_t", (and this one can live in another directory, e.g. # testpkg/config.h therefore I decided to move the output-header to be the # first arg) # # takes the usual config.h generated header file; looks for each of the # generated "#define SOMEDEF" lines, and prefixes the defined name (ie. # makes it "#define PREFIX_SOMEDEF". The result is written to the output # config.header file. The PREFIX is converted to uppercase for the # conversions. # # Defaults: # # OUTPUT-HEADER = $PACKAGE-config.h # PREFIX = $PACKAGE # ORIG-HEADER, from AM_CONFIG_HEADER(config.h) # # Your configure.ac script should contain both macros in this order, and # unlike the earlier variations of this prefix-macro it is okay to place # the AX_PREFIX_CONFIG_H call before the AC_OUTPUT invokation. # # Example: # # AC_INIT(config.h.in) # config.h.in as created by "autoheader" # AM_INIT_AUTOMAKE(testpkg, 0.1.1) # makes #undef VERSION and PACKAGE # AM_CONFIG_HEADER(config.h) # prep config.h from config.h.in # AX_PREFIX_CONFIG_H(mylib/_config.h) # prep mylib/_config.h from it.. # AC_MEMORY_H # makes "#undef NEED_MEMORY_H" # AC_C_CONST_H # makes "#undef const" # AC_OUTPUT(Makefile) # creates the "config.h" now # # and also mylib/_config.h # # if the argument to AX_PREFIX_CONFIG_H would have been omitted then the # default outputfile would have been called simply "testpkg-config.h", but # even under the name "mylib/_config.h" it contains prefix-defines like # # #ifndef TESTPKG_VERSION # #define TESTPKG_VERSION "0.1.1" # #endif # #ifndef TESTPKG_NEED_MEMORY_H # #define TESTPKG_NEED_MEMORY_H 1 # #endif # #ifndef _testpkg_const # #define _testpkg_const _const # #endif # # and this "mylib/_config.h" can be installed along with other # header-files, which is most convenient when creating a shared library # (that has some headers) where some functionality is dependent on the # OS-features detected at compile-time. No need to invent some # "mylib-confdefs.h.in" manually. :-) # # Note that some AC_DEFINEs that end up in the config.h file are actually # self-referential - e.g. AC_C_INLINE, AC_C_CONST, and the AC_TYPE_OFF_T # say that they "will define inline|const|off_t if the system does not do # it by itself". You might want to clean up about these - consider an # extra mylib/conf.h that reads something like: # # #include # #ifndef _testpkg_const # #define _testpkg_const const # #endif # # and then start using _testpkg_const in the header files. That is also a # good thing to differentiate whether some library-user has starting to # take up with a different compiler, so perhaps it could read something # like this: # # #ifdef _MSC_VER # #include # #else # #include # #endif # #ifndef _testpkg_const # #define _testpkg_const const # #endif # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2008 Marten Svantesson # Copyright (c) 2008 Gerald Point # # This program 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. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 11 AC_DEFUN([AX_PREFIX_CONFIG_H],[dnl AC_PREREQ([2.62]) AC_BEFORE([AC_CONFIG_HEADERS],[$0])dnl AC_CONFIG_COMMANDS([ifelse($1,,$PACKAGE-config.h,$1)],[dnl AS_VAR_PUSHDEF([_OUT],[ac_prefix_conf_OUT])dnl AS_VAR_PUSHDEF([_DEF],[ac_prefix_conf_DEF])dnl AS_VAR_PUSHDEF([_PKG],[ac_prefix_conf_PKG])dnl AS_VAR_PUSHDEF([_LOW],[ac_prefix_conf_LOW])dnl AS_VAR_PUSHDEF([_UPP],[ac_prefix_conf_UPP])dnl AS_VAR_PUSHDEF([_INP],[ac_prefix_conf_INP])dnl m4_pushdef([_script],[conftest.prefix])dnl m4_pushdef([_symbol],[m4_cr_Letters[]m4_cr_digits[]_])dnl _OUT=`echo ifelse($1, , $PACKAGE-config.h, $1)` _DEF=`echo _$_OUT | sed -e "y:m4_cr_letters:m4_cr_LETTERS[]:" -e "s/@<:@^m4_cr_Letters@:>@/_/g"` _PKG=`echo ifelse($2, , $PACKAGE, $2)` _LOW=`echo _$_PKG | sed -e "y:m4_cr_LETTERS-:m4_cr_letters[]_:"` _UPP=`echo $_PKG | sed -e "y:m4_cr_letters-:m4_cr_LETTERS[]_:" -e "/^@<:@m4_cr_digits@:>@/s/^/_/"` _INP=`echo "ifelse($3,,,$3)" | sed -e 's/ *//'` if test ".$_INP" = "."; then for ac_file in : $CONFIG_HEADERS; do test "_$ac_file" = _: && continue case "$ac_file" in *.h) _INP=$ac_file ;; *) esac test ".$_INP" != "." && break done fi if test ".$_INP" = "."; then case "$_OUT" in */*) _INP=`basename "$_OUT"` ;; *-*) _INP=`echo "$_OUT" | sed -e "s/@<:@_symbol@:>@*-//"` ;; *) _INP=config.h ;; esac fi if test -z "$_PKG" ; then AC_MSG_ERROR([no prefix for _PREFIX_PKG_CONFIG_H]) else if test ! -f "$_INP" ; then if test -f "$srcdir/$_INP" ; then _INP="$srcdir/$_INP" fi fi AC_MSG_NOTICE(creating $_OUT - prefix $_UPP for $_INP defines) if test -f $_INP ; then AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_LETTERS[]_@:>@\\)/@%:@undef $_UPP""_\\1/"]) > _script AS_ECHO(["s/^@%:@undef *\\(@<:@m4_cr_letters@:>@\\)/@%:@undef $_LOW""_\\1/"]) >> _script AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_LETTERS[]_@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_UPP""_\\1\\"]) >> _script AS_ECHO(["@%:@def[]ine $_UPP""_\\1\\2\\"]) >> _script AS_ECHO(["@%:@endif/"]) >> _script AS_ECHO(["s/^@%:@def[]ine *\\(@<:@m4_cr_letters@:>@@<:@_symbol@:>@*\\)\\(.*\\)/@%:@ifndef $_LOW""_\\1\\"]) >> _script AS_ECHO(["@%:@define $_LOW""_\\1\\2\\"]) >> _script AS_ECHO(["@%:@endif/"]) >> _script # now executing _script on _DEF input to create _OUT output file echo "@%:@ifndef $_DEF" >$tmp/pconfig.h echo "@%:@def[]ine $_DEF 1" >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo /'*' $_OUT. Generated automatically at end of configure. '*'/ >>$tmp/pconfig.h sed -f _script $_INP >>$tmp/pconfig.h echo ' ' >>$tmp/pconfig.h echo '/* once:' $_DEF '*/' >>$tmp/pconfig.h echo "@%:@endif" >>$tmp/pconfig.h if cmp -s $_OUT $tmp/pconfig.h 2>/dev/null; then AC_MSG_NOTICE([$_OUT is unchanged]) else ac_dir=`AS_DIRNAME(["$_OUT"])` AS_MKDIR_P(["$ac_dir"]) rm -f "$_OUT" mv $tmp/pconfig.h "$_OUT" fi cp _script _configs.sed else AC_MSG_ERROR([input file $_INP does not exist - skip generating $_OUT]) fi rm -f conftest.* fi m4_popdef([_symbol])dnl m4_popdef([_script])dnl AS_VAR_POPDEF([_INP])dnl AS_VAR_POPDEF([_UPP])dnl AS_VAR_POPDEF([_LOW])dnl AS_VAR_POPDEF([_PKG])dnl AS_VAR_POPDEF([_DEF])dnl AS_VAR_POPDEF([_OUT])dnl ],[PACKAGE="$PACKAGE"])]) rivet-3.0.0/tests/rivet.test000775 001750 001750 00000005513 15224454746 016635 0ustar00manghimanghi000000 000000 #!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # Rivet test suite, by David N. Welton # See README file for more information. package require tcltest set auto_path [linsert $auto_path 0 [file join [pwd] rivet]] set host "localhost" set urlbase "http://${host}:8081/" # Use this to start and stop the server: if {[info exists ::env(TestList)]} { set TestList $::env(TestList) } else { set TestList { rivetlib.test shorthand.test headers.test channelencoding.test cookies.test get.test post.test tclfile.test \ env.test hello.test include.test binary.test \ parse.test upload.test makeurl.test commands.test } } # Test stanzas are created by giving the test a name and a # description. The code is then executed, and the results compared # with the desired result, which is placed after the block of code. # See man tcltest for more information. foreach tgroup {1 2 3} { set testgroup${tgroup} 1 if {[info exists ::env(testgroup${tgroup})]} { set testgroup${tgroup} $::env(testgroup${tgroup}) } } # Run all tests against one server process. if { $testgroup1 } { puts -nonewline "Running all tests against one server process." flush stdout apachetest::start {} {} { foreach Test $TestList { puts -nonewline "." flush stdout source $Test } } puts " done" } # Run each test in its own server. if { $testgroup2 } { foreach Test $TestList { apachetest::start {} {} { puts "Running $Test" source $Test } } } # These tests start the server on their own, or don't need the server # at all. set group3 { failtest.test broken.test config.test parsepackage.test virtualhost.test inspect.test bailout.test channel.test } if { $testgroup3 } { foreach Test $group3 { puts "Running $Test" source $Test } } ::tcltest::cleanupTests rivet-3.0.0/doc/html/no_body.html000664 001750 001750 00000004615 15224455137 017463 0ustar00manghimanghi000000 000000 no_body

    Name

    no_body — Prevents Rivet from sending any content.

    Synopsis

    ::rivet::no_body

    Description

    This command is useful for situations where it is necessary to only return HTTP headers and no actual content. For instance, when returning a 304 redirect.

    rivet-3.0.0/contrib/README000664 001750 001750 00000000722 15224454746 015753 0ustar00manghimanghi000000 000000 README file for 'contrib', directory that stores various contribution that don't fit well in the current distribution of Rivet ======================================================================= $Id: $ ======================================================================= rvt.vim: Syntax highlighting of rvt files in Vim form.tcl: TclOO form package (contributed by Clif Flynt) two-mode-mode.el: Switches between tcl and sgml(html) modes (David Welton) rivet-3.0.0/src/librivet/Makefile.am000664 001750 001750 00000002411 15224454746 020073 0ustar00manghimanghi000000 000000 # Makefile for Rivet # Copyright 2004-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$ #AM_CPPFLAGS = @apache_include@ # ... and these two. We want to put the libs in the package path, # rather than the standard library location for the system. #lib_libexecdir = @RIVET_TCL_TARGET@ #lib_libexec_LTLIBRARIES = librivetlib.la ## ## Rivet Library ## #librivetlib_la_SOURCES = rivetList.c rivetCrypt.c rivetWWW.c rivetPkgInit.c #librivetlib_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version #librivetlib_la_LIBADD = @APXS_LIBS@ #librivetlib_la_CPPFLAGS = -I.. -I../@apache_version_dir@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='""' -DUSE_TCL_STUBS rivet-3.0.0/rivet/rivet-tcl/load_cookies.tcl000664 001750 001750 00000001075 15224454746 021636 0ustar00manghimanghi000000 000000 ### ## ## load_cookies - Read the cookies out of the web environment HTTP_COOKIE ## variable, parse it, and store them as key-value pairs into the named ## array. ## ## $Id$ ## ### namespace eval ::rivet { proc load_cookies {{arrayName cookies}} { upvar 1 $arrayName cookies set HTTP_COOKIE [env HTTP_COOKIE] foreach pair [split $HTTP_COOKIE ";"] { set pair [split [string trim $pair] "="] set key [lindex $pair 0] set value [lindex $pair 1] set cookies($key) [list $value] } } } rivet-3.0.0/LICENSE000664 001750 001750 00000026136 15224454746 014447 0ustar00manghimanghi000000 000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] 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. rivet-3.0.0/doc/images/home.png000664 001750 001750 00000012704 15224454746 017106 0ustar00manghimanghi000000 000000 PNG  IHDRd?m`bKGD pHYs  ~tIME*!@0\tEXtCommentCreated with GIMPW,IDATx{]W}?u+Yz_ݫ7u' O'!$`4ctqIqMIH&'i<ʤ(48< cK˲d!eْ㜳>>}JQs9{}Z}:tȾpcǎ\-[p7k.n*3,Ǿ}lk9 =qkﰇz.;^ eϖ/_>mcj5?l/r;D{?nf{<nwtR2Q}MOًضm۔;3&҉KҥKѣ/XP?|}QDY=|u׾6}&),3gp}he/7 t$`R]0\Z|&f AJHIK_ ֭geh8%a6iFʔAOH+)g>c ti8>p-z;Ysꫦj¶׾/(1FsԒ6% bdjQ{#  PR$SOr?}3$Ko}]}풦)p4\*Q)J-IM*jxp$i!>{o~ 8DnlZ}~s _}wI =uY{Y5yg7,ԉEpx`t,XXcٻ~cY:s} M>79Đ\I "`3c-[eZ@),xNwpsj+?,~;6-|l gss \mی/4;h!AtX85cojq&vg7BeKmpx.<;3raP7?jɩ3}{;z4AeeC r CY_`>>/_oHW7!h!"ƲY3z"#q#n->iE"9ꌦӿ[&v\1U+i`wwODɁ?Wt MgV"cĴfL %Sݲ#AsIB!sGDy_O"{eIR3 gTكf~!9PR8I7/}GEqPޠn)D+̇2A|l ,œH}49tV.EmCD5>Q`\X\!Yw=j!缇 #p[}RY{۪obN u#@&xih<}ԚǏRٺ H%jF4(K:Z镯7a04;e* Y#ԉ`P2Ox}>$NPs9 +wT|-T -qVUTĻ)%:Ap0W \D@SϫؙI!Sq-d>|)$$lRDՃAAM)xɬQU.zؙð{i{eFr|Gl9ܻ\h̉tT^"m;"D _@sV"M* ~;_2߂Paͽ_'3l%gb+*EzTvS۰μ;I~)a?S\uˉVc^DĚB1Í :N o`ʋFK]<*7Ozvvb9)zY7hK,X@B2cn\"ruǏ`I1wy~Æ$\* Fǧ9W]u\rd?r !X/r32t,)B3Gyj- ez#wI> GjZ$1*'>B;Jk 8p[pZ.41aJ&=7SYꕲ1 '%dDҽ7P#|. Jڵ׏q" \4);ϰΒ䔜qc[R!@,,Y%;#-_Oy9߿ƹRLsA. 248rAd8j$F:$4#P,VyrH TᝫG3`6*j¼tj\3;S2YCbb)$*|gOp"xq 4k_l+@(d΍ύhDHTHqs"suk2W6Aŭu?i_#j7SKEx2^D9)Fu~*=57XYϯXEM?OtJB:G/YDժ 09/ ]۶_~[7>oO' T{4$łR陜&H-?b3*M+;t:^W{o=7͞~IJ._zë\OR s -P3\D݌ c@޿1ynV*('J. i=质,z!ZQ+i\ t!bdlWD&N*+>Os;zB.r=^;|0rycfo7/fFhG5b@H9a,H &>I11|mL$X&Q#RS%f99\0U,C\[z$Hy R6`Vz<6[-by,VkKcmd'-!sMbaS3 CAަJ/SbW< #include #include #include #include #include "rivet_types.h" #include "rivet.h" #include "apache_request.h" /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif /* * Petasis 16 Dec 2018: This causes the symbol to be exported also from MPMs... * * APLOG_USE_MODULE(rivet); * * PLEASE: do not use any of APLOG_USE_MODULE, AP_DECLARE_MODULE, * AP_MODULE_DECLARE_DATA in this header file! * */ /* init.tcl file relative to the server root directory */ #define RIVET_DIR RIVET_RIVETLIB_DESTDIR #define RIVET_INIT RIVET_RIVETLIB_DESTDIR"/init.tcl" #if 0 #define FILEDEBUGINFO fprintf(stderr, "Function " __FUNCTION__ "\n") #else #define FILEDEBUGINFO #endif #define VAR_SRC_QUERYSTRING 1 #define VAR_SRC_POST 2 #define VAR_SRC_ALL 3 #define DEFAULT_ERROR_MSG "[an error occurred while processing this directive]" #define DEFAULT_TIME_FORMAT "%A, %d-%b-%Y %H:%M:%S %Z" #define MULTIPART_FORM_DATA 1 #define USER_SCRIPTS_UPDATED 1 #define USER_SCRIPTS_CONF 1<<1 #define USER_SCRIPTS_MERGED 1<<2 #define IS_USER_CONF(mc) ((mc->user_scripts_status & USER_SCRIPTS_CONF) != 0) #define USER_CONF_UPDATED(mc) ((mc->user_scripts_status & USER_SCRIPTS_UPDATED) != 0) #define USER_CONF_MERGED(mc) ((mc->user_scripts_status & USER_SCRIPTS_MERGED) != 0) /* IMPORTANT: If you make any changes to the rivet_server_conf struct, * you need to make the appropriate modifications to Rivet_CopyConfig, * Rivet_CreateConfig, Rivet_MergeConfig and so on. */ /* * Petasis 10 Aug 2017: This causes the symbol to be exported also from MPMs... * * module AP_MODULE_DECLARE_DATA rivet_module; * */ typedef struct _rivet_server_conf { char* rivet_global_init_script; /* run once when apache is started */ char* rivet_child_init_script; char* rivet_child_exit_script; char* request_handler; /* request handler script */ char* rivet_error_script; /* for errors */ char* rivet_abort_script; /* script run upon abort_page call */ char* after_every_script; /* script to be always run */ /* these scripts are kept for compatibility. They may disappear in future versions */ char* rivet_before_script; /* script run before each page */ char* rivet_after_script; /* after */ /* ------------------------------------------------------------------------ */ /* This flag is used with the above directives. If any of them have changed, it gets set. */ unsigned int user_scripts_status; int default_cache_size; int upload_max; int upload_files_to_var; int honor_head_requests; int export_rivet_ns; /* export the ::rivet namespace commands */ int import_rivet_ns; /* import into the global namespace the exported ::rivet commands */ char* server_name; const char* upload_dir; apr_table_t* rivet_server_vars; apr_table_t* rivet_dir_vars; apr_table_t* rivet_user_vars; int idx; /* server record index (to be used for the interps db) */ char* path; /* copy of the path field of a cmd_parms structure: * * should enable us to tell if a conf record comes from a * * Directory section */ } rivet_server_conf; #define TCL_INTERPS 1 /* thread private interpreter error flags */ #define RIVET_CACHE_FULL 1 #define RIVET_INTERP_INITIALIZED 2 typedef struct _interp_running_scripts { Tcl_Obj* request_processing; /* request processing central procedure */ Tcl_Obj* rivet_before_script; /* script run before each page */ Tcl_Obj* rivet_after_script; /* after */ Tcl_Obj* rivet_error_script; Tcl_Obj* rivet_abort_script; Tcl_Obj* after_every_script; } running_scripts; typedef struct _rivet_thread_interp { Tcl_Interp* interp; Tcl_Channel* channel; /* the Tcl interp private channel */ int cache_size; int cache_free; Tcl_HashTable* objCache; /* Objects cache - the key is the script name */ char** objCacheList; /* Array of cached objects (for priority handling) */ apr_pool_t* pool; /* interpreters cache private memory pool */ running_scripts* scripts; /* base server conf scripts */ apr_hash_t* per_dir_scripts; /* per dir running scripts */ unsigned int flags; /* signals of various interp specific conditions */ } rivet_thread_interp; typedef struct _thread_worker_private rivet_thread_private; typedef int (RivetBridge_ServerInit) (apr_pool_t*,apr_pool_t*,apr_pool_t*,server_rec*); typedef void (RivetBridge_ThreadInit) (apr_pool_t* pPool,server_rec* s); typedef int (RivetBridge_Request) (request_rec*,rivet_req_ctype); typedef apr_status_t (RivetBridge_Finalize) (void*); typedef rivet_thread_interp* (RivetBridge_Master_Interp) (void); typedef int (RivetBridge_Exit_Handler) (rivet_thread_private*); typedef rivet_thread_interp* (RivetBridge_Thread_Interp) (rivet_thread_private*,rivet_server_conf *,rivet_thread_interp*); typedef struct _mpm_bridge_table { RivetBridge_ServerInit *server_init; RivetBridge_ThreadInit *thread_init; RivetBridge_Request *request_processor; RivetBridge_Finalize *child_finalize; RivetBridge_Exit_Handler *exit_handler; RivetBridge_Thread_Interp *thread_interp; } rivet_bridge_table; /* we need also a place where to store globals with module wide scope */ typedef struct mpm_bridge_status mpm_bridge_status; typedef struct _mod_rivet_globals { apr_pool_t* pool; char* rivet_mpm_bridge; /* name of the MPM bridge */ server_rec* server; /* default host server_rec obj */ int vhosts_count; /* Number of configured virtual host including * * the root server thus it's supposed to be >= 1 */ char* default_handler; /* Default request handler code */ int default_handler_size; /* Size of the default_handler buffer */ rivet_thread_interp* server_interp; /* server and prefork MPM interpreter */ apr_thread_mutex_t* pool_mutex; /* threads commmon pool mutex */ rivet_bridge_table* bridge_jump_table; /* Jump table to bridge specific procedures */ const char* rivet_server_init_script; /* run before children are forked */ const char* mpm_bridge; /* MPM bridge. if not null the module will */ /* try to load the file name in this field. */ /* The string should be either a full */ /* path to a file name, or a string from */ /* which a file name will be composed using */ /* the pattern 'rivet_(mpm_bridge)_mpm.so */ mpm_bridge_status* mpm; /* bridge private control structure */ int single_thread_exit; /* With a threaded bridge allow a single */ /* thread to exit instead of forcing the */ /* whole process to terminate */ int separate_virtual_interps; /* Virtual host have their own interpreter */ int separate_channels; /* when true each virtual hosts gets a private channel */ #ifdef RIVET_SERIALIZE_HTTP_REQUESTS apr_thread_mutex_t* req_mutex; #endif } mod_rivet_globals; typedef struct mpm_bridge_specific mpm_bridge_specific; typedef struct _thread_worker_private { apr_pool_t* pool; /* threads private memory pool */ Tcl_Channel* channel; /* the Tcl thread private channel */ int req_cnt; /* requests served by thread */ rivet_req_ctype ctype; /* */ request_rec* r; /* current request_rec */ TclWebRequest* req; rivet_server_conf* running_conf; /* running configuration */ running_scripts* running; /* (per request) running conf scripts */ int thread_exit; /* Thread exit code */ int exit_status; /* status code to be passed to exit() */ int page_aborting; /* abort_page flag */ Tcl_Obj* abort_code; /* To be reset before request * * processing completes */ Tcl_Obj* default_error_script; /* mod_rivet default error handler */ request_rec* rivet_panic_request_rec; apr_pool_t* rivet_panic_pool; server_rec* rivet_panic_server_rec; mpm_bridge_specific* ext; /* bridge specific private thread data */ } rivet_thread_private; /* eventually we will transfer 'global' variables in here and 'de-globalize' them */ typedef struct _rivet_interp_globals { Tcl_Namespace* rivet_ns; /* Rivet commands namespace */ server_rec* server; /* Virtual host server rec */ } rivet_interp_globals; rivet_server_conf *Rivet_GetConf(request_rec *r); /* * Petasis, 04/08/2017: I think the following is wrong, as both "functions" are * defined through preprocessor definitions in http_config.h. At least under * windows, they do not exist as functions in libhttpd.lib. * #ifdef ap_get_module_config #undef ap_get_module_config #endif #ifdef ap_set_module_config #undef ap_set_module_config #endif */ #define RIVET_SERVER_CONF(module) (rivet_server_conf *)ap_get_module_config(module, &rivet_module) #define RIVET_NEW_CONF(p) (rivet_server_conf *)apr_pcalloc(p, sizeof(rivet_server_conf)) Tcl_Obj* Rivet_BuildConfDictionary (Tcl_Interp* interp,rivet_server_conf* rivet_conf); Tcl_Obj* Rivet_ReadConfParameter (Tcl_Interp* interp,rivet_server_conf* rivet_conf,Tcl_Obj* par_name); Tcl_Obj* Rivet_CurrentConfDict (Tcl_Interp* interp,rivet_server_conf* rivet_conf); Tcl_Obj* Rivet_CurrentServerRec (Tcl_Interp* interp, server_rec* s); /* rivet or tcl file */ #define RIVET_TEMPLATE_CTYPE "application/x-httpd-rivet" #define RIVET_TCLFILE_CTYPE "application/x-rivet-tcl" #define CTYPE_NOT_HANDLED 0 #define RIVET_TEMPLATE 1 #define RIVET_TCLFILE 2 /* these three must go in their own file */ /* temporary content generation handler */ //EXTERN int RivetContent (rivet_thread_private* private); /* error code set by command 'abort_page' */ #define ABORTPAGE_CODE "ABORTPAGE" #define THREAD_EXIT_CODE "THREAD_EXIT" /* Configuration defaults */ #define SINGLE_THREAD_EXIT_UNDEF -1 /* pre config undefined value for single thread exit flag in the module globals structure */ #define TCL_MAX_CHANNEL_BUFFER_SIZE (1024*1024) #define MODNAME "mod_rivet" /* * RIVET_CONF_SELECT: * * This macro avoids unnecessary verbosity of repetitive code in functions * overlaying and merging configuration records */ #define RIVET_CONF_SELECT(selected,base,overlay,field) \ selected->field = overlay->field ? overlay->field : base->field; #define RIVET_CR_TERM(pool,string) apr_pstrcat(pool,string,"\n",NULL) #define RIVET_SCRIPT_INIT(p,running_script,rivet_conf_rec,objscript) \ if (rivet_conf_rec->objscript == NULL) {\ running_script->objscript = NULL;\ } else {\ running_script->objscript = Tcl_NewStringObj(RIVET_CR_TERM(p,rivet_conf_rec->objscript),-1);\ Tcl_IncrRefCount(running_script->objscript);\ } #define RIVET_SCRIPT_DISPOSE(running_scripts,script_name) \ if (running_scripts->script_name != NULL) {\ Tcl_DecrRefCount(running_scripts->script_name);\ } #define RIVET_MPM_BRIDGE_TABLE bridge_jump_table #define RIVET_MPM_BRIDGE_FUNCTION(fun) module_globals->bridge_jump_table->fun #define RIVET_MPM_BRIDGE_CALL(fun,...) if ((*module_globals->bridge_jump_table->fun) != NULL) {\ (*module_globals->bridge_jump_table->fun)(__VA_ARGS__);\ } #define RIVET_PEEK_INTERP(thread_private,running_conf) \ (module_globals->bridge_jump_table->thread_interp)(thread_private,running_conf,NULL) #define RIVET_POKE_INTERP(thread_private,running_conf,interp) \ (module_globals->bridge_jump_table->thread_interp)(thread_private,running_conf,interp) #define RIVET_MPM_BRIDGE rivet_bridge_table bridge_jump_table = /* macro meant to build the ap_pstrcat argument list expansion */ #define RIVET_MPM_BRIDGE_COMPOSE(bridge) "/mpm/rivet_",bridge,"_mpm.so" #endif /* __mod_rivet_h__ */ rivet-3.0.0/src/request/apache_multipart_buffer.h000664 001750 001750 00000003714 15224454746 022742 0ustar00manghimanghi000000 000000 /* apache_multipart_buffer.h -- form multipart data handling */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #ifndef __apache_multipart_buffer_h__ #define __apache_multipart_buffer_h__ #include "apache_request.h" /* #define DEBUG 1 */ #define FILLUNIT (1024 * 8) #define MPB_ERROR APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, self->r #ifdef __cplusplus extern "C" { #endif typedef struct _multipart_buffer { /* request info */ request_rec* r; apr_off_t request_length; /* read buffer */ char* buffer; char* buf_begin; int bufsize; int bytes_in_buffer; /* boundary info */ char* boundary; char* boundary_next; char* boundary_end; } multipart_buffer; multipart_buffer* multipart_buffer_new(char* boundary,apr_off_t length,request_rec* r); // /*table*/apr_table_t *multipart_buffer_headers(multipart_buffer *self); size_t multipart_buffer_read(multipart_buffer* self,char* buf,size_t bytes); char* multipart_buffer_read_body(multipart_buffer *self); apr_table_t* multipart_buffer_headers(multipart_buffer *self); int multipart_buffer_eof(multipart_buffer *self); #ifdef __cplusplus } #endif #endif /*__apache_multipart_buffer_h__ */ rivet-3.0.0/doc/examples-sgml/vars.html000664 001750 001750 00000002130 15224454746 020612 0ustar00manghimanghi000000 000000 <form action="vars.rvt"> <table> <tbody> <tr> <td><b>Title:</b></td> <td><input name="title" /></td> </tr> <tr> <td><b>Salary:</b></td> <td><input name="salary" /></td> </tr> <tr> <td><b>Boss:</b></td> <td><input name="boss" /></td></tr> <tr> <td><b>Skills:</b></td> <td> <select name="skills" multiple="multiple"> <option>C</option> <option>Java</option> <option>Tcl</option> <option>Perl</option> </select> </td> </tr> <tr> <td><input type="submit" /></td> </tr> </tbody> </table> </form> rivet-3.0.0/rivet/packages/dio/000775 001750 001750 00000000000 15224454746 017114 5ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/packages/rivet_ncgi/rivet_ncgi.tcl000664 001750 001750 00000004264 15224454746 023335 0ustar00manghimanghi000000 000000 # rivet_ncgi.tcl -- Rivet ncgi compatibility layer # $Id$ package provide ncgi 1.0 package require fileutil package require http namespace eval ncgi { } # ::ncgi::parse -- # # Mostly a no-op for Rivet, although it loads up the ::env # variable. # # Arguments: # None. # # Side Effects: # Modifies ::env environment to include stuff from the request. # # Results: # None. proc ::ncgi::parse {} { ::rivet::load_env ::env } # ::ncgi::value -- # # Returns the value of a 'cgi' variable. # # Arguments: # key - variable name. # default - default value should it not exist. # # Side Effects: # None. # # Results: # The value of the specified variable, or {} if it is empty. proc ::ncgi::value {key {default {}}} { if { [::rivet::var exists $key] } { return [::rivet::var get $key] } else { return $default } } # ::ncgi::encode -- # # HTML encode a string. # # Arguments: # string - text to encode. # # Side Effects: # None. # # Results: # Encoded string. proc ::ncgi::encode {string} { return [http::formatQuery $string] } # ::ncgi::importFile -- # # See the ncgi documentation. proc ::ncgi::importFile {cmd var {filename {}}} { switch -exact -- $cmd { -server { if { $filename == {} } { set filename [::fileutil::tempfile ncgi] } ::rivet::upload save $var $filename return $filename } -client { return [::rivet::upload filename $var] } -type { return [::rivet::upload type] } -data { return [::rivet::upload data $var] } default { error "Unknown subcommand to ncgi::import_file: $cmd" } } } # ::ncgi::empty -- # # Returns 1 if the CGI variable in question is not set, 0 if it # is set. # # Arguments: # name - variable name. # # Side Effects: # None. # # Results: # 1 or 0. proc ::ncgi::empty {name} { expr {![::rivet::var exists $name]} } # ::ncgi::::redirect -- # # Generate a redirect. # # Arguments: # uri - new URL to go to. # # Side Effects: # Must be done before puts statements. # # Results: # None. proc ::ncgi::::redirect {uri} { ::rivet::headers redirect $uri } rivet-3.0.0/src/mod_rivet_ng/rivetChannel.c000664 001750 001750 00000006413 15224454746 021467 0ustar00manghimanghi000000 000000 /* rivetChannel.c -- mod_rivet Tcl output channel. */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "httpd.h" #include "http_config.h" #include "http_request.h" #include #include #include "mod_rivet.h" #include "TclWeb.h" /* In case of Tcl8.6 build we assign the sentinel value to the field closeProc, which redirects the call to close2Proc */ #if TCL_MAJOR_VERSION >= 9 # define TCL_CLOSEPROC NULL #else # define TCL_CLOSEPROC TCL_CLOSE2PROC #endif static int RivetChan_InputProc(ClientData instancedata, char *buf, int toRead, int *errorCodePtr) { return EINVAL; } /* This is the output 'method' for the Memory Buffer Tcl 'File' Channel that we create to divert stdout to. */ static int RivetChan_OutputProc(ClientData instancedata, const char *buf, int toWrite, int *errorCodePtr) { apr_threadkey_t* rivet_thread_key = (apr_threadkey_t*) instancedata; rivet_thread_private* private; apr_threadkey_private_get ((void **)&private,rivet_thread_key); TclWeb_PrintHeaders(private->req); if (private->req->content_sent == 0) { ap_rwrite(buf, toWrite, private->r); ap_rflush(private->r); } return toWrite; } static int RivetChan_Close2Proc(ClientData instancedata, Tcl_Interp *interp, int flags) { return 0; } static int RivetChan_SetOptionProc(ClientData instancedata,Tcl_Interp *interp, const char *optionname,const char *value) { return TCL_OK; } static void RivetChan_WatchProc(ClientData instancedata, int mask) { /* not much to do here */ return; } static int RivetChan_GetHandleProc(ClientData instancedata, int direction, ClientData *handlePtr) { return TCL_ERROR; } Tcl_ChannelType RivetChan = { .typeName = "apache_channel", .version = TCL_CHANNEL_VERSION_5, .closeProc = TCL_CLOSEPROC, .inputProc = RivetChan_InputProc, .outputProc = RivetChan_OutputProc, .seekProc = NULL, .setOptionProc = RivetChan_SetOptionProc, .getOptionProc = NULL, .watchProc = RivetChan_WatchProc, .getHandleProc = RivetChan_GetHandleProc, .close2Proc = RivetChan_Close2Proc, .blockModeProc = NULL, .flushProc = NULL, .handlerProc = NULL, .wideSeekProc = NULL, .threadActionProc = NULL, .truncateProc = NULL }; rivet-3.0.0/rivet/packages/session/session-class.tcl000664 001750 001750 00000041217 15224454746 023323 0ustar00manghimanghi000000 000000 # # Session - Itcl object for web session management for Rivet # # Copyright 2004 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. package provide Session 1.1 package require Itcl ::itcl::class Session { # true if the page being processed didn't have a previous session public variable isNewSession 1 # contains the reason why this session is a new session, or "" if it isn't public variable newSessionReason "" # the routine that will handle saving data, could use DIO, could use # flatfiles, etc. public variable saveHandler "" # the name of the DIO object that we'll use to access the database public variable dioObject "DIO" # the name of the cookie used to set the session ID public variable cookieName "rivetSession" # the probability that garbage collection will occur in percent. public variable gcProbability 1 # the number of seconds after which data will be seen as "garbage" # and cleaned up -- defaults to 1 day public variable gcMaxLifetime 86400 # the substring you want to check each HTTP referer for. If the # referer was sent by the browser and the substring is not found, # the session will be deleted. public variable refererCheck "" public variable entropyFile "/dev/urandom" # the number of bytes which will be read from the entropy file public variable entropyLength 0 # set the scramble code to something unique for the site or the # app or whatever, to slightly increase the unguessability of # session ids public variable scrambleCode "some random string" # the lifetime of the cookie in minutes. 0 means until the browser # is closed. public variable cookieLifetime 0 # the lifetime of the session in seconds. this will be updated if # additional pages are fetched while the session is still alive. public variable sessionLifetime 7200 # if a request is being processed, a session is active, and this many # seconds have elapsed since the session was created or the session # update time was last updated, the session update time will be updated # (the session being in use extends the session lifetime) public variable sessionRefreshInterval 900 # the webserver subpath that the session cookie applies to -- defaults # to / public variable cookiePath "/" # the domain to set in the session cookie public variable cookieDomain "" # the status of the last operation, "" if ok public variable status # specifies whether cookies should only be sent over secure connections public variable cookieSecure 0 # specifies whether cookies should only be sent over http connections public variable cookieHttpOnly 0 # the name of the table that session info will be stored in public variable sessionTable "rivet_session" # the name of the table that contains cached session data public variable sessionCacheTable "rivet_session_cache" # the file that debug messages will be written to public variable debugFile stdout # set debug mode to 1 to trace through and see the session object # do its thing public variable debugMode 1 constructor {args} { eval configure $args $dioObject registerSpecialField $sessionTable session_update_time NOW $dioObject registerSpecialField $sessionTable session_start_time NOW } method status {args} { if {$args == ""} { return $status } set status $args } # get_entropy_bytes - read entropyLength bytes from a random data # device, such as /dev/random or /dev/urandom, available on some # systems as a way to generate random data # # if entropyLength is 0 (the default) or entropyFile isn't defined # or doesn't open successfully, returns an empty string # method get_entropy_bytes {} { if {$entropyLength == 0 || $entropyFile == ""} { return "" } if {[catch {open $entropyFile} fp] == 1} { return "" } set entropyBytes [read $fp $entropyLength] close $fp if {[binary scan $entropyBytes h* data]} { debug "get_entropy_bytes: returning '$data'" return $data } error "software bug - binary scan behaved unexpectedly" } # # gen_session_id - generate a session ID by md5'ing as many things # as we can get our hands on. # method gen_session_id {args} { package require md5 # if the Apache unique ID module is installed, the environment # variable UNIQUE_ID will have been set. If not, we'll get an # empty string, which won't hurt anything. set uniqueID [::rivet::env UNIQUE_ID] set sessionIdKey "$uniqueID[clock clicks][pid]$args[clock seconds]$scrambleCode[get_entropy_bytes]" debug "gen_session_id - feeding this to md5: '$sessionIdKey'" return [::md5::md5 -hex -- $sessionIdKey] } # # do_garbage_collection - delete dead sessions from the session table. # corresponding session table cache entries will automatically be # deleted as well (assuming they've been defined with ON DELETE CASCADE) # method do_garbage_collection {} { debug "do_garbage_collection: performing garbage collection" # set result [$dioObject exec "delete from $sessionTable where timestamp 'now' - session_update_time > interval '$gcMaxLifetime seconds';"] # debug "do_garbage_collection: t1: [$dioObject makeDBFieldValue $sessionTable session_update_time now SECS] t2: [$dioObject makeDBFieldValue $sessionTable session_update_time {} SECS]" set del_cmd "delete from $sessionTable where " append del_cmd [$dioObject makeDBFieldValue $sessionTable session_update_time now SECS] append del_cmd " - [$dioObject makeDBFieldValue $sessionTable session_update_time {} SECS]" append del_cmd " > $gcMaxLifetime" debug "do_garbage_collection: > $del_cmd <" set result [$dioObject exec $del_cmd] $result destroy } # # consider_garbage_collection - perform a garbage collection gcProbability # percent of the time. For example, if gcProbability is 1, about 1 in # every 100 times this routine is called, garbage collection will be # performed. # method consider_garbage_collection {} { debug "consider_garbage_collection: probability: $gcProbability" if {rand() <= $gcProbability / 100.0} { do_garbage_collection } } # # set_session_cookie - set a session cookie to the specified value -- # other cookie attributes are controlled by variables defined in the # object # method set_session_cookie {value} { ::rivet::cookie set $cookieName $value \ -path $cookiePath \ -minutes $cookieLifetime \ -secure $cookieSecure \ -HttpOnly $cookieHttpOnly } # # id - get the session ID of the current browser # # returns a session ID if their session cookie matches a current session. # returns an empty string if they do not have a session. # # status will be set to an empty string if all is ok, "timeout" if # the session had timed out, "no_cookie" if no cookie was previously # defined (session id could still be valid though -- first visit) # # ...caches the results in the info array to avoid calls to the database # in subsequent requests for the user ID from the same page, a common # occurrence. # method id {} { ::request::global sessionInfo status "" # if we already know the session ID, we're done. # (i.e. we've already validated them earlier in the # handling of the current page.) if {[info exists sessionInfo(sessionID)]} { debug "id called, returning cached ID '$sessionInfo(sessionID)'" return $sessionInfo(sessionID) } # # see if they have a session cookie. if they don't, # set status and return. # set sessionCookie [::rivet::cookie get $cookieName] if {$sessionCookie == ""} { # they did not have a cookie set, they are not logged in status "no_cookie" debug "id: no session cookie '$cookieName'" return "" } # there is a session Cookie, grab the remote address of the connection, # see if our state table says he has logged into us from this # address within our login timeout window and we've given him # this session debug "id: found session cookie '$cookieName' value '$sessionCookie'" set a(session_id) $sessionCookie set a(ip_address) [::rivet::env REMOTE_ADDR] # see if there's a record matching the session ID cookie and # IP address set kf [list session_id ip_address] set key [$dioObject makekey a $kf] if {![$dioObject fetch $key a -table $sessionTable -keyfield $kf]} { debug "id: no entry in the session table for session '$sessionCookie' and address [::rivet::env REMOTE_ADDR]: [$dioObject errorinfo]" status "no_session" return "" } ## Carve the seconds out of the session_update_time field in the # $sessionTable table. Trim off the timezone at the end. set secs [clock scan [string range $a(session_update_time) 0 18]] # if the session has timed out, delete the session and return -1 if {[expr $secs + $sessionLifetime] < [clock seconds]} { $dioObject delete $key -table $sessionTable -keyfield $kf debug "id: session '$sessionCookie' timed out" status "timeout" return "" } # Their session is still alive. If the session refresh # interval time has expired, update the session update time in the # database (we don't update every time they request a page for # performance reasons) The idea is it's been at least 15 minutes or # something like that since they've logged in, and they're still # doing stuff, so reset their session update time to now if {[expr $secs + $sessionRefreshInterval] < [clock seconds]} { debug "session '$sessionCookie' alive, refreshing session update time" set a(session_update_time) now if {![$dioObject store a -table $sessionTable -keyfield $kf]} { debug "id: Failed to store $sessionTable: [$dioObject errorinfo]" puts "Failed to store $sessionTable: [$dioObject errorinfo]" } } # # THEY VALIDATED. Cache the session ID in the sessionInfo array # that will only exist for the handling of this request, set that # this is not a new session (at least one previous request has been # handled with this session ID) and return the session ID # debug "id: active session, '$a(session_id)'" set sessionInfo(sessionID) $a(session_id) set isNewSession 0 return $a(session_id) } # # store - given a package name, a key string, and a data string, # store the data in the rivet session cache # method store {packageName key data} { set a(session_id) [id] set a(package_) $packageName set a(key_) $key regsub -all {\\} $data {\\\\} data set a(data) $data debug "store session data, package_ '$packageName', key_ '$key', data '$data'" set kf [list session_id package_ key_] if {![$dioObject store a -table $sessionCacheTable -keyfield $kf]} { debug "Failed to store $sessionCacheTable '$kf'" #parray a error [$dioObject errorinfo] } } # # fetch - given a package name and a key, return the data stored # for this session # method fetch {packageName key} { set kf [list session_id package_ key_] set a(session_id) [id] set a(package_) $packageName set a(key_) $key set key [$dioObject makekey a $kf] if {![$dioObject fetch $key a -table $sessionCacheTable -keyfield $kf]} { status [$dioObject errorinfo] debug "error: [$dioObject errorinfo]" debug "fetch session data failed, package_ '$packageName', key_ '$key', error '[$dioObject errorinfo]'" return "" } debug "fetch session data succeeded, package_ '$packageName', key_ '$key', result '$a(data)'" return $a(data) } # # stash - given a packagename and a key-value dictionary of data # the procedure calls method store to data into the cache table using # the dictionary keys as column _key value # # method stash {packageName keyvalue_d} { dict for {key value} $keyvalue_d { $this store $packageName $key $value } } # # load - given a package names returns a dictionary storing the key - value pairs for this session # # method load {packageName} { set package_d [dict create] $dioObject forall \ "select key_,data from $sessionCacheTable where package_='$packageName' and session_id='[$this id]'" a { dict set package_d $a(key_) $a(data) } return $package_d } # clear - given a package name and optionally a key it deletes rows in the cache for this session. # when also the key value is specified only the row for that package-key pair is deleted # method clear {packageName {key ""}} { if {$key == ""} { set keyval [list [$this id] $packageName] set keyfield {session_id package_} } else { set keyval [list [$this id] $packageName $key] set keyfield {session_id package_ key_} } $dioObject delete $keyval -table $sessionCacheTable -keyfield $keyfield } # # delete - given a user ID and looking at their IP address we inherited # from the environment (thanks, webserver), remove them from the session # table. (the session table is how the server remembers stuff about # sessions) # method delete_session {{session_id ""}} { set ip_address [::rivet::env REMOTE_ADDR] if {$session_id == ""} { set session_id [id] } debug "delete session $session_id" set kf [list session_id ip_address] $dioObject delete [list $session_id $ip_address] -table $sessionTable -keyfield $kf ## NEED TO delete saved session data here too, from the # $sessionCacheTable structure. } # # create_session - Generate a session ID and store the session in the # session table. # # returns the session_id # method create_session {} { ## Create their session by storing their session information in # the session table. set a(ip_address) [::rivet::env REMOTE_ADDR] set a(session_start_time) now set a(session_update_time) now set a(session_id) [gen_session_id $a(ip_address)] set kf [list ip_address session_id] if {![$dioObject store a -table $sessionTable -keyfield $kf]} { debug "Failed to store $sessionTable: [$dioObject errorinfo]" puts "Failed to store $sessionTable: [$dioObject errorinfo]" } debug "create_session: ip $a(ip_address), id '$a(session_id)'" return $a(session_id) } # # activate - find the session ID if they have one. if they don't, create # one and drop a cookie on them. # method activate {} { ::request::global sessionInfo debug "activate: checking out the situation" # a small percentage of the time, try to delete stale session data consider_garbage_collection set id [id] if {$id != ""} { debug "activate: returning session id '$id'" return $id } # it's a new session, save the reason for why it's a new session, # set that it's a new session, drop a session cookie on the browser # that issued this request, set the session ID cache variable, and # return the cookie ID set newSessionReason [status] debug "activate: new session, reason '$newSessionReason'" set id [create_session] set isNewSession 1 set_session_cookie $id set sessionInfo(sessionID) $id debug "activate: created session '$id' and set cookie (theoretically)" return $id } # # is_new_session - return a 1 if it's a new session, else a zero if there # were one or more prior pages creating and/or using this session ID # method is_new_session {} { return $isNewSession } # # new_session_reason - return the reason why a session is new, either # it didn't have a cookie "no_cookie", there was a cookie but no # matching session "no_session", or there was a cookie and a session # but the session has timed out "timeout". if the session isn't new, # returns "" # method new_session_reason {} { return $newSessionReason } # # debug - output a debugging message # method debug {message} { if {$debugMode} { $this debug_output "$this (debug) $message" $debugFile flush $debugFile } } method debug_output {msg args} { puts [lindex $args 0] "$msg
    " } } rivet-3.0.0/doc/html/session_package.html000664 001750 001750 00000052232 15224455137 021166 0ustar00manghimanghi000000 000000 Session Package

    Session Package

    Introduction

    This is session management code. It provides an interface to allow you to generate and track a browser's visit as a "session", giving you a unique session ID and an interface for storing and retrieving data for that session on the server.

    This is an alpha/beta release -- documentation is not in final form, but everything you need should be in this file.

    Using sessions and their included ability to store and retrieve session-related data on the server, programmers can generate more secure and higher-performance websites. For example, hidden fields do not have to be included in forms (and the risk of them being manipulated by the user mitigated) since data that would be stored in hidden fields can now be stored in the session cache on the server. Forms are then faster since no hidden data is transmitted -- hidden fields must be sent twice, once in the form to the broswer and once in the response from it.

    Robust login systems, etc, can be built on top of this code.

    Requirements

    Currently has only been tested with Postgresql, MySql and Oracle. All DB interfacing is done through DIO, though, so it should be relatively easy to add support for other databases.

    Preparing To Use It

    Create the tables in your SQL server. With Postgres, do a psql www or whatever DB you connect as, then a backslash-i on session-create.sql

    (If you need to delete the tables, use session-drop.sql)

    The session code by default requires a DIO handle called DIO (the name of which can be overridden). We get it by doing a

    RivetServerConf ChildInitScript "package require DIO"
    RivetServerConf ChildInitScript "::DIO::handle Postgresql DIO -user www"

    Example Usage

    In your httpd.conf, add:

    RivetServerConf ChildInitScript "package require Session; Session SESSION"

    This tells Rivet you want to create a session object named SESSION in every child process Apache creates.

    You can configure the session at this point using numerous key-value pairs (which are defined later in this doc). Here's a quick example:

    RivetServerConf ChildInitScript "package require Session; Session SESSION \
      -cookieLifetime 120 -debugMode 1"

    Turn debugging on -debugMode 1 to figure out what's going on -- it's really useful, if verbose.

    In your .rvt file, when you're generating the <HEAD> section:

    SESSION activate

    Activate handles everything for you with respect to creating new sessions, and for locating, validating, and updating existing sessions. Activate will either locate an existing session, or create a new one. Sessions will automatically be refreshed (their lifetimes extended) as additional requests are received during the session, all under the control of the key-value pairs controlling the session object.

    Using Sessions From Your Code

    The main methods your code will use are:

    SESSION id
    After doing a SESSION activate, this will return a 32-byte ASCII-encoded random hexadecimal string. Every time this browser comes to us with a request within the timeout period, this same string will be returned (assuming they have cookies enabled).
    SESSION is_new_session
    returns 1 if it's a new session or 0 if it has previously existed (i.e. it's a zero if this request represents a "return" or subsequent visit to a current session.)
    SESSION new_session_reason
    This will return why this request is the first request of a new session, either "no_cookie" saying the browser didn't give us a session cookie, "no_session" indicating we got a cookie but couldn't find it in our session table, or "timeout" where they had a cookie and we found the matching session but the session has timed out.
    SESSION store ?packageName? ?key? ?data?
    Given the name of a package, a key, and some data. Stores the data in the rivet session cache table.
    SESSION fetch ?packageName? ?key?
    Given a package name and a key, return the data stored by the store method, or an empty string if none was set. (Status is set to the DIO error that occurred, it can be fetched using the status method.)

    Session Configuration Options

    The following key-value pairs can be specified when a session object (like SESSION above) is created:

    sessionLifetime
    how many seconds the session will live for. 7200 == 2 hours
    sessionRefreshInterval
    If a request is processed for a browser that currently has a session and this long has elapsed since the session update time was last updated, update it. 900 == 15 minutes. so if at least 15 minutes has elapsed and we've gotten a new request for a page, update the session update time, extending the session lifetime (sessions that are in use keep getting extended).
    cookieName
    name of the cookie stored on the user's web browser default rivetSession
    dioObject
    The name of the DIO object we'll use to access the database (default DIO)
    gcProbability
    The probability that garbage collection will occur in percent. (default 1%, i.e. 1)
    gcMaxLifetime
    the number of seconds after which data will be seen as "garbage" and cleaned up -- defaults to 1 day (86400)
    refererCheck
    The substring you want to check each HTTP referer for. If the referer was sent by the browser and the substring is not found, the session will be deleted. (not coded yet)
    entropyFile
    The name of a file that random binary data can be read from. (/dev/urandom) Data will be used from this file to help generate a super-hard-to-guess session ID.
    entropyLength
    The number of bytes which will be read from the entropy file. If 0, the entropy file will not be read (default 0)
    scrambleCode
    Set the scramble code to something unique for the site or your app or whatever, to slightly increase the unguessability of session ids (default "some random string")
    cookieLifetime
    The lifetime of the cookie in minutes. 0 means until the browser is closed (I think). (default 0)
    cookiePath
    The webserver subpath that the session cookie applies to (defaults to /)
    cookieSecure
    Specifies whether the cookie should only be sent over secure connections, 0 = any, 1 = secure connections only (default 0)
    sessionTable
    The name of the table that session info will be stored in (default rivet_session)
    sessionCacheTable
    The name of the table that contains cached session data (default rivet_session_cache)
    debugMode
    Set debug mode to 1 to trace through and see the session object do its thing (default 0)
    debugFile
    The file handle that debugging messages will be written to (default stdout)

    Session Methods

    The following methods can be invoked to find out information about the current session, store and fetch server data identified with this session, etc:

    SESSION status
    Return the status of the last operation
    SESSION id
    Get the session ID of the current browser. Returns an empty string if there's no session (will not happen is SESSION activate has been issued.)
    SESSION new_session_reason
    Returns the reason why there wasn't a previous session, either "no_cookie" saying the browser didn't give us a session cookie, "no_session" indicating we got a cookie but couldn't find it in the session table, or "timeout" when we had a cookie and a session but the session had timed out.
    SESSION store ?packageName? ?key? ?data?
    Given a package name, a key string, and a data string, store the data in the rivet session cache.
    SESSION fetch ?packageName? ?key?
    Given a package name and a key, return the data stored by the store method, or an empty string if none was set. Status is set to the DIO error that occurred, it can be fetched using the status method.
    SESSION delete
    Given a user ID and looking at their IP address we inherited from the environment (thanks, Apache), remove them from the session table. (the session table is how the server remembers stuff about sessions). If the session ID was not specified the current session is deleted.
    SESSION activate
    Find and validate the session ID if they have one. If they don't have one or it isn't valid (timed out, etc), create a session and drop a cookie on them.

    Getting Additional Randomness From The Entropy File

    RivetServerConf ChildInitScript "Session SESSION -entropyFile /dev/urandom \
      -entropyLength 10 -debugMode 1"

    This options say we want to get randomness from an entropy file (random data pseudo-device) of /dev/urandom, to get ten bytes of random data from that entropy device, and to turn on debug mode, which will cause the SESSION object to output all manner of debugging information as it does stuff. This has been tested on FreeBSD and appears to work.

    rivet-3.0.0/rivet/rivet-tcl/wrap.tcl000664 001750 001750 00000003214 15224454746 020151 0ustar00manghimanghi000000 000000 ### ## ## wrap - Split a string on newlines. For each line, wrap the line at a space ## character to be equal to or shorter than the maximum length value passed. ## ## if a third argument called "-html" is present, the string is put together ## with html
    line breaks, otherwise it's broken with newlines. ## ## $Id$ ## ### namespace eval ::rivet { proc wrap {string maxlen {html ""}} { set splitstring {} foreach line [split $string "\n"] { lappend splitstring [wrapline $line $maxlen $html] } if {$html == "-html"} { return [join $splitstring "
    "] } else { return [join $splitstring "\n"] } } ## ## wrapline -- Given a line and a maximum length and option "-html" ## argument, split the line into multiple lines by splitting on space ## characters and making sure each line is less than maximum length. ## ## If the third argument, "-html", is present, return the result with ## the lines separated by html
    line breaks, otherwise the lines ## are returned separated by newline characters. ## proc wrapline {line maxlen {html ""}} { set string [split $line " "] set newline [list [lindex $string 0]] foreach word [lrange $string 1 end] { if {[string length $newline]+[string length $word] > $maxlen} { lappend lines [join $newline " "] set newline {} } lappend newline $word } lappend lines [join $newline " "] if {$html == "-html"} { return [join $lines
    ] } else { return [join $lines "\n"] } } } rivet-3.0.0/doc/images/toc-blank.png000664 001750 001750 00000000476 15224454746 020033 0ustar00manghimanghi000000 000000 PNG  IHDR kd0PLTEO&IbKGDHIDATxc?|` h BhCtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignaturef7e388dabd4ef0097714b5643fdd3cfbb tEXtPage15x9+0+07vIENDB`rivet-3.0.0/doc/examples/vars.html000664 001750 001750 00000001301 15224454746 017651 0ustar00manghimanghi000000 000000
    Title:
    Salary:
    Boss:
    Skills:
    rivet-3.0.0/.gitignore000664 001750 001750 00000001111 15224454746 015414 0ustar00manghimanghi000000 000000 Makefile.in doc/Makefile.in src/Makefile.in aclocal.m4 autom4te.cache/ configure Makefile _configs.sed config.h config.h.in config.log config.status rivet_config.h doc/Makefile doc/convert_examples.tcl doc/graphics doc/html/ libtool src/Makefile src/librivet/.deps/ src/mod_rivet_ng/.deps/ src/parser/.deps/ src/request/.deps/ stamp-h1 *~ *.libs/ *.dirstamp *.lo *.la *.swp tags tests/access_log tests/apachelog.txt tests/error_log tests/htaccess2 tests/httpd.pid tests/redirect_code.txt tests/rivet/ tests/server.conf tests/test.conf tests/uploadedjpeg.jpg Session.vim rivet/init.tcl rivet-3.0.0/rivet/packages/session/session-purge-mysql.sql000664 001750 001750 00000001622 15224454746 024514 0ustar00manghimanghi000000 000000 -- -- Note for Mysql 4.x and 5.0 users -- -- Though Mysql<5.1 supports the specification 'ON CASCADE DELETE' for CREATE TABLE -- this is only for sql code portability: deleting a row in rivet_session doesn't -- imply Mysql remove the rows in rivet_session_cache matching the same session_id. -- This table gets progressively cluttered with rows referring to sessions that are long dead. -- This command can be used to clean up 'rivet_session_cache' delete rivet_session_cache from rivet_session_cache left join rivet_session as t2 using(session_id) where t2.session_id is null; -- You may subclass 'Session' in order to specialize the method do_garbage_collection and -- exec this command after the superclass method has run. -- Starting with version 5.1 the 'on delete cascade' should be working (but I haven't tried) -- and also triggers can be used to achive the same goal -- 2 Oct 2006 rivet-3.0.0/tests/get.test000664 001750 001750 00000006627 15224454746 016267 0ustar00manghimanghi000000 000000 # -- get.test # # testing ::rivet::var command for accessing urlencoded # variables catch {unset match} ::tcltest::test getvariables-1.1 {GET variables} { set page [ ::http::geturl "${urlbase}get.rvt?foobar=goober" ] regexp -line {\[::rivet::var get foobar\] = goober$} [ ::http::data $page ] match set match } {[::rivet::var get foobar] = goober} ::tcltest::test getvariables-1.2 {GET variables - exists} { set page [ ::http::geturl "${urlbase}get.rvt?xst=1" ] regexp -line {\[::rivet::var exists xst\]\[::rivet::var exists noxst\] = 1 0$} [ ::http::data $page ] match set match } {[::rivet::var exists xst][::rivet::var exists noxst] = 1 0} ::tcltest::test getvariables-1.3 {GET variables - doesn't exist} { set page [ ::http::geturl "${urlbase}get.rvt" ] regexp -line {\[::rivet::var get xst\] = } [ ::http::data $page ] match set match } {[::rivet::var get xst] = } ::tcltest::test getvariables-1.4 {GET variables - default value} { set page [::http::geturl "${urlbase}get.rvt?defaulttest=1"] regexp {^\[::rivet::var get xst foo\] = foo} [ ::http::data $page ] match set match } {[::rivet::var get xst foo] = foo} ::tcltest::test getvariables-1.5 {GET variables - var_qs exists} { set page [::http::geturl "${urlbase}get.rvt?xst=1"] regexp -line {\[::rivet::var_qs exists xst\]\[::rivet::var_qs exists noxst\] = 1 0$} [ ::http::data $page ] match set match } {[::rivet::var_qs exists xst][::rivet::var_qs exists noxst] = 1 0} ::tcltest::test getvariables-2.1 {GET variables + I18N} { set page [::http::geturl "${urlbase}get.rvt?Más=Tú"] regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match set match } {[::rivet::var get Más] = Tú} ::tcltest::test getvariables-2.2 {GET variables + I18N + encoding} { set page [::http::geturl [format "${urlbase}get.rvt?%s" [::http::formatQuery Más Tú]]] regexp -line {^\[::rivet::var get Más\] = Tú$} [ ::http::data $page ] match set match } {[::rivet::var get Más] = Tú} ::tcltest::test getvariables-3.1 {GET multi-value variable} { set page [::http::geturl "${urlbase}get.rvt?lstvar1=a&lstvar1=b&lstvar1=c+d"] regexp -line {\[::rivet::var get lstvar1\] = a b c d$} [ ::http::data $page ] match set match } {[::rivet::var get lstvar1] = a b c d} ::tcltest::test getvariables-3.2 {GET multi-value variable as list} { set page [::http::geturl "${urlbase}get.rvt?lstvar2=a&lstvar2=b&lstvar2=c+d"] regexp -line {\[::rivet::var list lstvar2\] = a b {c d}$} [ ::http::data $page ] match set match } {[::rivet::var list lstvar2] = a b {c d}} ::tcltest::test getvariables-4.1 {var_qs} { set page [::http::geturl "${urlbase}get.rvt?foobar=goober"] regexp -line {\[::rivet::var_qs get foobar\] = goober$} [::http::data $page] match set match } {[::rivet::var_qs get foobar] = goober} ::tcltest::test getvariables-5.1 {GET var_qs all} { set page [::http::geturl "${urlbase}getall.rvt?a=1&b=2&c=3&d=4"] set ptext [::http::data $page] regexp -line {^\[::rivet::var_qs all\]\s=\s.*$} $ptext match set match } {[::rivet::var_qs all] = a|1|b|2|c|3|d|4} ::tcltest::test getvariables-5.2 {GET var_qs all } { set page [::http::geturl "${urlbase}getall.rvt"] set ptext [::http::data $page] regexp -line {^\[::rivet::var_qs all\]\s=\s.*$} $ptext match set match } {[::rivet::var_qs all] = a|1|b|2|c|3|d|4} rivet-3.0.0/tests/apachetest/http.tcl000664 001750 001750 00000057112 15224454746 020406 0ustar00manghimanghi000000 000000 # http.tcl -- # # Client-side HTTP for GET, POST, and HEAD commands. # These routines can be used in untrusted code that uses # the Safesock security policy. These procedures use a # callback interface to avoid using vwait, which is not # defined in the safe base. # # See the file "license.terms" for information on usage and # redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Rough version history: # 1.0 Old http_get interface # 2.0 http:: namespace and http::geturl # 2.1 Added callbacks to handle arriving data, and timeouts # 2.2 Added ability to fetch into a channel # 2.3 Added SSL support, and ability to post from a channel # This version also cleans up error cases and eliminates the # "ioerror" status in favor of raising an error # 2.4 Added -binary option to http::geturl and charset element # to the state array. # keep this in sync with pkgIndex.tcl # and with the install directories in Makefiles package provide http 2.4.5 namespace eval http { variable http array set http { -accept */* -proxyhost {} -proxyport {} -proxyfilter http::ProxyRequired } set http(-useragent) "Tcl http client package [package provide http]" proc init {} { variable formMap variable alphanumeric a-zA-Z0-9 for {set i 0} {$i <= 256} {incr i} { set c [format %c $i] if {![string match \[$alphanumeric\] $c]} { set formMap($c) %[format %.2x $i] } } # These are handled specially array set formMap { " " + \n %0d%0a } } init variable urlTypes array set urlTypes { http {80 ::socket} } variable encodings [string tolower [encoding names]] # This can be changed, but iso8859-1 is the RFC standard. variable defaultCharset "iso8859-1" namespace export geturl config reset wait formatQuery register unregister # Useful, but not exported: data size status code } # http::register -- # # See documentation for details. # # Arguments: # proto URL protocol prefix, e.g. https # port Default port for protocol # command Command to use to create socket # Results: # list of port and command that was registered. proc http::register {proto port command} { variable urlTypes set urlTypes($proto) [list $port $command] } # http::unregister -- # # Unregisters URL protocol handler # # Arguments: # proto URL protocol prefix, e.g. https # Results: # list of port and command that was unregistered. proc http::unregister {proto} { variable urlTypes if {![info exists urlTypes($proto)]} { return -code error "unsupported url type \"$proto\"" } set old $urlTypes($proto) unset urlTypes($proto) return $old } # http::config -- # # See documentation for details. # # Arguments: # args Options parsed by the procedure. # Results: # TODO proc http::config {args} { variable http set options [lsort [array names http -*]] set usage [join $options ", "] if {[llength $args] == 0} { set result {} foreach name $options { lappend result $name $http($name) } return $result } set options [string map {- ""} $options] set pat ^-([join $options |])$ if {[llength $args] == 1} { set flag [lindex $args 0] if {[regexp -- $pat $flag]} { return $http($flag) } else { return -code error "Unknown option $flag, must be: $usage" } } else { foreach {flag value} $args { if {[regexp -- $pat $flag]} { set http($flag) $value } else { return -code error "Unknown option $flag, must be: $usage" } } } } # http::Finish -- # # Clean up the socket and eval close time callbacks # # Arguments: # token Connection token. # errormsg (optional) If set, forces status to error. # skipCB (optional) If set, don't call the -command callback. This # is useful when geturl wants to throw an exception instead # of calling the callback. That way, the same error isn't # reported to two places. # # Side Effects: # Closes the socket proc http::Finish { token {errormsg ""} {skipCB 0}} { variable $token upvar 0 $token state global errorInfo errorCode if {[string length $errormsg] != 0} { set state(error) [list $errormsg $errorInfo $errorCode] set state(status) error } catch {close $state(sock)} catch {after cancel $state(after)} if {[info exists state(-command)] && !$skipCB} { if {[catch {eval $state(-command) {$token}} err]} { if {[string length $errormsg] == 0} { set state(error) [list $err $errorInfo $errorCode] set state(status) error } } if {[info exists state(-command)]} { # Command callback may already have unset our state unset state(-command) } } } # http::reset -- # # See documentation for details. # # Arguments: # token Connection token. # why Status info. # # Side Effects: # See Finish proc http::reset { token {why reset} } { variable $token upvar 0 $token state set state(status) $why catch {fileevent $state(sock) readable {}} catch {fileevent $state(sock) writable {}} Finish $token if {[info exists state(error)]} { set errorlist $state(error) unset state eval ::error $errorlist } } # http::geturl -- # # Establishes a connection to a remote url via http. # # Arguments: # url The http URL to goget. # args Option value pairs. Valid options include: # -blocksize, -validate, -headers, -timeout # Results: # Returns a token for this connection. # This token is the name of an array that the caller should # unset to garbage collect the state. proc http::geturl { url args } { variable http variable urlTypes variable defaultCharset # Initialize the state variable, an array. We'll return the # name of this array as the token for the transaction. if {![info exists http(uid)]} { set http(uid) 0 } set token [namespace current]::[incr http(uid)] variable $token upvar 0 $token state reset $token # Process command options. array set state { -binary false -blocksize 8192 -queryblocksize 8192 -validate false -headers {} -timeout 0 -type application/x-www-form-urlencoded -queryprogress {} state header meta {} coding {} currentsize 0 totalsize 0 querylength 0 queryoffset 0 type text/html body {} status "" http "" } # These flags have their types verified [Bug 811170] array set type { -binary boolean -blocksize integer -queryblocksize integer -validate boolean -timeout integer } set state(charset) $defaultCharset set options { -binary -blocksize -channel -command -handler -headers \ -progress -query -queryblocksize -querychannel -queryprogress\ -validate -timeout -type} set usage [join $options ", "] set options [string map {- ""} $options] set pat ^-([join $options |])$ foreach {flag value} $args { if {[regexp $pat $flag]} { # Validate numbers and booleans if {[info exists type($flag)] && \ ![string is $type($flag) -strict $value]} { unset $token return -code error "Bad value for $flag ($value), must be $type($flag)" } set state($flag) $value } else { unset $token return -code error "Unknown option $flag, can be: $usage" } } # Make sure -query and -querychannel aren't both specified set isQueryChannel [info exists state(-querychannel)] set isQuery [info exists state(-query)] if {$isQuery && $isQueryChannel} { unset $token return -code error "Can't combine -query and -querychannel options!" } # Validate URL, determine the server host and port, and check proxy case # Recognize user:pass@host URLs also, although we do not do anything # with that info yet. set exp {^(([^:]*)://)?([^@]+@)?([^/:]+)(:([0-9]+))?(/.*)?$} if {![regexp -nocase $exp $url x prefix proto user host y port srvurl]} { unset $token return -code error "Unsupported URL: $url" } if {[string length $proto] == 0} { set proto http set url ${proto}://$url } if {![info exists urlTypes($proto)]} { unset $token return -code error "Unsupported URL type \"$proto\"" } set defport [lindex $urlTypes($proto) 0] set defcmd [lindex $urlTypes($proto) 1] if {[string length $port] == 0} { set port $defport } if {[string length $srvurl] == 0} { set srvurl / } if {[string length $proto] == 0} { set url http://$url } set state(url) $url if {![catch {$http(-proxyfilter) $host} proxy]} { set phost [lindex $proxy 0] set pport [lindex $proxy 1] } # If a timeout is specified we set up the after event # and arrange for an asynchronous socket connection. if {$state(-timeout) > 0} { set state(after) [after $state(-timeout) \ [list http::reset $token timeout]] set async -async } else { set async "" } # If we are using the proxy, we must pass in the full URL that # includes the server name. if {[info exists phost] && [string length $phost]} { set srvurl $url set conStat [catch {eval $defcmd $async {$phost $pport}} s] } else { set conStat [catch {eval $defcmd $async {$host $port}} s] } if {$conStat} { # something went wrong while trying to establish the connection # Clean up after events and such, but DON'T call the command callback # (if available) because we're going to throw an exception from here # instead. Finish $token "" 1 cleanup $token return -code error $s } set state(sock) $s # Wait for the connection to complete if {$state(-timeout) > 0} { fileevent $s writable [list http::Connect $token] http::wait $token if {[string equal $state(status) "error"]} { # something went wrong while trying to establish the connection # Clean up after events and such, but DON'T call the command # callback (if available) because we're going to throw an # exception from here instead. set err [lindex $state(error) 0] cleanup $token return -code error $err } elseif {![string equal $state(status) "connect"]} { # Likely to be connection timeout return $token } set state(status) "" } # Send data in cr-lf format, but accept any line terminators fconfigure $s -translation {auto crlf} -buffersize $state(-blocksize) # The following is disallowed in safe interpreters, but the socket # is already in non-blocking mode in that case. catch {fconfigure $s -blocking off} set how GET if {$isQuery} { set state(querylength) [string length $state(-query)] if {$state(querylength) > 0} { set how POST set contDone 0 } else { # there's no query data unset state(-query) set isQuery 0 } } elseif {$state(-validate)} { set how HEAD } elseif {$isQueryChannel} { set how POST # The query channel must be blocking for the async Write to # work properly. fconfigure $state(-querychannel) -blocking 1 -translation binary set contDone 0 } if {[catch { puts $s "$how $srvurl HTTP/1.0" puts $s "Accept: $http(-accept)" array set hdrs $state(-headers) if { [info exists hdrs(Host)] } { puts $s "Host: $hdrs(Host)" } elseif {$port == $defport} { # Don't add port in this case, to handle broken servers. # [Bug #504508] puts $s "Host: $host" } else { puts $s "Host: $host:$port" } unset hdrs puts $s "User-Agent: $http(-useragent)" foreach {key value} $state(-headers) { if { $key == "Host" } continue set value [string map [list \n "" \r ""] $value] set key [string trim $key] if {[string equal $key "Content-Length"]} { set contDone 1 set state(querylength) $value } if {[string length $key]} { puts $s "$key: $value" } } if {$isQueryChannel && $state(querylength) == 0} { # Try to determine size of data in channel # If we cannot seek, the surrounding catch will trap us set start [tell $state(-querychannel)] seek $state(-querychannel) 0 end set state(querylength) \ [expr {[tell $state(-querychannel)] - $start}] seek $state(-querychannel) $start } # Flush the request header and set up the fileevent that will # either push the POST data or read the response. # # fileevent note: # # It is possible to have both the read and write fileevents active # at this point. The only scenario it seems to affect is a server # that closes the connection without reading the POST data. # (e.g., early versions TclHttpd in various error cases). # Depending on the platform, the client may or may not be able to # get the response from the server because of the error it will # get trying to write the post data. Having both fileevents active # changes the timing and the behavior, but no two platforms # (among Solaris, Linux, and NT) behave the same, and none # behave all that well in any case. Servers should always read thier # POST data if they expect the client to read their response. if {$isQuery || $isQueryChannel} { puts $s "Content-Type: $state(-type)" if {!$contDone} { puts $s "Content-Length: $state(querylength)" } puts $s "" fconfigure $s -translation {auto binary} fileevent $s writable [list http::Write $token] } else { puts $s "" flush $s fileevent $s readable [list http::Event $token] } if {! [info exists state(-command)]} { # geturl does EVERYTHING asynchronously, so if the user # calls it synchronously, we just do a wait here. wait $token if {[string equal $state(status) "error"]} { # Something went wrong, so throw the exception, and the # enclosing catch will do cleanup. return -code error [lindex $state(error) 0] } } } err]} { # The socket probably was never connected, # or the connection dropped later. # Clean up after events and such, but DON'T call the command callback # (if available) because we're going to throw an exception from here # instead. # if state(status) is error, it means someone's already called Finish # to do the above-described clean up. if {[string equal $state(status) "error"]} { Finish $token $err 1 } cleanup $token return -code error $err } return $token } # Data access functions: # Data - the URL data # Status - the transaction status: ok, reset, eof, timeout # Code - the HTTP transaction code, e.g., 200 # Size - the size of the URL data proc http::data {token} { variable $token upvar 0 $token state return $state(body) } proc http::status {token} { variable $token upvar 0 $token state return $state(status) } proc http::code {token} { variable $token upvar 0 $token state return $state(http) } proc http::ncode {token} { variable $token upvar 0 $token state if {[regexp {[0-9]{3}} $state(http) numeric_code]} { return $numeric_code } else { return $state(http) } } proc http::size {token} { variable $token upvar 0 $token state return $state(currentsize) } proc http::error {token} { variable $token upvar 0 $token state if {[info exists state(error)]} { return $state(error) } return "" } # http::cleanup # # Garbage collect the state associated with a transaction # # Arguments # token The token returned from http::geturl # # Side Effects # unsets the state array proc http::cleanup {token} { variable $token upvar 0 $token state if {[info exists state]} { unset state } } # http::Connect # # This callback is made when an asyncronous connection completes. # # Arguments # token The token returned from http::geturl # # Side Effects # Sets the status of the connection, which unblocks # the waiting geturl call proc http::Connect {token} { variable $token upvar 0 $token state global errorInfo errorCode if {[eof $state(sock)] || [string length [fconfigure $state(sock) -error]]} { Finish $token "connect failed [fconfigure $state(sock) -error]" 1 } else { set state(status) connect fileevent $state(sock) writable {} } return } # http::Write # # Write POST query data to the socket # # Arguments # token The token for the connection # # Side Effects # Write the socket and handle callbacks. proc http::Write {token} { variable $token upvar 0 $token state set s $state(sock) # Output a block. Tcl will buffer this if the socket blocks set done 0 if {[catch { # Catch I/O errors on dead sockets if {[info exists state(-query)]} { # Chop up large query strings so queryprogress callback # can give smooth feedback puts -nonewline $s \ [string range $state(-query) $state(queryoffset) \ [expr {$state(queryoffset) + $state(-queryblocksize) - 1}]] incr state(queryoffset) $state(-queryblocksize) if {$state(queryoffset) >= $state(querylength)} { set state(queryoffset) $state(querylength) set done 1 } } else { # Copy blocks from the query channel set outStr [read $state(-querychannel) $state(-queryblocksize)] puts -nonewline $s $outStr incr state(queryoffset) [string length $outStr] if {[eof $state(-querychannel)]} { set done 1 } } } err]} { # Do not call Finish here, but instead let the read half of # the socket process whatever server reply there is to get. set state(posterror) $err set done 1 } if {$done} { catch {flush $s} fileevent $s writable {} fileevent $s readable [list http::Event $token] } # Callback to the client after we've completely handled everything if {[string length $state(-queryprogress)]} { eval $state(-queryprogress) [list $token $state(querylength)\ $state(queryoffset)] } } # http::Event # # Handle input on the socket # # Arguments # token The token returned from http::geturl # # Side Effects # Read the socket and handle callbacks. proc http::Event {token} { variable $token upvar 0 $token state set s $state(sock) if {[eof $s]} { Eof $token return } if {[string equal $state(state) "header"]} { if {[catch {gets $s line} n]} { Finish $token $n } elseif {$n == 0} { variable encodings set state(state) body if {$state(-binary) || ![string match -nocase text* $state(type)] || [string match *gzip* $state(coding)] || [string match *compress* $state(coding)]} { # Turn off conversions for non-text data fconfigure $s -translation binary if {[info exists state(-channel)]} { fconfigure $state(-channel) -translation binary } } else { # If we are getting text, set the incoming channel's # encoding correctly. iso8859-1 is the RFC default, but # this could be any IANA charset. However, we only know # how to convert what we have encodings for. set idx [lsearch -exact $encodings \ [string tolower $state(charset)]] if {$idx >= 0} { fconfigure $s -encoding [lindex $encodings $idx] } } if {[info exists state(-channel)] && \ ![info exists state(-handler)]} { # Initiate a sequence of background fcopies fileevent $s readable {} CopyStart $s $token } } elseif {$n > 0} { if {[regexp -nocase {^content-type:(.+)$} $line x type]} { set state(type) [string trim $type] # grab the optional charset information regexp -nocase {charset\s*=\s*(\S+)} $type x state(charset) } if {[regexp -nocase {^content-length:(.+)$} $line x length]} { set state(totalsize) [string trim $length] } if {[regexp -nocase {^content-encoding:(.+)$} $line x coding]} { set state(coding) [string trim $coding] } if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { lappend state(meta) $key [string trim $value] } elseif {[string match HTTP* $line]} { set state(http) $line } } } else { if {[catch { if {[info exists state(-handler)]} { set n [eval $state(-handler) {$s $token}] } else { set block [read $s $state(-blocksize)] set n [string length $block] if {$n >= 0} { append state(body) $block } } if {$n >= 0} { incr state(currentsize) $n } } err]} { Finish $token $err } else { if {[info exists state(-progress)]} { eval $state(-progress) \ {$token $state(totalsize) $state(currentsize)} } } } } # http::CopyStart # # Error handling wrapper around fcopy # # Arguments # s The socket to copy from # token The token returned from http::geturl # # Side Effects # This closes the connection upon error proc http::CopyStart {s token} { variable $token upvar 0 $token state if {[catch { fcopy $s $state(-channel) -size $state(-blocksize) -command \ [list http::CopyDone $token] } err]} { Finish $token $err } } # http::CopyDone # # fcopy completion callback # # Arguments # token The token returned from http::geturl # count The amount transfered # # Side Effects # Invokes callbacks proc http::CopyDone {token count {error {}}} { variable $token upvar 0 $token state set s $state(sock) incr state(currentsize) $count if {[info exists state(-progress)]} { eval $state(-progress) {$token $state(totalsize) $state(currentsize)} } # At this point the token may have been reset if {[string length $error]} { Finish $token $error } elseif {[catch {eof $s} iseof] || $iseof} { Eof $token } else { CopyStart $s $token } } # http::Eof # # Handle eof on the socket # # Arguments # token The token returned from http::geturl # # Side Effects # Clean up the socket proc http::Eof {token} { variable $token upvar 0 $token state if {[string equal $state(state) "header"]} { # Premature eof set state(status) eof } else { set state(status) ok } set state(state) eof Finish $token } # http::wait -- # # See documentation for details. # # Arguments: # token Connection token. # # Results: # The status after the wait. proc http::wait {token} { variable $token upvar 0 $token state if {![info exists state(status)] || [string length $state(status)] == 0} { # We must wait on the original variable name, not the upvar alias vwait $token\(status) } return $state(status) } # http::formatQuery -- # # See documentation for details. # Call http::formatQuery with an even number of arguments, where # the first is a name, the second is a value, the third is another # name, and so on. # # Arguments: # args A list of name-value pairs. # # Results: # TODO proc http::formatQuery {args} { set result "" set sep "" foreach i $args { append result $sep [mapReply $i] if {[string equal $sep "="]} { set sep & } else { set sep = } } return $result } # http::mapReply -- # # Do x-www-urlencoded character mapping # # Arguments: # string The string the needs to be encoded # # Results: # The encoded string proc http::mapReply {string} { variable formMap variable alphanumeric # The spec says: "non-alphanumeric characters are replaced by '%HH'" # 1 leave alphanumerics characters alone # 2 Convert every other character to an array lookup # 3 Escape constructs that are "special" to the tcl parser # 4 "subst" the result, doing all the array substitutions regsub -all \[^$alphanumeric\] $string {$formMap(&)} string regsub -all {[][{})\\]\)} $string {\\&} string return [subst -nocommand $string] } # http::ProxyRequired -- # Default proxy filter. # # Arguments: # host The destination host # # Results: # The current proxy settings proc http::ProxyRequired {host} { variable http if {[info exists http(-proxyhost)] && [string length $http(-proxyhost)]} { if {![info exists http(-proxyport)] || \ ![string length $http(-proxyport)]} { set http(-proxyport) 8080 } return [list $http(-proxyhost) $http(-proxyport)] } } rivet-3.0.0/rivet/packages/session/session-create-oracle.sql000664 001750 001750 00000001563 15224454746 024741 0ustar00manghimanghi000000 000000 -- -- Session management database creation for Oracle -- -- Arnulf -- CREATE TABLE rivet_session (ip_address VARCHAR2(23) DEFAULT NULL, session_start_time DATE DEFAULT NULL, session_update_time DATE DEFAULT NULL, session_id VARCHAR2(64) NOT NULL ) / ALTER TABLE rivet_session ADD PRIMARY KEY (session_id) / CREATE TABLE rivet_session_cache (session_id VARCHAR2(128) DEFAULT NULL, package_ VARCHAR2(128) DEFAULT NULL, key_ VARCHAR2(256) DEFAULT NULL, data VARCHAR2(4096) DEFAULT NULL ) / CREATE UNIQUE INDEX riv_sess_cache_ix ON rivet_session_cache ( session_id, package_, key_ ) / CREATE INDEX rivet_session_cache_idx ON rivet_session_cache ( session_id ) rivet-3.0.0/tests/docroot1/childinit.tcl000664 001750 001750 00000000077 15224454746 021005 0ustar00manghimanghi000000 000000 # childinit.tcl -- ChildInitScript # $Id$ set ::childinit1 1 rivet-3.0.0/form.txt000664 001750 001750 00000006641 15224454746 015145 0ustar00manghimanghi000000 000000 Super quick doc on the Rivet form package. Forms directly emit HTML so if you want to format them in a table or something, you've got to be emitting your table around your form calls. See the example. The supported field types are: checkbox text password hidden submit button reset image radiobuttons select textarea And the new HTML 5 types that may not be in every browser (but are in the iPhone): color date datetime datetime_local email file image month number range search tel time url week form myform -defaults tag -method post -action view_photo.rvt This defines a form called "myform", says that default values can be taken from an array named "tag", specifies that the submit method will be "post" and that the view_photo.rvt URL will be invoked upon submission. myform start This starts emitting the form. It will generate the "
    " HTML. myform text tail -size 8 -maxlength 20 This defines a single line text entry box. myform textarea description -cols 60 -rows 8 This defines a multiline text box. myform select part_of_day -labels [list "" Day Dawn Dusk Night] -values [list "" day dawn dusk night] -style "width: 160px;" This defines a dropbox. The labels of each entry will be blank, Day, Dawn, Dusk, Night, and the values sent in the field named "part_of_day" will correspondingly be blank, day, dawn, dusk and night. If values is not set, the labels will be used. myform radiobuttons station -labels [list "" KUHF KLOL KRBE KLBJ] -values [list "" kuhg klol krbe klbj] If values is not set, the labels will be used. myform hidden upload_id -value $uploadID This specifies a hidden field named upload_id and assigns a value to it as the contents of the variable uploadID. myform submit Tag This creates the submit button for the form and calls it Tag. myform button Tag This creates a clickable button for the form and calls it Tag. Unlike a submit element, button elements are not invoked if the user presses "Enter". myform cancel This create the cancel button for the form. myform end This ends the form and is mandatory. It generates the HTML to complete the form. myform destroy This gets rid of the form object. FILE UPLOADING There isn't a form type in forms at this time for uploading a file, however you can do it by emitting something like: EXAMPLE package require form form myform -defaults response -method get -name feedsearch myform start puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "" puts "
    " myform select codebase -values [list stable beta] -labels [list Stable Beta] puts "" myform select type -values [list xmlparsed parsed] -labels [list XML T1] puts "ident" myform text ident -size 8 puts "" myform select startMonth -values "1 2 3 4 5 6 7 8 9 10 11 12" puts "" myform select startDay -values "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31" puts "" myform select startYear -values "2005 2006 2007 2008" puts "days" myform select days -values "1 2 3" puts "" myform submit submit -value Search puts "
    " emit_toggle_all_function emit_toggle_buttons myform end myform destroy rivet-3.0.0/src/librivet/000775 001750 001750 00000000000 15224454746 016041 5ustar00manghimanghi000000 000000 rivet-3.0.0/cmake/cmake_extra_modules/000775 001750 001750 00000000000 15224454746 020525 5ustar00manghimanghi000000 000000 rivet-3.0.0/src/request/000775 001750 001750 00000000000 15224454746 015711 5ustar00manghimanghi000000 000000 rivet-3.0.0/contrib/rvt.vim000664 001750 001750 00000001101 15224454746 016413 0ustar00manghimanghi000000 000000 " RVT (mod_dtcl) syntax file. " Language: Tcl + HTML " Maintainer: Wojciech Kocjan " Filenames: *.rvt if version < 600 syntax clear elseif exists("b:current_syntax") finish endif if !exists("main_syntax") let main_syntax = 'rvt' endif if version < 600 so :p:h/html.vim else runtime! syntax/html.vim unlet b:current_syntax endif syntax include @tclTop syntax/tcl.vim syntax region rvtTcl keepend matchgroup=Delimiter start="" contains=@tclTop let b:current_syntax = "rvt" if main_syntax == 'rvt' unlet main_syntax endif rivet-3.0.0/rivet/rivet-tcl/debug.tcl000664 001750 001750 00000005770 15224454746 020277 0ustar00manghimanghi000000 000000 ### ## debug ?-option value? ?-option value?... ## A command to make debugging more convenient. Print strings, arrays ## and the values of variables as specified by the arguments. ## ## Also allows the setting of an array called debug which will pick up ## options for all debug commands. ## ## We create this command in the ::request namespace because we want the ## user to be able to use the debug array without actually having to set ## it at the global level. ## ## Options: ## ## -subst - Each word should be considered a variable and subst'd. ## -separator - A text string that goes between each variable. ## -ip - A list of IP addresses to display to. ## ## $Id$ ## ### namespace eval ::rivet { proc debug {args} { # starting with 2.1.0 ::RivetUserConf can be created on demand (see ::rivet::inspect) array set ::RivetUserConf [dict get [::rivet::inspect] user] ## If they've turned off debugging, we don't do anything. if {[info exists ::RivetUserConf(Debug)] && !$::RivetUserConf(Debug)} { return } ## We want to save the REMOTE_ADDR for any subsequent calls to debug. if {![info exists ::RivetUserConf(REMOTE_ADDR)]} { set REMOTE_ADDR [env REMOTE_ADDR] set ::RivetUserConf(REMOTE_ADDR) $REMOTE_ADDR } ## Set some defaults for the options. set data(subst) 0 set data(separator)
    ## Check RivetUserConf for globally set options. if {[info exists ::RivetUserConf(DebugIp)]} { set data(ip) $::RivetUserConf(DebugIp) } if {[info exists ::RivetUserConf(DebugSubst)]} { set data(subst) $::RivetUserConf(DebugSubst) } if {[info exists ::RivetUserConf(DebugSeparator)]} { set data(separator) $::RivetUserConf(DebugSeparator) } import_keyvalue_pairs data $args if {[info exists data(ip)]} { set can_see 0 foreach ip $data(ip) { if {[string match $data(ip)* $::RivetUserConf(REMOTE_ADDR)]} { set can_see 1 break } } if {!$can_see} { return } } if {[string tolower $data(subst)] != "on"} { ::rivet::html [join $data(args)] return } set lastWasArray 0 foreach varName $data(args) { upvar $varName var if {[array exists var]} { parray $varName set lastWasArray 1 } elseif {[info exists var]} { if {!$lastWasArray} { ::rivet::html $data(separator) } ::rivet::html $var set lastWasArray 0 } else { if {!$lastWasArray} { ::rivet::html $data(separator) } ::rivet::html $varName set lastWasArray 0 } } } } rivet-3.0.0/doc/images/toc-plus.png000664 001750 001750 00000000410 15224454746 017713 0ustar00manghimanghi000000 000000 PNG  IHDR )bKGD#2#IDATxch`#@C"ԣj?RJld:4CtEXtSoftware@(#)ImageMagick 4.2.8 99/08/01 cristy@mystic.es.dupont.com!*tEXtSignatureab17802e1ddae3211b1ce6bc3b08aec7{( tEXtPage15x9+0+07vIENDB`rivet-3.0.0/rivet/packages/dio/dio_Mysql.tcl000664 001750 001750 00000012660 15224454746 021565 0ustar00manghimanghi000000 000000 # -- dio_Mysql.tcl -- Mysql backend. # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. package require DIO 1.2 package provide dio_Mysql 1.2 namespace eval DIO { ::itcl::class Mysql { inherit Database constructor {args} {eval configure -interface Mysql $args} { if { [catch {package require Mysqltcl}] \ && [catch {package require mysqltcl}] \ && [catch {package require mysql}]} { return -code error "No MySQL Tcl package available" } eval configure $args if {[::rivet::lempty $db]} { if {[::rivet::lempty $user]} { set user $::env(USER) } set db $user } } destructor { close } method open {} { set command "mysqlconnect" if {![::rivet::lempty $user]} { lappend command -user $user } if {![::rivet::lempty $pass]} { lappend command -password $pass } if {![::rivet::lempty $port]} { lappend command -port $port } if {![::rivet::lempty $host]} { lappend command -host $host } #if {![::rivet::lempty $encoding]} { lappend command -encoding $encoding } if {$clientargs != ""} { set command [lappend command {*}$clientargs] } #puts stderr "evaluating $command" if {[catch $command error]} { return -code error $error } set conn $error if {![::rivet::lempty $db]} { mysqluse $conn $db } } method close {} { if {![info exists conn]} { return } catch {mysqlclose $conn} unset conn } method exec {req} { if {![info exists conn] || ![mysqlping $conn]} { open } set cmd mysqlexec # # if {[::string tolower [lindex $req 0]] == "select"} { set cmd mysqlsel } # select is a 6 characters word, so let's see if the query is a select # set q [::string trim $req] # set q [::string tolower $q] # set q [::string range $q 0 5] # if {[::string match select $q]} { set cmd mysqlsel } if {[regexp -nocase {^\(*\s*select\s+} $q]} { set cmd mysqlsel } set errorinfo "" if {[catch {$cmd $conn $req} error]} { set errorinfo $error set obj [result Mysql -error 1 -errorinfo [::list $error]] return $obj } if {[catch {mysqlcol $conn -current name} fields]} { set fields "" } set obj [result Mysql -resultid $conn \ -numrows [::list $error] \ -fields [::list $fields]] return $obj } method lastkey {} { if {![info exists conn] || ![mysqlping $conn]} { return } return [mysqlinsertid $conn] } method quote {string} { if {![catch {mysqlquote $string} result]} { return $result } regsub -all {'} $string {\'} string return $string } method sql_limit_syntax {limit {offset ""}} { if {[::rivet::lempty $offset]} { return " LIMIT $limit" } return " LIMIT [expr $offset - 1],$limit" } method handle {} { if {![info exists conn] || ![mysqlping $conn]} { open } return $conn } public variable db "" { if {[info exists conn] && [mysqlping $conn]} { mysqluse $conn $db } } protected method handle_client_arguments {cargs} { # we assign only the accepted options set clientargs {} foreach {a v} $cargs { if {($a == "-encoding") || \ ($a == "-localfiles") || \ ($a == "-ssl") || \ ($a == "-sslkey") || \ ($a == "-sslcert") || \ ($a == "-sslca") || \ ($a == "-sslcapath") || \ ($a == "-sslcipher") || \ ($a == "-socket")} { lappend clientargs $a $v } } } #public variable interface "Mysql" private variable conn } ; ## ::itcl::class Mysql ::itcl::class MysqlResult { inherit Result constructor {args} { eval configure $args } destructor { } method nextrow {} { return [mysqlnext $resultid] } } ; ## ::itcl::class MysqlResult } rivet-3.0.0/doc/html/apache_table.html000664 001750 001750 00000023421 15224455137 020416 0ustar00manghimanghi000000 000000 apache_table

    Name

    apache_table — access and manipulate Apache tables in the request structure.

    Synopsis

    ::rivet::apache_table (get | set | exists | unset | names | array_get | clear)

    Description

    The apache_table command is for accessing and manipulating Apache tables in the request structure.

    The table name must be one of notes, headers_in, headers_out, err_headers_out, or subprocess_env.

    ::rivet::apache_table get ?tablename? ?key?
    When given the name of an Apache table tablename and the name of a key tablename, returns the value of the key in the table, or an empty string.
    ::rivet::apache_table set ?tablename? ?key? ?value?
    ::rivet::apache_table set ?tablename? ?list?
    Stores the value in the table tablename under the key key.
    For the list form, list contains a list of zero or more pairs of key-value pairs to be set into the table tablename.
    ::rivet::apache_table exists ?tablename? ?key?
    Returns 1 if the specified key, key, exists in table tablename, else 0.
    ::rivet::apache_table unset ?tablename? ?key?
    Removes the key-value pair referenced by key from the table tablename.
    ::rivet::apache_table names ?tablename?
    Returns a list of all of the keys present in the table tablename.
    ::rivet::apache_table array_get ?tablename?
    Returns a list of key-value pairs from the table tablename.
    ::rivet::apache_table clear ?tablename?
    Clears the contents of the specified table.
    rivet-3.0.0/rivet/rivet-tcl/try.tcl000664 001750 001750 00000000570 15224454746 020020 0ustar00manghimanghi000000 000000 # -- try.tcl # # Wrapper of the core [try] command # # $Id$ # namespace eval ::rivet { proc try {script args} { uplevel [list ::try $script trap {RIVET ABORTPAGE} {} { return -errorcode {RIVET ABORTPAGE} -code error } trap {RIVET THREAD_EXIT} {} { return -errorcode {RIVET THREAD_EXIT} -code error } {*}$args] } } rivet-3.0.0/doc/html/env.html000664 001750 001750 00000005607 15224455137 016624 0ustar00manghimanghi000000 000000 env

    Name

    env — Returns the value a single "environmental variable".

    Synopsis

    ::rivet::env ?environment_variable_name?

    Description

    ::rivet::env resolves a single environment variable and returns its value or an empty string if the environment variable name in the argument is not defined. This command is the recommended way to resolve an environment variable leaving ::rivet::load_env to debugging and development operations.

    rivet-3.0.0/tests/apachetest/apachetest.tcl000664 001750 001750 00000032017 15224454746 021545 0ustar00manghimanghi000000 000000 # apachetest.tcl -- Tcl-based Apache test suite # Copyright 2001-2020 The Apache Tcl Team / 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. # This test suite provides a means to create configuration files, and # start apache with user-specified options. All it needs to run is # the name of the Apache executable, which must, however, be compiled # with the right options. set auto_path [linsert $auto_path 0 [file dirname [info script]]] package provide apachetest 0.1 # kill -- # kill a process and wait until it's really gone # (mimic TclX's kill and wait procs) # # Arguments: # signal - signal to send (e.g. TERM, HUP, KILL...) # pid - process id # # Side Effects: # kills a running process/processes (if permitted) # # Results: # None. proc kill {signal pid} { catch {exec kill -s $signal $pid} after 100 set i 100 while {1} { catch {exec ps -p $pid} out if {[regexp $pid $out]} { incr i 250 after 250 } else { break } } if {$i > 100} { puts "Waiting [expr {$i/1000.0}] seconds until process was killed" } } #package require http source [file join [file dirname [info script]] http.tcl] namespace eval apachetest { set debug 1 # name of the apache binary, such as /usr/sbin/httpd variable binname "" if ![info exists ::httpd_version ] { puts stderr "Please create httpd_version variable in global namespace" exit 1 } variable httpd_version $::httpd_version # this file should be in the same directory this script is. variable templatefile [file join [file dirname [info script]] template.conf.2.tcl] variable httpd_root set httpd_root "" variable server_config_file set server_config_file "" } # apachetest::need_modules -- # # Tell the test suite which modules we *need* to have. The test # suite will then check to see if these are either 1) compiled # into the server or 2) loaded in its configuration file. # # Arguments: # args # # Side Effects: # Sets up the rest of the apachetest tools to find the needed # modules. # # Results: # None. proc apachetest::need_modules { modlist } { variable module_assoc foreach module_pair $modlist { set module_assoc([lindex $module_pair 0]) [lindex $module_pair 1] } } # apachetest::connect -- # # Attempt to open a socket to the web server we are using in our # tests. Try for 10 seconds before giving up. # # Arguments: # None. proc apachetest::connect { } { set starttime [clock seconds] set diff 0 # We try for 10 seconds. while { $diff < 10 } { if { ! [catch { set sk [socket localhost 8081] } err]} { close $sk return } set diff [expr {[clock seconds] - $starttime}] } } # apachetest::start -- # # Start the web server in the background. After running the # script specified, stop the server. # # Arguments: # options - command line options to pass to the web server. # conftext - text to insert into test.conf. # code - code to run. # # Side Effects: # Runs 'code' in the global namespace. # # Results: # None. proc apachetest::start { options conftext code } { variable serverpid 0 variable binname variable debug variable httpd_version set fn [file join [pwd] test.conf] catch {file delete -force $fn} set fl [open $fn w] puts $fl [uplevel [list subst $conftext]] close $fl #OpenBSD related workaround, their stock apache tries to chroot by default #have to add -u to the arguments to prevent this catch {exec uname} uname_str if {[string equal $uname_str OpenBSD]} { set server_args "-u -X -f" } else { set server_args [list -X -f] } # There has got to be a better way to do this, aside from waiting. set serverpid [eval exec $binname $server_args \ [file join [pwd] server.conf] $options >& apachelog.txt &] apachetest::connect if { $debug > 0 } { puts "Apache started as PID $serverpid" } if { [catch { uplevel $code } err] } { puts stderr $::errorInfo } # apache2 binary started with -X reacts to SIGQUIT and ignores TERM, but KILL is most reliable kill KILL $serverpid } # startserver - start the server with 'options'. proc apachetest::startserver { args } { variable binname variable debug if { [catch { if { $debug } { puts "$binname -X -f [file join [pwd] server.conf] [concat $args]" } set serverpid [eval exec $binname -X -f "[file join [pwd] server.conf]" [concat $args]] } err] } { puts "$err" } } # getbinname - get the name of the apache binary, and check to make # sure it's ok. The user should supply this parameter. proc apachetest::getbinname { bname } { variable binname set binname $bname if { $binname == "" || ! [file executable $binname] } { error "Invalid executable '$binname', please supply the full name and path of the Apache executable on the command line." } return $binname } # get the modules that are compiled into Apache directly, and return # the XXX_module name. Check also for the existence of mod_so, which # we need to load the shared object in the directory above... proc apachetest::getcompiledin { binname } { variable module_assoc if {[catch { set bin [open [list | "$binname" -l] r] set compiledin [read $bin] close $bin} e einfo]} { puts "error: $e" puts "error info: $einfo" error "caught error in apachetest::getcompledin" } set modlist [split $compiledin] set compiledin [list] set mod_so_present 0 foreach entry $modlist { if { [regexp {(.*)\.c$} $entry match modname] } { if { $modname == "mod_so" } { set mod_so_present 1 } if { [info exists module_assoc($modname)] } { lappend compiledin $module_assoc($modname) } } } if { $mod_so_present == 0 } { error "We need mod_so in Apache to run these tests" } return $compiledin } # find the httpd.conf file proc apachetest::gethttpdconf { binname } { set bin [open [list | $binname -V] r] set options [read $bin] catch {close $bin} regexp {SERVER_CONFIG_FILE="(.*?)"} "$options" match filename if {![file exists $filename]} { # see if we can find something by combining # HTTP_ROOT + SERVER_CONFIG_FILE regexp {HTTPD_ROOT="(.*?)"} "$options" match httpdroot set completename [file join $httpdroot $filename] if {![file exists $completename]} { error "neither '$filename' or '$completename' exists" } return $completename } return $filename } # apachetest::getallincludes -- # # Reads the conf file, and returns its text, plus the text in # all the files that it Includes itself. # # Arguments: # conffile - file to read. # # Side Effects: # None. # # Results: # Text of configuration files. proc apachetest::getallincludes { conffile } { variable httpd_root if [file exists $conffile] { set fl [open $conffile r] set data [read $fl] close $fl set newdata {} foreach line [split $data \n] { # Look for Include lines. if { [regexp -line {^[^\#]*Include(?:|Optional) +(.*)} $line match file]} { puts "including files from $file" set file [string trim $file] if {[string index $file 0] != "/"} { set file [file join $httpd_root $file] } # Include directives accept as argument a file, a directory # or a glob-style file matching pattern. Patterns usually match # many files, but are not directories, so we have to handle # all these 3 cases # we use the glob command to tell whether we are dealing with # a pure file expression or a matching pattern set matched_files [glob -nocomplain $file] set matched_files_n [llength $matched_files] if {$matched_files_n > 1} { foreach fl $matched_files { puts "including $fl" if [file exists $fl] { append newdata [getallincludes $fl] } } } elseif {$matched_files_n == 1} { set file $matched_files if { [file isdirectory $file] } { foreach fl [glob -nocomplain [file join $file *]] { puts "including $fl" if [file exists $fl] { append newdata [getallincludes $fl] } } } else { append newdata [getallincludes $file] } } } } append data $newdata return $data } else { return } } # apachetest::getloadmodules -- # # Get the LoadModule lines for modules that we want to load. # # Arguments: # conffile - the name of the conf file to read. # needtoget - list of modules that we want to load. # # Side Effects: # None. # # Results: # Returns a string suitable for inclusion in a conf file. proc apachetest::getloadmodules { conffile needtoget } { variable httpd_root puts "checking $conffile " set confdata [getallincludes $conffile] set loadline [list] regexp -line {^[^#]*(ServerRoot[\s]?[\"]?)([^\"]+)()([\"]?)} $confdata \ match sub1 server_root_path sub2 if {![info exists server_root_path]} { set server_root_path $httpd_root } foreach mod $needtoget { # Look for LoadModule lines. puts -nonewline "check conf line for $mod module..." flush stdout if { ! [regexp -line "^\[^\#\]*(LoadModule\\s+$mod\\s+.+)\$"\ $confdata match line] } { error "No LoadModule line for $mod\!" } else { puts ok set raw_path [join [lrange [split $line { }] 2 end]] #trimming leading whitespaces set path [string trimleft $raw_path] if ![string equal [file pathtype $line] "absolute"] { set absolute_path [file join $server_root_path $path] lappend loadline "[join [lrange [split $line " "] 0 1]] $absolute_path" } else { lappend loadline $line } } } return [join $loadline "\n"] } # Compare what's compiled in with what we need. proc apachetest::determinemodules { binname } { variable server_config_file variable httpd_root variable module_assoc set compiledin [lsort [getcompiledin $binname]] set conffile [gethttpdconf $binname] set server_config_file $conffile set httpd_root [file dirname $conffile] foreach {n k} [array get module_assoc] { lappend needed $k } set needed [lsort $needed] puts "needed: $needed" set needtoget [list] foreach mod $needed { if { [lsearch $compiledin $mod] == -1 } { lappend needtoget $mod } } if {$needtoget == ""} { return "" } else { return [getloadmodules $conffile $needtoget] } } # apachetest::makeconf -- # # Creates a config file and writes it to disk. # # Arguments: # outfile - the file to create/write to. # extra - extra config options to add. # # Side Effects: # Creates a new config file. # # Results: # None. proc apachetest::makeconf { outfile bridge {extra ""} } { variable binname variable templatefile set CWD [pwd] #getting uid and gid of user catch {exec id} raw_string # username and group no longer needed. User and Group directives removed from # main conffile template (#Bug 53396) # set username [lindex [regexp -inline {(uid=)([\d]+)(\()([^\)]+)(\))} $raw_string] 4] # set group [lindex [regexp -inline {(gid=)([\d]+)(\()([^\)]+)(\))} $raw_string] 4] # replace with determinemodules set LOADMODULES [determinemodules $binname] puts "reading template from $templatefile" set fl [open [file join . $templatefile] r] set template [read $fl] close $fl # configure a specific bridge if -bridge passed as argument if {$bridge == "default"} { set bridge_conf "# Default bridge" } else { set bridge_conf "RivetServerConf MpmBridge $bridge" } set extra [string map [list BRIDGE $bridge_conf] $extra] append template $extra puts $template set out [subst $template] set of [open $outfile w] puts $of "$out" close $of } rivet-3.0.0/tests/commands.tcl000664 001750 001750 00000001464 15224454746 017106 0ustar00manghimanghi000000 000000 # -- commands.tcl # # testing the output of various commands that # provide a swiss knife for formatting, generating, etc.etc. # if {[::rivet::var exists cmd]} { set cmd [::rivet::var get cmd] switch $cmd { xml { # generic ::rivet::xml usage puts [::rivet::xml "a text string" a [list b a1 v1 a2 v2] [list c a1 v1 a2 v2]] puts [::rivet::xml "a text string" [list b a1 v1 a2 v2] [list c a1 v1 a2 v2] a] puts [::rivet::xml "" [list b a1 v1 a2 v2] [list c a1 v1 a2 v2] a] # self closing single element puts [::rivet::xml [list a a1 v1 a2 v2]] puts -nonewline [::rivet::xml br] } default { puts "invalid argument '$cmd'" } } } else { puts "no cmd argument provided" } rivet-3.0.0/rivet/packages/tclrivet/pkgIndex.tcl000664 001750 001750 00000001034 15224454746 022450 0ustar00manghimanghi000000 000000 # Tcl package index file, version 1.1 # This file is generated by the "pkg_mkIndex" command # and sourced either when an application starts up or # by a "package unknown" script. It invokes the # "package ifneeded" command to set up package-related # information so that packages will be loaded automatically # in response to "package require" commands. When this # script is sourced, the variable $dir must contain the # full path name of this file's directory. package ifneeded tclrivet 0.1 [list source [file join $dir tclrivet.tcl]] rivet-3.0.0/doc/html/images/word.png000644 001750 001750 00000000611 15224455140 020052 0ustar00manghimanghi000000 000000 PNG  IHDRf0gAMA asRGB cHRMz&u0`:pQ<PLTEBBB[ϕtRNS@fbKGD- pHYsHHFk>XIDAT% **,PxD6QPr0"T:&Ss'zN:i^;EjjN /y%tEXtdate:create2012-10-01T18:30:10+02:00k%tEXtdate:modify2004-02-19T05:50:53+01:00OS1IENDB`rivet-3.0.0/src/mod_rivet_ng/mod_rivet.c000664 001750 001750 00000043050 15224454746 021033 0ustar00manghimanghi000000 000000 /* mod_rivet.c -- The apache module itself, for Apache 2.4. */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif /* Apache includes */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /* Tcl includes */ #include /* as long as we need to emulate ap_chdir_file we need to include unistd.h */ #ifdef RIVET_HAVE_UNISTD_H #include #endif /* RIVET_HAVE_UNISTD_H */ #include "rivet_types.h" #include "mod_rivet.h" #include "apache_config.h" /* Function prototypes are defined with EXTERN. Since we are in the same DLL, * no need to keep this extern... */ #ifdef EXTERN # undef EXTERN # define EXTERN #endif /* EXTERN */ #include "rivet.h" #include "mod_rivet_common.h" #include "mod_rivet_generator.h" module AP_MODULE_DECLARE_DATA rivet_module; extern Tcl_ChannelType RivetChan; DLLEXPORT apr_threadkey_t* rivet_thread_key = NULL; DLLEXPORT mod_rivet_globals* module_globals = NULL; #define ERRORBUF_SZ 256 #define TCL_HANDLER_FILE RIVET_DIR"/default_request_handler.tcl" /* * -- Rivet_SeekMPMBridge * * MPM name determination. The function returns a filename to * an MPM bridge module. The module name is determined in 4 steps * * - The environment variable RIVET_MPM_BRIDGE is checked. If the * variable exists its value is returned as the path to the bridge module * If the module doesn't exist the server exits with an error * - The global configuration is checked. If module_globals->mpm_bridge is * not NULL its value is taken as the bridge name as given by means of * the server configuration directive RivetMpmBridge. * The value is interpolated with the macro RIVET_MPM_BRIDGE_COMPOSE * to compose the full path (e.g. 'lazy' -> RIVET_DIR'/mpm/rivet_lazy_mpm.so') * to the bridge module. * - If the interpolated file name doesn't exist the mpm_bridge string is * checked as a full path to the MPM bridge. If not existing the server exits * - An heuristics criterion based on the MPM module features returned by * mpm_bridge_query is evaluated. * */ static char* Rivet_SeekMPMBridge (apr_pool_t* pool) { char* mpm_bridge_path; int ap_mpm_result; apr_status_t apr_ret; apr_finfo_t finfo; /* With the env variable RIVET_MPM_BRIDGE we have the chance to tell mod_rivet what bridge custom implementation we want be loaded */ if (apr_env_get (&mpm_bridge_path,"RIVET_MPM_BRIDGE",pool) == APR_SUCCESS) { if ((apr_ret = apr_stat(&finfo,mpm_bridge_path,APR_FINFO_MIN,pool)) != APR_SUCCESS) { ap_log_perror(APLOG_MARK,APLOG_ERR,apr_ret,pool, MODNAME ": MPM bridge %s not found", module_globals->mpm_bridge); exit(1); } return mpm_bridge_path; } /* we now look into the configuration record */ if (module_globals->mpm_bridge != NULL) { char* proposed_bridge; proposed_bridge = apr_pstrcat(pool,RIVET_DIR,RIVET_MPM_BRIDGE_COMPOSE(module_globals->mpm_bridge),NULL); if (apr_stat(&finfo,proposed_bridge,APR_FINFO_MIN,pool) == APR_SUCCESS) { mpm_bridge_path = proposed_bridge; } else if ((apr_ret = apr_stat(&finfo,module_globals->mpm_bridge,APR_FINFO_MIN,pool)) == APR_SUCCESS) { mpm_bridge_path = apr_pstrdup(pool,module_globals->mpm_bridge); } else { ap_log_perror(APLOG_MARK,APLOG_ERR,apr_ret,pool, MODNAME ": MPM bridge %s (%s) not found",module_globals->mpm_bridge, proposed_bridge); exit(1); } } else { /* MPM bridge determination heuristics */ /* Let's query the Apache server about the current MPM threaded capabilities */ if (ap_mpm_query(AP_MPMQ_IS_THREADED,&ap_mpm_result) == APR_SUCCESS) { if (ap_mpm_result == AP_MPMQ_NOT_SUPPORTED) { /* Since the MPM is not threaded we assume we can load the prefork bridge */ mpm_bridge_path = apr_pstrcat(pool,RIVET_MPM_BRIDGE_COMPOSE("prefork"),NULL); } else { mpm_bridge_path = apr_pstrcat(pool,RIVET_MPM_BRIDGE_COMPOSE("worker"),NULL); } } else { /* Execution shouldn't get here as a failure querying about MPM is supposed * to return APR_SUCCESS in every normal operative conditions. We * give a default to the MPM bridge anyway */ mpm_bridge_path = apr_pstrcat(pool,RIVET_MPM_BRIDGE_COMPOSE("worker"),NULL); } mpm_bridge_path = apr_pstrcat(pool,RIVET_DIR,mpm_bridge_path,NULL); } return mpm_bridge_path; } /* * -- Rivet_CreateModuleGlobals * * module globals (mod_rivet_globals) allocation and initialization. * As of 3.2 the procedure initialized the fields that can be set * during the pre_config stage of the server initialization * */ static mod_rivet_globals* Rivet_CreateModuleGlobals (apr_pool_t* pool) { mod_rivet_globals* mod_rivet_g; mod_rivet_g = apr_pcalloc(pool,sizeof(mod_rivet_globals)); mod_rivet_g->single_thread_exit = SINGLE_THREAD_EXIT_UNDEF; mod_rivet_g->separate_virtual_interps = RIVET_SEPARATE_VIRTUAL_INTERPS; mod_rivet_g->separate_channels = RIVET_SEPARATE_CHANNELS; if (apr_pool_create(&mod_rivet_g->pool, NULL) != APR_SUCCESS) { ap_log_perror(APLOG_MARK,APLOG_ERR,APR_EGENERAL,pool, MODNAME ": could not initialize rivet module global pool"); exit(1); } /* read the default request handler code */ if (Rivet_ReadFile(pool,TCL_HANDLER_FILE, &mod_rivet_g->default_handler, &mod_rivet_g->default_handler_size) > 0) { ap_log_perror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, pool, MODNAME ": could not read rivet default handler"); exit(1); } return mod_rivet_g; } /* * -- Rivet_Exit_Handler * * * */ int Rivet_Exit_Handler(int code) { //Tcl_Exit(code); /*NOTREACHED*/ return TCL_OK; /* Better not ever reach this! */ } /* * -- Rivet_RunServerInit * * Prepare the execution of any Rivet server initialization script * */ static int Rivet_RunServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *s) { #ifdef WIN32 char* parent_pid_var = NULL; #endif FILEDEBUGINFO; /* we create and initialize a master (server) interpreter */ module_globals->server_interp = Rivet_NewVHostInterp(pPool,0); /* root interpreter */ /* We initialize the interpreter and we won't register a channel with it because * we couldn't send data to the stdout anyway */ Rivet_PerInterpInit(module_globals->server_interp,NULL,s,pPool); /* This code conditionally compiled when we are building for the * Windows family of OS. The winnt MPM runs the post_config * hooks after it has spawned a child process but we don't want * to run the Tcl server initialization script again. We * detect we are in a child process by checking * the environment variable AP_PARENT_PID * (https://wiki.apache.org/httpd/ModuleLife) */ #ifdef WIN32 /* if the environment variable AP_PARENT_PID is set * we know we are in a child process of the winnt MPM */ apr_env_get(&parent_pid_var,"AP_PARENT_PID",pTemp); if (parent_pid_var != NULL) { ap_log_perror(APLOG_MARK,APLOG_INFO,0,pPool, "AP_PARENT_PID found: not running the Tcl server script in winnt MPM child process"); return OK; } else { ap_log_perror(APLOG_MARK,APLOG_INFO,0,pPool, "AP_PARENT_PID undefined, we proceed with server initialization"); } #endif /* We don't create the cache here: it would make sense for prefork MPM * but threaded MPM bridges have their pool of threads. Each of them * will by now have their own cache */ if (module_globals->rivet_server_init_script != NULL) { Tcl_Interp* interp = module_globals->server_interp->interp; Tcl_Obj* server_init = Tcl_NewStringObj(module_globals->rivet_server_init_script,-1); Tcl_IncrRefCount(server_init); if (Tcl_EvalObjEx(interp, server_init, 0) != TCL_OK) { ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, s, MODNAME ": Error running ServerInitScript '%s': %s", module_globals->rivet_server_init_script, Tcl_GetVar(interp, "errorInfo", 0)); } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, s, MODNAME ": ServerInitScript '%s' successful", module_globals->rivet_server_init_script); } Tcl_DecrRefCount(server_init); } /* bridge specific server init script */ RIVET_MPM_BRIDGE_CALL(server_init,pPool,pLog,pTemp,s); return OK; } /* -- Rivet_ServerInit * * Post config hook. The server initialization loads the MPM bridge * and runs the Tcl server initialization script * * The module globals structure is allocated and initialized by * the pre-config hook procedure (Rivet_InitGlobals) * */ static int Rivet_ServerInit (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp, server_rec *server) { apr_dso_handle_t* dso_handle; void* userdata; const char *userdata_key = "rivet_post_config"; #if RIVET_DISPLAY_VERSION ap_add_version_component(pPool,RIVET_PACKAGE_NAME"/"RIVET_VERSION); #else ap_add_version_component(pPool,RIVET_PACKAGE_NAME); #endif /* This function runs as post_config_hook and as such it's run twice by design. * This is the recommended way to avoid a double load of external modules. */ apr_pool_userdata_get(&userdata, userdata_key, server->process->pool); if (userdata == NULL) { apr_pool_userdata_set((const void *)1, userdata_key, apr_pool_cleanup_null, server->process->pool); ap_log_error(APLOG_MARK,APLOG_DEBUG,0,server, "first post_config run: not initializing Tcl stuff"); return OK; /* This would be the first time through */ } /* We determine the Rivet Bridge and we store its pointer in the module globals */ module_globals->rivet_mpm_bridge = Rivet_SeekMPMBridge(pPool); module_globals->server = server; /* The bridge is loaded and the jump table sought */ if (apr_dso_load(&dso_handle,module_globals->rivet_mpm_bridge,pPool) == APR_SUCCESS) { apr_status_t rv; apr_dso_handle_sym_t bjt = NULL; ap_log_perror(APLOG_MARK,APLOG_DEBUG,APR_EGENERAL,pTemp, "MPM bridge loaded: %s",module_globals->rivet_mpm_bridge); rv = apr_dso_sym(&bjt,dso_handle,"bridge_jump_table"); if (rv == APR_SUCCESS) { module_globals->bridge_jump_table = (rivet_bridge_table*) bjt; } else { char errorbuf[ERRORBUF_SZ]; ap_log_error (APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME ": Error loading symbol bridge_jump_table: %s", apr_dso_error(dso_handle,errorbuf,ERRORBUF_SZ)); exit(1); } /* we require only request_processor and thread_interp to be defined */ ap_assert(RIVET_MPM_BRIDGE_FUNCTION(request_processor) != NULL); ap_assert(RIVET_MPM_BRIDGE_FUNCTION(thread_interp) != NULL); apr_thread_mutex_create(&module_globals->pool_mutex, APR_THREAD_MUTEX_UNNESTED, pPool); } else { char errorbuf[ERRORBUF_SZ]; /* If we can't load the mpm handler module we give up and exit */ ap_log_error(APLOG_MARK, APLOG_ERR, APR_EGENERAL, server, MODNAME " Error loading MPM manager: %s", apr_dso_error(dso_handle,errorbuf,ERRORBUF_SZ)); exit(1); } Rivet_RunServerInit(pPool,pLog,pTemp,server); return OK; } /* * -- Rivet_Finalize * */ apr_status_t Rivet_Finalize(void* data) { RIVET_MPM_BRIDGE_CALL(child_finalize,data); apr_threadkey_private_delete (rivet_thread_key); return OK; } static void Rivet_ChildInit (apr_pool_t *pChild, server_rec *server) { int idx; rivet_server_conf* root_server_conf; server_rec* s; /* the thread key used to access to Tcl threads private data */ ap_assert (apr_threadkey_private_create (&rivet_thread_key, NULL, pChild) == APR_SUCCESS); /* This code is run once per child process. The forking * of a child process doesn't preserve the thread where the Tcl * notifier runs. The Notifier should have been restarted by one the * pthread_atfork callbacks (setup in Tcl >= 8.5.14 and Tcl >= 8.6.1). In * case pthread_atfork is not supported we unconditionally call Tcl_InitNotifier * hoping for the best (Bug #55153) */ #if !defined(HAVE_PTHREAD_ATFORK) Tcl_InitNotifier(); #endif /* We can rely on the existence of module_globals only when * running the prefork MPM, otherwise the pointer is NULL and * the structure has to be allocated and filled with data */ if (module_globals == NULL) { module_globals = Rivet_CreateModuleGlobals(pChild); module_globals->rivet_mpm_bridge = Rivet_SeekMPMBridge(pChild); module_globals->server = server; } /* * the mutex to protect the process wide pool is created here */ apr_thread_mutex_create(&module_globals->pool_mutex, APR_THREAD_MUTEX_UNNESTED, pChild); /* Once we have established a pool with the same lifetime of the child process we * process all the configured server records assigning an integer as unique key * to each of them */ root_server_conf = RIVET_SERVER_CONF(server->module_config); idx = 0; for (s = server; s != NULL; s = s->next) { rivet_server_conf* myrsc; myrsc = RIVET_SERVER_CONF(s->module_config); /* We only have a different rivet_server_conf if MergeConfig * was called. We really need a separate one for each server, * so we go ahead and create one here, if necessary. */ if (s != server && myrsc == root_server_conf) { myrsc = RIVET_NEW_CONF(pChild); ap_set_module_config(s->module_config,&rivet_module,myrsc); Rivet_CopyConfig(root_server_conf,myrsc); } myrsc->idx = idx++; } module_globals->vhosts_count = idx; /* Calling the brigde child process initialization */ RIVET_MPM_BRIDGE_CALL(thread_init,pChild,server); apr_pool_cleanup_register(pChild,server,Rivet_Finalize,Rivet_Finalize); } static int Rivet_Handler (request_rec *r) { rivet_req_ctype ctype = Rivet_CheckType(r); if (ctype == CTYPE_NOT_HANDLED) { return DECLINED; } return (*RIVET_MPM_BRIDGE_FUNCTION(request_processor))(r,ctype); } static int Rivet_InitGlobals (apr_pool_t *pPool, apr_pool_t *pLog, apr_pool_t *pTemp) { /* the module global structure is allocated and the MPM bridge name established */ module_globals = Rivet_CreateModuleGlobals (pPool); return OK; } /* * -- rivet_register_hooks: mod_rivet basic setup. * * */ static void rivet_register_hooks(apr_pool_t *p) { ap_hook_pre_config (Rivet_InitGlobals,NULL, NULL, APR_HOOK_LAST); ap_hook_post_config (Rivet_ServerInit, NULL, NULL, APR_HOOK_LAST); ap_hook_handler (Rivet_Handler, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init (Rivet_ChildInit, NULL, NULL, APR_HOOK_LAST); } /* mod_rivet basic structures */ /* configuration commands and directives */ const command_rec rivet_cmds[] = { AP_INIT_TAKE2 ("RivetServerConf", Rivet_ServerConf, NULL, RSRC_CONF, NULL), AP_INIT_TAKE2 ("RivetDirConf", Rivet_DirConf, NULL, ACCESS_CONF, NULL), AP_INIT_TAKE2 ("RivetUserConf", Rivet_UserConf, NULL, ACCESS_CONF|OR_FILEINFO, "RivetUserConf key value: sets RivetUserConf(key) = value"), {NULL} }; /* Dispatch list for API hooks */ module AP_MODULE_DECLARE_DATA rivet_module = { STANDARD20_MODULE_STUFF, Rivet_CreateDirConfig, /* create per-dir config structures */ Rivet_MergeDirConfig, /* merge per-dir config structures */ Rivet_CreateConfig, /* create per-server config structures */ Rivet_MergeConfig, /* merge per-server config structures */ rivet_cmds, /* table of config file commands */ rivet_register_hooks /* register hooks */ }; rivet-3.0.0/src/request/apache_multipart_buffer.c000664 001750 001750 00000020145 15224454746 022732 0ustar00manghimanghi000000 000000 /* apache_multipart_buffer.c -- form multipart data handling */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include #include #include #include "apache_multipart_buffer.h" /*********************** internal functions *********************/ /* search for a string in a fixed-length byte string. if partial is true, partial matches are allowed at the end of the buffer. returns NULL if not found, or a pointer to the start of the first match. */ void* my_memstr(char* haystack,int haystacklen,const char* needle,int partial) { size_t needlen = strlen(needle); int len = haystacklen; char *ptr = haystack; /* iterate through first character matches */ while( (ptr = memchr(ptr, needle[0], len)) ) { /* calculate length after match */ len = haystacklen - (int)(ptr - (char *)haystack); /* done if matches up to capacity of buffer */ if(memcmp(needle, ptr, needlen) == 0 && (partial || len >= needlen)) { break; } /* next character */ ptr++; len--; } return ptr; } /* fill up the buffer with client data. returns number of bytes added to buffer. */ int fill_buffer(multipart_buffer *self) { int bytes_to_read, actual_read = 0; /* shift the existing data if necessary */ if(self->bytes_in_buffer > 0 && self->buf_begin != self->buffer) memmove(self->buffer, self->buf_begin, self->bytes_in_buffer); self->buf_begin = self->buffer; /* calculate the free space in the buffer */ bytes_to_read = self->bufsize - self->bytes_in_buffer; if (bytes_to_read >= self->r->remaining) { bytes_to_read = (int)(self->r->remaining - (apr_off_t)strlen(self->boundary)); #ifdef DEBUG ap_log_rerror(MPB_ERROR, "mozilla 0.97 hack: '%ld'", self->r->remaining); #endif } /* read the required number of bytes */ if(bytes_to_read > 0) { char *buf = self->buffer + self->bytes_in_buffer; actual_read = ap_get_client_block(self->r, buf, bytes_to_read); /* update the buffer length */ if(actual_read > 0) self->bytes_in_buffer += actual_read; } return actual_read; } /* gets the next CRLF terminated line from the input buffer. if it doesn't find a CRLF, and the buffer isn't completely full, returns NULL; otherwise, returns the beginning of the null-terminated line, minus the CRLF. note that we really just look for LF terminated lines. this works around a bug in internet explorer for the macintosh which sends mime boundaries that are only LF terminated when you use an image submit button in a multipart/form-data form. */ char* next_line(multipart_buffer *self) { /* look for LF in the data */ char* line = self->buf_begin; char* ptr = memchr(self->buf_begin, '\n', self->bytes_in_buffer); /* LF found */ if(ptr) { /* terminate the string, remove CRLF */ if((ptr - line) > 0 && *(ptr-1) == '\r') *(ptr-1) = 0; else *ptr = 0; /* bump the pointer */ self->buf_begin = ptr + 1; self->bytes_in_buffer -= (int)(self->buf_begin - line); } /* no LF found */ else { /* buffer isn't completely full, fail */ if(self->bytes_in_buffer < self->bufsize) return NULL; /* return entire buffer as a partial line */ line[self->bufsize] = 0; self->buf_begin = ptr; self->bytes_in_buffer = 0; } return line; } /* returns the next CRLF terminated line from the client */ char* get_line(multipart_buffer *self) { char* ptr = next_line(self); if(!ptr) { fill_buffer(self); ptr = next_line(self); } #ifdef DEBUG ap_log_rerror(MPB_ERROR, "get_line: '%s'", ptr); #endif return ptr; } /* finds a boundary */ int find_boundary(multipart_buffer *self, char *boundary) { char *line; /* loop thru lines */ while( (line = get_line(self)) ) { #ifdef DEBUG ap_log_rerror(MPB_ERROR, "find_boundary: '%s' ?= '%s'", line, boundary); #endif /* finished if we found the boundary */ if(strEQ(line, boundary)) return 1; } /* didn't find the boundary */ return 0; } /*********************** external functions *********************/ /* create new multipart_buffer structure */ multipart_buffer *multipart_buffer_new(char *boundary, apr_off_t length, request_rec *r) { multipart_buffer *self = (multipart_buffer *) apr_pcalloc (r->pool, sizeof(multipart_buffer)); size_t minsize = strlen(boundary)+6; if(minsize < FILLUNIT) minsize = FILLUNIT; self->r = r; self->buffer = (char *) apr_pcalloc(r->pool, minsize+1); self->bufsize = (int)minsize; self->request_length = length; self->boundary = (char*) apr_pstrcat(r->pool, "--", boundary, NULL); self->boundary_next = (char*) apr_pstrcat(r->pool, "\n", self->boundary, NULL); self->buf_begin = self->buffer; self->bytes_in_buffer = 0; return self; } /* parse headers and return them in an apache table */ //table *multipart_buffer_headers(multipart_buffer *self) apr_table_t *multipart_buffer_headers(multipart_buffer *self) { apr_table_t *tab; char *line; /* didn't find boundary, abort */ if(!find_boundary(self, self->boundary)) return NULL; /* get lines of text, or CRLF_CRLF */ tab = apr_table_make(self->r->pool, 10); while( (line = get_line(self)) && strlen(line) > 0 ) { /* add header to table */ char *key = line; char *value = strchr(line, ':'); if(value) { *value = 0; do { value++; } while (apr_isspace(*value)); #ifdef DEBUG ap_log_rerror(MPB_ERROR, "multipart_buffer_headers: '%s' = '%s'", key, value); #endif apr_table_add(tab, key, value); } else { #ifdef DEBUG ap_log_rerror(MPB_ERROR, "multipart_buffer_headers: '%s' = ''", key); #endif apr_table_add(tab, key, ""); } } return tab; } /* read until a boundary condition */ size_t multipart_buffer_read(multipart_buffer *self, char *buf, size_t bytes) { size_t max; size_t len; char* bound; /* fill buffer if needed */ if(bytes > self->bytes_in_buffer) fill_buffer(self); /* look for a potential boundary match, only read data up to that point */ if( (bound = my_memstr(self->buf_begin, self->bytes_in_buffer, self->boundary_next, 1)) ) { max = bound - self->buf_begin; } else { max = self->bytes_in_buffer; } /* maximum number of bytes we are reading */ len = max < bytes-1 ? max : bytes-1; /* if we read any data... */ if (len > 0) { /* copy the data */ memcpy(buf, self->buf_begin, len); buf[len] = 0; if(bound && len > 0 && buf[len-1] == '\r') buf[--len] = 0; /* update the buffer */ self->bytes_in_buffer -= (int)len; self->buf_begin += len; } #ifdef DEBUG ap_log_rerror(MPB_ERROR, "multipart_buffer_read: %d bytes", len); #endif return len; } /* XXX: this is horrible memory-usage-wise, but we only expect to do this on small pieces of form data. */ char *multipart_buffer_read_body(multipart_buffer *self) { char buf[FILLUNIT], *out = ""; while(multipart_buffer_read(self, buf, sizeof(buf))) out = (char*) apr_pstrcat(self->r->pool, out, buf, NULL); #ifdef DEBUG ap_log_rerror(MPB_ERROR, "multipart_buffer_read_body: '%s'", out); #endif return out; } /* eof if we are out of bytes, or if we hit the final boundary */ int multipart_buffer_eof(multipart_buffer *self) { if( (self->bytes_in_buffer == 0 && fill_buffer(self) < 1) ) return 1; else return 0; } rivet-3.0.0/tests/access.conf000664 001750 001750 00000000000 15224454746 016672 0ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/packages/dio/formatters.tcl000664 001750 001750 00000024535 15224454746 022017 0ustar00manghimanghi000000 000000 # formatters.tcl -- connector for tdbc, the Tcl database abstraction layer # # Copyright 2024 The Apache Software Foundation # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. package require Itcl namespace eval ::DIO::formatters { # ::itcl::class RootFormatter # # we devolve the role of special field formatter to this # class. By design this is more sensible with respect to # the current approach of having such method in subclasses # because it allows to reuse the functionality of this # class in other DBMS connector. # this class must be subclassed for each dbms or SQL dialect ::itcl::class RootFormatter { private variable special_fields [dict create] public proc quote {a_string} { regsub -all {'} $a_string {\'} a_string return $a_string } public method register {table_name field_name ftype} { dict set special_fields $table_name $field_name $ftype } public method get_special_fields {table_name} { if {[dict exists $special_fields $table_name]} { return [dict keys [dict get $special_fields $table_name] } return "" } public method has_special_fields {table_name} { return [dict exists $special_fields $table_name] } public method build {table_name field_name val convert_to} { if {[dict exists $special_fields $table_name $field_name]} { set field_type [dict get $special_fields $table_name $field_name] if {[catch { set field_value [$this $field_type $field_name $val $convert_to] } e einfo]} { puts "
    Error: $e, $einfo
    " set field_value "'[quote $val]'" } return $field_value } else { return "'[quote $val]'" } } } ; ## ::itcl::class RootFormatter ::itcl::class Mysql { inherit RootFormatter public method DATE {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d}] return "DATE_FORMAT('$my_val','%Y-%m-%d')" } public method DATETIME {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d %T}] return "DATE_FORMAT('$my_val','%Y-%m-%d %T')" } public method NOW {field_name val convert_to} { # we try to be coherent with the original purpose of this method whose # goal endows the class with a uniform way to handle timestamps. # E.g.: Package session expects this case to return a timestamp in seconds # so that differences with timestamps returned by [clock seconds] # can be done and session expirations are computed consistently. # (Bug #53703) switch $convert_to { SECS { if {[::string compare $val "now"] == 0} { # set secs [clock seconds] # set my_val [clock format $secs -format {%Y%m%d%H%M%S}] # return $my_val return [clock seconds] } else { return "UNIX_TIMESTAMP($field_name)" } } default { if {[::string compare $val, "now"] == 0} { set secs [clock seconds] } else { set secs [clock scan $val] } # this is kind of going back and forth from the same # format, #set my_val [clock format $secs -format {%Y-%m-%d %T}] return "FROM_UNIXTIME('$secs')" } } } public method NULL {field_name val convert_to} { if {[::string toupper $val] == "NULL"} { return $val } else { return "'[quote $val]'" } } } ::itcl::class Sqlite3 { inherit RootFormatter # # quote - given a string, return the same string with any single # quote characters preceded by a backslash # method quote {a_string} { regsub -all {'} $a_string {''} a_string return $a_string } public method DATE {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d}] return "date('$my_val')" } public method DATETIME {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d %T}] return "datetime('$my_val')" } public method NOW {field_name val convert_to} { # we try to be coherent with the original purpose of this method whose # goal is to provide a uniform way to handle timestamps. # E.g.: Package session expects this case to return a timestamp in seconds # so that differences with timestamps returned by [clock seconds] # can be done and session expirations are computed consistently. # (Bug #53703) switch $convert_to { SECS { if {[::string compare $val "now"] == 0} { # set secs [clock seconds] # set my_val [clock format $secs -format "%Y%m%d%H%M%S"] return [clock seconds] } else { # the numbers of seconds must be returned as 'utc' to # be compared with values returned by [clock seconds] return "strftime('%s',$field_name,'utc')" } } default { if {[::string compare $val, "now"] == 0} { set secs [clock seconds] } else { set secs [clock scan $val] } set my_val [clock format $secs -format {%Y-%m-%d %T}] return "datetime('$my_val')" } } } } ::itcl::class Postgres { inherit RootFormatter public method DATE {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d}] return "'$my_val'" } public method DATETIME {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d %T}] return "'$my_val'" } public method NOW {field_name val convert_to} { # we try to be coherent with the original purpose of this method whose # goal is to provide a uniform way to handle timestamps. # E.g.: Package session expects this case to return a timestamp in seconds # so that differences with timestamps returned by [clock seconds] # can be done and session expirations are computed consistently. # (Bug #53703) switch $convert_to { SECS { if {[::string compare $val "now"] == 0} { return [clock seconds] } else { return "extract(epoch from $field_name)" } } default { if {[::string compare $val, "now"] == 0} { set secs [clock seconds] } else { set secs [clock scan $val] } # this is kind of going back and forth from the same # format, return "'[clock format $secs -format {%Y-%m-%d %T}]'" } } } } ::itcl::class Oracle { inherit RootFormatter public method DATE {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d}] return "to_date('$my_val','YYYY-MM-DD')" } public method DATETIME {field_name val convert_to} { set secs [clock scan $val] set my_val [clock format $secs -format {%Y-%m-%d %T}] return "to_date('$my_val','YYYY-MM-DD HH24:MI:SS')" } public method NOW {field_name val convert_to} { switch $convert_to { SECS { if {[::string compare $val "now"] == 0} { set secs [clock seconds] set my_val [clock format $secs -format {%Y%m%d%H%M%S}] return $my_val } else { return "($field_name - to_date('1970-01-01')) * 86400" #return "to_char($field_name, 'YYYYMMDDHH24MISS')" } } default { if {[::string compare $val "now"] == 0} { set secs [clock seconds] } else { set secs [clock scan $val] } set my_val [clock format $secs -format {%Y-%m-%d %T}] return "to_date('$my_val', 'YYYY-MM-DD HH24:MI:SS')" } } } } }; ## namespace eval DIO package provide dio::formatters 1.1 rivet-3.0.0/rivet/packages/dio/dio_Tdbc.tcl000664 001750 001750 00000032567 15224454746 021344 0ustar00manghimanghi000000 000000 # tdbc.tcl -- connector for tdbc, the Tcl database abstraction layer # # Copyright 2024 The Apache Software Foundation # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. package require tdbc package require DIO 1.2.3 package provide dio_Tdbc 1.2.5 namespace eval DIO { ::itcl::class Tdbc { inherit Database private common connector_n -1 private variable connector private variable connector_name private variable tdbc_connector private variable tdbc_arguments [list -encoding \ -isolation \ -readonly \ -timeout] constructor {interface_name args} {eval configure -interface $interface_name $args} { set connector "" # I should check this one: we only accept connector # interfaces that map into one of tdbc's supported drivers #puts "tdbc interface: $interface_name" set connector_name [::string tolower $interface_name] switch $connector_name { "oracle" { set connector_name "odbc" } "postgresql" { set connector_name "postgres" } "sqlite" { set connector_name "sqlite3" } "mariadb" { set connector_name "mysql" } "sqlite3" - "odbc" - "postgres" - "mysql" { # OK } default { return -code error -errorcode invalid_tdbc_driver "Invalid TDBC driver '$connector_name'" } } set interface $connector_name $this set_field_formatter ::DIO::formatters::[::string totitle $interface] set tdbc_connector "tdbc::${interface}" uplevel #0 package require ${tdbc_connector} } destructor { } private method check_connector {} { if {$connector == ""} { open } } public method tdbc_connector {} { return $connector } public method open {} { set connector_cmd "${tdbc_connector}::connection create ${tdbc_connector}#[incr connector_n]" if {$user != ""} { lappend connector_cmd -user $user } if {$db != ""} { if {$connector_name == "sqlite3"} { lappend connector_cmd $db } else { lappend connector_cmd -db $db } } if {$pass != ""} { lappend connector_cmd -password $pass } if {$port != ""} { lappend connector_cmd -port $port } if {$host != ""} { lappend connector_cmd -host $host } if {$clientargs != ""} { lappend connector_cmd {*}$clientargs } set connector [eval $connector_cmd] incr connector_n } public method close {} { if {$connector == ""} { return } $connector close set connector "" } protected method handle_client_arguments {cargs} { set clientargs {} lmap {k v} $cargs { if {[lsearch $k $tdbc_arguments] >= 0} { lappend clientargs $k $v } } } public method tdbc_exec {sql sql_values_d {results_v ""}} { $this check_connector if {[::string index $sql end] == ";"} {set sql [::string range $sql 0 end-1]} set is_select [regexp -nocase {^\(*\s*select\s+} $sql] set tdbc_statement [$connector prepare $sql] #puts "--> $sql_values" if {[catch {set tdbc_result [$tdbc_statement execute $sql_values_d]} e errorinfo]} { $tdbc_statement close return -code error -errorinfo [::list $errorinfo] } else { # we must store also the TDBC SQL statement as it owns # the TDBC results set represented by tdbc_result. Closing # a tdbc::statement closes also any active tdbc::resultset # owned by it set result_obj [$this result TDBC -resultid $tdbc_result \ -statement $tdbc_statement \ -isselect $is_select \ -fields [::list [$tdbc_result columns]]] } # this doesn't work on postgres, you've got to use cmdRows, # we need to figure out what to do with this set numrows [$result_obj numrows] if {$is_select && ($numrows > 0) && ($results_v != "")} { upvar 1 $results_v results_o set results_o $result_obj } else { $result_obj destroy } return $numrows } # delete - # # method delete {key args} { table_check $args set sql "DELETE FROM $myTable" set sql_values_d [dict create] if {[$special_fields_formatter has_special_fields $table]} { append sql [build_key_where_clause $myKeyfield $key] } else { set where_key_value_pairs [lmap field $myKeyfield { set v "${field}=:${field}" }] set sql "$sql WHERE [join $where_key_value_pairs { AND }]" foreach field $myKeyfield k $key { dict set sql_values_d $field $k } } #puts $sql return [$this tdbc_exec $sql $sql_values_d] } # # update - reimplementation of the ::DIO::Database::update # method that is supposed to exploit the named arguments # feature of TDBC. # method update {arrayName args} { upvar 1 $arrayName row_a $this table_check $args # myTable is implicitly set by table_check $this configure -table $myTable set key [makekey row_a $myKeyfield] #puts "-> table: $table" #puts "-> key: $key" #puts "-> keyfield: $myKeyfield" set sql_values_d [dict create {*}[::array get row_a]] set fields [::array names row_a] if {[$special_fields_formatter has_special_fields $table]} { # the special fields formatter is fundamentally incompatible with # TDBC's named arguments mechanism. We resort to the superclass method # where a literal SQL statement is built set sql [$this build_update_query row_a $fields $table] append sql [$this build_key_where_clause $myKeyfield $key] } else { set set_key_value_pairs [lmap field $fields { set v "${field}=:${field}" }] set where_key_value_pairs [lmap field $myKeyfield { set v "${field}=:${field}" }] ::lappend where_key_value_pairs "1 = 1" set sql [join [::list "UPDATE $table" \ "SET [join $set_key_value_pairs {, }]" \ "WHERE [join $where_key_value_pairs { AND }]"] " "] } #puts $sql return [$this tdbc_exec $sql $sql_values_d] } # # insert - # # overriding method 'insert' as in case of registered special fields # we have to give up with the idea of using the named arguments approach # method insert {table arrayName} { upvar 1 $arrayName row_a set sql_values_d [dict create {*}[::array get row_a]] set fields [::array names row_a] if {[$special_fields_formatter has_special_fields $table]} { set sql [build_insert_query row_a [::array names row_a] $table] } else { set values [lmap field $fields { set v ":${field}" }] set sql "INSERT INTO $table ([join $fields {,}]) VALUES ([join $values {,}])" } #puts $sql #puts $sql_values_d return [$this tdbc_exec $sql $sql_values_d] } # fetch # # method fetch {key arrayName args} { upvar 1 $arrayName row_a table_check $args key_check $myKeyfield $key $this configure -table $myTable set sql_values_d [dict create] set sql "SELECT * FROM $myTable" if {[$special_fields_formatter has_special_fields $table]} { append sql [build_key_where_clause $myKeyfield $key] } else { set where_key_value_pairs [lmap field $myKeyfield { set v "${field}=:${field}" }] set sql "$sql WHERE [join $where_key_value_pairs { AND }]" foreach field $myKeyfield k $key { if {$field == ""} { continue } dict set sql_values_d $field $k } } #puts $sql set numrows [$this tdbc_exec $sql $sql_values_d result_o] if {$numrows > 0} { $result_o next -array row_a $result_o destroy } return $numrows } # # exec # # public method exec {sql} { $this check_connector set sql [::string trim $sql] # tdbc doesn't like ';' at the end of a SQL statement if {[::string index $sql end] == ";"} {set sql [::string range $sql 0 end-1]} set is_select [regexp -nocase {^\(*\s*select\s+} $sql] set tdbc_statement [uplevel 1 $connector prepare [::list $sql]] # errorinfo is a public variable of the parent class Database. # Not a good object design practice if {[catch {set tdbc_result [uplevel 1 $tdbc_statement execute]} e errorinfo]} { set result_obj [$this result TDBC -error 1 -errorinfo [::list $errorinfo] -isselect false] } else { # we must store also the TDBC SQL statement as it owns # the TDBC results set represented by tdbc_result. Closing # a tdbc::statement closes also any active tdbc::resultset # owned by it set result_obj [$this result TDBC -resultid $tdbc_result \ -statement $tdbc_statement \ -isselect $is_select \ -fields [::list [$tdbc_result columns]]] } return $result_obj } } ::itcl::class TDBCResult { inherit Result public variable isselect false public variable statement public variable rowid public variable cached_rows public variable columns public variable resultid constructor {args} { eval configure $args set cached_rows {} set columns {} set rowid 0 set rownum 0 set statement "" } destructor {} public method destroy {} { if {$statement != ""} { $statement close } Result::destroy } public method current_row {} { return $rowid } public method cached_results {} { return $cached_rows } public method nextrow {} { if {[llength $cached_rows] == 0} { if {![$resultid nextrow -as lists row]} { return "" } } else { set cached_rows [lassign $cached_rows row] } incr rowid return $row } public method numrows {} { if {$isselect} { # this is not scaling well at all but tdbc is not telling # the number of columns for a select so must determine it # from the whole set of results if {[llength $cached_rows] == 0} { set cached_rows [$resultid allrows -as lists -columnsvariable columns] } return [expr [llength $cached_rows] + $rowid] } else { return [$resultid rowcount] } } } } rivet-3.0.0/tests/parsepackage.test000664 001750 001750 00000002216 15224454746 020124 0ustar00manghimanghi000000 000000 # $Id$ package require tcltest package require tclrivetparser load [file join [pwd] .. src .libs librivetparser[info sharedlibext]] ::tcltest::test parserivetdata-1.1 {parserivetdata command} { set fl [open hello.rvt] set data [rivet::parserivetdata [read $fl]] close $fl set data } {puts -nonewline "" # hello-1.1 puts "Hello, World\n" # i18n-1.1 puts "¡ À È Ì Ò Ù - El Burro Sabe Más Que Tú!\n" puts -nonewline "

    日本語 (UTF-8 Japanese text)

    " } ::tcltest::test parserivet-1.1 {parserivet command} { rivet::parserivet hello.rvt } {namespace eval request { puts -nonewline "" # hello-1.1 puts "Hello, World\n" # i18n-1.1 puts "¡ À È Ì Ò Ù - El Burro Sabe Más Que Tú!\n" puts -nonewline "

    日本語 (UTF-8 Japanese text)

    " } } # Make sure that the Tcl version is identical to the C version. ::tcltest::test tclrivetparser-1.1 {tclparsedata command} { set fl [open hello.rvt] set data1 [tclrivetparser::parserivetdata [read $fl]] close $fl set fl [open hello.rvt] set data2 [rivet::parserivetdata [read $fl]] close $fl set data2 string compare $data1 $data2 } {0} rivet-3.0.0/rivet/packages/session/session-create-mysql.sql000664 001750 001750 00000001773 15224454746 024644 0ustar00manghimanghi000000 000000 -- -- Define SQL tables for session management code -- -- Author: Arnulf (minor changes by Massimo Manghi) -- -- 02 May 2006 -- DROP TABLE IF EXISTS `rivet_session`; create table rivet_session ( ip_address varchar(16) default NULL, session_start_time datetime default NULL, session_update_time datetime default NULL, session_id varchar(64) NOT NULL default '', PRIMARY KEY (session_id) ) ENGINE=INNODB; DROP TABLE IF EXISTS `rivet_session_cache`; create table rivet_session_cache( session_id varchar(128) default NULL, package_ varchar(128) default NULL, key_ varchar(256) default NULL, data varchar(4096) default NULL, UNIQUE KEY riv_sess_cache_ix( session_id, package_, key_ ), KEY rivet_session_cache_idx (session_id), FOREIGN KEY (session_id) REFERENCES rivet_session(session_id) ON DELETE CASCADE ) ENGINE=INNODB; -- create index rivet_session_cache_idx ON rivet_session_cache( session_id ); rivet-3.0.0/src/Makefile.am000664 001750 001750 00000015255 15224454746 016265 0ustar00manghimanghi000000 000000 # Makefile for Rivet # Copyright 2004-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. #SUBDIRS = @rivet_core@ lib_libexecdir = @RIVET_TCL_TARGET@ lib_libexec_LTLIBRARIES = librivetparser.la librivetlib.la # # Rivet Parser Library # librivetparser_la_SOURCES = parser/rivetParser.c parser/parserPkgInit.c parser/rivetParser.h librivetparser_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ -module -avoid-version librivetparser_la_LIBADD = @APXS_LIBS@ librivetparser_la_CPPFLAGS = @apache_include@ -I$(srcdir)/@rivet_core@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='""' -DUSE_TCL_STUBS # # Rivet Library # librivetlib_la_SOURCES = librivet/rivetList.c librivet/rivetCrypt.c librivet/rivetWWW.c librivet/rivetPkgInit.c librivetlib_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ @APR_LDFLAGS@ @APU_LDFLAGS@ -module -avoid-version librivetlib_la_LIBADD = @APXS_LIBS@ librivetlib_la_CPPFLAGS = -I$(srcdir)/@rivet_core@ -I$(srcdir)/@apache_request@ @TCL_INCLUDES@ @APXS_CPPFLAGS@ @APXS_INCLUDES@ @APR_INCLUDES@ @APU_INCLUDES@ @APR_CPPFLAGS@ -DSTART_TAG='""' -DUSE_TCL_STUBS apxs_libexecdir = @APXS_LIBEXECDIR@ apxs_libexec_LTLIBRARIES = mod_rivet.la mod_rivet_la_SOURCES = @rivet_core@/mod_rivet.c \ @apache_request@/apache_multipart_buffer.c \ @apache_request@/apache_multipart_buffer.h \ @apache_request@/apache_request.c \ @apache_request@/apache_request.h \ @rivet_commands@/rivetCore.c \ @rivet_commands@/rivetInspect.c \ @rivet_channel@/rivetChannel.c \ parser/rivetParser.c \ @rivet_core@/TclWebapache.c \ @rivet_core@/apache_config.c \ @rivet_core@/mod_rivet_common.c \ @rivet_core@/mod_rivet_generator.c \ @rivet_core@/mod_rivet_cache.c \ @rivet_core@/apache_config.h \ @rivet_core@/mod_rivet_cache.h \ @rivet_core@/mod_rivet_common.h \ @rivet_core@/mod_rivet_generator.h \ @rivet_core@/mod_rivet.h \ @rivet_core@/rivetChannel.h \ @rivet_core@/rivetCore.h \ @rivet_core@/rivet_types.h \ @rivet_core@/worker_prefork_common.h \ rivet.h \ TclWeb.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 = -I$(srcdir) \ -I$(srcdir)/@rivet_core@ \ -I$(srcdir)/@rivet_channel@ \ -I$(srcdir)/parser \ -I$(srcdir)/@apache_request@ \ @apache_include@ -I. @TCL_INCLUDES@ \ @APXS_CPPFLAGS@ @APXS_INCLUDES@ \ @APR_CPPFLAGS@ @APR_INCLUDES@ \ @APU_INCLUDES@ -DSTART_TAG='""' lib_libmpmdir = @RIVET_TCL_TARGET@/mpm lib_libmpm_LTLIBRARIES = rivet_worker_mpm.la rivet_prefork_mpm.la rivet_lazy_mpm.la rivet_worker_mpm_la_SOURCES = @rivet_core@/rivet_worker_mpm.c \ @rivet_core@/worker_prefork_common.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@ @TCL_INCLUDES@ \ @APXS_CPPFLAGS@ @APXS_INCLUDES@ \ @APR_CPPFLAGS@ @APR_INCLUDES@ \ @APU_INCLUDES@ \ -I$(srcdir) \ -I$(srcdir)/@apache_request@ \ -I$(srcdir)/@rivet_core@ rivet_prefork_mpm_la_SOURCES = @rivet_core@/rivet_prefork_mpm.c \ @rivet_core@/worker_prefork_common.c rivet_prefork_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version rivet_prefork_mpm_la_LIBADD = @APXS_LIBS@ rivet_prefork_mpm_la_CPPFLAGS = @apache_include@ @TCL_INCLUDES@ \ @APXS_CPPFLAGS@ @APXS_INCLUDES@ \ @APR_CPPFLAGS@ @APR_INCLUDES@ \ @APU_INCLUDES@ \ -I$(srcdir) \ -I$(srcdir)/@apache_request@ \ -I$(srcdir)/@rivet_core@ rivet_lazy_mpm_la_SOURCES = @rivet_core@/rivet_lazy_mpm.c rivet_lazy_mpm_la_LDFLAGS = @TCL_STUB_LIB_SPEC@ @APXS_LDFLAGS@ -module -avoid-version rivet_lazy_mpm_la_LIBADD = @APXS_LIBS@ rivet_lazy_mpm_la_CPPFLAGS = @apache_include@ @TCL_INCLUDES@ \ @APXS_CPPFLAGS@ @APXS_INCLUDES@ \ @APR_CPPFLAGS@ @APR_INCLUDES@ \ @APU_INCLUDES@ \ -I$(srcdir) \ -I$(srcdir)/@apache_request@ \ -I$(srcdir)/@rivet_core@ # Removing libtool .la files from installation install-data-hook: echo 'target install-data-hook: removing unwanted libtool .la files from $(lib_libexecdir) $(apxs_libexecdir) $(lib_libmpmdir)' rm -f $(DESTDIR)$(lib_libexecdir)/*.la rm -f $(DESTDIR)$(apxs_libexecdir)/*.la rm -f $(DESTDIR)$(lib_libmpmdir)/*.la uninstall: echo 'target uninstall: removing shared libraries from $(lib_libexecdir) $(apxs_libexecdir) $(lib_libmpmdir)' rm -f $(DESTDIR)$(lib_libmpmdir)/*.so rm -f $(DESTDIR)$(lib_libexecdir)/*.so rm -f $(DESTDIR)$(apxs_libexecdir)/mod_rivet.so rivet-3.0.0/doc/html/directives.html000664 001750 001750 00000103652 15224455137 020174 0ustar00manghimanghi000000 000000 Apache Rivet 3.3 Configuration

    Apache Rivet 3.3 Configuration

    Apache Rivet Configuration lines

    Rivet directives are used within the Apache httpd server configuration to set up the environment where Rivet script will be run.

    Rivet has 3 general scope directives

    • RivetDirConf: for configuration directives meant to apply to a directory tree
    • RivetUserConf: for directives specific to a user private space
    • RivetServerConf: for any directive meant to apply globally (either to the whole Rivet installation or a single virtual host)

    These directives are applied so that RivetDirConf will override RivetUserConf, which in turn overrides any RivetServerConf directives. Not every configuration directory is meaningful to a scope directive, as shown in the table below. The scope of application of a configuration line is matched also with the context where it appears. Virtual hosts definitions are contexts where rivet configuration lines can appear in many adding further customization to a given virtual host server.

    Example of configuration of a web server having independent interpreters for each virtual host, a larger default cache and a specific script to be executed before any templates/scripts located in /var/www/myrivetapp

    <IfModule rivet_module>
        AddType application/x-httpd-rivet .rvt
        AddType application/x-rivet-tcl   .tcl
    
        RivetServerConf CacheSize              100
        RivetServerConf SeparateVirtualInterps On
    </IfModule>
    
    <Directory /var/www/myrivetapp>
        RivetDirConf BeforeScript "source /var/www/myrivetapp/before_script.tcl"
    </Directory>

    Configuration Directives

    Configuration DirectivesDirConfUserConfServerConfVirtual HostNotes
    AbortScriptXXXX This directive is meaningful with the default request handler. In order to have this triggered by calling ::rivet::abort_page or ::rivet::exit any special request handler should explicitly read this script from the configuration using ::rivet::inspect and evaluate it (see the section called “Apache Child Processes Lifecycle and Request Processing”)
    AfterScriptXXXXSpecial request handler scripts should read it from the configuration calling ::rivet::inspect and evaluate it
    AfterEveryScriptXXXXSee notes for the AfterScript directive
    BeforeScriptXXXX See notes for the AfterScript directive
    CacheSizeXX
    ChildExitScriptXX
    ChildInitScriptXX
    ErrorScriptXXXX Rivet provides a default error handler. In case you are writing your own request handling procedure you need to call this error handler yourself or develop your application specific error handler to be integrated into the RequestHandler script. See also the notes for the AbortScript and AfterScript directives
    ExportRivetNSXXIt can be set in a virtual host configuration if SeparateVirtualInterps is On, otherwise this directive can be safely used at the global level only
    GlobalInitScriptX effective only when SeparateVirtualInterps is Off (default)
    ImportRivetNSXXIt can be set in a virtual host configuration if SeparateVirtualInterps is On, otherwise this directive can be safely used at the global level only
    HonorHeadRequestsXXReplaces HonorHeaderOnlyReqs, which is still supported but DEPRECATED
    MpmBridgeXglobal only
    RequestHandlerXX
    SeparateChannelsXglobal only (DEPRECATED: will be replaced in future versions of Rivet)
    SeparateVirtualInterpsXglobal only
    ServerInitScriptXglobal only
    SingleThreadExitXglobal only
    UploadDirectoryXXXX
    UploadFilesToVarXX
    UploadMaxSizeXX
    AbortScript ?script?
    If an AbortScript is defined control is passed to it as soon as the command abort_page is called. AbortScript is the right place where specific actions can be taken to catch resources left dangling by the sudden interruption.
    AfterScript ?script?
    Script to be called after each parsed .rvt template or .tcl script is executed
    In virtual hosts, this option overrides any AfterScript definitions at the global level.
    AfterEveryScript ?script?
    AfterEveryScript is a script that is to be run anyway before requests processing ends. This script is therefore run both when the content generation script completes successfully and when its execution is interrupted by abort_page. The code in this script can understand whether it's running after the page was interrupted by calling abort_page with the argument ?-aborting?. The command will return 1 if an abort_page call took place earlier in the request processing.
    BeforeScript ?script?
    Script to be evaluated before each server parsed (.rvt) page. This can be used to create a standard header, for instance. It could also be used to load code that you need for every page, if you don't want to put it in a GlobalInitScript ChildInitScript when you are first developing a web site.
    [Note]Note
    This code is evaluated at the global level, not inside the request namespace where pages are evaluated.
    In virtual hosts, this option takes precedence over the global setting.
    CacheSize ?size?
    Sets the size of the internal page cache, where size is the number of byte-compiled pages to be cached for future use. Default is MaxRequestsPerChild / 5, or 50, if MaxRequestsPerChild is 0.
    This option is completely global, even when using separate per-virtual host interpreters.
    ChildExitScript ?script?
    Script to be evaluated when each Apache child process exits. This is the logical place to clean up resources created in ChildInitScript, if necessary.
    In virtual hosts, this script is run in addition to any global childexitscript. When SeparateVirtualInterp any ChildExitScript placed within a <VirtualHost ...>....</VirtualHost> will be that Virtual Host specific exit handler
    ChildInitScript ?script?
    Script to be evaluated when each Apache child process is initialized. This is the recommended place to load modules, create global variables, open connections to other facilities (such as databases) and so on.
    In virtual hosts, this script is run in addition to any global childinitscript. When SeparateVirtualInterp any ChildInitScript placed within a <VirtualHost ...>....</VirtualHost> will be that Virtual Host specific ininitalization
    ErrorScript ?script?
    When Rivet encounters an error in a script, it constructs an HTML page with some information about the error, and the script that was being evaluated. If an ErrorScript is specified, it is possible to create custom error pages. This may be useful if you want to make sure that users never view your source code.
    In virtual hosts, this option takes precedence over the global setting.
    ExportRivetNS (yes | no)
    Rivet commands are created within the ::rivet namespace. Setting this option mod_rivet places the whole command set on the export list of the ::rivet namespace, enabling your scripts to import them in a different namespace.
    This option is, by nature, only available at the global level
    HonorHeadRequests (yes | no)
    If a HEAD requests is issued by the client Rivet detects this case and sends back to the client a standard header response. If the real header has to be examined (e.g. for debugging) you can turn this options on.
    This option is only available at the global level
    ImportRivetNS (yes | no)
    Rivet commands are created within the ::rivet namespace. Setting this option mod_rivet is told to place the whole command set on the export list of the ::rivet namespace (implicitly forcing also ExportRivetNS) and then importing the commands into the global namespace
    [Note]Note
    This option is provided only for compatibility with existing code that assumes mod_rivet commands to reside in the global namespace it could be removed in future versions of Rivet. This option is only available at the global level
    MpmBridge ?string?
    This global only option tells mod_rivet which MPM bridge has to be loaded. The module attempt to interpolate the argument value
    bridge = apr_pstrcat(pool,RIVET_DIR,"/mpm/rivet_",rsc->mpm_bridge,"_mpm.so",NULL);
    Where RIVET_DIR is the location of the rivet libraries whose definition is controlled by the configure switch --with-rivet-target-dir=DIR. For example
    RivetServerConf MpmBridge lazy
    will cause the rivet_lazy_mpm.so library module to be loaded.
    If such library does not exists mod_rivet tries to check if such definition is actually the fully qualified path to such MPM bridge. If this fails the module causes the web server to stop with an error.
    RequestHandler ?request_handler_filename?
    Filename of the request handler script. Overrides the default request handler. Can be virtual host specific
    [Note]Note
    Note that changing this scripts requires the programmer to understand mod_rivet request processing model. See the request processing manual page
    SeparateChannels (yes | no)
    Internally mod_rivet creates a new Tcl channel (Rivet channel) which is configured as stdout and registered to each existing interpreter. There is no need of multiple channels in a single thread as each thread can serve only one request at a time. But if you are deploying mod_rivet in a complex environment running unrelated applications developed by different teams, it could be the case to have SeparateVirtualInterps set. If you want to enhance the environment separation you may also set SeparateChannels to force mod_rivet to create a channel per each Tcl interpreter thus enabling single application code to change the Rivet channel parameters without affecting other applications (even though changing the Tcl channel parameters is a rare necessity). Setting this options increases the system overheads as each Rivet channel needs to allocate its own control structures and internal buffers.
    [Note]Note
    This option is implemented in order to have fine-grained control over mod_rivet. In nearly all practical cases you won't need to change Rivet Channel (stdout) settings for different applications by calling fconfigure stdout ..... This option is, by nature, only available at the global level and has effect only if also SeparateVirtualInterps is set
    SeparateVirtualInterps (yes | no)
    If on, Rivet will create a separate Tcl interpreter for each Apache virtual host. This is useful in an ISP type situation where it is desirable to separate clients into separate interpreters, so that they don't accidentally interfere with one another.
    [Note]Note
    This option is, by nature, only available at the global level. By enabling SeparateVirtualInterps you must rely only on ChildInitScript to initialize the interpreters. Don't expect the initialization done in ServerInitScript and GlobalInitScript to be handed down to the slave interpreters that are private to each configured virtual host.
    ServerInitScript ?script?
    The directive ServerInitScript plays a special role since the script runs within the master interpreter, an interpreter created when the Apache web server is setting up for answering requests and before worker processes/threads are started. During this stage Apache is still running as a single process, so this is the right place for doing initialization of systems such as any IPC systems.
    On systems with the capability of forking child processes the Apache web server can run the prefork MPM. By default rivet selects the prefork brigde which makes mod_rivet work the way mod_rivet 2.x work. In a web server with this set up child processes inherit a copy of the address space from the parent processes and therefore Tcl interpreters too are replicated into the child address space. If SeparateVirtualInteprs is Off child processes run with a copy of the Tcl master interpreter and ServerInitScipt thus provides a way to initialize only once any subsequent Tcl interpreters created by fork calls as each of them are clones of the master interpreter.
    SingleThreadExit (yes | no)
    The Tcl exit command has a simple implementation that eventually calls Tcl_Exit (which in turn calls stdlib's exit) that forces the immediate deletion of all threads in a process. This behavior would be unacceptable with the worker MPM and worker bridge which are fundamentally threaded. Therefore Rivet shadows the Tcl exit command with ::rivet::exit which calls a designated function in the running bridge. The prefork bridge simply prepares the child process to terminate, whereas the worker bridge is behavior controlled by this option.
    1. If SingleThreadExit is set (default) each thread behaves individually and terminates after running the ChildExitScript and deleting its Tcl interpreters
    2. If SingleThreadExit is No the worker bridge notifies all threads to exit and then calls Tcl_Exit
    The latter option might be useful in cases where an application is using an improperly developed Tcl extension which might cause a child process to crash when calling Tcl_DeleteInterp.
    [Note]Note
    The default is No for the prefork bridge (loaded by default if the server runs the prefork MPM) and true for the worker and lazy bridges
    UploadDirectory ?directory?
    Directory to place uploaded files.
    In virtual hosts, this option takes precedence over the global setting.
    UploadFilesToVar (yes | no)
    This option controls whether it is possible to upload files to a Tcl variable. If you have a size limit, and don't have to deal with large files, this might be more convenient than sending the data to a file on disk.
    UploadMaxSize ?size?
    Maximum size for uploaded files.
    In virtual hosts, this option takes precedence over the global setting.
    rivet-3.0.0/tests/virtualhost.test000664 001750 001750 00000017116 15224454746 020067 0ustar00manghimanghi000000 000000 # virtualhost.test -- test virtual host setups. # $Id$ set docroot1 [file join [pwd] docroot1] set docroot2 [file join [pwd] docroot2] set vhostconf { #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 DocumentRoot $docroot2 ServerName vhost2 } # Make sure virtual hosts work. ::tcltest::test vhost-1.1 {basic virtual host} { apachetest::start {} $vhostconf { set page1 [::http::geturl "${urlbase}basic1.rvt" -headers [list Host vhost1]] set page2 [::http::geturl "${urlbase}basic2.rvt" -headers [list Host vhost2]] set match1 [::http::data $page1] set match2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } list [string match {Virtual Host1 Test*} $match1] \ [string match {Virtual Host2 Test*} $match2] } {1 1} # Try virtual hosts with and without a childinitscript. ::tcltest::test vhost-2.1 {virtual host w/ ChildInitScript} { set data {} apachetest::start {} { RivetServerConf SeparateVirtualInterps off RivetServerConf ChildInitScript "source [file join $docroot1 childinit.tcl]" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page2 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page1 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data "[::http::data $page1][::http::data $page2]" ::http::cleanup $page1 ::http::cleanup $page2 } # puts ">>>$data<<<" regexp "::childinit1 exists.*::childinit2 exists" $data match } 1 # Test out a ChildInitScript that is only in a vhost. ::tcltest::test vhost-2.2 {virtual host w/ ChildInitScript in vhost} { set data {} apachetest::start {} { #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "source [file join $docroot2 childinit.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page {} lappend page [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] lappend page [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] foreach p $page { lappend data [::http::data $p] ::http::cleanup $p } } # set data regexp "vhost2 hello world
    \n::childinit2 exists
    " $data match } 1 # Test out a beforescript in a virtual host. ::tcltest::test vhost-3.1 {virtual host w/ BeforeScript} { set data {} apachetest::start {} { RivetServerConf BeforeScript "source [file join $docroot1 beforescript.tcl]" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf BeforeScript "source [file join $docroot2 beforescript.tcl]" DocumentRoot $docroot2 ServerName vhost2 } { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } list [regexp "^beforescript2\nVirtual Host2 Test" $data1 match] \ [regexp "^beforescript1\nVirtual Host1 Test" $data2 match] # list $data1 $data2 } {1 1} # Turn on separate interpreters per virtual host. ::tcltest::test vhost-4.1 {virtual host w/ separate interps} { set data {} apachetest::start {} { RivetServerConf SeparateVirtualInterps on #NameVirtualHost 127.0.0.1 RivetServerConf ChildInitScript "set ::childinit1 1" DocumentRoot $docroot1 ServerName vhost1 RivetServerConf ChildInitScript "set ::childinit2 1" DocumentRoot $docroot2 ServerName vhost2 } { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } # puts "--$data1--" # puts "--$data2--" list \ [regexp "vhost2 hello world
    \n::childinit2 exists
    " $data1 match] \ [regexp "vhost1 hello world
    \n::childinit1 exists
    " $data2 match] # list $data1 $data2 } {1 1} # Run through a list of config options, the files they use and the # regexps that match the results. # Format: directive, file, 2 regexps to match set configs { ChildInitScript childinit.tcl "vhost2 hello world
    \n::childinit2 exists
    \n::childinit1 exists
    \n" \ "vhost1 hello world
    \n::childinit1 exists
    \n::childinit2 exists
    " BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test" AfterScript afterscript.tcl "afterscript2" "afterscript1" } set i 1 foreach {conf file re1 re2} $configs { ::tcltest::test vhost-5.$i [list vhost with $conf] { apachetest::start {} " RivetServerConf SeparateVirtualInterps off RivetServerConf $conf \"source [file join $docroot1 $file]\" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf $conf \"source [file join $docroot2 $file]\" DocumentRoot $docroot2 ServerName vhost2 " { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } #puts "--$re1--\n--$data1--" #puts "--$re2--\n--$data2--" list [regexp $re1 $data1 match] [regexp $re1 $data1 match] #list $data1 $data2 } {1 1} } set configs { ChildInitScript childinit.tcl "vhost2 hello world
    \n::childinit2 exists
    \n" "vhost1 hello world
    \n::childinit1 exists
    \n" BeforeScript beforescript.tcl "^beforescript2\nVirtual Host2 Test" "^beforescript1\nVirtual Host1 Test" AfterScript afterscript.tcl "afterscript2" "afterscript1" } # Now run through a similar list, using per vhost interps. set i 1 foreach {conf file re1 re2} $configs { ::tcltest::test vhost-6.$i [list vhost with $conf and SeparateVirtualInterps] { apachetest::start {} " RivetServerConf SeparateVirtualInterps on RivetServerConf $conf \"source [file join $docroot1 $file]\" #NameVirtualHost 127.0.0.1 DocumentRoot $docroot1 ServerName vhost1 RivetServerConf $conf \"source [file join $docroot2 $file]\" DocumentRoot $docroot2 ServerName vhost2 " { set page1 [::http::geturl "${urlbase}vhost2.rvt" -headers [list Host vhost2]] set page2 [::http::geturl "${urlbase}vhost1.rvt" -headers [list Host vhost1]] set data1 [::http::data $page1] set data2 [::http::data $page2] ::http::cleanup $page1 ::http::cleanup $page2 } #puts "--$re1--\n--$data1--" #puts "--$re2--\n--$data2--" list [regexp $re1 $data1 match] [regexp $re1 $data1 match] } {1 1} incr i } rivet-3.0.0/doc/html/images/note.png000644 001750 001750 00000000752 15224455140 020052 0ustar00manghimanghi000000 000000 PNG  IHDRb$bKGD#2IDATxe!0 E}K C tAQCACQA+g4mɌoK. qc  D="s %dǜH1y%M8fK wֵ>i6g-NpYtL#ߟ ab;U#2V} ԣrVx]zTT1O H4]o zΧg"ӒNHlUu߯9V_/LTRSϤRSs5(dY2O>ZpTc%7P #FW : 1JYPM<y_JdTF5`ցa8ǻ Uէ(A2U "ŨFWXQG)E<"S@Q@QB w2G,;,Kn(AQ{EΣwT'I_~D.xsA6N "+~JQxG 2s2E ruuZ)J@U ʡ(a#$|PW VÓ5wBQfMd R Msxtg(9U黡nHxPgQȨ(dRN!E!SR\Ʒ'Tog~RS}}ȢQgQHjnUV\Ml] 6ތPœ-7P ЕWvj~&N@R$k_lbkt%I 8i%U jD)ElCЕI{ ln*S}"iBQfL+[Ng(E !,Uܬ_X%+e6.)E 0[ZMP 0; Q)B$}YԤm<6NH28Wv`M8a)A|_(A>sud+J!"># I"%sU䕢a RYcז;C(AvLֺWRDJ9}7CE!΢J9FLJeƷޱk~[HM_环/JME!΢8yԼI;-آ+a$kҾ}xn@@m ,>o7>i[N-CT֤}x:@NJ6X!+bKSb}|(33tLTp,"Oҷ|!'M4Yrk68 3HI;uIŮy5ּOQزylE&M"y&|r2sԼbRWoϹG ^Ci![>#'m;C(Yk$"w\6[f|K wCǃ:BFE!r , ԣ󧌯jU3vJ>MjRS?)WF:B&w{W;1t,o;@U¼qR p<;K~,mw*; Y&.~7X/Y><ڽN/?Ӱd9 2%̺I%iG&Bl po'\C.eܣ:Q3mSÀA"p@2dr=7RY̾\vTZ°4}s R_(^ + &ސ-aYQ}HfֽMrF80oOW gɩIyCꭳ%:BFE!r , ԣg_2dj|y+5x'5ղE!΢ɞ0YF2P-7PI =9'9ιxCYF5`TC hJ 7A9i'd* vo,o{bsǰr نjO])E+NT{`y۹[,3Xo}_4J(,&_$* ?xb`ŏ಑ TerN2 ĺ IF2dVnS7\F\H&Xv>IFʗ229 W.3UA;qv !+e 9# 0>#PVKfw΂Z0Yk%&-wBQ&Xvns/1MqJz8!E ΢QgQhBF#B&y /$PLaȢQgQdOp@e4@U ArRmm` T` L!,:0c TkR vJ.'&XVn 6dcE@E% p vo <|%W4L!J/8g(nwd=b wN7 XV#[k Session Package
    Introduction This is session management code. It provides an interface to allow you to generate and track a browser's visit as a "session", giving you a unique session ID and an interface for storing and retrieving data for that session on the server. This is an alpha/beta release -- documentation is not in final form, but everything you need should be in this file. Using sessions and their included ability to store and retrieve session-related data on the server, programmers can generate more secure and higher-performance websites. For example, hidden fields do not have to be included in forms (and the risk of them being manipulated by the user mitigated) since data that would be stored in hidden fields can now be stored in the session cache on the server. Forms are then faster since no hidden data is transmitted -- hidden fields must be sent twice, once in the form to the broswer and once in the response from it. Robust login systems, etc, can be built on top of this code.
    Requirements Currently has only been tested with Postgresql, MySql and Oracle. All DB interfacing is done through DIO, though, so it should be relatively easy to add support for other databases.
    Preparing To Use It Create the tables in your SQL server. With Postgres, do a psql www or whatever DB you connect as, then a backslash-i on session-create.sql (If you need to delete the tables, use session-drop.sql) The session code by default requires a DIO handle called DIO (the name of which can be overridden). We get it by doing a RivetServerConf ChildInitScript "package require DIO" RivetServerConf ChildInitScript "::DIO::handle Postgresql DIO -user www"
    Example Usage In your httpd.conf, add: RivetServerConf ChildInitScript "package require Session; Session SESSION" This tells Rivet you want to create a session object named SESSION in every child process Apache creates. You can configure the session at this point using numerous key-value pairs (which are defined later in this doc). Here's a quick example: RivetServerConf ChildInitScript "package require Session; Session SESSION \ -cookieLifetime 120 -debugMode 1" Turn debugging on to figure out what's going on -- it's really useful, if verbose. In your .rvt file, when you're generating the <HEAD> section: SESSION activate Activate handles everything for you with respect to creating new sessions, and for locating, validating, and updating existing sessions. Activate will either locate an existing session, or create a new one. Sessions will automatically be refreshed (their lifetimes extended) as additional requests are received during the session, all under the control of the key-value pairs controlling the session object.
    Using Sessions From Your Code The main methods your code will use are: SESSION id After doing a SESSION activate, this will return a 32-byte ASCII-encoded random hexadecimal string. Every time this browser comes to us with a request within the timeout period, this same string will be returned (assuming they have cookies enabled). SESSION is_new_session returns 1 if it's a new session or 0 if it has previously existed (i.e. it's a zero if this request represents a "return" or subsequent visit to a current session.) SESSION new_session_reason This will return why this request is the first request of a new session, either "no_cookie" saying the browser didn't give us a session cookie, "no_session" indicating we got a cookie but couldn't find it in our session table, or "timeout" where they had a cookie and we found the matching session but the session has timed out. SESSION store packageName key data Given the name of a package, a key, and some data. Stores the data in the rivet session cache table. SESSION fetch packageName key Given a package name and a key, return the data stored by the store method, or an empty string if none was set. (Status is set to the DIO error that occurred, it can be fetched using the status method.)
    Session Configuration Options The following key-value pairs can be specified when a session object (like SESSION above) is created: how many seconds the session will live for. 7200 == 2 hours sessionRefreshInterval If a request is processed for a browser that currently has a session and this long has elapsed since the session update time was last updated, update it. 900 == 15 minutes. so if at least 15 minutes has elapsed and we've gotten a new request for a page, update the session update time, extending the session lifetime (sessions that are in use keep getting extended). cookieName name of the cookie stored on the user's web browser default rivetSession dioObject The name of the DIO object we'll use to access the database (default DIO) gcProbability The probability that garbage collection will occur in percent. (default 1%, i.e. 1) gcMaxLifetime the number of seconds after which data will be seen as "garbage" and cleaned up -- defaults to 1 day (86400) refererCheck The substring you want to check each HTTP referer for. If the referer was sent by the browser and the substring is not found, the session will be deleted. (not coded yet) entropyFile The name of a file that random binary data can be read from. (/dev/urandom) Data will be used from this file to help generate a super-hard-to-guess session ID. entropyLength The number of bytes which will be read from the entropy file. If 0, the entropy file will not be read (default 0) scrambleCode Set the scramble code to something unique for the site or your app or whatever, to slightly increase the unguessability of session ids (default "some random string") cookieLifetime The lifetime of the cookie in minutes. 0 means until the browser is closed (I think). (default 0) cookiePath The webserver subpath that the session cookie applies to (defaults to /) cookieSecure Specifies whether the cookie should only be sent over secure connections, 0 = any, 1 = secure connections only (default 0) sessionTable The name of the table that session info will be stored in (default rivet_session) sessionCacheTable The name of the table that contains cached session data (default rivet_session_cache) debugMode Set debug mode to 1 to trace through and see the session object do its thing (default 0) debugFile The file handle that debugging messages will be written to (default stdout)
    Session Methods The following methods can be invoked to find out information about the current session, store and fetch server data identified with this session, etc: SESSION status Return the status of the last operation SESSION id Get the session ID of the current browser. Returns an empty string if there's no session (will not happen is SESSION activate has been issued.) SESSION new_session_reason Returns the reason why there wasn't a previous session, either "no_cookie" saying the browser didn't give us a session cookie, "no_session" indicating we got a cookie but couldn't find it in the session table, or "timeout" when we had a cookie and a session but the session had timed out. SESSION store packageName key data Given a package name, a key string, and a data string, store the data in the rivet session cache. SESSION fetch packageName key Given a package name and a key, return the data stored by the store method, or an empty string if none was set. Status is set to the DIO error that occurred, it can be fetched using the status method. SESSION delete Given a user ID and looking at their IP address we inherited from the environment (thanks, Apache), remove them from the session table. (the session table is how the server remembers stuff about sessions). If the session ID was not specified the current session is deleted. SESSION activate Find and validate the session ID if they have one. If they don't have one or it isn't valid (timed out, etc), create a session and drop a cookie on them.
    Getting Additional Randomness From The Entropy File RivetServerConf ChildInitScript "Session SESSION -entropyFile /dev/urandom \ -entropyLength 10 -debugMode 1" This options say we want to get randomness from an entropy file (random data pseudo-device) of /dev/urandom, to get ten bytes of random data from that entropy device, and to turn on debug mode, which will cause the SESSION object to output all manner of debugging information as it does stuff. This has been tested on FreeBSD and appears to work.
    rivet-3.0.0/tests/parse.rvt000664 001750 001750 00000000337 15224454746 016446 0ustar00manghimanghi000000 000000 Parse Test

    Parse Test

    rivet-3.0.0/doc/html/images/calendar.png000644 001750 001750 00000023215 15224455140 020655 0ustar00manghimanghi000000 000000 PNG  IHDR]&sRGB pHYs+tIME bk IDATx]yX~9m紧Me+d+b0.a,Ac(dM% K*YCkTTHEiվSgQڜ}'wz=>8  E P,3:bmB`fff4FD@@DD@DD@@DDPCܺ^ `p앻 seIoދ|UW1s5?i;tqä:6QNfu)m`Vg&=q&pDs4߳;qWwX֨ Od]W&S]ٙ%ZX+Ƿ𵀺wU͖:9޹p#qFs+m*^\>}"sש@O 8Vr 댹| 3=ٟ ~#id1ݮ%PWޒصw >y|#%;L${'G2&o;ix]9q.<"+deH-jYb.@bXۀ ;lvB[@DшHIEv'?MFkKZVVbe%Qd*%ҋv<@~Bgcѡx?ΏxƩO޲ԃ W6PHUYh,kh]zQ% `DID6̤/ _Xi mFS UӁO_iͩK{@) ~ ?Cd_Rd5fGuzy?m)9VDyF>{/h.O~~h) WT޹Rykua~ztrNٳ zQy{;'F>ԖLʢ6mH>Ѷ,MXBR=t Di6E_$_&a#(9v'gRte6@k/p%ܸx`ff]*ã!n~p h5/^{8zdF_hƈ=.:'w :zfi}vtQ痢k2aO0=kۇo^@.ދw qd)oW 8Q5MsUO*;{.jݼJOÒ>S/_c$΃bm1D #]~D$+-vTNQO~9UAJiL0(M-2%߅?SgW&HocE^pR 7r&ɬ)K }^#WyqH NhcRf_mɣ+(CCxFfdn>rMQEtV&adZl9@osiVtGDFezhL!K3pv+dI $ά~trˎgNU䍀|qyqF-ˍ%\;{b*Y`¤ZjECݗFR1 i5Ɖ5SôcZfyrw^ձ@\~ +6.>{<ޔ~oE, *pզjwEsQT)˗f}hIdUsn[5R_MpU 4 w-r tV4G{EoM7%gw٬(xiF1hOo9[w᛬"@we,`Uf/2}x j9,OKf!̒pN|{n(lB m8O /K\Z/,iF /u-8Uo(Lh)9sbNES4tc? ܶt( I'O'ax͒o8I0@]j0'uv>].Hm)Nc˯nrT써%ιt< rz%kRO53{= ϳ+nߌ}5{nЗ؈c[G:N2`>pY;EvjpMf7>Gso*TS ? P2fl jBlVwIPϑ4[S3@K)=M.@R[Д< pzlvc7;W ӄsX Cך|>TW3T=r2$@ݐo%ffcVr *1E~Z:?gqc"9%wߟ7z l{_ȗ&Pd&,jYa$6P )\%*ЂɅ4Քj* i'[ZQ$@ep54͈cG6[P!.@Lȩ>/Vվڻw+ZI Rjc,yˮ,b@'Lkp dW;h~z Le ]'$ @m2V.rK@FIF89vW%4G)(LJ)ԉ $ Rf⯢ҋ$u-Z$b2j5: {|X($D9wV0sCip2e ĩ _=\2uĆw~9U4:è+}*T %EhK.4R ހ,Fufٽ(:BaҖYг_Eg & +(vJ*͠|Lztw|/+86HYI8t=Yϙ 驏.wY3E[[7ٸ<76˒Gaip9RW a!&Q~wMn3ؤ~Ku?DYoSf7 =D ^g "Uƛ$;8Y%J ""p=g˵E#7~طߋ/U4M-yh4(p?ǻ>uBUŚ8gb G[pBǩqmDDDDDDDDDDDD^ P{Qd`Xq!FX(7P2cM-gH5~H*/k`"Y}QV7~i@Q2~+LqmfG=42MѶyˮyT^}(R*Hiid-BDF񝽷8~q1VOTCѺ욗=.W>MZm.0f sevC!Y=lҨW*07Vu:ӅmFr k^$mN'qn+(DSwM535nL1_B\WkfkfˌUg+4+P|.H:xP Mmr::M/xi3x4?>q*(\^R4BӸURkreF ƈ%N|Ʉ"zLhV;k=E9wrn:$ >Vb!s+dcآ VD ot^5[e.K5W+y_;}j[RTǿI`aEܒiMʝKȒdh5=YaW]:3i!ns4$I 8&|,#%Ǻ:KK+8v|u." Qx闎2pqD`L_̺7s1=fR jeʣ+[|!N{/#}%*x8<˥c,7:W6o K5Wt~&Bf64/%t#0V4 ~"%Ao U Cr<;U:Gi<1 *"|3$*P3'34g5..?P2Kdv_9%2}E0Uk1$roTj8boT^BYsO1c'+ht6Vy[žB7FĉCy4{fR_9JI:pÝίjbj2|`<1ȞgLf};\[BQ\;KꙌ7NO18OG{OC/yv5 ,,6@g1~u8[4?(@NlFՖ*; mX0v1Fݐ|L@Tb (zSy9\ҲBo9#Vur_`jv&'4MɘHK|1d{y-Uڈ&e._⇻?M,'#RL5iaCa1Nu<YjՖ]GaV oOkv]B2 5VT ;vVA7&1?vۮI-J gel~arqH[F^CV~3@fߠ+iH M8ӢOk9)SgH#}zS,*FCYv[;KckqRe$O[0?&Vz"zy Y 3dt_f <*9kI_ "6_5h42=UkDXÄHIbR6M5DM4-=`uU_V2gFk+@MKGJ<IHyOCL5#z1oXWS:At(o޼y3(m Jh}}XD"uZnm!+A0 ٰ+xIGWd11D׵qe,Q8i RzP2f,s~_{ʑ".)FQxig9ʀ~8Rz46$%+w$8NZEtǮz{/Eƚ"Us0Ȟ*)̬D g2&*@p p80GW\ejk/BJRz5Yo/I۽ʴ g+j-L"xUs@෦-T;MxY:BD%c3bbjmqjSޔ(h-K ^LDF̓g:Zt=2 cҋjiLQ_;Ӵġt7 i 6&/ik+-qFRh#ՈJIrB8gOvUq׷:&+%6< {_Po>y©zmXXe.z KMɯcH>~ƢNL8@%Z{6YgQoNl 2/9)ڏh? 2": "" "" ""*o Boso=AcDDDDD|Ȼ%z|\ _8(|,:MW4gPG3Yoi+NP jPl*eIo~;`Եv{XWnz,\o3KW]urZ[uAvœSUK(It޿MFϺSMI`^q]6p{W. ܯu()ЬYms]GzmV8aIGql}QUKkT8;aG; ^ g?)oy_f{7O_+Mj#blp&ݛ<%]~`*) T,A rE)RpWd >DvU?y0OMak\=Q/ "(ɮ?upˆA-1T8SA #|\f)bvW7 ^Mk{^f{|G]ce{tJ\߅Ͱ1B;ֺ-Qߌ~}A3mbYH|p&oA,{:H^0  ձ"ܝ*6-Q֟4g461լ5TvdD,y|g™rawG *=j pͮSz}/Uf->"~zw(PLVۃow|tL3m%Xѱḅ1+Dq0o9)/j{^f{p&=g˵v@X grxXwWd=2&m"KfkKއ;30M[s1/h>IIDATC^&o gr7z`j[-A g-Z-T-GoMpE1ϮW1$4jS1\AU'Fu@DD@DD@@DDU@)4@eD@7(#" "" ""1"OryV:6\rD_k%o_ }0+'ΰg X hȃK5 }-_Z61񽻣oN>;R3c.zF^ڷSYcc5/{\/6R'V% |b\ow(+owS`۬v<Cir@i>h[ìx4 (m0^ UlliZ9z`j>?Oܪ< Q?98y֡Zr̆]mJ!kl~ب/^p_~dpusS\f'yI9ڧylZSQkyv1ud[& @RQw_LLQg1_B\W<XM UыYf(V\gݕkDINo sqPG`q B\#vNUlh7%:y~2@}4 l6 R&X4HL+}ϵ`(t̮ƙE9wrn:$ >Vb!CpGFDP\Q #;400 N0G_O}Qh9f $IKo >Y,dbjCl.-&.llpUչ"&McµH9)xYUNj `А Y>^7 c}-)(0TYin]DJE0xs5qʼI)a%\@q0ҫy\ ]" -B5c0 3.bp3rC F놺 ֹ+K/o(ϏzZrObV:tvyVm/寯&o0m$'JD|@FrRDDDDDD^$B3 };:"|0_ uYOIENDB`rivet-3.0.0/tests/uploadsave.rvt000664 001750 001750 00000000104 15224454746 017467 0ustar00manghimanghi000000 000000 rivet-3.0.0/tests/docroot1/vhost1.rvt000664 001750 001750 00000000371 15224454746 020310 0ustar00manghimanghi000000 000000 " puts "::childinit1 exists
    " } elseif {[info exists ::beforescript1]} { ?>Virtual Host1 Test" } ?> rivet-3.0.0/doc/html/redirect.html000664 001750 001750 00000012207 15224455137 017627 0ustar00manghimanghi000000 000000 redirect

    Name

    redirect — Interrupt processing and divert to a new URL

    Synopsis

    ::rivet::redirect ?URL? ?permanent?

    Description

    ::rivet::redirect diverts the browser to a new URL and marks the redirection as either permanent in the browser local cache or non permanent (default). Calling ::rivet::redirect causes the script execution to interrupt and control passes to AbortScript, if such script is set, by calling ::rivet::abort_page and passing as abort code a dictionary with 2 keys:

    • error_code: string literal 'redirect'
    • location: the URL the browser will be redirected to

    ::rivet::redirect drives the redirection by setting the 301 (permanent = 1: permanent redirect) or 302 (permanent = 0: non permanent redirect) and attempts to discard the output the script might have already placed in the stdout channel buffer. The permanent argument can also be any of the other HTTP status codes. This is handy for returning one the 3xx status codes dedicated to the HTTP request redirection The command can fail if

    • A flush stdout has already been called before ::rivet::redirect thus causing the HTTP headers to be sent
    • The channel buffer has been flushed already by calling flush stdout or because the Rivet channel internal buffer was full

    The stdout channel, like any Tcl channels, can be manipulated and if needed its internal buffer stretched.

    rivet-3.0.0/tclconfig/libtool.m4000664 001750 001750 00001126311 15224454746 017315 0ustar00manghimanghi000000 000000 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 2014 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. # GNU Libtool 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 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program or library that is built # using GNU Libtool, you may include this file under the same # distribution terms that you use for the rest of that program. # # GNU Libtool 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 . ]) # serial 58 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS=$ltmain # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_PREPARE_CC_BASENAME # ----------------------- m4_defun([_LT_PREPARE_CC_BASENAME], [ # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. func_cc_basename () { for cc_temp in @S|@*""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` } ])# _LT_PREPARE_CC_BASENAME # _LT_CC_BASENAME(CC) # ------------------- # It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME, # but that macro is also expanded into generated libtool script, which # arranges for $SED and $ECHO to be set by different means. m4_defun([_LT_CC_BASENAME], [m4_require([_LT_PREPARE_CC_BASENAME])dnl AC_REQUIRE([_LT_DECL_SED])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl func_cc_basename $1 cc_basename=$func_cc_basename_result ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl m4_require([_LT_CMD_TRUNCATE])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a '.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld=$lt_cv_prog_gnu_ld old_CC=$CC old_CFLAGS=$CFLAGS # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from 'configure', and 'config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # 'config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain=$ac_aux_dir/ltmain.sh ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the 'libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to 'config.status' so that its # declaration there will have the same value as in 'configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags='_LT_TAGS'dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the 'libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into 'config.status', and then the shell code to quote escape them in # for loops in 'config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # '#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test 0 = "$lt_write_fail" && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ '$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test 0 != $[#] do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try '$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try '$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test yes = "$silent" && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options that allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}"; then setopt NO_GLOB_SUBST fi cfgfile=${ofile}T trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # Generated automatically by $as_me ($PACKAGE) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # Provide generalized library-building support services. # Written by Gordon Matzigkeit, 1996 _LT_COPYING _LT_LIBTOOL_TAGS # Configured defaults for sys_lib_dlsearch_path munging. : \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"} # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF cat <<'_LT_EOF' >> "$cfgfile" # ### BEGIN FUNCTIONS SHARED WITH CONFIGURE _LT_PREPARE_MUNGE_PATH_LIST _LT_PREPARE_CC_BASENAME # ### END FUNCTIONS SHARED WITH CONFIGURE _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test set != "${COLLECT_NAMES+set}"; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "$LT_MULTI_MODULE"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test 0 = "$_lt_result"; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS=$save_LDFLAGS ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; 10.[[012]][[,.]]*) _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test yes = "$lt_cv_apple_cc_single_mod"; then _lt_dar_single_mod='$single_module' fi if test yes = "$lt_cv_ld_exported_symbols_list"; then _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib' fi if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test yes = "$lt_cv_ld_force_load"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined case $cc_basename in ifort*|nagfor*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test yes = "$_lt_dar_can_shared"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil" m4_if([$1], [CXX], [ if test yes != "$lt_cv_apple_cc_single_mod"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test set = "${lt_cv_aix_libpath+set}"; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script that will find a shell with a builtin # printf (that we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case $ECHO in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@], [Search for dependent libraries within DIR (or the compiler's sysroot if not specified).])], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case $with_sysroot in #( yes) if test yes = "$GCC"; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([$with_sysroot]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and where our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test no = "$enable_libtool_lock" || enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out what ABI is being produced by ac_compile, and set mode # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE=32 ;; *ELF-64*) HPUX_IA64_MODE=64 ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test yes = "$lt_cv_prog_gnu_ld"; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; mips64*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then emul=elf case `/usr/bin/file conftest.$ac_objext` in *32-bit*) emul="${emul}32" ;; *64-bit*) emul="${emul}64" ;; esac case `/usr/bin/file conftest.$ac_objext` in *MSB*) emul="${emul}btsmip" ;; *LSB*) emul="${emul}ltsmip" ;; esac case `/usr/bin/file conftest.$ac_objext` in *N32*) emul="${emul}n32" ;; esac LD="${LD-ld} -m $emul" fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. Note that the listed cases only cover the # situations where additional linker options are needed (such as when # doing 32-bit compilation for a host where ld defaults to 64-bit, or # vice versa); the common cases where no linker options are needed do # not appear in the list. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) case `/usr/bin/file conftest.o` in *x86-64*) LD="${LD-ld} -m elf32_x86_64" ;; *) LD="${LD-ld} -m elf_i386" ;; esac ;; powerpc64le-*linux*) LD="${LD-ld} -m elf32lppclinux" ;; powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; powerpcle-*linux*) LD="${LD-ld} -m elf64lppc" ;; powerpc-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS=$CFLAGS CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test yes != "$lt_cv_cc_needs_belf"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS=$SAVE_CFLAGS fi ;; *-*solaris*) # Find out what ABI is being produced by ac_compile, and set linker # options accordingly. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*|x86_64-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD=${LD-ld}_sol2 fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks=$enable_libtool_lock ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test 0 -eq "$ac_status"; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test 0 -ne "$ac_status"; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test no = "$lt_cv_ar_at_file"; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in bitrig* | openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test yes = "[$]$2"; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS=$save_LDFLAGS ]) if test yes = "[$]$2"; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring=ABCD case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len" && \ test undefined != "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test X`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test 17 != "$i" # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n "$lt_cv_sys_max_cmd_len"; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes = "$cross_compiling"; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisibility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test yes != "$enable_dlopen"; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen=load_add_on lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen=LoadLibrary lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen=dlopen lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[ lt_cv_dlopen=dyld lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; tpf*) # Don't try to run any link tests for TPF. We know it's impossible # because TPF is a cross-compiler, and we know how we open DSOs. lt_cv_dlopen=dlopen lt_cv_dlopen_libs= lt_cv_dlopen_self=no ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen=shl_load], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen=dlopen], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld]) ]) ]) ]) ]) ]) ;; esac if test no = "$lt_cv_dlopen"; then enable_dlopen=no else enable_dlopen=yes fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS=$CPPFLAGS test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS=$LDFLAGS wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS=$LIBS LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test yes = "$lt_cv_dlopen_self"; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS=$save_CPPFLAGS LDFLAGS=$save_LDFLAGS LIBS=$save_LIBS ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links=nottested if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test no = "$hard_links"; then AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/", [Define to the sub-directory where libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then # We can hardcode non-existent directories. if test no != "$_LT_TAGVAR(hardcode_direct, $1)" && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" && test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test relink = "$_LT_TAGVAR(hardcode_action, $1)" || test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then # Fast installation is not supported enable_fast_install=no elif test yes = "$shlibpath_overrides_runpath" || test no = "$enable_shared"; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP"; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_PREPARE_MUNGE_PATH_LIST # --------------------------- # Make sure func_munge_path_list() is defined correctly. m4_defun([_LT_PREPARE_MUNGE_PATH_LIST], [[# func_munge_path_list VARIABLE PATH # ----------------------------------- # VARIABLE is name of variable containing _space_ separated list of # directories to be munged by the contents of PATH, which is string # having a format: # "DIR[:DIR]:" # string "DIR[ DIR]" will be prepended to VARIABLE # ":DIR[:DIR]" # string "DIR[ DIR]" will be appended to VARIABLE # "DIRP[:DIRP]::[DIRA:]DIRA" # string "DIRP[ DIRP]" will be prepended to VARIABLE and string # "DIRA[ DIRA]" will be appended to VARIABLE # "DIR[:DIR]" # VARIABLE will be replaced by "DIR[ DIR]" func_munge_path_list () { case x@S|@2 in x) ;; *:) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\" ;; x:*) eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; *::*) eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\" eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\" ;; *) eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\" ;; esac } ]])# _LT_PREPARE_PATH_LIST # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test yes = "$GCC"; then case $host_os in darwin*) lt_awk_arg='/^libraries:/,/LR/' ;; *) lt_awk_arg='/^libraries:/' ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;; *) lt_sed_strip_eq='s|=/|/|g' ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary... lt_tmp_lt_search_path_spec= lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` # ...but if some path component already ends with the multilib dir we assume # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer). case "$lt_multi_os_dir; $lt_search_path_spec " in "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*) lt_multi_os_dir= ;; esac for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir" elif test -n "$lt_multi_os_dir"; then test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS = " "; FS = "/|\n";} { lt_foo = ""; lt_count = 0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo = "/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=.so postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown AC_ARG_VAR([LT_SYS_LIBRARY_PATH], [User-defined run-time library search path.]) case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='$libname$release$shared_ext$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test ia64 = "$host_cpu"; then # AIX 5 supports IA64 library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line '#! .'. This would cause the generated library to # depend on '.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # Using Import Files as archive members, it is possible to support # filename-based versioning of shared library archives on AIX. While # this would work for both with and without runtime linking, it will # prevent static linking of such archives. So we do filename-based # shared library versioning with .so extension only, which is used # when both runtime linking and shared linking is enabled. # Unfortunately, runtime linking may impact performance, so we do # not want this to be the default eventually. Also, we use the # versioned .so libs for executables only if there is the -brtl # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only. # To allow for filename-based versioning support, we need to create # libNAME.so.V as an archive file, containing: # *) an Import File, referring to the versioned filename of the # archive as well as the shared archive member, telling the # bitwidth (32 or 64) of that shared object, and providing the # list of exported symbols of that shared object, eventually # decorated with the 'weak' keyword # *) the shared object with the F_LOADONLY flag set, to really avoid # it being seen by the linker. # At run time we better use the real file rather than another symlink, # but for link time we create the symlink libNAME.so -> libNAME.so.V case $with_aix_soname,$aix_use_runtimelinking in # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. aix,yes) # traditional libtool dynamic_linker='AIX unversionable lib.so' # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; aix,no) # traditional AIX only dynamic_linker='AIX lib.a[(]lib.so.V[)]' # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' ;; svr4,*) # full svr4 only dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,yes) # both, prefer svr4 dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]" library_names_spec='$libname$release$shared_ext$major $libname$shared_ext' # unpreferred sharedlib libNAME.a needs extra handling postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"' postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"' # We do not specify a path in Import Files, so LIBPATH fires. shlibpath_overrides_runpath=yes ;; *,no) # both, prefer aix dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]" library_names_spec='$libname$release.a $libname.a' soname_spec='$libname$release$shared_ext$major' # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)' postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"' ;; esac shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='$libname$shared_ext' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext' library_names_spec='$libname.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec=$LIB if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='$libname$release$major$shared_ext $libname$shared_ext' soname_spec='$libname$release$major$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=no sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' if test 32 = "$HPUX_IA64_MODE"; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" sys_lib_dlsearch_path_spec=/usr/lib/hpux32 else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" sys_lib_dlsearch_path_spec=/usr/lib/hpux64 fi ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test yes = "$lt_cv_prog_gnu_ld"; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff" sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; linux*android*) version_type=none # Android doesn't support versioned libraries. need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext' soname_spec='$libname$release$shared_ext' finish_cmds= shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes dynamic_linker='Android linker' # Don't embed -rpath directories since the linker doesn't support them. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Ideally, we could use ldconfig to report *all* directores which are # searched for libraries, however this is still not possible. Aside from not # being certain /sbin/ldconfig is available, command # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64, # even though it is searched at run-time. Try to do the best guess by # appending ld.so.conf contents (and includes) to the search path. if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd* | bitrig*) version_type=sunos sys_lib_dlsearch_path_spec=/usr/lib need_lib_prefix=no if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then need_version=no else need_version=yes fi library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; os2*) libname_spec='$name' version_type=windows shrext_cmds=.dll need_version=no need_lib_prefix=no # OS/2 can only load a DLL with a base name of 8 characters or less. soname_spec='`test -n "$os2dllname" && libname="$os2dllname"; v=$($ECHO $release$versuffix | tr -d .-); n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _); $ECHO $n$v`$shared_ext' library_names_spec='${libname}_dll.$libext' dynamic_linker='OS/2 ld.exe' shlibpath_var=BEGINLIBPATH sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec postinstall_cmds='base_file=`basename \$file`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='$libname$release$shared_ext$major' library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test yes = "$with_gnu_ld"; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec; then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext' soname_spec='$libname$shared_ext.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=sco need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test yes = "$with_gnu_ld"; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test no = "$dynamic_linker" && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test yes = "$GCC"; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec fi if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec fi # remember unaugmented sys_lib_dlsearch_path content for libtool script decls... configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec # ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH" # to be used as default LT_SYS_LIBRARY_PATH value in generated libtool configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2], [Detected run-time system search path for libraries]) _LT_DECL([], [configure_time_lt_sys_library_path], [2], [Explicit LT_SYS_LIBRARY_PATH set during ./configure time]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program that can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD=$MAGIC_CMD lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$1"; then lt_cv_path_MAGIC_CMD=$ac_dir/"$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD=$lt_cv_path_MAGIC_CMD if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS=$lt_save_ifs MAGIC_CMD=$lt_save_MAGIC_CMD ;; esac]) MAGIC_CMD=$lt_cv_path_MAGIC_CMD if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program that can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test no = "$withval" || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test yes = "$GCC"; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return, which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD=$ac_prog ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test yes = "$with_gnu_ld"; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD=$ac_dir/$ac_prog # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 conftest.i cat conftest.i conftest.i >conftest2.i : ${lt_DD:=$DD} AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd], [if "$ac_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=: fi]) rm -f conftest.i conftest2.i conftest.out]) ])# _LT_PATH_DD # _LT_CMD_TRUNCATE # ---------------- # find command to truncate a binary pipe m4_defun([_LT_CMD_TRUNCATE], [m4_require([_LT_PATH_DD]) AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin], [printf 0123456789abcdef0123456789abcdef >conftest.i cat conftest.i conftest.i >conftest2.i lt_cv_truncate_bin= if "$ac_cv_path_lt_DD" bs=32 count=1 conftest.out 2>/dev/null; then cmp -s conftest.i conftest.out \ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1" fi rm -f conftest.i conftest2.i conftest.out test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"]) _LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1], [Command to truncate a binary pipe]) ])# _LT_CMD_TRUNCATE # _LT_CHECK_MAGIC_METHOD # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # 'unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # that responds to the $file_magic_cmd with a given extended regex. # If you have 'file' or equivalent on your system and you're not sure # whether 'pass_all' will *always* work, you probably want this one. case $host_os in aix[[4-9]]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[[45]]*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd* | bitrig*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; os2*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM=$NM else lt_nm_to_check=${ac_tool_prefix}nm if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS=$lt_save_ifs test -z "$ac_dir" && ac_dir=. tmp_nm=$ac_dir/$lt_tmp_nm if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then # Check to see if the nm accepts a BSD-compat flag. # Adding the 'sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty case $build_os in mingw*) lt_bad_file=conftest.nm/nofile ;; *) lt_bad_file=/dev/null ;; esac case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in *$lt_bad_file* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break 2 ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break 2 ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS=$lt_save_ifs done : ${lt_cv_path_NM=no} fi]) if test no != "$lt_cv_path_NM"; then NM=$lt_cv_path_NM else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols -headers" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test : != "$DUMPBIN"; then NM=$DUMPBIN fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh; # decide which one to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd=$ECHO ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test yes != "$lt_cv_path_mainfest_tool"; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # _LT_DLL_DEF_P([FILE]) # --------------------- # True iff FILE is a Windows DLL '.def' file. # Keep in sync with func_dll_def_p in the libtool script AC_DEFUN([_LT_DLL_DEF_P], [dnl test DEF = "`$SED -n dnl -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl -e q dnl Only consider the first "real" line $1`" dnl ])# _LT_DLL_DEF_P # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw) AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM=-lm) ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test yes = "$GCC"; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test ia64 = "$host_cpu"; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Gets list of data symbols to import. lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'" # Adjust the below global symbol transforms to fixup imported variables. lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'" lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'" lt_c_name_lib_hook="\ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'" else # Disable hooks by default. lt_cv_sys_global_symbol_to_import= lt_cdecl_hook= lt_c_name_hook= lt_c_name_lib_hook= fi # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n"\ $lt_cdecl_hook\ " -e 's/^T .* \(.*\)$/extern int \1();/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n"\ $lt_c_name_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'" # Transform an extracted symbol line into symbol name with lib prefix and # symbol address. lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\ $lt_c_name_lib_hook\ " -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\ " -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\ " -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function, # D for any global variable and I for any imported variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\ " /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\ " /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\ " {split(\$ 0,a,/\||\r/); split(a[2],s)};"\ " s[1]~/^[@?]/{print f,s[1],s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE /* DATA imports from DLLs on WIN32 can't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined __osf__ /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS=conftstm.$ac_objext CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test yes = "$pipe_works"; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1], [Transform the output of nm into a list of symbols to manually relocate]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([nm_interface], [lt_cv_nm_interface], [1], [The name lister interface]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' if test ia64 != "$host_cpu"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64, which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test yes = "$GCC"; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the '-m68020' flag to GCC prevents building anything better, # like '-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test ia64 = "$host_cpu"; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' case $cc_basename in nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) case $host_os in os2*) _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static' ;; esac ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64, which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms that do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ' (' and ')$', so one must not match beginning or # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc', # as well as any symbol that contains 'd'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test yes != "$GCC"; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd* | bitrig*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test yes = "$with_gnu_ld"; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test yes = "$lt_use_gnu_ld_interface"; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='$wl' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test ia64 != "$host_cpu"; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test linux-dietlibc = "$host_os"; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test no = "$tmp_diet" then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; nagfor*) # NAGFOR 5.3 tmp_sharedflag='-Wl,-shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi case $cc_basename in tcc*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic' ;; xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to GNU nm, but means don't demangle to AIX nm. # Without the "-l" option, or with the "-B" option, AIX nm treats # weak defined symbols like other global defined symbols, whereas # GNU nm marks them as "W". # While the 'weak' keyword is ignored in the Export File, we need # it in the Import File for the 'aix-soname' feature, so we have # to replace the "-B" option with "-P" for AIX nm. if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then aix_use_runtimelinking=yes break fi done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # traditional, no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GCC"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag="$shared_flag "'$wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; hpux10*) if test yes,no = "$GCC,$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test yes,no = "$GCC,$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS=$save_LDFLAGS]) if test yes = "$lt_cv_irix_exported_symbol"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib' fi _LT_TAGVAR(link_all_deplibs, $1)=no else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; linux*) case $cc_basename in tcc*) # Fabrice Bellard et al's Tiny C Compiler _LT_TAGVAR(ld_shlibs, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; osf3*) if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test yes = "$GCC"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test yes = "$GCC"; then wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='$wl' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. GCC discards it without '$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test yes = "$GCC"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test sequent = "$host_vendor"; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' if test yes = "$GCC"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test sni = "$host_vendor"; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test yes,yes = "$GCC,$enable_shared"; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting $shlibpath_var if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC=$CC AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report what library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC=$lt_save_CC ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to 'libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test no != "$CXX" && ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) || (test g++ != "$CXX"))); then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_caught_CXX_error"; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test yes = "$GXX"; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test yes = "$GXX"; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test yes = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='$wl' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test ia64 = "$host_cpu"; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag= else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # have runtime linking enabled, and use it for executables. # For shared libraries, we enable/disable runtime linking # depending on the kind of the shared library created - # when "with_aix_soname,aix_use_runtimelinking" is: # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables # "aix,yes" lib.so shared, rtl:yes, for executables # lib.a static archive # "both,no" lib.so.V(shr.o) shared, rtl:yes # lib.a(lib.so.V) shared, rtl:no, for executables # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a(lib.so.V) shared, rtl:no # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables # lib.a static archive case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then # With aix-soname=svr4, we create the lib.so.V shared archives only, # so we don't have lib.a shared libs to link our executables. # We have to force runtime linking in this case. aix_use_runtimelinking=yes LDFLAGS="$LDFLAGS -Wl,-brtl" fi ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='$wl-f,' case $with_aix_soname,$aix_use_runtimelinking in aix,*) ;; # no import file svr4,* | *,yes) # use import file # The Import File defines what to hardcode. _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no ;; esac if test yes = "$GXX"; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`$CC -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test yes = "$aix_use_runtimelinking"; then shared_flag=$shared_flag' $wl-G' fi # Need to ensure runtime linking is disabled for the traditional # shared library, or the linker may eventually find shared libraries # /with/ Import File - we do not want to mix them. shared_flag_aix='-shared' shared_flag_svr4='-shared $wl-G' else # not using gcc if test ia64 = "$host_cpu"; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test yes = "$aix_use_runtimelinking"; then shared_flag='$wl-G' else shared_flag='$wl-bM:SRE' fi shared_flag_aix='$wl-bM:SRE' shared_flag_svr4='$wl-G' fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. # The "-G" linker flag allows undefined symbols. _LT_TAGVAR(no_undefined_flag, $1)='-bernotok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag else if test ia64 = "$host_cpu"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok' if test yes = "$with_gnu_ld"; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d' # -brtl affects multiple linker settings, -berok does not and is overridden later compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`' if test svr4 != "$with_aix_soname"; then # This is similar to how AIX traditionally builds its shared # libraries. Need -bnortl late, we may have -brtl in LDFLAGS. _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname' fi if test aix != "$with_aix_soname"; then _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp' else # used by -dlpreopen to get the symbols _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir' fi _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=.dll # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp "$export_symbols" "$output_objdir/$soname.def"; echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp"; else $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile=$lt_outputfile.exe lt_tool_outputfile=$lt_tool_outputfile.exe ;; esac~ func_to_tool_file "$lt_outputfile"~ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file, use it as # is; otherwise, prepend EXPORTS... _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported shrext_cmds=.dll _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~ $ECHO EXPORTS >> $output_objdir/$libname.def~ prefix_cmds="$SED"~ if test EXPORTS = "`$SED 1q $export_symbols`"; then prefix_cmds="$prefix_cmds -e 1d"; fi~ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~ emximp -o $lib $output_objdir/$libname.def' _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test no = "$with_gnu_ld"; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test yes = "$GXX"; then if test no = "$with_gnu_ld"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib' if test yes = "$supports_anon_versioning"; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd* | bitrig*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E' _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands '-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test yes,no = "$GXX,$with_gnu_ld"; then _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require '-G' NOT '-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We CANNOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no _LT_TAGVAR(GCC, $1)=$GXX _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test yes != "$_lt_caught_CXX_error" AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case @S|@2 in .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;; *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $prev$p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test x-L = "$p" || test x-R = "$p"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test no = "$pre_test_object_deps_done"; then case $prev in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)=$prev$p else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test no = "$pre_test_object_deps_done"; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)=$p else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)=$p else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test no = "$F77"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_F77"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$G77 _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_F77" AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test no = "$FC"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test yes != "$_lt_disable_FC"; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test no = "$can_build_shared" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test yes = "$enable_shared" && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test ia64 != "$host_cpu"; then case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in yes,aix,yes) ;; # shared object as lib.so file only yes,svr4,*) ;; # shared object as lib.so archive member only yes,*) enable_static=no ;; # shared object in lib.a archive as well esac fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test yes = "$enable_shared" || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu _LT_TAGVAR(LD, $1)=$LD ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test yes != "$_lt_disable_FC" AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)=$LD _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to 'libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code=$lt_simple_compile_test_code # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f "$lt_ac_sed" && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test 10 -lt "$lt_ac_count" && break lt_ac_count=`expr $lt_ac_count + 1` if test "$lt_ac_count" -gt "$lt_ac_max"; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine what file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS rivet-3.0.0/cmake/README.cmake000664 001750 001750 00000003564 15224454746 016461 0ustar00manghimanghi000000 000000 In order to build Rivet with cmake, the following software is required: a) cmake, version 3.2 or newer. Compiling Rivet with cmake: ------------------------------------------------------- 1) Change the working directory to "cmake". 2) Execute the following commands (all commands must be executed from the "cmake" directory): cmake -E make_directory build cmake -E chdir build cmake .. cmake --build build --target all --clean-first cmake --build build --target install 3) To install mod_rivet.so/Rivet library to a custom location, the following commands can be used: cmake -E make_directory build cmake -E chdir build cmake \ -DAPACHE_MODULE_DIR=/home/tcl/rivet/branches/cmake/cmake/test/modules \ -DAPACHE_LIB_DIR=/home/tcl/rivet/branches/cmake/cmake/test/ .. cmake --build build --config Release --target install 4) To install mod_rivet.so/Rivet library in a system where Apache Server is not in a known location (i.e. under Windows), you can speficy APACHE_ROOT: cmake -E make_directory build cmake -E chdir build cmake -DAPACHE_ROOT=F:/Apache24 .. cmake --build build --config Release --target install 5) Compile for 64 bits under Windows (for Visual Studio 2017): cmake -E make_directory build_64 cmake -E chdir build_64 cmake -DAPACHE_ROOT=F:/Apache24_64 -G "Visual Studio 15 2017 Win64" .. cmake --build build_64 --config Release --target install -G "..." can be set to any of the available 64-bit generators available under the platform. 6) Specify Tcl at a non standard location: cmake -E make_directory build_64 cmake -E chdir build_64 cmake -DAPACHE_ROOT=F:/Apache24_64 -G "Visual Studio 15 2017 Win64" -Dwith-tcl=C:/TclApps/Tcl64/lib .. cmake --build build_64 --config Release --target install Instead of -Dwith-tcl=, -DTCL_ROOT=, -DTclStub_ROOT, and -DTCL_TCLSH= can be specified as an alternative. rivet-3.0.0/doc/xml/asciiglyphs.xml000664 001750 001750 00000005272 15224454746 020046 0ustar00manghimanghi000000 000000
    AsciiGlyphs
    Introduction The AsciiGlyphs package provides a command to print large ASCII glyphs in an HTML fragment based on a <pre>...</pre:> element. The shape of the glyphs was inspired by the challenge response used by Fossil to let anonymous users to log into a repository. The glyph set was extended to support the whole English alphabet and some punctuation characters. The string to be represented has to be made of pure 7-bit ASCII characters. The package also runs standalone outside of mod_rivet
    toGlyphs print large ASCII glyphs ::AsciiGlyphs toGlyphs string Description prints the ASCII glyphs corresponding to the characters forming the argument string
    Example package require AsciiGlyphs ::AsciiGlyphs toGlyphs "Date: 07-12-2015" _____ _____ ______ ___ ______ __ ___ ___ ___ __ _____ | __ \ /\ |_ _| | ____| _ / _ \ |____ | /_ ||__ \ |__ \ / _ \ /_ || ____| | | | | / \ | | | |__ |_| | | | | / / ____ | | ) | ____ ) || | | | | || |__ | | | | / /\ \ | | | __| _ | | | | / / |____| | | / / |____| / / | | | | | ||___ \ | |__| | / ____ \ | | | |____ |_| | |_| | / / | | / /_ / /_ | |_| | | | ___) | |_____/ /_/ \_\ |_| |______| \___/ /_/ |_||____| |____| \___/ |_||____/ ::AsciiGlyphs toGlyphs "Time: 18:10:19" _____ ___ _ _ ______ __ ___ __ ___ __ ___ |_ _| | || \ / | | ____| _ /_ | / _ \ _ /_ | / _ \ _ /_ | / _ \ | | | | | \/ | | |__ |_| | || (_) | |_| | || | | | |_| | || (_) | | | | | | | | | | __| _ | | > _ < _ | || | | | _ | | \__, | | | | | | | | | | |____ |_| | || (_) | |_| | || |_| | |_| | | / / |_| |___||_| |_| |______| |_| \___/ |_| \___/ |_| /_/
    rivet-3.0.0/rivet/packages/form/000775 001750 001750 00000000000 15224454746 017304 5ustar00manghimanghi000000 000000 rivet-3.0.0/src/mod_rivet_ng/apache_config.h000664 001750 001750 00000003301 15224454746 021611 0ustar00manghimanghi000000 000000 /* apache_config.h -- configuration functions for apache 2.x */ /* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ #ifndef __apache_config_h__ #define __apache_config_h__ #include "mod_rivet.h" void Rivet_CopyConfig( rivet_server_conf *oldrsc, rivet_server_conf *newrsc); const char* Rivet_ServerConf(cmd_parms *cmd, void *dummy, const char *var, const char *val); const char* Rivet_DirConf(cmd_parms *cmd, void *vrdc, const char *var, const char *val); const char* Rivet_UserConf(cmd_parms *cmd, void *vrdc, const char *var, const char *val); void* Rivet_CreateDirConfig(apr_pool_t *p, char *dir); void* Rivet_MergeDirConfig( apr_pool_t *p, void *basev, void *addv); void* Rivet_CreateConfig(apr_pool_t *p, server_rec *s); void* Rivet_MergeConfig(apr_pool_t *p, void *basev, void *overridesv); void Rivet_MergeDirConfigVars(apr_pool_t *p,rivet_server_conf *new,rivet_server_conf *base,rivet_server_conf *add); #endif rivet-3.0.0/rivet/packages/dtcl/dtcl.tcl000664 001750 001750 00000002516 15224454746 020725 0ustar00manghimanghi000000 000000 ### ## This package is a compatibility layer between Rivet and mod_dtcl. ## ## All of the mod_dtcl commands call their Rivet equivalents and return the ## proper responses. ### # Copyright 2002-2004 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. package provide Dtcl 1.0 proc hgetvars {} { uplevel { catch {unset VARS} load_env ENVS load_cookies COOKIES } set vars [var all] foreach {name val} $vars { uplevel [list set VARS($name) "$val"] } unset vars } proc hputs {args} { set nargs [llength $args] if {$nargs < 1 || $nargs > 2} { return -code error {wrong # args: should be "hputs ?-error? text"} } if {$nargs == 2} { set string [lindex $args 1] } else { set string [lindex $args 0] } puts $string } proc hflush {} { flush stdout } proc dtcl_info {} { } rivet-3.0.0/rivet/rivet-tcl/lempty.tcl000664 001750 001750 00000000465 15224454746 020517 0ustar00manghimanghi000000 000000 ### ## lempty ## ## Returns 1 if is empty or 0 if it has any elements. This command ## emulates the TclX lempty command. ## ## $Id$ ## ### namespace eval ::rivet { proc lempty {list} { if {[catch {llength $list} len]} { return 0 } return [expr {$len == 0}] } } rivet-3.0.0/rivet/packages/000775 001750 001750 00000000000 15224454746 016341 5ustar00manghimanghi000000 000000 rivet-3.0.0/doc/rivet-nochunk.xsl000664 001750 001750 00000002725 15224454746 017531 0ustar00manghimanghi000000 000000 rivet-3.0.0/rivet/packages/simpledb/simpledb.tcl000664 001750 001750 00000016055 15224454746 022452 0ustar00manghimanghi000000 000000 # simpledb.tcl -- provides a simple tcl database. # Copyright 2003-2004 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$ package provide simpledb 0.1 namespace eval ::simpledb { set oid 0 } # simpledb::createtable -- # # Creates a table and its associated columns. # # Arguments: # table - name of the table. # args - column names. # # Side Effects: # Creates internal namespace and arrays. # # Results: # None. proc simpledb::createtable { table args } { namespace eval $table {} array set ${table}::cols {} # Currently active oids. array set ${table}::goodoids {} foreach col $args { # Each key gets its own namespace. namespace eval ${table}::${col} {} # In that namespace we have an array that maps oids->data. array set ${table}::${col}::data {} # And an array that maps data->oids. array set ${table}::${col}::values {} set ${table}::cols($col) 1 } } # simpledb::deltable -- # # Delete table. # # Arguments: # table - table to delete. # # Side Effects: # Deletes table namespace. # # Results: # None. proc simpledb::deltable { table } { namespace delete $table } # simpledb::tables -- # # Return a list of all tables. # # Arguments: # None. # # Side Effects: # None. # # Results: # A list of all tables that exist in the database. proc simpledb::tables {} { set res {} foreach ns [namespace children [namespace current]] { lappend res [namespace tail $ns] } return $res } # simpledb::createitem -- # # Create an item in the table. # # Arguments: # table - table name. # properties - a list of keys and their corresponding values. # Keys must correspond to those listed in 'createtable'. # # Side Effects: # Creates a new table item. # # Results: # None. proc simpledb::createitem { table properties } { variable oid incr oid set ${table}::goodoids($oid) 1 foreach {col data} $properties { set ${table}::${col}::data($oid) $data lappend ${table}::${col}::values($data) $oid } return $oid } # simpledb::getitem -- # # Fetches an item from the database based on its oid. # # Arguments: # table - table name. # oid - identity of the item to fetch. # # Side Effects: # None. # # Results: # Returns information as a list suitable to pass to 'array set'. proc simpledb::getitem { table oid } { foreach col [array names ${table}::cols] { lappend res $col [set ${table}::${col}::data($oid)] } return $res } # simpledb::setitem -- # # Set the values of given keys. # # Arguments: # table - table name. # oid - item's unique id. # properties - list of keys and values. # # Side Effects: # The old value of the item is lost. # # Results: # None. proc simpledb::setitem { table oid properties } { upvar $properties props foreach {col data} $properties { if { [info exists ${table}::${col}::data($oid)] } { set oldval [set ${table}::${col}::data($oid)] set item [lsearch [set ${table}::${col}::values($oldval)] $oid] if { $item >= 0 } { set ${table}::${col}::values($oldval) \ [lreplace ${table}::${col}::values($oldval) $item $item] } if { [llength [set ${table}::${col}::values($oldval)]] == 0 } { unset ${table}::${col}::values($oldval) } } set ${table}::${col}::data($oid) $data lappend ${table}::${col}::values($data) $oid } return $oid } # simpledb::delitem -- # # Delete an item from the database. This is slow because of the # lsearch. # # Arguments: # table - table name. # oid - object's unique id. # # Side Effects: # Deletes item from the database. # # Results: # None. proc simpledb::delitem { table oid properties } { upvar $properties props foreach col [array names ${table}::cols] { unset ${table}::${col}::data($oid) set item [lsearch ${table}::${col}::values($props($col)) $oid] set ${table}::${col}::values($props($col)) \ [lreplace ${table}::${col}::values($props($col)) $item $item] } unset ${table}::goodoids($oid) return $oid } # simpledb::finditems -- # # Find items that match the given "properties" - a list of keys # and the sought values. Glob patterns are accepted as # 'values'. # # Arguments: # table - table name. # propertymatch - list of keys and values to search on. # # Side Effects: # None. # # Results: # A list of the id's of matching item. proc simpledb::finditems { table propertymatch } { array set res {} foreach {col value} $propertymatch { foreach {value oids} [array get ${table}::${col}::values $value] { foreach oid $oids { if { [info exists res($oid)] } { incr res($oid) } else { set res($oid) 1 } } } } set retlist {} foreach {oid num} [array get res] { if { $res($oid) == [llength $propertymatch] / 2 } { lappend retlist $oid } } return $retlist } # simpledb::items -- # # Fetch all the items from a particular table. # # Arguments: # table. # # Side Effects: # None. # # Results: # A list of lists, with the sublists being key/value lists of # column names and their value for the oid in question. proc simpledb::items {table} { set reslist {} set collist [array names ${table}::cols] foreach oid [array names ${table}::goodoids] { set oidlist {} foreach col $collist { if { [info exists ${table}::${col}::data($oid)] } { lappend oidlist $col [set ${table}::${col}::data($oid)] } } lappend reslist $oidlist } return $reslist } # simpledb::synctostorage -- # # Writes the database to a file. The storage format, for the # moment is Tcl code, which isn't space efficient, but is easy # to reload. # # Arguments: # savefile - file to save database in. # # Side Effects: # None. # # Results: # None. proc simpledb::synctostorage {savefile} { set fl [open $savefile w] foreach ns [namespace children] { # Let's store the goodoids array. set collist [array names ${ns}::cols] puts $fl "namespace eval $ns \{" puts $fl " array set cols \{ [array get ${ns}::cols] \}" puts $fl " array set goodoids \{ [array get ${ns}::goodoids] \}" foreach col $collist { puts $fl " namespace eval ${col} \{" puts $fl " array set data [list [array get ${ns}::${col}::data]]" puts $fl " array set values [list [array get ${ns}::${col}::values]]" puts $fl " \}" } puts $fl "\}" } close $fl } # simpledb::syncfromstorage -- # # Reloads database from file. # # Arguments: # savefile - file to read. # # Side Effects: # Creates database. # # Results: # None. proc simpledb::syncfromstorage {savefile} { source $savefile } rivet-3.0.0/tclconfig/config.sub000775 001750 001750 00000106450 15224454746 017373 0ustar00manghimanghi000000 000000 #! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2018 Free Software Foundation, Inc. timestamp='2018-02-22' # 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. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # 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. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2018 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." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ kopensolaris*-gnu* | cloudabi*-eabi* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo "$1" | sed 's/-[^-]*$//'` if [ "$basic_machine" != "$1" ] then os=`echo "$1" | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -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*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | ba \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | e2k | epiphany \ | fido | fr30 | frv | ft32 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia16 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pru \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | visium \ | wasm32 \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; leon|leon[3-9]) basic_machine=sparc-$basic_machine ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | ba-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | e2k-* | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pru-* \ | pyramid-* \ | riscv32-* | riscv64-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | visium-* \ | wasm32-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-pc os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; asmjs) basic_machine=asmjs-unknown ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2*) basic_machine=m68k-bull os=-sysv3 ;; e500v[12]) basic_machine=powerpc-unknown os=$os"spe" ;; e500v[12]-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=$os"spe" ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; leon-*|leon[3-9]-*) basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; nsv-tandem) basic_machine=nsv-tandem ;; nsx-tandem) basic_machine=nsx-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh5el) basic_machine=sh5le-unknown ;; simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; x64) basic_machine=x86_64-pc ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases that might get confused # with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # es1800 is here to avoid being matched by es* (a different OS) -es1800*) os=-ose ;; # Now accept the basic system types. # The portable systems comes first. # Each alternative MUST end in a * to match a version number. # -sysv* is not here because it comes later, after sysvr4. -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* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* | -cloudabi* | -sortix* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -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* | -glidix* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \ | -midnightbsd*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -xray | -os68k* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo "$os" | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4*) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -pikeos*) # Until real need of OS specific support for # particular features comes up, bare metal # configurations are quite functional. case $basic_machine in arm*) os=-eabi ;; *) os=-elf ;; esac ;; -nacl*) ;; -ios) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; pru-*) os=-elf ;; *-be) os=-beos ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` ;; esac echo "$basic_machine$os" exit # Local variables: # eval: (add-hook 'write-file-functions 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: rivet-3.0.0/tests/docroot1/beforescript.tcl000664 001750 001750 00000000142 15224454746 021516 0ustar00manghimanghi000000 000000 # beforescript.tcl -- beforescript for tests # $Id$ set ::beforescript1 1 puts "beforescript1" rivet-3.0.0/tests/parsestring.rvt000664 001750 001750 00000000412 15224454746 017667 0ustar00manghimanghi000000 000000 Parse String Test

    Parse String Test

    rivet-3.0.0/tclconfig/tcl.m4000664 001750 001750 00000406411 15224454746 016434 0ustar00manghimanghi000000 000000 # tcl.m4 -- # # This file provides a set of autoconf macros to help TEA-enable # a Tcl extension. # # Copyright (c) 1999-2000 Ajuba Solutions. # Copyright (c) 2002-2005 ActiveState Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. AC_PREREQ([2.69]) # Possible values for key variables defined: # # TEA_WINDOWINGSYSTEM - win32 aqua x11 (mirrors 'tk windowingsystem') # TEA_PLATFORM - windows unix # TEA_TK_EXTENSION - True if this is a Tk extension # #------------------------------------------------------------------------ # TEA_PATH_TCLCONFIG -- # # Locate the tclConfig.sh file and perform a sanity check on # the Tcl compile flags # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tcl=... # # Defines the following vars: # TCL_BIN_DIR Full path to the directory containing # the tclConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TCLCONFIG], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_INIT]) # # Ok, lets find the tcl configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tcl # if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), [with_tclconfig="${withval}"]) AC_ARG_WITH(tcl8, AS_HELP_STRING([--with-tcl8], [Compile for Tcl8 in Tcl9 environment]), [with_tcl8="${withval}"]) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then case "${with_tclconfig}" in */tclConfig.sh ) if test -f "${with_tclconfig}"; then AC_MSG_WARN([--with-tcl argument should refer to directory containing tclConfig.sh, not to tclConfig.sh itself]) with_tclconfig="`echo "${with_tclconfig}" | sed 's!/tclConfig\.sh$!!'`" fi ;; esac if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks/Tcl.framework 2>/dev/null` \ `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Network/Library/Frameworks/Tcl.framework 2>/dev/null` \ `ls -d /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/lib/tcl9.1 2>/dev/null` \ `ls -d /usr/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/lib/tcl8.5 2>/dev/null` \ `ls -d /usr/local/lib/tcl9.1 2>/dev/null` \ `ls -d /usr/local/lib/tcl9.0 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.6 2>/dev/null` \ `ls -d /usr/local/lib/tcl8.5 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl9.1 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tclconfig}" = x ; then TCL_BIN_DIR="# no Tcl configs found" AC_MSG_ERROR([Can't find Tcl configuration definitions. Use --with-tcl to specify a directory containing tclConfig.sh]) else no_tcl= TCL_BIN_DIR="${ac_cv_c_tclconfig}" AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_PATH_TKCONFIG -- # # Locate the tkConfig.sh file # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-tk=... # # Defines the following vars: # TK_BIN_DIR Full path to the directory containing # the tkConfig.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_TKCONFIG], [ # # Ok, lets find the tk configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-tk # if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true AC_ARG_WITH(tk, AS_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), [with_tkconfig="${withval}"]) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ # First check to see if --with-tkconfig was specified. if test x"${with_tkconfig}" != x ; then case "${with_tkconfig}" in */tkConfig.sh ) if test -f "${with_tkconfig}"; then AC_MSG_WARN([--with-tk argument should refer to directory containing tkConfig.sh, not to tkConfig.sh itself]) with_tkconfig="`echo "${with_tkconfig}" | sed 's!/tkConfig\.sh$!!'`" fi ;; esac if test -f "${with_tkconfig}/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi fi # then check for a private Tk library if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi # on Darwin, check in Framework installation locations if test "`uname -s`" = "Darwin" -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ~/Library/Frameworks 2>/dev/null` \ `ls -d /Library/Frameworks 2>/dev/null` \ `ls -d /Network/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" break fi done fi # check in a few common install locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib/tk9.1 2>/dev/null` \ `ls -d /usr/lib/tk9.0 2>/dev/null` \ `ls -d /usr/lib/tk8.6 2>/dev/null` \ `ls -d /usr/lib/tk8.5 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ `ls -d /usr/local/lib/tk9.1 2>/dev/null` \ `ls -d /usr/local/lib/tk9.0 2>/dev/null` \ `ls -d /usr/local/lib/tk8.6 2>/dev/null` \ `ls -d /usr/local/lib/tk8.5 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk9.1 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \ `ls -d /usr/local/lib/tcl/tk8.5 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # TEA specific: on Windows, check in common installation locations if test "${TEA_PLATFORM}" = "windows" \ -a x"${ac_cv_c_tkconfig}" = x ; then for i in `ls -d C:/Tcl/lib 2>/dev/null` \ `ls -d C:/Progra~1/Tcl/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done fi # check in a few other private locations if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test "${TEA_PLATFORM}" = "windows" \ -a -f "$i/win/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/win; pwd)`" break fi if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done fi ]) if test x"${ac_cv_c_tkconfig}" = x ; then TK_BIN_DIR="# no Tk configs found" AC_MSG_ERROR([Can't find Tk configuration definitions. Use --with-tk to specify a directory containing tkConfig.sh]) else no_tk= TK_BIN_DIR="${ac_cv_c_tkconfig}" AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_TCLCONFIG -- # # Load the tclConfig.sh file # # Arguments: # # Requires the following vars to be set: # TCL_BIN_DIR # # Results: # # Substitutes the following vars: # TCL_BIN_DIR # TCL_SRC_DIR # TCL_LIB_FILE # TCL_ZIP_FILE # TCL_ZIPFS_SUPPORT #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TCLCONFIG], [ AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh]) if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TCL_BIN_DIR}/tclConfig.sh" else AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh]) fi # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TCL_LIB_SPEC will be set to the value # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC # instead of TCL_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TCL_BIN_DIR}/Makefile" ; then TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}" TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}" TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tcl.framework installed in an arbitrary location. case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -f "${TCL_BIN_DIR}/${TCL_LIB_FILE}"; then for i in "`cd "${TCL_BIN_DIR}"; pwd`" \ "`cd "${TCL_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TCL_LIB_FILE}.framework"; then TCL_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then TCL_STUB_LIB_SPEC="-L`echo "${TCL_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; esac fi AC_SUBST(TCL_VERSION) AC_SUBST(TCL_PATCH_LEVEL) AC_SUBST(TCL_BIN_DIR) AC_SUBST(TCL_SRC_DIR) AC_SUBST(TCL_LIB_FILE) AC_SUBST(TCL_LIB_FLAG) AC_SUBST(TCL_LIB_SPEC) AC_SUBST(TCL_STUB_LIB_FILE) AC_SUBST(TCL_STUB_LIB_FLAG) AC_SUBST(TCL_STUB_LIB_SPEC) AC_MSG_CHECKING([platform]) hold_cc=$CC; CC="$TCL_CC" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ #ifdef _WIN32 #error win32 #endif ]])],[ # first test we've already retrieved platform (cross-compile), fallback to unix otherwise: TEA_PLATFORM="${TEA_PLATFORM-unix}" CYGPATH=echo ],[ TEA_PLATFORM="windows" AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) ]) CC=$hold_cc AC_MSG_RESULT($TEA_PLATFORM) # The BUILD_$pkg is to define the correct extern storage class # handling when making this package # To be able to sefely use the package name in a #define, it must not # contain anything other than alphanumeric characters and underscores SAFE_PKG_NAME=patsubst(AC_PACKAGE_NAME, [[^A-Za-z0-9_]], [_]) AC_DEFINE_UNQUOTED(BUILD_${SAFE_PKG_NAME}, [], [Building extension source?]) # Do this here as we have fully defined TEA_PLATFORM now if test "${TEA_PLATFORM}" = "windows" ; then EXEEXT=".exe" CLEANFILES="$CLEANFILES *.lib *.dll *.pdb *.exp" fi # TEA specific: AC_SUBST(CLEANFILES) AC_SUBST(TCL_LIBS) AC_SUBST(TCL_DEFS) AC_SUBST(TCL_EXTRA_CFLAGS) AC_SUBST(TCL_LD_FLAGS) AC_SUBST(TCL_SHLIB_LD_LIBS) ]) #------------------------------------------------------------------------ # TEA_LOAD_TKCONFIG -- # # Load the tkConfig.sh file # # Arguments: # # Requires the following vars to be set: # TK_BIN_DIR # # Results: # # Sets the following vars that should be in tkConfig.sh: # TK_BIN_DIR #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_TKCONFIG], [ AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh]) if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then AC_MSG_RESULT([loading]) . "${TK_BIN_DIR}/tkConfig.sh" else AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh]) fi # If the TK_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable TK_LIB_SPEC will be set to the value # of TK_BUILD_LIB_SPEC. An extension should make use of TK_LIB_SPEC # instead of TK_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. if test -f "${TK_BIN_DIR}/Makefile" ; then TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}" TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}" TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}" elif test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use the libraries # from the framework at the given location so that linking works # against Tk.framework installed in an arbitrary location. case ${TK_DEFS} in *TK_FRAMEWORK*) if test -f "${TK_BIN_DIR}/${TK_LIB_FILE}"; then for i in "`cd "${TK_BIN_DIR}"; pwd`" \ "`cd "${TK_BIN_DIR}"/../..; pwd`"; do if test "`basename "$i"`" = "${TK_LIB_FILE}.framework"; then TK_LIB_SPEC="-F`dirname "$i" | sed -e 's/ /\\\\ /g'` -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then TK_STUB_LIB_SPEC="-L` echo "${TK_BIN_DIR}" | sed -e 's/ /\\\\ /g'` ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; esac fi # TEA specific: Ensure windowingsystem is defined if test "${TEA_PLATFORM}" = "unix" ; then case ${TK_DEFS} in *MAC_OSX_TK*) AC_DEFINE(MAC_OSX_TK, 1, [Are we building against Mac OS X TkAqua?]) TEA_WINDOWINGSYSTEM="aqua" ;; *) TEA_WINDOWINGSYSTEM="x11" ;; esac elif test "${TEA_PLATFORM}" = "windows" ; then TEA_WINDOWINGSYSTEM="win32" fi AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) AC_SUBST(TK_SRC_DIR) AC_SUBST(TK_LIB_FILE) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) AC_SUBST(TK_STUB_LIB_FILE) AC_SUBST(TK_STUB_LIB_FLAG) AC_SUBST(TK_STUB_LIB_SPEC) # TEA specific: AC_SUBST(TK_LIBS) AC_SUBST(TK_XINCLUDES) ]) #------------------------------------------------------------------------ # TEA_PROG_TCLSH # Determine the fully qualified path name of the tclsh executable # in the Tcl build directory or the tclsh installed in a bin # directory. This macro will correctly determine the name # of the tclsh executable even if tclsh has not yet been # built in the build directory. The tclsh found is always # associated with a tclConfig.sh file. This tclsh should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments: # none # # Results: # Substitutes the following vars: # TCLSH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_TCLSH], [ AC_MSG_CHECKING([for tclsh]) if test -f "${TCL_BIN_DIR}/Makefile" ; then # tclConfig.sh is in Tcl build directory if test "${TEA_PLATFORM}" = "windows"; then if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" fi else TCLSH_PROG="${TCL_BIN_DIR}/tclsh" fi else # tclConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" else TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}" fi list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TCL_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${TCLSH_PROG}" ; then REAL_TCL_BIN_DIR="`cd "$i"; pwd`/" break fi done TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}" fi AC_MSG_RESULT([${TCLSH_PROG}]) AC_SUBST(TCLSH_PROG) ]) #------------------------------------------------------------------------ # TEA_PROG_WISH # Determine the fully qualified path name of the wish executable # in the Tk build directory or the wish installed in a bin # directory. This macro will correctly determine the name # of the wish executable even if wish has not yet been # built in the build directory. The wish found is always # associated with a tkConfig.sh file. This wish should be used # only for running extension test cases. It should never be # or generation of files (like pkgIndex.tcl) at build time. # # Arguments: # none # # Results: # Substitutes the following vars: # WISH_PROG #------------------------------------------------------------------------ AC_DEFUN([TEA_PROG_WISH], [ AC_MSG_CHECKING([for wish]) if test -f "${TK_BIN_DIR}/Makefile" ; then # tkConfig.sh is in Tk build directory if test "${TEA_PLATFORM}" = "windows"; then if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}" elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" fi else WISH_PROG="${TK_BIN_DIR}/wish" fi else # tkConfig.sh is in install location if test "${TEA_PLATFORM}" = "windows"; then WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" else WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}" fi list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \ `ls -d ${TK_PREFIX}/bin 2>/dev/null`" for i in $list ; do if test -f "$i/${WISH_PROG}" ; then REAL_TK_BIN_DIR="`cd "$i"; pwd`/" break fi done WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}" fi AC_MSG_RESULT([${WISH_PROG}]) AC_SUBST(WISH_PROG) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SHARED -- # # Allows the building of shared libraries # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-shared=yes|no # --enable-stubs=yes|no # # Defines the following vars: # STATIC_BUILD Used for building import/export libraries # on Windows. # # Sets the following vars: # SHARED_BUILD Value of 1 or 0 # STUBS_BUILD Value if 1 or 0 # USE_TCL_STUBS Value true: if SHARED_BUILD or --enable-stubs # USE_TCLOO_STUBS Value true: if SHARED_BUILD or --enable-stubs # USE_TK_STUBS Value true: if SHARED_BUILD or --enable-stubs # AND TEA_WINDOWING_SYSTEM != "" #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SHARED], [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, AS_HELP_STRING([--enable-shared], [build and link with shared libraries (default: on)]), [shared_ok=$enableval], [shared_ok=yes]) if test "${enable_shared+set}" = set; then enableval="$enable_shared" shared_ok=$enableval else shared_ok=yes fi AC_ARG_ENABLE(stubs, AS_HELP_STRING([--enable-stubs], [build and link with stub libraries. Always true for shared builds (default: on)]), [stubs_ok=$enableval], [stubs_ok=yes]) if test "${enable_stubs+set}" = set; then enableval="$enable_stubs" stubs_ok=$enableval else stubs_ok=yes fi # Stubs are always enabled for shared builds if test "$shared_ok" = "yes" ; then AC_MSG_RESULT([shared]) SHARED_BUILD=1 STUBS_BUILD=1 else AC_MSG_RESULT([static]) SHARED_BUILD=0 AC_DEFINE(STATIC_BUILD, 1, [This a static build]) if test "$stubs_ok" = "yes" ; then STUBS_BUILD=1 else STUBS_BUILD=0 fi fi if test "${STUBS_BUILD}" = "1" ; then AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs]) AC_DEFINE(USE_TCLOO_STUBS, 1, [Use TclOO stubs]) if test "${TEA_WINDOWINGSYSTEM}" != ""; then AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs]) fi fi AC_SUBST(SHARED_BUILD) AC_SUBST(STUBS_BUILD) ]) #------------------------------------------------------------------------ # TEA_ENABLE_THREADS -- # # Specify if thread support should be enabled. If "yes" is specified # as an arg (optional), threads are enabled by default, "no" means # threads are disabled. "yes" is the default. # # TCL_THREADS is checked so that if you are compiling an extension # against a threaded core, your extension must be compiled threaded # as well. # # Note that it is legal to have a thread enabled extension run in a # threaded or non-threaded Tcl core, but a non-threaded extension may # only run in a non-threaded Tcl core. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-threads # # Sets the following vars: # THREADS_LIBS Thread library(s) # # Defines the following vars: # TCL_THREADS # _REENTRANT # _THREAD_SAFE #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_THREADS], [ AC_ARG_ENABLE(threads, AS_HELP_STRING([--enable-threads], [build with threads (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_threads+set}" = set; then enableval="$enable_threads" tcl_ok=$enableval else tcl_ok=yes fi if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then TCL_THREADS=1 if test "${TEA_PLATFORM}" != "windows" ; then # We are always OK on Windows, so check what this platform wants: # USE_THREAD_ALLOC tells us to try the special thread-based # allocator that significantly reduces lock contention AC_DEFINE(USE_THREAD_ALLOC, 1, [Do we want to use the threaded memory allocator?]) AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) if test "`uname -s`" = "SunOS" ; then AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) fi AC_DEFINE(_THREAD_SAFE, 1, [Do we want the thread-safe OS API?]) AC_CHECK_LIB(pthread,pthread_mutex_init,tcl_ok=yes,tcl_ok=no) if test "$tcl_ok" = "no"; then # Check a little harder for __pthread_mutex_init in the same # library, as some systems hide it there until pthread.h is # defined. We could alternatively do an AC_TRY_COMPILE with # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] AC_CHECK_LIB(pthread, __pthread_mutex_init, tcl_ok=yes, tcl_ok=no) fi if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthread" else AC_CHECK_LIB(pthreads, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -lpthreads" else AC_CHECK_LIB(c, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "no"; then AC_CHECK_LIB(c_r, pthread_mutex_init, tcl_ok=yes, tcl_ok=no) if test "$tcl_ok" = "yes"; then # The space is needed THREADS_LIBS=" -pthread" else TCL_THREADS=0 AC_MSG_WARN([Do not know how to find pthread lib on your system - thread support disabled]) fi fi fi fi fi else TCL_THREADS=0 fi # Do checking message here to not mess up interleaved configure output AC_MSG_CHECKING([for building with threads]) if test "${TCL_THREADS}" = 1; then AC_DEFINE(TCL_THREADS, 1, [Are we building with threads enabled?]) AC_MSG_RESULT([yes (default)]) else AC_MSG_RESULT([no]) fi # TCL_THREADS sanity checking. See if our request for building with # threads is the same as the way Tcl was built. If not, warn the user. case ${TCL_DEFS} in *THREADS=1*) if test "${TCL_THREADS}" = "0"; then AC_MSG_WARN([ Building ${PACKAGE_NAME} without threads enabled, but building against Tcl that IS thread-enabled. It is recommended to use --enable-threads.]) fi ;; esac AC_SUBST(TCL_THREADS) ]) #------------------------------------------------------------------------ # TEA_ENABLE_SYMBOLS -- # # Specify if debugging symbols should be used. # Memory (TCL_MEM_DEBUG) debugging can also be enabled. # # Arguments: # none # # TEA varies from core Tcl in that C|LDFLAGS_DEFAULT receives # the value of C|LDFLAGS_OPTIMIZE|DEBUG already substituted. # Requires the following vars to be set in the Makefile: # CFLAGS_DEFAULT # LDFLAGS_DEFAULT # # Results: # # Adds the following arguments to configure: # --enable-symbols # # Defines the following vars: # CFLAGS_DEFAULT Sets to $(CFLAGS_DEBUG) if true # Sets to "$(CFLAGS_OPTIMIZE) -DNDEBUG" if false # LDFLAGS_DEFAULT Sets to $(LDFLAGS_DEBUG) if true # Sets to $(LDFLAGS_OPTIMIZE) if false #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_SYMBOLS], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_CONFIG_CFLAGS]) AC_MSG_CHECKING([for build with symbols]) AC_ARG_ENABLE(symbols, AS_HELP_STRING([--enable-symbols], [build with debugging symbols (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "no"; then CFLAGS_DEFAULT="${CFLAGS_OPTIMIZE} -DNDEBUG" LDFLAGS_DEFAULT="${LDFLAGS_OPTIMIZE}" AC_MSG_RESULT([no]) AC_DEFINE(TCL_CFG_OPTIMIZED, 1, [Is this an optimized build?]) else CFLAGS_DEFAULT="${CFLAGS_DEBUG}" LDFLAGS_DEFAULT="${LDFLAGS_DEBUG}" if test "$tcl_ok" = "yes"; then AC_MSG_RESULT([yes (standard debugging)]) fi fi AC_SUBST(CFLAGS_DEFAULT) AC_SUBST(LDFLAGS_DEFAULT) if test "$tcl_ok" = "mem" -o "$tcl_ok" = "all"; then AC_DEFINE(TCL_MEM_DEBUG, 1, [Is memory debugging enabled?]) fi if test "$tcl_ok" != "yes" -a "$tcl_ok" != "no"; then if test "$tcl_ok" = "all"; then AC_MSG_RESULT([enabled symbols mem debugging]) else AC_MSG_RESULT([enabled $tcl_ok debugging]) fi fi ]) #------------------------------------------------------------------------ # TEA_ENABLE_LANGINFO -- # # Allows use of modern nl_langinfo check for better l10n. # This is only relevant for Unix. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --enable-langinfo=yes|no (default is yes) # # Defines the following vars: # HAVE_LANGINFO Triggers use of nl_langinfo if defined. #------------------------------------------------------------------------ AC_DEFUN([TEA_ENABLE_LANGINFO], [ AC_ARG_ENABLE(langinfo, AS_HELP_STRING([--enable-langinfo], [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 if test "$langinfo_ok" = "yes"; then AC_CHECK_HEADER(langinfo.h,[langinfo_ok=yes],[langinfo_ok=no]) fi AC_MSG_CHECKING([whether to use nl_langinfo]) if test "$langinfo_ok" = "yes"; then AC_CACHE_VAL(tcl_cv_langinfo_h, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[nl_langinfo(CODESET);]])], [tcl_cv_langinfo_h=yes],[tcl_cv_langinfo_h=no])]) AC_MSG_RESULT([$tcl_cv_langinfo_h]) if test $tcl_cv_langinfo_h = yes; then AC_DEFINE(HAVE_LANGINFO, 1, [Do we have nl_langinfo()?]) fi else AC_MSG_RESULT([$langinfo_ok]) fi ]) #-------------------------------------------------------------------- # TEA_CONFIG_SYSTEM # # Determine what the system is (some things cannot be easily checked # on a feature-driven basis, alas). This can usually be done via the # "uname" command. # # Arguments: # none # # Results: # Defines the following var: # # system - System/platform/version identification code. # #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_SYSTEM], [ AC_CACHE_CHECK([system version], tcl_cv_sys_version, [ # TEA specific: if test "${TEA_PLATFORM}" = "windows" ; then tcl_cv_sys_version=windows else tcl_cv_sys_version=`uname -s`-`uname -r` if test "$?" -ne 0 ; then AC_MSG_WARN([can't find uname command]) tcl_cv_sys_version=unknown else if test "`uname -s`" = "AIX" ; then tcl_cv_sys_version=AIX-`uname -v`.`uname -r` fi if test "`uname -s`" = "NetBSD" -a -f /etc/debian_version ; then tcl_cv_sys_version=NetBSD-Debian fi fi fi ]) system=$tcl_cv_sys_version ]) #-------------------------------------------------------------------- # TEA_CONFIG_CFLAGS # # Try to determine the proper flags to pass to the compiler # for building shared libraries and other such nonsense. # # Arguments: # none # # Results: # # Defines and substitutes the following vars: # # DL_OBJS, DL_LIBS - removed for TEA, only needed by core. # LDFLAGS - Flags to pass to the compiler when linking object # files into an executable application binary such # as tclsh. # LD_SEARCH_FLAGS-Flags to pass to ld, such as "-R /usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. Could # be the same as CC_SEARCH_FLAGS if ${CC} is used to link. # CC_SEARCH_FLAGS-Flags to pass to ${CC}, such as "-Wl,-rpath,/usr/local/tcl/lib", # that tell the run-time dynamic linker where to look # for shared libraries such as libtcl.so. Depends on # the variable LIB_RUNTIME_DIR in the Makefile. # SHLIB_CFLAGS - Flags to pass to cc when compiling the components # of a shared library (may request position-independent # code, among other things). # SHLIB_LD - Base command to use for combining object files # into a shared library. # SHLIB_LD_LIBS - Dependent libraries for the linker to scan when # creating shared libraries. This symbol typically # goes at the end of the "ld" commands that build # shared libraries. The value of the symbol defaults to # "${LIBS}" if all of the dependent libraries should # be specified when creating a shared library. If # dependent libraries should not be specified (as on # SunOS 4.x, where they cause the link to fail, or in # general if Tcl and Tk aren't themselves shared # libraries), then this symbol has an empty string # as its value. # SHLIB_SUFFIX - Suffix to use for the names of dynamically loadable # extensions. An empty string means we don't know how # to use shared libraries on this platform. # LIB_SUFFIX - Specifies everything that comes after the "libfoo" # in a static or shared library name, using the $PACKAGE_VERSION variable # to put the version in the right place. This is used # by platforms that need non-standard library names. # Examples: ${PACKAGE_VERSION}.so.1.1 on NetBSD, since it needs # to have a version after the .so, and ${PACKAGE_VERSION}.a # on AIX, since a shared library needs to have # a .a extension whereas shared objects for loadable # extensions have a .so extension. Defaults to # ${PACKAGE_VERSION}${SHLIB_SUFFIX}. # CFLAGS_DEBUG - # Flags used when running the compiler in debug mode # CFLAGS_OPTIMIZE - # Flags used when running the compiler in optimize mode # CFLAGS - Additional CFLAGS added as necessary (usually 64-bit) #-------------------------------------------------------------------- AC_DEFUN([TEA_CONFIG_CFLAGS], [ dnl TEA specific: Make sure we are initialized AC_REQUIRE([TEA_INIT]) # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) AC_ARG_ENABLE(64bit, AS_HELP_STRING([--enable-64bit], [enable 64bit support (default: off)]), [do64bit=$enableval], [do64bit=no]) AC_MSG_RESULT([$do64bit]) # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) AC_ARG_ENABLE(64bit-vis, AS_HELP_STRING([--enable-64bit-vis], [enable 64bit Sparc VIS support (default: off)]), [do64bitVIS=$enableval], [do64bitVIS=no]) AC_MSG_RESULT([$do64bitVIS]) # Force 64bit on with VIS AS_IF([test "$do64bitVIS" = "yes"], [do64bit=yes]) # Step 0.c: Check if visibility support is available. Do this here so # that platform specific alternatives can be used below if this fails. AC_CACHE_CHECK([if compiler supports visibility "hidden"], tcl_cv_cc_visibility_hidden, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Werror" AC_LINK_IFELSE([AC_LANG_PROGRAM([[ extern __attribute__((__visibility__("hidden"))) void f(void); void f(void) {}]], [[f();]])],[tcl_cv_cc_visibility_hidden=yes], [tcl_cv_cc_visibility_hidden=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_visibility_hidden = yes], [ AC_DEFINE(MODULE_SCOPE, [extern __attribute__((__visibility__("hidden")))], [Compiler support for module scope symbols]) AC_DEFINE(HAVE_HIDDEN, [1], [Compiler support for module scope symbols]) ]) # Step 0.d: Disable -rpath support? AC_MSG_CHECKING([if rpath support is requested]) AC_ARG_ENABLE(rpath, AS_HELP_STRING([--disable-rpath], [disable rpath support (default: on)]), [doRpath=$enableval], [doRpath=yes]) AC_MSG_RESULT([$doRpath]) # Set the variable "system" to hold the name and version number # for the system. TEA_CONFIG_SYSTEM # Require ranlib early so we can override it in special cases below. AC_REQUIRE([AC_PROG_RANLIB]) # Set configuration options based on system name and version. # This is similar to Tcl's unix/tcl.m4 except that we've added a # "windows" case and removed some core-only vars. do64bit_ok=no # default to '{$LIBS}' and set to "" on per-platform necessary basis SHLIB_LD_LIBS='${LIBS}' # When ld needs options to work in 64-bit mode, put them in # LDFLAGS_ARCH so they eventually end up in LDFLAGS even if [load] # is disabled by the user. [Bug 1016796] LDFLAGS_ARCH="" UNSHARED_LIB_SUFFIX="" # TEA specific: use PACKAGE_VERSION instead of VERSION TCL_TRIM_DOTS='`echo ${PACKAGE_VERSION} | tr -d .`' ECHO_VERSION='`echo ${PACKAGE_VERSION}`' TCL_LIB_VERSIONS_OK=ok CFLAGS_DEBUG=-g AS_IF([test "$GCC" = yes], [ CFLAGS_OPTIMIZE=-O2 CFLAGS_WARNING="-Wall" ], [ CFLAGS_OPTIMIZE=-O CFLAGS_WARNING="" ]) AC_CHECK_TOOL(AR, ar) STLIB_LD='${AR} cr' LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH" AS_IF([test "x$SHLIB_VERSION" = x],[SHLIB_VERSION=""],[SHLIB_VERSION=".$SHLIB_VERSION"]) case $system in # TEA specific: windows) MACHINE="X86" if test "$do64bit" != "no" ; then case "$do64bit" in amd64|x64|yes) MACHINE="AMD64" ; # default to AMD64 64-bit build ;; arm64|aarch64) MACHINE="ARM64" ;; ia64) MACHINE="IA64" ;; esac do64bit_ok=yes fi if test "$GCC" != "yes" ; then if test "${SHARED_BUILD}" = "0" ; then runtime=-MT else runtime=-MD fi case "x`echo \${VisualStudioVersion}`" in x1[[4-9]]*) lflags="${lflags} -nodefaultlib:ucrt.lib" TEA_ADD_LIBS([ucrt.lib]) ;; *) ;; esac if test "$do64bit" != "no" ; then CC="cl.exe" RC="rc.exe" lflags="${lflags} -nologo -MACHINE:${MACHINE} " LINKBIN="link.exe" CFLAGS_DEBUG="-nologo -Zi -Od -W3 ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" # Avoid 'unresolved external symbol __security_cookie' # errors, c.f. http://support.microsoft.com/?id=894573 TEA_ADD_LIBS([bufferoverflowU.lib]) else RC="rc" lflags="${lflags} -nologo" LINKBIN="link" CFLAGS_DEBUG="-nologo -Z7 -Od -W3 -WX ${runtime}d" CFLAGS_OPTIMIZE="-nologo -O2 -W2 ${runtime}" fi fi if test "$GCC" = "yes"; then # mingw gcc mode AC_CHECK_TOOL(RC, windres) CFLAGS_DEBUG="-g" CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" SHLIB_LD='${CC} -shared' UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' LDFLAGS_CONSOLE="-wl,--subsystem,console ${lflags}" LDFLAGS_WINDOW="-wl,--subsystem,windows ${lflags}" AC_CACHE_CHECK(for cross-compile version of gcc, ac_cv_cross, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #ifdef _WIN32 #error cross-compiler #endif ]], [[]])], [ac_cv_cross=yes], [ac_cv_cross=no]) ) if test "$ac_cv_cross" = "yes"; then case "$do64bit" in amd64|x64|yes) CC="x86_64-w64-mingw32-${CC}" LD="x86_64-w64-mingw32-ld" AR="x86_64-w64-mingw32-ar" RANLIB="x86_64-w64-mingw32-ranlib" RC="x86_64-w64-mingw32-windres" ;; arm64|aarch64) CC="aarch64-w64-mingw32-clang" LD="aarch64-w64-mingw32-ld" AR="aarch64-w64-mingw32-ar" RANLIB="aarch64-w64-mingw32-ranlib" RC="aarch64-w64-mingw32-windres" ;; *) CC="i686-w64-mingw32-${CC}" LD="i686-w64-mingw32-ld" AR="i686-w64-mingw32-ar" RANLIB="i686-w64-mingw32-ranlib" RC="i686-w64-mingw32-windres" ;; esac fi else SHLIB_LD="${LINKBIN} -dll ${lflags}" # link -lib only works when -lib is the first arg STLIB_LD="${LINKBIN} -lib ${lflags}" UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.lib' PATHTYPE=-w # For information on what debugtype is most useful, see: # http://msdn.microsoft.com/library/en-us/dnvc60/html/gendepdebug.asp # and also # http://msdn2.microsoft.com/en-us/library/y0zzbyt4%28VS.80%29.aspx # This essentially turns it all on. LDFLAGS_DEBUG="-debug -debugtype:cv" LDFLAGS_OPTIMIZE="-release" LDFLAGS_CONSOLE="-link -subsystem:console ${lflags}" LDFLAGS_WINDOW="-link -subsystem:windows ${lflags}" fi SHLIB_SUFFIX=".dll" SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.dll' TCL_LIB_VERSIONS_OK=nodots ;; AIX-*) AS_IF([test "$GCC" != "yes"], [ # AIX requires the _r compiler when gcc isn't being used case "${CC}" in *_r|*_r\ *) # ok ... ;; *) # Make sure only first arg gets _r CC=`echo "$CC" | sed -e 's/^\([[^ ]]*\)/\1_r/'` ;; esac AC_MSG_RESULT([Using $CC for compiling with threads]) ]) LIBS="$LIBS -lc" SHLIB_CFLAGS="" SHLIB_SUFFIX=".so" LD_LIBRARY_PATH_VAR="LIBPATH" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported with GCC on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -q64" LDFLAGS_ARCH="-q64" RANLIB="${RANLIB} -X64" AR="${AR} -X64" SHLIB_LD_FLAGS="-b64" ]) ]) AS_IF([test "`uname -m`" = ia64], [ # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC SHLIB_LD="/usr/ccs/bin/ld -G -z text" AS_IF([test "$GCC" = yes], [ CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' ], [ CC_SEARCH_FLAGS='"-R${LIB_RUNTIME_DIR}"' ]) LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' ], [ AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared -Wl,-bexpall' ], [ SHLIB_LD="/bin/ld -bhalt:4 -bM:SRE -bexpall -H512 -T512 -bnoentry" LDFLAGS="$LDFLAGS -brtl" ]) SHLIB_LD="${SHLIB_LD} ${SHLIB_LD_FLAGS}" CC_SEARCH_FLAGS='"-L${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) ;; BeOS*) SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} -nostart' SHLIB_SUFFIX=".so" #----------------------------------------------------------- # Check for inet_ntoa in -lbind, for BeOS (which also needs # -lsocket, even if the network functions are in -lnet which # is always linked to, for compatibility. #----------------------------------------------------------- AC_CHECK_LIB(bind, inet_ntoa, [LIBS="$LIBS -lbind -lsocket"]) ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" SHLIB_LD="shlicc -r" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; BSD/OS-4.*) SHLIB_CFLAGS="-export-dynamic -fPIC" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; CYGWIN_*|MINGW32_*|MINGW64_*|MSYS_*) SHLIB_CFLAGS="" SHLIB_LD='${CC} -shared' SHLIB_SUFFIX=".dll" if test "${TEA_PLATFORM}" = "unix" -a "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$(patsubst cyg%.dll,lib%.dll,\$[@]).a" else SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--out-implib,\$[@].a" fi EXEEXT=".exe" do64bit_ok=yes CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; dgux*) SHLIB_CFLAGS="-K PIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; Haiku*) LDFLAGS="$LDFLAGS -Wl,--export-dynamic" SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS} -shared' AC_CHECK_LIB(network, inet_ntoa, [LIBS="$LIBS -lnetwork"]) ;; HP-UX-*.11.*) # Use updated header definitions where possible AC_DEFINE(_XOPEN_SOURCE_EXTENDED, 1, [Do we want to use the XOPEN network library?]) # TEA specific: Needed by Tcl, but not most extensions #AC_DEFINE(_XOPEN_SOURCE, 1, [Do we want to use the XOPEN network library?]) #LIBS="$LIBS -lxnet" # Use the XOPEN network library AS_IF([test "`uname -m`" = ia64], [ SHLIB_SUFFIX=".so" ], [ SHLIB_SUFFIX=".sl" ]) AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ], [ CFLAGS="$CFLAGS -z" ]) # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = "yes"], [ AS_IF([test "$GCC" = yes], [ case `${CC} -dumpmachine` in hppa64*) # 64-bit gcc in use. Fix flags for GNU ld. do64bit_ok=yes SHLIB_LD='${CC} -shared' AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ;; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]) ;; esac ], [ do64bit_ok=yes CFLAGS="$CFLAGS +DD64" LDFLAGS_ARCH="+DD64" ]) ]) ;; HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" AC_CHECK_LIB(dld, shl_load, tcl_ok=yes, tcl_ok=no) AS_IF([test "$tcl_ok" = yes], [ SHLIB_CFLAGS="+z" SHLIB_LD="ld -b" SHLIB_LD_LIBS="" LDFLAGS="$LDFLAGS -Wl,-E" CC_SEARCH_FLAGS='"-Wl,+s,+b,${LIB_RUNTIME_DIR}:."' LD_SEARCH_FLAGS='+s +b "${LIB_RUNTIME_DIR}:."' LD_LIBRARY_PATH_VAR="SHLIB_PATH" ]) ;; IRIX-5.*) SHLIB_CFLAGS="" SHLIB_LD="ld -shared -rdata_shared" SHLIB_SUFFIX=".so" AC_LIBOBJ(mkstemp) AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) ;; IRIX-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) AS_IF([test "$GCC" = yes], [ CFLAGS="$CFLAGS -mabi=n32" LDFLAGS="$LDFLAGS -mabi=n32" ], [ case $system in IRIX-6.3) # Use to build 6.2 compatible binaries on 6.3. CFLAGS="$CFLAGS -n32 -D_OLD_TERMIOS" ;; *) CFLAGS="$CFLAGS -n32" ;; esac LDFLAGS="$LDFLAGS -n32" ]) ;; IRIX64-6.*) SHLIB_CFLAGS="" SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_SUFFIX=".so" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath "${LIB_RUNTIME_DIR}"']) # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ AS_IF([test "$GCC" = yes], [ AC_MSG_WARN([64bit mode not supported by gcc]) ], [ do64bit_ok=yes SHLIB_LD="ld -64 -shared -rdata_shared" CFLAGS="$CFLAGS -64" LDFLAGS_ARCH="-64" ]) ]) ;; Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" # TEA specific: CFLAGS_OPTIMIZE="-O2 -fomit-frame-pointer" # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} ${CFLAGS} ${LDFLAGS_DEFAULT} -shared' LDFLAGS="$LDFLAGS -Wl,--export-dynamic" case $system in DragonFly-*|FreeBSD-*) AS_IF([test "${TCL_THREADS}" = "1"], [ # The -pthread needs to go in the LDFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS $PTHREAD_CFLAGS" LDFLAGS="$LDFLAGS $PTHREAD_LIBS"]) ;; esac AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "`uname -m`" = "alpha"], [CFLAGS="$CFLAGS -mieee"]) AS_IF([test $do64bit = yes], [ AC_CACHE_CHECK([if compiler accepts -m64 flag], tcl_cv_cc_m64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -m64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_m64=yes],[tcl_cv_cc_m64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_m64 = yes], [ CFLAGS="$CFLAGS -m64" do64bit_ok=yes ]) ]) # The combo of gcc + glibc has a bug related to inlining of # functions like strtod(). The -fno-builtin flag should address # this problem but it does not work. The -fno-inline flag is kind # of overkill but it works. Disable inlining only when one of the # files in compat/*.c is being linked in. AS_IF([test x"${USE_COMPAT}" != x],[CFLAGS="$CFLAGS -fno-inline"]) ;; Lynx*) SHLIB_CFLAGS="-fPIC" SHLIB_SUFFIX=".so" CFLAGS_OPTIMIZE=-02 SHLIB_LD='${CC} -shared' LD_FLAGS="-Wl,--export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) ;; OpenBSD-*) arch=`arch -s` case "$arch" in alpha|sparc64) SHLIB_CFLAGS="-fPIC" ;; *) SHLIB_CFLAGS="-fpic" ;; esac SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} SHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.so${SHLIB_VERSION}' LDFLAGS="$LDFLAGS -Wl,-export-dynamic" CFLAGS_OPTIMIZE="-O2" # On OpenBSD: Compile with -pthread # Don't link with -lpthread LIBS=`echo $LIBS | sed s/-lpthread//` CFLAGS="$CFLAGS -pthread" # OpenBSD doesn't do version numbers with dots. UNSHARED_LIB_SUFFIX='${TCL_TRIM_DOTS}.a' TCL_LIB_VERSIONS_OK=nodots ;; NetBSD-*) # NetBSD has ELF and can use 'cc -shared' to build shared libs SHLIB_CFLAGS="-fPIC" SHLIB_LD='${CC} ${SHLIB_CFLAGS} -shared' SHLIB_SUFFIX=".so" LDFLAGS="$LDFLAGS -export-dynamic" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"']) LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} # The -pthread needs to go in the CFLAGS, not LIBS LIBS=`echo $LIBS | sed s/-pthread//` CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ;; Darwin-*) CFLAGS_OPTIMIZE="-Os" SHLIB_CFLAGS="-fno-common" # To avoid discrepancies between what headers configure sees during # preprocessing tests and compiling tests, move any -isysroot and # -mmacosx-version-min flags from CFLAGS to CPPFLAGS: CPPFLAGS="${CPPFLAGS} `echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if ([$]i~/^(isysroot|mmacosx-version-min)/) print "-"[$]i}'`" CFLAGS="`echo " ${CFLAGS}" | \ awk 'BEGIN {FS=" +-";ORS=" "}; {for (i=2;i<=NF;i++) \ if (!([$]i~/^(isysroot|mmacosx-version-min)/)) print "-"[$]i}'`" AS_IF([test $do64bit = yes], [ case `arch` in ppc) AC_CACHE_CHECK([if compiler accepts -arch ppc64 flag], tcl_cv_cc_arch_ppc64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_arch_ppc64=yes],[tcl_cv_cc_arch_ppc64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_ppc64 = yes], [ CFLAGS="$CFLAGS -arch ppc64 -mpowerpc64 -mcpu=G5" do64bit_ok=yes ]);; i386) AC_CACHE_CHECK([if compiler accepts -arch x86_64 flag], tcl_cv_cc_arch_x86_64, [ hold_cflags=$CFLAGS CFLAGS="$CFLAGS -arch x86_64" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [tcl_cv_cc_arch_x86_64=yes],[tcl_cv_cc_arch_x86_64=no]) CFLAGS=$hold_cflags]) AS_IF([test $tcl_cv_cc_arch_x86_64 = yes], [ CFLAGS="$CFLAGS -arch x86_64" do64bit_ok=yes ]);; *) AC_MSG_WARN([Don't know how enable 64-bit on architecture `arch`]);; esac ], [ # Check for combined 32-bit and 64-bit fat build AS_IF([echo "$CFLAGS " |grep -E -q -- '-arch (ppc64|x86_64) ' \ && echo "$CFLAGS " |grep -E -q -- '-arch (ppc|i386) '], [ fat_32_64=yes]) ]) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -dynamiclib ${CFLAGS} ${LDFLAGS_DEFAULT}' # TEA specific: link shlib with current and compatibility version flags vers=`echo ${PACKAGE_VERSION} | sed -e 's/^\([[0-9]]\{1,5\}\)\(\(\.[[0-9]]\{1,3\}\)\{0,2\}\).*$/\1\2/p' -e d` SHLIB_LD="${SHLIB_LD} -current_version ${vers:-0} -compatibility_version ${vers:-0}" SHLIB_SUFFIX=".dylib" LDFLAGS="$LDFLAGS -headerpad_max_install_names" AC_CACHE_CHECK([if ld accepts -search_paths_first flag], tcl_cv_ld_search_paths_first, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [tcl_cv_ld_search_paths_first=yes],[tcl_cv_ld_search_paths_first=no]) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_search_paths_first = yes], [ LDFLAGS="$LDFLAGS -Wl,-search_paths_first" ]) AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ AC_DEFINE(MODULE_SCOPE, [__private_extern__], [Compiler support for module scope symbols]) tcl_cv_cc_visibility_hidden=yes ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" LD_LIBRARY_PATH_VAR="DYLD_LIBRARY_PATH" # TEA specific: for combined 32 & 64 bit fat builds of Tk # extensions, verify that 64-bit build is possible. AS_IF([test "$fat_32_64" = yes && test -n "${TK_BIN_DIR}"], [ AS_IF([test "${TEA_WINDOWINGSYSTEM}" = x11], [ AC_CACHE_CHECK([for 64-bit X11], tcl_cv_lib_x11_64, [ for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -I/usr/X11R6/include" LDFLAGS="$LDFLAGS -L/usr/X11R6/lib -lX11" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[XrmInitialize();]])], [tcl_cv_lib_x11_64=yes],[tcl_cv_lib_x11_64=no]) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done]) ]) AS_IF([test "${TEA_WINDOWINGSYSTEM}" = aqua], [ AC_CACHE_CHECK([for 64-bit Tk], tcl_cv_lib_tk_64, [ for v in CFLAGS CPPFLAGS LDFLAGS; do eval 'hold_'$v'="$'$v'";'$v'="`echo "$'$v' "|sed -e "s/-arch ppc / /g" -e "s/-arch i386 / /g"`"' done CPPFLAGS="$CPPFLAGS -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 ${TCL_INCLUDES} ${TK_INCLUDES}" LDFLAGS="$LDFLAGS ${TCL_STUB_LIB_SPEC} ${TK_STUB_LIB_SPEC}" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[Tk_InitStubs(NULL, "", 0);]])], [tcl_cv_lib_tk_64=yes],[tcl_cv_lib_tk_64=no]) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="$hold_'$v'"' done]) ]) # remove 64-bit arch flags from CFLAGS et al. if configuration # does not support 64-bit. AS_IF([test "$tcl_cv_lib_tk_64" = no -o "$tcl_cv_lib_x11_64" = no], [ AC_MSG_NOTICE([Removing 64-bit architectures from compiler & linker flags]) for v in CFLAGS CPPFLAGS LDFLAGS; do eval $v'="`echo "$'$v' "|sed -e "s/-arch ppc64 / /g" -e "s/-arch x86_64 / /g"`"' done]) ]) ;; OS/390-*) CFLAGS_OPTIMIZE="" # Optimizer is buggy AC_DEFINE(_OE_SOCKETS, 1, # needed in sys/socket.h [Should OS/390 do the right thing with sockets?]) ;; OSF1-V*) # Digital OSF/1 SHLIB_CFLAGS="" AS_IF([test "$SHARED_BUILD" = 1], [ SHLIB_LD='ld -shared -expect_unresolved "*"' ], [ SHLIB_LD='ld -non_shared -expect_unresolved "*"' ]) SHLIB_SUFFIX=".so" AS_IF([test $doRpath = yes], [ CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}']) AS_IF([test "$GCC" = yes], [CFLAGS="$CFLAGS -mieee"], [ CFLAGS="$CFLAGS -DHAVE_TZSET -std1 -ieee"]) # see pthread_intro(3) for pthread support on osf1, k.furukawa CFLAGS="$CFLAGS -DHAVE_PTHREAD_ATTR_SETSTACKSIZE" CFLAGS="$CFLAGS -DTCL_THREAD_STACK_MIN=PTHREAD_STACK_MIN*64" LIBS=`echo $LIBS | sed s/-lpthreads//` AS_IF([test "$GCC" = yes], [ LIBS="$LIBS -lpthread -lmach -lexc" ], [ CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -pthread" ]) ;; QNX-6*) # QNX RTP # This may work for all QNX, but it was only reported for v6. SHLIB_CFLAGS="-fPIC" SHLIB_LD="ld -Bshareable -x" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SCO_SV-3.2*) AS_IF([test "$GCC" = yes], [ SHLIB_CFLAGS="-fPIC -melf" LDFLAGS="$LDFLAGS -melf -Wl,-Bexport" ], [ SHLIB_CFLAGS="-Kpic -belf" LDFLAGS="$LDFLAGS -belf -Wl,-Bexport" ]) SHLIB_LD="ld -G" SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; SunOS-5.[[0-6]]) # Careful to not let 5.10+ fall into this case # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" SHLIB_SUFFIX=".so" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ], [ SHLIB_LD="/usr/ccs/bin/ld -G -z text" CC_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} ]) ;; SunOS-5*) # Note: If _REENTRANT isn't defined, then Solaris # won't define thread-safe library routines. AC_DEFINE(_REENTRANT, 1, [Do we want the reentrant OS API?]) AC_DEFINE(_POSIX_PTHREAD_SEMANTICS, 1, [Do we really want to follow the standard? Yes we do!]) SHLIB_CFLAGS="-KPIC" # Check to enable 64-bit flags for compiler/linker AS_IF([test "$do64bit" = yes], [ arch=`isainfo` AS_IF([test "$arch" = "sparcv9 sparc"], [ AS_IF([test "$GCC" = yes], [ AS_IF([test "`${CC} -dumpversion | awk -F. '{print [$]1}'`" -lt 3], [ AC_MSG_WARN([64bit mode not supported with GCC < 3.2 on $system]) ], [ do64bit_ok=yes CFLAGS="$CFLAGS -m64 -mcpu=v9" LDFLAGS="$LDFLAGS -m64 -mcpu=v9" SHLIB_CFLAGS="-fPIC" ]) ], [ do64bit_ok=yes AS_IF([test "$do64bitVIS" = yes], [ CFLAGS="$CFLAGS -xarch=v9a" LDFLAGS_ARCH="-xarch=v9a" ], [ CFLAGS="$CFLAGS -xarch=v9" LDFLAGS_ARCH="-xarch=v9" ]) # Solaris 64 uses this as well #LD_LIBRARY_PATH_VAR="LD_LIBRARY_PATH_64" ]) ], [AS_IF([test "$arch" = "amd64 i386"], [ AS_IF([test "$GCC" = yes], [ case $system in SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) do64bit_ok=yes CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) AC_MSG_WARN([64bit mode not supported with GCC on $system]);; esac ], [ do64bit_ok=yes case $system in SunOS-5.1[[1-9]]*|SunOS-5.[[2-9]][[0-9]]*) CFLAGS="$CFLAGS -m64" LDFLAGS="$LDFLAGS -m64";; *) CFLAGS="$CFLAGS -xarch=amd64" LDFLAGS="$LDFLAGS -xarch=amd64";; esac ]) ], [AC_MSG_WARN([64bit mode not supported for $arch])])]) ]) SHLIB_SUFFIX=".so" AS_IF([test "$GCC" = yes], [ SHLIB_LD='${CC} -shared' CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} AS_IF([test "$do64bit_ok" = yes], [ AS_IF([test "$arch" = "sparcv9 sparc"], [ # We need to specify -static-libgcc or we need to # add the path to the sparv9 libgcc. # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -mcpu=v9 -static-libgcc" # for finding sparcv9 libgcc, get the regular libgcc # path, remove so name and append 'sparcv9' #v9gcclibdir="`gcc -print-file-name=libgcc_s.so` | ..." #CC_SEARCH_FLAGS="${CC_SEARCH_FLAGS},-R,$v9gcclibdir" ], [AS_IF([test "$arch" = "amd64 i386"], [ # JH: static-libgcc is necessary for core Tcl, but may # not be necessary for extensions. SHLIB_LD="$SHLIB_LD -m64 -static-libgcc" ])]) ]) ], [ case $system in SunOS-5.[[1-9]][[0-9]]*) # TEA specific: use LDFLAGS_DEFAULT instead of LDFLAGS SHLIB_LD='${CC} -G -z text ${LDFLAGS_DEFAULT}';; *) SHLIB_LD='/usr/ccs/bin/ld -G -z text';; esac CC_SEARCH_FLAGS='"-Wl,-R,${LIB_RUNTIME_DIR}"' LD_SEARCH_FLAGS='-R "${LIB_RUNTIME_DIR}"' ]) ;; UNIX_SV* | UnixWare-5*) SHLIB_CFLAGS="-KPIC" SHLIB_LD='${CC} -G' SHLIB_LD_LIBS="" SHLIB_SUFFIX=".so" # Some UNIX_SV* systems (unixware 1.1.2 for example) have linkers # that don't grok the -Bexport option. Test that it does. AC_CACHE_CHECK([for ld accepts -Bexport flag], tcl_cv_ld_Bexport, [ hold_ldflags=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-Bexport" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])], [tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no]) LDFLAGS=$hold_ldflags]) AS_IF([test $tcl_cv_ld_Bexport = yes], [ LDFLAGS="$LDFLAGS -Wl,-Bexport" ]) CC_SEARCH_FLAGS="" LD_SEARCH_FLAGS="" ;; esac AS_IF([test "$do64bit" = yes -a "$do64bit_ok" = no], [ AC_MSG_WARN([64bit support being disabled -- don't know magic for this platform]) ]) dnl # Add any CPPFLAGS set in the environment to our CFLAGS, but delay doing so dnl # until the end of configure, as configure's compile and link tests use dnl # both CPPFLAGS and CFLAGS (unlike our compile and link) but configure's dnl # preprocessing tests use only CPPFLAGS. AC_CONFIG_COMMANDS_PRE([CFLAGS="${CFLAGS} ${CPPFLAGS}"; CPPFLAGS=""]) # Add in the arch flags late to ensure it wasn't removed. # Not necessary in TEA, but this is aligned with core LDFLAGS="$LDFLAGS $LDFLAGS_ARCH" # If we're running gcc, then change the C flags for compiling shared # libraries to the right flags for gcc, instead of those for the # standard manufacturer compiler. AS_IF([test "$GCC" = yes], [ case $system in AIX-*) ;; BSD/OS*) ;; CYGWIN_*|MINGW32_*|MINGW64_*|MSYS_*) ;; IRIX*) ;; NetBSD-*|DragonFly-*|FreeBSD-*|OpenBSD-*) ;; Darwin-*) ;; SCO_SV-3.2*) ;; windows) ;; *) SHLIB_CFLAGS="-fPIC" ;; esac]) AS_IF([test "$tcl_cv_cc_visibility_hidden" != yes], [ AC_DEFINE(MODULE_SCOPE, [extern], [No Compiler support for module scope symbols]) ]) AS_IF([test "$SHARED_LIB_SUFFIX" = ""], [ # TEA specific: use PACKAGE_VERSION instead of VERSION SHARED_LIB_SUFFIX='${PACKAGE_VERSION}${SHLIB_SUFFIX}']) AS_IF([test "$UNSHARED_LIB_SUFFIX" = ""], [ # TEA specific: use PACKAGE_VERSION instead of VERSION UNSHARED_LIB_SUFFIX='${PACKAGE_VERSION}.a']) if test "${GCC}" = "yes" -a ${SHLIB_SUFFIX} = ".dll"; then AC_CACHE_CHECK(for SEH support in compiler, tcl_cv_seh, AC_RUN_IFELSE([AC_LANG_SOURCE([[ #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN int main(int argc, char** argv) { int a, b = 0; __try { a = 666 / b; } __except (EXCEPTION_EXECUTE_HANDLER) { return 0; } return 1; } ]])], [tcl_cv_seh=yes], [tcl_cv_seh=no], [tcl_cv_seh=no]) ) if test "$tcl_cv_seh" = "no" ; then AC_DEFINE(HAVE_NO_SEH, 1, [Defined when mingw does not support SEH]) fi # # Check to see if the excpt.h include file provided contains the # definition for EXCEPTION_DISPOSITION; if not, which is the case # with Cygwin's version as of 2002-04-10, define it to be int, # sufficient for getting the current code to work. # AC_CACHE_CHECK(for EXCEPTION_DISPOSITION support in include files, tcl_cv_eh_disposition, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ # define WIN32_LEAN_AND_MEAN # include # undef WIN32_LEAN_AND_MEAN ]], [[ EXCEPTION_DISPOSITION x; ]])], [tcl_cv_eh_disposition=yes], [tcl_cv_eh_disposition=no]) ) if test "$tcl_cv_eh_disposition" = "no" ; then AC_DEFINE(EXCEPTION_DISPOSITION, int, [Defined when cygwin/mingw does not support EXCEPTION DISPOSITION]) fi # Check to see if winnt.h defines CHAR, SHORT, and LONG # even if VOID has already been #defined. The win32api # used by mingw and cygwin is known to do this. AC_CACHE_CHECK(for winnt.h that ignores VOID define, tcl_cv_winnt_ignore_void, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #define VOID void #define WIN32_LEAN_AND_MEAN #include #undef WIN32_LEAN_AND_MEAN ]], [[ CHAR c; SHORT s; LONG l; ]])], [tcl_cv_winnt_ignore_void=yes], [tcl_cv_winnt_ignore_void=no]) ) if test "$tcl_cv_winnt_ignore_void" = "yes" ; then AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1, [Defined when cygwin/mingw ignores VOID define in winnt.h]) fi fi # See if the compiler supports casting to a union type. # This is used to stop gcc from printing a compiler # warning when initializing a union member. AC_CACHE_CHECK(for cast to union support, tcl_cv_cast_to_union, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ union foo { int i; double d; }; union foo f = (union foo) (int) 0; ]])], [tcl_cv_cast_to_union=yes], [tcl_cv_cast_to_union=no]) ) if test "$tcl_cv_cast_to_union" = "yes"; then AC_DEFINE(HAVE_CAST_TO_UNION, 1, [Defined when compiler supports casting to union type.]) fi AC_CHECK_HEADER(stdbool.h, [AC_DEFINE(HAVE_STDBOOL_H, 1, [Do we have ?])],) AC_SUBST(CFLAGS_DEBUG) AC_SUBST(CFLAGS_OPTIMIZE) AC_SUBST(CFLAGS_WARNING) AC_SUBST(LDFLAGS_DEBUG) AC_SUBST(LDFLAGS_OPTIMIZE) AC_SUBST(STLIB_LD) AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD_LIBS) AC_SUBST(SHLIB_CFLAGS) AC_SUBST(LD_LIBRARY_PATH_VAR) # These must be called after we do the basic CFLAGS checks and # verify any possible 64-bit or similar switches are necessary TEA_TCL_EARLY_FLAGS TEA_TCL_64BIT_FLAGS ]) #-------------------------------------------------------------------- # TEA_SERIAL_PORT # # Determine which interface to use to talk to the serial port. # Note that #include lines must begin in leftmost column for # some compilers to recognize them as preprocessor directives, # and some build environments have stdin not pointing at a # pseudo-terminal (usually /dev/null instead.) # # Arguments: # none # # Results: # # Defines only one of the following vars: # HAVE_SYS_MODEM_H # USE_TERMIOS # USE_TERMIO # USE_SGTTY #-------------------------------------------------------------------- AC_DEFUN([TEA_SERIAL_PORT], [ AC_CHECK_HEADERS(sys/modem.h) AC_CACHE_CHECK([termios vs. termio vs. sgtty], tcl_cv_api_serial, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { struct termios t; if (tcgetattr(0, &t) == 0) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) if test $tcl_cv_api_serial = no ; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) fi if test $tcl_cv_api_serial = no ; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) fi if test $tcl_cv_api_serial = no ; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { struct termios t; if (tcgetattr(0, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { cfsetospeed(&t, 0); t.c_cflag |= PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }]])],[tcl_cv_api_serial=termios],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) fi if test $tcl_cv_api_serial = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { struct termio t; if (ioctl(0, TCGETA, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.c_cflag |= CBAUD | PARENB | PARODD | CSIZE | CSTOPB; return 0; } return 1; }]])],[tcl_cv_api_serial=termio],[tcl_cv_api_serial=no],[tcl_cv_api_serial=no]) fi if test $tcl_cv_api_serial = no; then AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include #include int main() { struct sgttyb t; if (ioctl(0, TIOCGETP, &t) == 0 || errno == ENOTTY || errno == ENXIO || errno == EINVAL) { t.sg_ospeed = 0; t.sg_flags |= ODDP | EVENP | RAW; return 0; } return 1; }]])],[tcl_cv_api_serial=sgtty],[tcl_cv_api_serial=none],[tcl_cv_api_serial=none]) fi]) case $tcl_cv_api_serial in termios) AC_DEFINE(USE_TERMIOS, 1, [Use the termios API for serial lines]);; termio) AC_DEFINE(USE_TERMIO, 1, [Use the termio API for serial lines]);; sgtty) AC_DEFINE(USE_SGTTY, 1, [Use the sgtty API for serial lines]);; esac ]) #-------------------------------------------------------------------- # TEA_PATH_X # # Locate the X11 header files and the X11 library archive. Try # the ac_path_x macro first, but if it doesn't find the X stuff # (e.g. because there's no xmkmf program) then check through # a list of possible directories. Under some conditions the # autoconf macro will return an include directory that contains # no include files, so double-check its result just to be safe. # # This should be called after TEA_CONFIG_CFLAGS as setting the # LIBS line can confuse some configure macro magic. # # Arguments: # none # # Results: # # Sets the following vars: # XINCLUDES # XLIBSW # PKG_LIBS (appends to) #-------------------------------------------------------------------- AC_DEFUN([TEA_PATH_X], [ if test "${TEA_WINDOWINGSYSTEM}" = "x11" ; then TEA_PATH_UNIX_X fi ]) AC_DEFUN([TEA_PATH_UNIX_X], [ AC_PATH_X not_really_there="" if test "$no_x" = ""; then if test "$x_includes" = ""; then AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[],[not_really_there="yes"]) else if test ! -r $x_includes/X11/Xlib.h; then not_really_there="yes" fi fi fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then AC_MSG_CHECKING([for X11 header files]) found_xincludes="no" AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include ]])],[found_xincludes="yes"],[found_xincludes="no"]) if test "$found_xincludes" = "no"; then dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/X11R6/include /usr/X11R5/include /usr/include/X11R5 /usr/include/X11R4 /usr/openwin/include /usr/X11/include /usr/sww/include" for i in $dirs ; do if test -r $i/X11/Xlib.h; then AC_MSG_RESULT([$i]) XINCLUDES=" -I$i" found_xincludes="yes" break fi done fi else if test "$x_includes" != ""; then XINCLUDES="-I$x_includes" found_xincludes="yes" fi fi if test "$found_xincludes" = "no"; then AC_MSG_RESULT([couldn't find any!]) fi if test "$no_x" = yes; then AC_MSG_CHECKING([for X11 libraries]) XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do if test -r $i/libX11.a -o -r $i/libX11.so -o -r $i/libX11.sl -o -r $i/libX11.dylib; then AC_MSG_RESULT([$i]) XLIBSW="-L$i -lX11" x_libraries="$i" break fi done else if test "$x_libraries" = ""; then XLIBSW=-lX11 else XLIBSW="-L$x_libraries -lX11" fi fi if test "$XLIBSW" = nope ; then AC_CHECK_LIB(Xwindow, XCreateWindow, XLIBSW=-lXwindow) fi if test "$XLIBSW" = nope ; then AC_MSG_RESULT([could not find any! Using -lX11.]) XLIBSW=-lX11 fi # TEA specific: if test x"${XLIBSW}" != x ; then PKG_LIBS="${PKG_LIBS} ${XLIBSW}" fi ]) #-------------------------------------------------------------------- # TEA_BLOCKING_STYLE # # The statements below check for systems where POSIX-style # non-blocking I/O (O_NONBLOCK) doesn't work or is unimplemented. # On these systems (mostly older ones), use the old BSD-style # FIONBIO approach instead. # # Arguments: # none # # Results: # # Defines some of the following vars: # HAVE_SYS_IOCTL_H # HAVE_SYS_FILIO_H # USE_FIONBIO # O_NONBLOCK #-------------------------------------------------------------------- AC_DEFUN([TEA_BLOCKING_STYLE], [ AC_CHECK_HEADERS(sys/ioctl.h) AC_CHECK_HEADERS(sys/filio.h) TEA_CONFIG_SYSTEM AC_MSG_CHECKING([FIONBIO vs. O_NONBLOCK for nonblocking I/O]) case $system in OSF*) AC_DEFINE(USE_FIONBIO, 1, [Should we use FIONBIO?]) AC_MSG_RESULT([FIONBIO]) ;; *) AC_MSG_RESULT([O_NONBLOCK]) ;; esac ]) #-------------------------------------------------------------------- # TEA_TIME_HANDLER # # Checks how the system deals with time.h, what time structures # are used on the system, and what fields the structures have. # # Arguments: # none # # Results: # # Defines some of the following vars: # USE_DELTA_FOR_TZ # HAVE_TM_GMTOFF # HAVE_TM_TZADJ # HAVE_TIMEZONE_VAR # #-------------------------------------------------------------------- AC_DEFUN([TEA_TIME_HANDLER], [ AC_CHECK_HEADERS(sys/time.h) AC_HEADER_TIME AC_STRUCT_TIMEZONE AC_CHECK_FUNCS(gmtime_r localtime_r mktime) AC_CACHE_CHECK([tm_tzadj in struct tm], tcl_cv_member_tm_tzadj, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_tzadj;]])], [tcl_cv_member_tm_tzadj=yes], [tcl_cv_member_tm_tzadj=no])]) if test $tcl_cv_member_tm_tzadj = yes ; then AC_DEFINE(HAVE_TM_TZADJ, 1, [Should we use the tm_tzadj field of struct tm?]) fi AC_CACHE_CHECK([tm_gmtoff in struct tm], tcl_cv_member_tm_gmtoff, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct tm tm; (void)tm.tm_gmtoff;]])], [tcl_cv_member_tm_gmtoff=yes], [tcl_cv_member_tm_gmtoff=no])]) if test $tcl_cv_member_tm_gmtoff = yes ; then AC_DEFINE(HAVE_TM_GMTOFF, 1, [Should we use the tm_gmtoff field of struct tm?]) fi # # Its important to include time.h in this check, as some systems # (like convex) have timezone functions, etc. # AC_CACHE_CHECK([long timezone variable], tcl_cv_timezone_long, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[extern long timezone; timezone += 1; exit (0);]])], [tcl_cv_timezone_long=yes], [tcl_cv_timezone_long=no])]) if test $tcl_cv_timezone_long = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) else # # On some systems (eg IRIX 6.2), timezone is a time_t and not a long. # AC_CACHE_CHECK([time_t timezone variable], tcl_cv_timezone_time, [ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[extern time_t timezone; timezone += 1; exit (0);]])], [tcl_cv_timezone_time=yes], [tcl_cv_timezone_time=no])]) if test $tcl_cv_timezone_time = yes ; then AC_DEFINE(HAVE_TIMEZONE_VAR, 1, [Should we use the global timezone variable?]) fi fi ]) #-------------------------------------------------------------------- # TEA_BUGGY_STRTOD # # Under Solaris 2.4, strtod returns the wrong value for the # terminating character under some conditions. Check for this # and if the problem exists use a substitute procedure # "fixstrtod" (provided by Tcl) that corrects the error. # Also, on Compaq's Tru64 Unix 5.0, # strtod(" ") returns 0.0 instead of a failure to convert. # # Arguments: # none # # Results: # # Might defines some of the following vars: # strtod (=fixstrtod) #-------------------------------------------------------------------- AC_DEFUN([TEA_BUGGY_STRTOD], [ AC_CHECK_FUNC(strtod, tcl_strtod=1, tcl_strtod=0) if test "$tcl_strtod" = 1; then AC_CACHE_CHECK([for Solaris2.4/Tru64 strtod bugs], tcl_cv_strtod_buggy,[ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include extern double strtod(); int main() { char *infString="Inf", *nanString="NaN", *spaceString=" "; char *term; double value; value = strtod(infString, &term); if ((term != infString) && (term[-1] == 0)) { exit(1); } value = strtod(nanString, &term); if ((term != nanString) && (term[-1] == 0)) { exit(1); } value = strtod(spaceString, &term); if (term == (spaceString+1)) { exit(1); } exit(0); }]])], [tcl_cv_strtod_buggy=ok], [tcl_cv_strtod_buggy=buggy], [tcl_cv_strtod_buggy=buggy])]) if test "$tcl_cv_strtod_buggy" = buggy; then AC_LIBOBJ([fixstrtod]) USE_COMPAT=1 AC_DEFINE(strtod, fixstrtod, [Do we want to use the strtod() in compat?]) fi fi ]) #-------------------------------------------------------------------- # TEA_TCL_LINK_LIBS # # Search for the libraries needed to link the Tcl shell. # Things like the math library (-lm), socket stuff (-lsocket vs. # -lnsl), zlib (-lz) and libtommath (-ltommath) are dealt with here. # # Arguments: # None. # # Results: # # Might append to the following vars: # LIBS # MATH_LIBS # # Might define the following vars: # HAVE_NET_ERRNO_H # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_LINK_LIBS], [ #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. #-------------------------------------------------------------------- AC_CHECK_FUNC(sin, MATH_LIBS="", MATH_LIBS="-lm") #-------------------------------------------------------------------- # Interactive UNIX requires -linet instead of -lsocket, plus it # needs net/errno.h to define the socket-related error codes. #-------------------------------------------------------------------- AC_CHECK_LIB(inet, main, [LIBS="$LIBS -linet"]) AC_CHECK_HEADER(net/errno.h, [ AC_DEFINE(HAVE_NET_ERRNO_H, 1, [Do we have ?])]) #-------------------------------------------------------------------- # Check for the existence of the -lsocket and -lnsl libraries. # The order here is important, so that they end up in the right # order in the command line generated by make. Here are some # special considerations: # 1. Use "connect" and "accept" to check for -lsocket, and # "gethostbyname" to check for -lnsl. # 2. Use each function name only once: can't redo a check because # autoconf caches the results of the last check and won't redo it. # 3. Use -lnsl and -lsocket only if they supply procedures that # aren't already present in the normal libraries. This is because # IRIX 5.2 has libraries, but they aren't needed and they're # bogus: they goof up name resolution if used. # 4. On some SVR4 systems, can't use -lsocket without -lnsl too. # To get around this problem, check for both libraries together # if -lsocket doesn't work by itself. #-------------------------------------------------------------------- tcl_checkBoth=0 AC_CHECK_FUNC(connect, tcl_checkSocket=0, tcl_checkSocket=1) if test "$tcl_checkSocket" = 1; then AC_CHECK_FUNC(setsockopt, , [AC_CHECK_LIB(socket, setsockopt, LIBS="$LIBS -lsocket", tcl_checkBoth=1)]) fi if test "$tcl_checkBoth" = 1; then tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" AC_CHECK_FUNC(accept, tcl_checkNsl=0, [LIBS=$tk_oldLibs]) fi AC_CHECK_FUNC(gethostbyname, , [AC_CHECK_LIB(nsl, gethostbyname, [LIBS="$LIBS -lnsl"])]) AC_CHECK_FUNC(mp_log_u32, , [AC_CHECK_LIB(tommath, mp_log_u32, [LIBS="$LIBS -ltommath"])]) AC_CHECK_FUNC(deflateSetHeader, , [AC_CHECK_LIB(z, deflateSetHeader, [LIBS="$LIBS -lz"])]) ]) #-------------------------------------------------------------------- # TEA_TCL_EARLY_FLAGS # # Check for what flags are needed to be passed so the correct OS # features are available. # # Arguments: # None # # Results: # # Might define the following vars: # _ISOC99_SOURCE # _FILE_OFFSET_BITS # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_EARLY_FLAG],[ AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]), AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])], [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[ ]$2]], [[$3]])], [tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes, [tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)])) if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building]) tcl_flags="$tcl_flags $1" fi ]) AC_DEFUN([TEA_TCL_EARLY_FLAGS],[ AC_MSG_CHECKING([for required early compiler flags]) tcl_flags="" TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include ], [char *p = (char *)strtoll; char *q = (char *)strtoull;]) if test "${TCL_MAJOR_VERSION}" -ne 8 ; then TEA_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include ], [switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64) fi if test "x${tcl_flags}" = "x" ; then AC_MSG_RESULT([none]) else AC_MSG_RESULT([${tcl_flags}]) fi ]) #-------------------------------------------------------------------- # TEA_TCL_64BIT_FLAGS # # Check for what is defined in the way of 64-bit features. # # Arguments: # None # # Results: # # Might define the following vars: # TCL_WIDE_INT_IS_LONG # TCL_WIDE_INT_TYPE # HAVE_STRUCT_DIRENT64, HAVE_DIR64 # HAVE_STRUCT_STAT64 # HAVE_TYPE_OFF64_T # _TIME_BITS # #-------------------------------------------------------------------- AC_DEFUN([TEA_TCL_64BIT_FLAGS], [ AC_MSG_CHECKING([for 64-bit integer type]) AC_CACHE_VAL(tcl_cv_type_64bit,[ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[__int64 value = (__int64) 0;]])], [tcl_type_64bit=__int64],[tcl_type_64bit="long long"]) # See if we could use long anyway Note that we substitute in the # type that is our current guess for a 64-bit type inside this check # program, so it should be modified only carefully... AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) { case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ; }]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])]) if test "${tcl_cv_type_64bit}" = none ; then AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?]) AC_MSG_RESULT([yes]) elif test "${tcl_cv_type_64bit}" = "__int64" \ -a "${TEA_PLATFORM}" = "windows" ; then # TEA specific: We actually want to use the default tcl.h checks in # this case to handle both TCL_WIDE_INT_TYPE and TCL_LL_MODIFIER* AC_MSG_RESULT([using Tcl header defaults]) else AC_DEFINE_UNQUOTED(TCL_WIDE_INT_TYPE,${tcl_cv_type_64bit}, [What type should be used to define wide integers?]) AC_MSG_RESULT([${tcl_cv_type_64bit}]) # Now check for auxiliary declarations if test "${TCL_MAJOR_VERSION}" -ne 8 ; then AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], [tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])]) if test "x${tcl_cv_time_t_64}" = "xno" ; then # Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64 # which SC_TCL_EARLY_FLAGS has defined if necessary. AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64 #include ]], [[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])], [tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])]) if test "x${tcl_cv__time_bits}" = "xyes" ; then AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.]) fi fi fi AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct dirent64 p;]])], [tcl_cv_struct_dirent64=yes],[tcl_cv_struct_dirent64=no])]) if test "x${tcl_cv_struct_dirent64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_DIRENT64, 1, [Is 'struct dirent64' in ?]) fi AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[struct dirent64 *p; DIR64 d = opendir64("."); p = readdir64(d); rewinddir64(d); closedir64(d);]])], [tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])]) if test "x${tcl_cv_DIR64}" = "xyes" ; then AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in ?]) fi AC_CACHE_CHECK([for struct stat64], tcl_cv_struct_stat64,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct stat64 p; ]])], [tcl_cv_struct_stat64=yes], [tcl_cv_struct_stat64=no])]) if test "x${tcl_cv_struct_stat64}" = "xyes" ; then AC_DEFINE(HAVE_STRUCT_STAT64, 1, [Is 'struct stat64' in ?]) fi AC_CHECK_FUNCS(open64 lseek64) AC_MSG_CHECKING([for off64_t]) AC_CACHE_VAL(tcl_cv_type_off64_t,[ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[off64_t offset; ]])], [tcl_cv_type_off64_t=yes], [tcl_cv_type_off64_t=no])]) dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the dnl functions lseek64 and open64 are defined. if test "x${tcl_cv_type_off64_t}" = "xyes" && \ test "x${ac_cv_func_lseek64}" = "xyes" && \ test "x${ac_cv_func_open64}" = "xyes" ; then AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in ?]) AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi fi ]) ## ## Here ends the standard Tcl configuration bits and starts the ## TEA specific functions ## #------------------------------------------------------------------------ # TEA_INIT -- # # Init various Tcl Extension Architecture (TEA) variables. # This should be the first called TEA_* macro. # # Arguments: # none # # Results: # # Defines and substs the following vars: # CYGPATH # EXEEXT # Defines only: # TEA_VERSION # TEA_INITED # TEA_PLATFORM (windows or unix) # # "cygpath" is used on windows to generate native path names for include # files. These variables should only be used with the compiler and linker # since they generate native path names. # # EXEEXT # Select the executable extension based on the host type. This # is a lightweight replacement for AC_EXEEXT that doesn't require # a compiler. #------------------------------------------------------------------------ AC_DEFUN([TEA_INIT], [ TEA_VERSION="3.13" AC_MSG_CHECKING([TEA configuration]) if test x"${PACKAGE_NAME}" = x ; then AC_MSG_ERROR([ The PACKAGE_NAME variable must be defined by your TEA configure.ac]) fi AC_MSG_RESULT([ok (TEA ${TEA_VERSION})]) # If the user did not set CFLAGS, set it now to keep macros # like AC_PROG_CC and AC_TRY_COMPILE from adding "-g -O2". if test "${CFLAGS+set}" != "set" ; then CFLAGS="" fi case "`uname -s`" in *win32*|*WIN32*|*MINGW32_*|*MINGW64_*|*MSYS_*) AC_CHECK_PROG(CYGPATH, cygpath, cygpath -m, echo) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *CYGWIN_*) EXEEXT=".exe" # CYGPATH and TEA_PLATFORM are determined later in LOAD_TCLCONFIG ;; *) CYGPATH=echo # Maybe we are cross-compiling.... case ${host_alias} in *mingw32*) EXEEXT=".exe" TEA_PLATFORM="windows" ;; *) EXEEXT="" TEA_PLATFORM="unix" ;; esac ;; esac # Check if exec_prefix is set. If not use fall back to prefix. # Note when adjusted, so that TEA_PREFIX can correct for this. # This is needed for recursive configures, since autoconf propagates # $prefix, but not $exec_prefix (doh!). if test x$exec_prefix = xNONE ; then exec_prefix_default=yes exec_prefix=$prefix fi AC_MSG_NOTICE([configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}]) AC_SUBST(EXEEXT) AC_SUBST(CYGPATH) # This package name must be replaced statically for AC_SUBST to work AC_SUBST(PKG_LIB_FILE) AC_SUBST(PKG_LIB_FILE8) AC_SUBST(PKG_LIB_FILE9) # We AC_SUBST these here to ensure they are subst'ed, # in case the user doesn't call TEA_ADD_... AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) AC_SUBST(PKG_TCL_SOURCES) AC_SUBST(PKG_HEADERS) AC_SUBST(PKG_INCLUDES) AC_SUBST(PKG_LIBS) AC_SUBST(PKG_CFLAGS) # Configure the installer. TEA_INSTALLER ]) #------------------------------------------------------------------------ # TEA_ADD_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_SOURCES # PKG_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_SOURCES], [ vars="$@" for i in $vars; do case $i in [\$]*) # allow $-var names PKG_SOURCES="$PKG_SOURCES $i" PKG_OBJECTS="$PKG_OBJECTS $i" ;; *) # check for existence - allows for generic/win/unix VPATH # To add more dirs here (like 'src'), you have to update VPATH # in Makefile.in as well if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ -a ! -f "${srcdir}/macosx/$i" \ ; then AC_MSG_ERROR([could not find source file '$i']) fi PKG_SOURCES="$PKG_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_OBJECTS="$PKG_OBJECTS $j" ;; esac done AC_SUBST(PKG_SOURCES) AC_SUBST(PKG_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_STUB_SOURCES -- # # Specify one or more source files. Users should check for # the right platform before adding to their list. # It is not important to specify the directory, as long as it is # in the generic, win or unix subdirectory of $(srcdir). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_STUB_SOURCES # PKG_STUB_OBJECTS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_STUB_SOURCES], [ vars="$@" for i in $vars; do # check for existence - allows for generic/win/unix VPATH if test ! -f "${srcdir}/$i" -a ! -f "${srcdir}/generic/$i" \ -a ! -f "${srcdir}/win/$i" -a ! -f "${srcdir}/unix/$i" \ -a ! -f "${srcdir}/macosx/$i" \ ; then AC_MSG_ERROR([could not find stub source file '$i']) fi PKG_STUB_SOURCES="$PKG_STUB_SOURCES $i" # this assumes it is in a VPATH dir i=`basename $i` # handle user calling this before or after TEA_SETUP_COMPILER if test x"${OBJEXT}" != x ; then j="`echo $i | sed -e 's/\.[[^.]]*$//'`.${OBJEXT}" else j="`echo $i | sed -e 's/\.[[^.]]*$//'`.\${OBJEXT}" fi PKG_STUB_OBJECTS="$PKG_STUB_OBJECTS $j" done AC_SUBST(PKG_STUB_SOURCES) AC_SUBST(PKG_STUB_OBJECTS) ]) #------------------------------------------------------------------------ # TEA_ADD_TCL_SOURCES -- # # Specify one or more Tcl source files. These should be platform # independent runtime files. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_TCL_SOURCES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_TCL_SOURCES], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find tcl source file '${srcdir}/$i']) fi PKG_TCL_SOURCES="$PKG_TCL_SOURCES $i" done AC_SUBST(PKG_TCL_SOURCES) ]) #------------------------------------------------------------------------ # TEA_ADD_HEADERS -- # # Specify one or more source headers. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_HEADERS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_HEADERS], [ vars="$@" for i in $vars; do # check for existence, be strict because it is installed if test ! -f "${srcdir}/$i" ; then AC_MSG_ERROR([could not find header file '${srcdir}/$i']) fi PKG_HEADERS="$PKG_HEADERS $i" done AC_SUBST(PKG_HEADERS) ]) #------------------------------------------------------------------------ # TEA_ADD_INCLUDES -- # # Specify one or more include dirs. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_INCLUDES], [ vars="$@" for i in $vars; do PKG_INCLUDES="$PKG_INCLUDES $i" done AC_SUBST(PKG_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_ADD_LIBS -- # # Specify one or more libraries. Users should check for # the right platform before adding to their list. For Windows, # libraries provided in "foo.lib" format will be converted to # "-lfoo" when using GCC (mingw). # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_LIBS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_LIBS], [ vars="$@" for i in $vars; do if test "${TEA_PLATFORM}" = "windows" -a "$GCC" = "yes" ; then # Convert foo.lib to -lfoo for GCC. No-op if not *.lib i=`echo "$i" | sed -e 's/^\([[^-]].*\)\.[[lL]][[iI]][[bB]][$]/-l\1/'` fi PKG_LIBS="$PKG_LIBS $i" done AC_SUBST(PKG_LIBS) ]) #------------------------------------------------------------------------ # TEA_ADD_CFLAGS -- # # Specify one or more CFLAGS. Users should check for # the right platform before adding to their list. # # Arguments: # one or more file names # # Results: # # Defines and substs the following vars: # PKG_CFLAGS #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_CFLAGS], [ PKG_CFLAGS="$PKG_CFLAGS $@" AC_SUBST(PKG_CFLAGS) ]) #------------------------------------------------------------------------ # TEA_ADD_CLEANFILES -- # # Specify one or more CLEANFILES. # # Arguments: # one or more file names to clean target # # Results: # # Appends to CLEANFILES, already defined for subst in LOAD_TCLCONFIG #------------------------------------------------------------------------ AC_DEFUN([TEA_ADD_CLEANFILES], [ CLEANFILES="$CLEANFILES $@" ]) #------------------------------------------------------------------------ # TEA_PREFIX -- # # Handle the --prefix=... option by defaulting to what Tcl gave # # Arguments: # none # # Results: # # If --prefix or --exec-prefix was not specified, $prefix and # $exec_prefix will be set to the values given to Tcl when it was # configured. #------------------------------------------------------------------------ AC_DEFUN([TEA_PREFIX], [ if test "${prefix}" = "NONE"; then prefix_default=yes if test x"${TCL_PREFIX}" != x; then AC_MSG_NOTICE([--prefix defaulting to TCL_PREFIX ${TCL_PREFIX}]) prefix=${TCL_PREFIX} else AC_MSG_NOTICE([--prefix defaulting to /usr/local]) prefix=/usr/local fi fi if test "${exec_prefix}" = "NONE" -a x"${prefix_default}" = x"yes" \ -o x"${exec_prefix_default}" = x"yes" ; then if test x"${TCL_EXEC_PREFIX}" != x; then AC_MSG_NOTICE([--exec-prefix defaulting to TCL_EXEC_PREFIX ${TCL_EXEC_PREFIX}]) exec_prefix=${TCL_EXEC_PREFIX} else AC_MSG_NOTICE([--exec-prefix defaulting to ${prefix}]) exec_prefix=$prefix fi fi ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER_CC -- # # Do compiler checks the way we want. This is just a replacement # for AC_PROG_CC in TEA configure.ac files to make them cleaner. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER_CC], [ # Don't put any macros that use the compiler (e.g. AC_TRY_COMPILE) # in this macro, they need to go into TEA_SETUP_COMPILER instead. AC_PROG_CC AC_PROG_CPP #-------------------------------------------------------------------- # Checks to see if the make program sets the $MAKE variable. #-------------------------------------------------------------------- AC_PROG_MAKE_SET #-------------------------------------------------------------------- # Find ranlib #-------------------------------------------------------------------- AC_CHECK_TOOL(RANLIB, ranlib) #-------------------------------------------------------------------- # Determines the correct binary file extension (.o, .obj, .exe etc.) #-------------------------------------------------------------------- AC_OBJEXT AC_EXEEXT ]) #------------------------------------------------------------------------ # TEA_SETUP_COMPILER -- # # Do compiler checks that use the compiler. This must go after # TEA_SETUP_COMPILER_CC, which does the actual compiler check. # # Arguments: # none # # Results: # # Sets up CC var and other standard bits we need to make executables. #------------------------------------------------------------------------ AC_DEFUN([TEA_SETUP_COMPILER], [ # Any macros that use the compiler (e.g. AC_TRY_COMPILE) have to go here. AC_REQUIRE([TEA_SETUP_COMPILER_CC]) #------------------------------------------------------------------------ # If we're using GCC, see if the compiler understands -pipe. If so, use it. # It makes compiling go faster. (This is only a performance feature.) #------------------------------------------------------------------------ if test -z "$no_pipe" -a -n "$GCC"; then AC_CACHE_CHECK([if the compiler understands -pipe], tcl_cv_cc_pipe, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -pipe" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_cc_pipe=yes],[tcl_cv_cc_pipe=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_cc_pipe = yes; then CFLAGS="$CFLAGS -pipe" fi fi if test "${TCL_MAJOR_VERSION}" -lt 9 -a "${TCL_MINOR_VERSION}" -lt 7; then AC_DEFINE(Tcl_Size, int, [Is 'Tcl_Size' in ?]) fi #-------------------------------------------------------------------- # Common compiler flag setup #-------------------------------------------------------------------- AC_C_BIGENDIAN(,,,[#]) ]) #------------------------------------------------------------------------ # TEA_MAKE_LIB -- # # Generate a line that can be used to build a shared/unshared library # in a platform independent manner. # # Arguments: # none # # Requires: # # Results: # # Defines the following vars: # CFLAGS - Done late here to note disturb other AC macros # MAKE_LIB - Command to execute to build the Tcl library; # differs depending on whether or not Tcl is being # compiled as a shared library. # MAKE_SHARED_LIB Makefile rule for building a shared library # MAKE_STATIC_LIB Makefile rule for building a static library # MAKE_STUB_LIB Makefile rule for building a stub library # VC_MANIFEST_EMBED_DLL Makefile rule for embedded VC manifest in DLL # VC_MANIFEST_EMBED_EXE Makefile rule for embedded VC manifest in EXE #------------------------------------------------------------------------ AC_DEFUN([TEA_MAKE_LIB], [ if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes"; then MAKE_STATIC_LIB="\${STLIB_LD} -out:\[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -out:\[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" AC_EGREP_CPP([manifest needed], [ #if defined(_MSC_VER) && _MSC_VER >= 1400 print("manifest needed") #endif ], [ # Could do a CHECK_PROG for mt, but should always be with MSVC8+ VC_MANIFEST_EMBED_DLL="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;2 ; fi" VC_MANIFEST_EMBED_EXE="if test -f \[$]@.manifest ; then mt.exe -nologo -manifest \[$]@.manifest -outputresource:\[$]@\;1 ; fi" MAKE_SHARED_LIB="${MAKE_SHARED_LIB} ; ${VC_MANIFEST_EMBED_DLL}" TEA_ADD_CLEANFILES([*.manifest]) ]) MAKE_STUB_LIB="\${STLIB_LD} -nodefaultlib -out:\[$]@ \$(PKG_STUB_OBJECTS)" else MAKE_STATIC_LIB="\${STLIB_LD} \[$]@ \$(PKG_OBJECTS)" MAKE_SHARED_LIB="\${SHLIB_LD} \${LDFLAGS} \${LDFLAGS_DEFAULT} -o \[$]@ \$(PKG_OBJECTS) \${SHLIB_LD_LIBS}" MAKE_STUB_LIB="\${STLIB_LD} \[$]@ \$(PKG_STUB_OBJECTS)" fi if test "${SHARED_BUILD}" = "1" ; then MAKE_LIB="${MAKE_SHARED_LIB} " else MAKE_LIB="${MAKE_STATIC_LIB} " fi #-------------------------------------------------------------------- # Shared libraries and static libraries have different names. # Use the double eval to make sure any variables in the suffix is # substituted. (@@@ Might not be necessary anymore) #-------------------------------------------------------------------- if test "$TEA_PLATFORM" = "unix"; then PACKAGE_LIB_PREFIX8="lib" if test "$EXEEXT" = ".exe" -a "$SHARED_BUILD" != "0"; then PACKAGE_LIB_PREFIX9="cygtcl9" else PACKAGE_LIB_PREFIX9="libtcl9" fi else PACKAGE_LIB_PREFIX8="" PACKAGE_LIB_PREFIX9="tcl9" fi if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX9}" else PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX8}" AC_DEFINE(TCL_MAJOR_VERSION, 8, [Compile for Tcl8?]) AC_DEFINE(TK_MAJOR_VERSION, 8, [Compile for Tk8?]) fi if test "${TEA_PLATFORM}" = "windows" ; then if test "${SHARED_BUILD}" = "1" ; then # We force the unresolved linking of symbols that are really in # the private libraries of Tcl and Tk. if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TK_BIN_DIR}/${TK_STUB_LIB_FILE}`\"" fi SHLIB_LD_LIBS="${SHLIB_LD_LIBS} \"`${CYGPATH} ${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}`\"" if test "$GCC" = "yes"; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -static-libgcc" fi AC_CACHE_CHECK([if the linker understands --disable-high-entropy-va], tcl_cv_ld_high_entropy, [ hold_cflags=$CFLAGS; CFLAGS="$CFLAGS -Wl,--disable-high-entropy-va" AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[tcl_cv_ld_high_entropy=yes],[tcl_cv_ld_high_entropy=no]) CFLAGS=$hold_cflags]) if test $tcl_cv_ld_high_entropy = yes; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} -Wl,--disable-high-entropy-va" fi eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" else if test "$GCC" = "yes"; then PACKAGE_LIB_PREFIX=lib${PACKAGE_LIB_PREFIX} fi eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a" else eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi if test "$GCC" = "yes"; then PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE} fi # These aren't needed on Windows (either MSVC or gcc) RANLIB=: RANLIB_STUB=: else RANLIB_STUB="${RANLIB}" if test "${SHARED_BUILD}" = "1" ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TCL_STUB_LIB_SPEC}" if test x"${TK_BIN_DIR}" != x ; then SHLIB_LD_LIBS="${SHLIB_LD_LIBS} ${TK_STUB_LIB_SPEC}" fi eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}" RANLIB=: else eval eval "PKG_LIB_FILE8=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE9=${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}" fi # Some packages build their own stubs libraries if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a" else eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}" fi fi # These are escaped so that only CFLAGS is picked up at configure time. # The other values will be substituted at make time. CFLAGS="${CFLAGS} \${CFLAGS_DEFAULT} \${CFLAGS_WARNING}" if test "${SHARED_BUILD}" = "1" ; then CFLAGS="${CFLAGS} \${SHLIB_CFLAGS}" fi AC_SUBST(MAKE_LIB) AC_SUBST(MAKE_SHARED_LIB) AC_SUBST(MAKE_STATIC_LIB) AC_SUBST(MAKE_STUB_LIB) # Substitute STUB_LIB_FILE in case package creates a stub library too. AC_SUBST(PKG_STUB_LIB_FILE) AC_SUBST(RANLIB_STUB) AC_SUBST(VC_MANIFEST_EMBED_DLL) AC_SUBST(VC_MANIFEST_EMBED_EXE) ]) #------------------------------------------------------------------------ # TEA_LIB_SPEC -- # # Compute the name of an existing object library located in libdir # from the given base name and produce the appropriate linker flags. # # Arguments: # basename The base name of the library without version # numbers, extensions, or "lib" prefixes. # extra_dir Extra directory in which to search for the # library. This location is used first, then # $prefix/$exec-prefix, then some defaults. # # Requires: # TEA_INIT and TEA_PREFIX must be called first. # # Results: # # Defines the following vars: # ${basename}_LIB_NAME The computed library name. # ${basename}_LIB_SPEC The computed linker flags. #------------------------------------------------------------------------ AC_DEFUN([TEA_LIB_SPEC], [ AC_MSG_CHECKING([for $1 library]) # Look in exec-prefix for the library (defined by TEA_PREFIX). tea_lib_name_dir="${exec_prefix}/lib" # Or in a user-specified location. if test x"$2" != x ; then tea_extra_lib_dir=$2 else tea_extra_lib_dir=NONE fi for i in \ `ls -dr ${tea_extra_lib_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_extra_lib_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr ${tea_lib_name_dir}/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/lib64/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/lib64/lib$1[[0-9]]* 2>/dev/null ` \ `ls -dr /usr/local/lib/$1[[0-9]]*.lib 2>/dev/null ` \ `ls -dr /usr/local/lib/lib$1[[0-9]]* 2>/dev/null ` ; do if test -f "$i" ; then tea_lib_name_dir=`dirname $i` $1_LIB_NAME=`basename $i` $1_LIB_PATH_NAME=$i break fi done if test "${TEA_PLATFORM}" = "windows"; then $1_LIB_SPEC=\"`${CYGPATH} ${$1_LIB_PATH_NAME} 2>/dev/null`\" else # Strip off the leading "lib" and trailing ".a" or ".so" tea_lib_name_lib=`echo ${$1_LIB_NAME}|sed -e 's/^lib//' -e 's/\.[[^.]]*$//' -e 's/\.so.*//'` $1_LIB_SPEC="-L${tea_lib_name_dir} -l${tea_lib_name_lib}" fi if test "x${$1_LIB_NAME}" = x ; then AC_MSG_ERROR([not found]) else AC_MSG_RESULT([${$1_LIB_SPEC}]) fi ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TCL_HEADERS -- # # Locate the private Tcl include files # # Arguments: # # Requires: # TCL_SRC_DIR Assumes that TEA_LOAD_TCLCONFIG has # already been called. # # Results: # # Substitutes the following vars: # TCL_TOP_DIR_NATIVE # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [ # Allow for --with-tclinclude to take effect and define ${ac_cv_c_tclh} AC_REQUIRE([TEA_PUBLIC_TCL_HEADERS]) AC_MSG_CHECKING([for Tcl private include files]) TCL_SRC_DIR_NATIVE=`${CYGPATH} ${TCL_SRC_DIR}` TCL_TOP_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}\" # Check to see if tclPort.h isn't already with the public headers # Don't look for tclInt.h because that resides with tcl.h in the core # sources, but the Port headers are in a different directory if test "${TEA_PLATFORM}" = "windows" -a \ -f "${ac_cv_c_tclh}/tclWinPort.h"; then result="private headers found with public headers" elif test "${TEA_PLATFORM}" = "unix" -a \ -f "${ac_cv_c_tclh}/tclUnixPort.h"; then result="private headers found with public headers" else TCL_GENERIC_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/generic\" if test "${TEA_PLATFORM}" = "windows"; then TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/win\" else TCL_PLATFORM_DIR_NATIVE=\"${TCL_SRC_DIR_NATIVE}/unix\" fi # Overwrite the previous TCL_INCLUDES as this should capture both # public and private headers in the same set. # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TCL_DEFS} in *TCL_FRAMEWORK*) if test -d "${TCL_BIN_DIR}/Headers" -a \ -d "${TCL_BIN_DIR}/PrivateHeaders"; then TCL_INCLUDES="-I\"${TCL_BIN_DIR}/Headers\" -I\"${TCL_BIN_DIR}/PrivateHeaders\" ${TCL_INCLUDES}" else TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" fi ;; esac result="Using ${TCL_INCLUDES}" else if test ! -f "${TCL_SRC_DIR}/generic/tclInt.h" ; then AC_MSG_ERROR([Cannot find private header tclInt.h in ${TCL_SRC_DIR}]) fi result="Using srcdir found in tclConfig.sh: ${TCL_SRC_DIR}" fi fi AC_SUBST(TCL_TOP_DIR_NATIVE) AC_SUBST(TCL_INCLUDES) AC_MSG_RESULT([${result}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TCL_HEADERS -- # # Locate the installed public Tcl header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tclinclude switch to configure. # Result is cached. # # Substitutes the following vars: # TCL_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TCL_HEADERS], [ AC_MSG_CHECKING([for Tcl public headers]) AC_ARG_WITH(tclinclude, [ --with-tclinclude directory containing the public Tcl header files], with_tclinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tclh, [ # Use the value from --with-tclinclude, if it was given if test x"${with_tclinclude}" != x ; then if test -f "${with_tclinclude}/tcl.h" ; then ac_cv_c_tclh=${with_tclinclude} else AC_MSG_ERROR([${with_tclinclude} directory does not contain tcl.h]) fi else list="" if test "`uname -s`" = "Darwin"; then # If Tcl was built as a framework, attempt to use # the framework's Headers directory case ${TCL_DEFS} in *TCL_FRAMEWORK*) list="`ls -d ${TCL_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tcl is not installed, # and in that situation, look there before installed locations. if test -f "${TCL_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TCL_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TCL_INCLUDE_SPEC}" != x ; then d=`echo "${TCL_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tcl.h" ; then ac_cv_c_tclh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tclh}" = x ; then AC_MSG_ERROR([tcl.h not found. Please specify its location with --with-tclinclude]) else AC_MSG_RESULT([${ac_cv_c_tclh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tclh}` TCL_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TCL_INCLUDES) ]) #------------------------------------------------------------------------ # TEA_PRIVATE_TK_HEADERS -- # # Locate the private Tk include files # # Arguments: # # Requires: # TK_SRC_DIR Assumes that TEA_LOAD_TKCONFIG has # already been called. # # Results: # # Substitutes the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PRIVATE_TK_HEADERS], [ # Allow for --with-tkinclude to take effect and define ${ac_cv_c_tkh} AC_REQUIRE([TEA_PUBLIC_TK_HEADERS]) AC_MSG_CHECKING([for Tk private include files]) TK_SRC_DIR_NATIVE=`${CYGPATH} ${TK_SRC_DIR}` TK_TOP_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}\" # Check to see if tkPort.h isn't already with the public headers # Don't look for tkInt.h because that resides with tk.h in the core # sources, but the Port headers are in a different directory if test "${TEA_PLATFORM}" = "windows" -a \ -f "${ac_cv_c_tkh}/tkWinPort.h"; then result="private headers found with public headers" elif test "${TEA_PLATFORM}" = "unix" -a \ -f "${ac_cv_c_tkh}/tkUnixPort.h"; then result="private headers found with public headers" else TK_GENERIC_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/generic\" TK_XLIB_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/xlib\" if test "${TEA_PLATFORM}" = "windows"; then TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/win\" else TK_PLATFORM_DIR_NATIVE=\"${TK_SRC_DIR_NATIVE}/unix\" fi # Overwrite the previous TK_INCLUDES as this should capture both # public and private headers in the same set. # We want to ensure these are substituted so as not to require # any *_NATIVE vars be defined in the Makefile TK_INCLUDES="-I${TK_GENERIC_DIR_NATIVE} -I${TK_PLATFORM_DIR_NATIVE}" # Detect and add ttk subdir if test -d "${TK_SRC_DIR}/generic/ttk"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/generic/ttk\"" fi if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_XLIB_DIR_NATIVE}\"" fi if test "${TEA_WINDOWINGSYSTEM}" = "aqua"; then TK_INCLUDES="${TK_INCLUDES} -I\"${TK_SRC_DIR_NATIVE}/macosx\"" fi if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers and PrivateHeaders directories case ${TK_DEFS} in *TK_FRAMEWORK*) if test -d "${TK_BIN_DIR}/Headers" -a \ -d "${TK_BIN_DIR}/PrivateHeaders"; then TK_INCLUDES="-I\"${TK_BIN_DIR}/Headers\" -I\"${TK_BIN_DIR}/PrivateHeaders\" ${TK_INCLUDES}" else TK_INCLUDES="${TK_INCLUDES} ${TK_INCLUDE_SPEC} `echo "${TK_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`" fi ;; esac result="Using ${TK_INCLUDES}" else if test ! -f "${TK_SRC_DIR}/generic/tkInt.h" ; then AC_MSG_ERROR([Cannot find private header tkInt.h in ${TK_SRC_DIR}]) fi result="Using srcdir found in tkConfig.sh: ${TK_SRC_DIR}" fi fi AC_SUBST(TK_TOP_DIR_NATIVE) AC_SUBST(TK_XLIB_DIR_NATIVE) AC_SUBST(TK_INCLUDES) AC_MSG_RESULT([${result}]) ]) #------------------------------------------------------------------------ # TEA_PUBLIC_TK_HEADERS -- # # Locate the installed public Tk header files # # Arguments: # None. # # Requires: # CYGPATH must be set # # Results: # # Adds a --with-tkinclude switch to configure. # Result is cached. # # Substitutes the following vars: # TK_INCLUDES #------------------------------------------------------------------------ AC_DEFUN([TEA_PUBLIC_TK_HEADERS], [ AC_MSG_CHECKING([for Tk public headers]) AC_ARG_WITH(tkinclude, [ --with-tkinclude directory containing the public Tk header files], with_tkinclude=${withval}) AC_CACHE_VAL(ac_cv_c_tkh, [ # Use the value from --with-tkinclude, if it was given if test x"${with_tkinclude}" != x ; then if test -f "${with_tkinclude}/tk.h" ; then ac_cv_c_tkh=${with_tkinclude} else AC_MSG_ERROR([${with_tkinclude} directory does not contain tk.h]) fi else list="" if test "`uname -s`" = "Darwin"; then # If Tk was built as a framework, attempt to use # the framework's Headers directory. case ${TK_DEFS} in *TK_FRAMEWORK*) list="`ls -d ${TK_BIN_DIR}/Headers 2>/dev/null`" ;; esac fi # Look in the source dir only if Tk is not installed, # and in that situation, look there before installed locations. if test -f "${TK_BIN_DIR}/Makefile" ; then list="$list `ls -d ${TK_SRC_DIR}/generic 2>/dev/null`" fi # Check order: pkg --prefix location, Tk's --prefix location, # relative to directory of tkConfig.sh, Tcl's --prefix location, # relative to directory of tclConfig.sh. eval "temp_includedir=${includedir}" list="$list \ `ls -d ${temp_includedir} 2>/dev/null` \ `ls -d ${TK_PREFIX}/include 2>/dev/null` \ `ls -d ${TK_BIN_DIR}/../include 2>/dev/null` \ `ls -d ${TCL_PREFIX}/include 2>/dev/null` \ `ls -d ${TCL_BIN_DIR}/../include 2>/dev/null`" if test "${TEA_PLATFORM}" != "windows" -o "$GCC" = "yes"; then list="$list /usr/local/include /usr/include" if test x"${TK_INCLUDE_SPEC}" != x ; then d=`echo "${TK_INCLUDE_SPEC}" | sed -e 's/^-I//'` list="$list `ls -d ${d} 2>/dev/null`" fi fi for i in $list ; do if test -f "$i/tk.h" ; then ac_cv_c_tkh=$i break fi done fi ]) # Print a message based on how we determined the include path if test x"${ac_cv_c_tkh}" = x ; then AC_MSG_ERROR([tk.h not found. Please specify its location with --with-tkinclude]) else AC_MSG_RESULT([${ac_cv_c_tkh}]) fi # Convert to a native path and substitute into the output files. INCLUDE_DIR_NATIVE=`${CYGPATH} ${ac_cv_c_tkh}` TK_INCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_INCLUDES) if test "${TEA_WINDOWINGSYSTEM}" != "x11"; then # On Windows and Aqua, we need the X compat headers AC_MSG_CHECKING([for X11 header files]) if test ! -r "${INCLUDE_DIR_NATIVE}/X11/Xlib.h"; then INCLUDE_DIR_NATIVE="`${CYGPATH} ${TK_SRC_DIR}/xlib`" TK_XINCLUDES=-I\"${INCLUDE_DIR_NATIVE}\" AC_SUBST(TK_XINCLUDES) fi AC_MSG_RESULT([${INCLUDE_DIR_NATIVE}]) fi ]) #------------------------------------------------------------------------ # TEA_PATH_CONFIG -- # # Locate the ${1}Config.sh file and perform a sanity check on # the ${1} compile flags. These are used by packages like # [incr Tk] that load *Config.sh files from more than Tcl and Tk. # # Arguments: # none # # Results: # # Adds the following arguments to configure: # --with-$1=... # # Defines the following vars: # $1_BIN_DIR Full path to the directory containing # the $1Config.sh file #------------------------------------------------------------------------ AC_DEFUN([TEA_PATH_CONFIG], [ # # Ok, lets find the $1 configuration # First, look for one uninstalled. # the alternative search directory is invoked by --with-$1 # if test x"${no_$1}" = x ; then # we reset no_$1 in case something fails here no_$1=true AC_ARG_WITH($1, [ --with-$1 directory containing $1 configuration ($1Config.sh)], with_$1config=${withval}) AC_MSG_CHECKING([for $1 configuration]) AC_CACHE_VAL(ac_cv_c_$1config,[ # First check to see if --with-$1 was specified. if test x"${with_$1config}" != x ; then case ${with_$1config} in */$1Config.sh ) if test -f ${with_$1config}; then AC_MSG_WARN([--with-$1 argument should refer to directory containing $1Config.sh, not to $1Config.sh itself]) with_$1config=`echo ${with_$1config} | sed 's!/$1Config\.sh$!!'` fi;; esac if test -f "${with_$1config}/$1Config.sh" ; then ac_cv_c_$1config=`(cd ${with_$1config}; pwd)` else AC_MSG_ERROR([${with_$1config} directory doesn't contain $1Config.sh]) fi fi # then check for a private $1 installation if test x"${ac_cv_c_$1config}" = x ; then for i in \ ../$1 \ `ls -dr ../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../$1 \ `ls -dr ../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ../../../$1 \ `ls -dr ../../../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ${srcdir}/../$1 \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]*.[[0-9]]* 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]][[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../$1*[[0-9]].[[0-9]]* 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi if test -f "$i/unix/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i/unix; pwd)` break fi done fi # check in a few common install locations if test x"${ac_cv_c_$1config}" = x ; then for i in `ls -d ${libdir} 2>/dev/null` \ `ls -d ${exec_prefix}/lib 2>/dev/null` \ `ls -d ${prefix}/lib 2>/dev/null` \ `ls -d /usr/local/lib 2>/dev/null` \ `ls -d /usr/contrib/lib 2>/dev/null` \ `ls -d /usr/pkg/lib 2>/dev/null` \ `ls -d /usr/lib 2>/dev/null` \ `ls -d /usr/lib64 2>/dev/null` \ ; do if test -f "$i/$1Config.sh" ; then ac_cv_c_$1config=`(cd $i; pwd)` break fi done fi ]) if test x"${ac_cv_c_$1config}" = x ; then $1_BIN_DIR="# no $1 configs found" AC_MSG_WARN([Cannot find $1 configuration definitions]) exit 0 else no_$1= $1_BIN_DIR=${ac_cv_c_$1config} AC_MSG_RESULT([found $$1_BIN_DIR/$1Config.sh]) fi fi ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG -- # # Load the $1Config.sh file # # Arguments: # # Requires the following vars to be set: # $1_BIN_DIR # # Results: # # Substitutes the following vars: # $1_SRC_DIR # $1_LIB_FILE # $1_LIB_SPEC #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG], [ AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh]) if test -f "${$1_BIN_DIR}/$1Config.sh" ; then AC_MSG_RESULT([loading]) . "${$1_BIN_DIR}/$1Config.sh" else AC_MSG_RESULT([file not found]) fi # # If the $1_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. # For example, the variable $1_LIB_SPEC will be set to the value # of $1_BUILD_LIB_SPEC. An extension should make use of $1_LIB_SPEC # instead of $1_BUILD_LIB_SPEC since it will work with both an # installed and uninstalled version of Tcl. # if test -f "${$1_BIN_DIR}/Makefile" ; then AC_MSG_WARN([Found Makefile - using build library specs for $1]) $1_LIB_SPEC=${$1_BUILD_LIB_SPEC} $1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC} $1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH} $1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC} $1_LIBRARY_PATH=${$1_LIBRARY_PATH} fi AC_SUBST($1_VERSION) AC_SUBST($1_BIN_DIR) AC_SUBST($1_SRC_DIR) AC_SUBST($1_LIB_FILE) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_STUB_LIB_FILE) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_PATH) # Allow the caller to prevent this auto-check by specifying any 2nd arg AS_IF([test "x$2" = x], [ # Check both upper and lower-case variants # If a dev wanted non-stubs libs, this function could take an option # to not use _STUB in the paths below AS_IF([test "x${$1_STUB_LIB_SPEC}" = x], [TEA_LOAD_CONFIG_LIB(translit($1,[a-z],[A-Z])_STUB)], [TEA_LOAD_CONFIG_LIB($1_STUB)]) ]) ]) #------------------------------------------------------------------------ # TEA_LOAD_CONFIG_LIB -- # # Helper function to load correct library from another extension's # ${PACKAGE}Config.sh. # # Results: # Adds to LIBS the appropriate extension library #------------------------------------------------------------------------ AC_DEFUN([TEA_LOAD_CONFIG_LIB], [ AC_MSG_CHECKING([For $1 library for LIBS]) # This simplifies the use of stub libraries by automatically adding # the stub lib to your path. Normally this would add to SHLIB_LD_LIBS, # but this is called before CONFIG_CFLAGS. More importantly, this adds # to PKG_LIBS, which becomes LIBS, and that is only used by SHLIB_LD. if test "x${$1_LIB_SPEC}" != "x" ; then if test "${TEA_PLATFORM}" = "windows" -a "$GCC" != "yes" ; then TEA_ADD_LIBS([\"`${CYGPATH} ${$1_LIB_PATH}`\"]) AC_MSG_RESULT([using $1_LIB_PATH ${$1_LIB_PATH}]) else TEA_ADD_LIBS([${$1_LIB_SPEC}]) AC_MSG_RESULT([using $1_LIB_SPEC ${$1_LIB_SPEC}]) fi else AC_MSG_RESULT([file not found]) fi ]) #------------------------------------------------------------------------ # TEA_EXPORT_CONFIG -- # # Define the data to insert into the ${PACKAGE}Config.sh file # # Arguments: # # Requires the following vars to be set: # $1 # # Results: # Substitutes the following vars: #------------------------------------------------------------------------ AC_DEFUN([TEA_EXPORT_CONFIG], [ #-------------------------------------------------------------------- # These are for $1Config.sh #-------------------------------------------------------------------- # pkglibdir must be a fully qualified path and (not ${exec_prefix}/lib) eval pkglibdir="[$]{libdir}/$1${PACKAGE_VERSION}" if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then eval $1_LIB_FLAG="-l$1${PACKAGE_VERSION}" eval $1_STUB_LIB_FLAG="-l$1stub${PACKAGE_VERSION}" else eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`" eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`" fi if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then eval $1_STUB_LIB_FLAG="-l$1stub" fi $1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}" $1_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${$1_LIB_FLAG}" $1_BUILD_STUB_LIB_SPEC="-L`$CYGPATH $(pwd)` [$]{$1_STUB_LIB_FLAG}" $1_STUB_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` [$]{$1_STUB_LIB_FLAG}" $1_BUILD_STUB_LIB_PATH="`$CYGPATH $(pwd)`/[$]{PKG_STUB_LIB_FILE}" $1_STUB_LIB_PATH="`$CYGPATH ${pkglibdir}`/[$]{PKG_STUB_LIB_FILE}" AC_SUBST($1_BUILD_LIB_SPEC) AC_SUBST($1_LIB_SPEC) AC_SUBST($1_BUILD_STUB_LIB_SPEC) AC_SUBST($1_STUB_LIB_SPEC) AC_SUBST($1_BUILD_STUB_LIB_PATH) AC_SUBST($1_STUB_LIB_PATH) AC_SUBST(MAJOR_VERSION) AC_SUBST(MINOR_VERSION) AC_SUBST(PATCHLEVEL) ]) #------------------------------------------------------------------------ # TEA_INSTALLER -- # # Configure the installer. # # Arguments: # none # # Results: # Substitutes the following vars: # INSTALL # INSTALL_DATA_DIR # INSTALL_DATA # INSTALL_PROGRAM # INSTALL_SCRIPT # INSTALL_LIBRARY #------------------------------------------------------------------------ AC_DEFUN([TEA_INSTALLER], [ INSTALL='$(SHELL) $(top_srcdir)/tclconfig/install-sh -c' INSTALL_DATA_DIR='${INSTALL} -d -m 755' INSTALL_DATA='${INSTALL} -m 644' INSTALL_PROGRAM='${INSTALL} -m 755' INSTALL_SCRIPT='${INSTALL} -m 755' TEA_CONFIG_SYSTEM case $system in HP-UX-*) INSTALL_LIBRARY='${INSTALL} -m 755' ;; *) INSTALL_LIBRARY='${INSTALL} -m 644' ;; esac AC_SUBST(INSTALL) AC_SUBST(INSTALL_DATA_DIR) AC_SUBST(INSTALL_DATA) AC_SUBST(INSTALL_PROGRAM) AC_SUBST(INSTALL_SCRIPT) AC_SUBST(INSTALL_LIBRARY) ]) ### # Tip 430 - ZipFS Modifications ### #------------------------------------------------------------------------ # TEA_ZIPFS_SUPPORT # Locate a zip encoder installed on the system path, or none. # # Arguments: # none # # Results: # Substitutes the following vars: # MACHER_PROG # ZIP_PROG # ZIP_PROG_OPTIONS # ZIP_PROG_VFSSEARCH # ZIP_INSTALL_OBJS #------------------------------------------------------------------------ AC_DEFUN([TEA_ZIPFS_SUPPORT], [ MACHER_PROG="" ZIP_PROG="" ZIP_PROG_OPTIONS="" ZIP_PROG_VFSSEARCH="" ZIP_INSTALL_OBJS="" AC_MSG_CHECKING([for macher]) AC_CACHE_VAL(ac_cv_path_macher, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/macher 2> /dev/null` \ `ls -r $dir/macher 2> /dev/null` ; do if test x"$ac_cv_path_macher" = x ; then if test -f "$j" ; then ac_cv_path_macher=$j break fi fi done done ]) if test -f "$ac_cv_path_macher" ; then MACHER_PROG="$ac_cv_path_macher" AC_MSG_RESULT([$MACHER_PROG]) AC_MSG_RESULT([Found macher in environment]) fi AC_MSG_CHECKING([for zip]) AC_CACHE_VAL(ac_cv_path_zip, [ search_path=`echo ${PATH} | sed -e 's/:/ /g'` for dir in $search_path ; do for j in `ls -r $dir/zip 2> /dev/null` \ `ls -r $dir/zip 2> /dev/null` ; do if test x"$ac_cv_path_zip" = x ; then if test -f "$j" ; then ac_cv_path_zip=$j break fi fi done done ]) if test -f "$ac_cv_path_zip" ; then ZIP_PROG="$ac_cv_path_zip" AC_MSG_RESULT([$ZIP_PROG]) ZIP_PROG_OPTIONS="-rq" ZIP_PROG_VFSSEARCH="*" AC_MSG_RESULT([Found INFO Zip in environment]) # Use standard arguments for zip else # It is not an error if an installed version of Zip can't be located. # We can use the locally distributed minizip instead ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}" ZIP_PROG_OPTIONS="-o -r" ZIP_PROG_VFSSEARCH="*" ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}" AC_MSG_RESULT([No zip found on PATH. Building minizip]) fi AC_SUBST(MACHER_PROG) AC_SUBST(ZIP_PROG) AC_SUBST(ZIP_PROG_OPTIONS) AC_SUBST(ZIP_PROG_VFSSEARCH) AC_SUBST(ZIP_INSTALL_OBJS) ]) # Local Variables: # mode: autoconf # End: rivet-3.0.0/tests/cookies.rvt000664 001750 001750 00000000320 15224454746 016760 0ustar00manghimanghi000000 000000 rivet-3.0.0/tests/parseencoding.rvt000664 001750 001750 00000000075 15224454746 020154 0ustar00manghimanghi000000 000000 rivet-3.0.0/doc/images/word.png000664 001750 001750 00000000611 15224454746 017123 0ustar00manghimanghi000000 000000 PNG  IHDRf0gAMA asRGB cHRMz&u0`:pQ<PLTEBBB[ϕtRNS@fbKGD- pHYsHHFk>XIDAT% **,PxD6QPr0"T:&Ss'zN:i^;EjjN /y%tEXtdate:create2012-10-01T18:30:10+02:00k%tEXtdate:modify2004-02-19T05:50:53+01:00OS1IENDB`rivet-3.0.0/doc/html/rivet.css000644 001750 001750 00000017240 15224455137 017003 0ustar00manghimanghi000000 000000 BODY { font-family: verdana; background-color: #fbfcfc; } DIV.ABSTRACT { border: solid 2px; padding-left: 10pt; padding-right: 10pt; } PRE.SCREEN { font-family:monospace; white-space: pre; width: 100%; background-color: #ffffcc; border:solid; color: #000000; border-color: #009999; border-left: solid #009999 2px; border-right: solid #009999 2px; border-top: solid #009999 2px; border-bottom: solid #009999 2px; padding-left: 15pt; } PRE.PROGRAMLISTING { font-family: monospace; white-space: pre; width: 95%; background-color: #e8ecf2; border: solid; color: #000000; border-color: #a3b1bc; border-left: solid #a3b1bc 1px; border-right: solid #a3b1bc 1px; border-top: solid #a3b1bc 1px; border-bottom: solid #a3b1bc 1px; font-size: normal; padding-top: 1em; padding-left: 1em; padding-bottom: 1em; font-size: 0.9em; } H1 { color: #ffffff; border: solid 3px #1d252b; background-color: #a3b1bc; font-variant: small-caps; width: 100%; } H1.TITLE { color: #ffffff; border: solid 3px #1d252b; background-color: #a3b1bc; font-variant: small-caps; width: 100%; } .TITLE a { color: #ffffff; text-decoration: none; } .TITLE a:active { color: #ffffff; text-decoration: none; } .TITLE a:visited { color: #ffffff; text-decoration: none; } H2 { COLOR: #ffffff ; font-style: italic; border: solid 3px #1d252b; background-color: #a3b1bc; PADDING: 0.5em; } TABLE.IMPORTANT { font-style:italic; border: solid 2px #ff0000; width: 70%; margin-left: 15%; } TABLE.CAUTION { font-style:italic; border: ridge 2px #ffff00; width: 70%; margin-left: 15%; } TABLE.NOTE { font-style:italic; border: solid 1px #000000; width: 70%; margin-left: 15%; } TABLE.TIP { font-style:italic; border: solid 1px #000000; width: 70%; margin-left: 15%; } TABLE.WARNING { font-style:italic; font-weight: bold; border: ridge 4px #ff0000; width: 70%; margin-left: 15%; } DIV.VARIABLELIST { font-family: sans-serif; font-style: normal; font-weight: normal; padding-left: 20px; font-size: small; } .VARLISTENTRY { font-weight: bold; margin-top: 10px; color: #ffffff ; background-color: #e8ecf2; border: solid 1px #a3b1bc; padding: 1px } /* * See http://diveintoaccessibility.org/day_26_using_relative_font_sizes.html * for an explanation of the following few commands. * They are really too complicated to explain here in all depth. ;-) */ P { font-size: 12px; } /* A{ color: maroon; } A:visited { color: darkgreen; } */ BODY P { /* font-size: x-small; */ voice-family: "\"}\""; voice-family: inherit; font-size: normal; } HTML>BODY P { font-size: normal; } /* */ /* Add an external-link icon to absolute links */ a[href^="http:"] { background: url(images/remote.png) right center no-repeat; padding-right: 12px; } a[href^="http:"]:hover { background: url(images/remote.png) right center no-repeat; } /* Add a note icon to footnote links */ a[href^="#FTN"] { background: url(images/qbullet-note.png) right center no-repeat; padding-right: 12px; } a[href^="#FTN"]:hover { background: url(images/qbullet-note.png) right center no-repeat; } /* ...and a back icon to the backlinks in the footnotes themselves */ a[name^="FTN"] { background: url(images/scrollup.png) right center no-repeat; padding-right: 12px; } a[name^="FTN"]:hover { background: url(images/scrollup.png) right center no-repeat; } /* Add a download icon to .gz links */ a[href$=".gz"],a[href$=".tar"],a[href$=".zip"] { background: url(images/disk.png) right center no-repeat; padding-right: 12px; } /* Add an Acrobat Reader icon to PDF links */ a[href$=".pdf"] { background: url(images/acrobat.png) right center no-repeat; padding-right: 12px; } a[href$=".pdf"]:hover { background: url(images/acrobat.png) right center no-repeat; } /* Add a Word icon to RTF links */ a[href$=".rtf"] { background: url(images/word.png) right center no-repeat; padding-right: 12px; } /* ...but not to absolute links in this domain... */ a[href^="http://www.karakas-online.de"] { background: transparent; padding-right: 0px; } a[href^="http://www.karakas-online.de"]:hover { background: transparent; } /* ...or to the translation links on each page */ DIV.translatelink > a[href^="http:"] { background: transparent; padding-right: 0px; } DIV.translatelink > a[href^="http:"]:hover { background: transparent; } /* ...or to any images */ DIV.imagelink a[href^="http:"] { background: transparent; padding-right: 0px; } DIV.imagelink a[href^="http:"]:hover { background: transparent; } P.C2 { COLOR: #ffffff ; BACKGROUND-color: #a0a0d0; BORDER: solid 1px #606090; PADDING: 1px } DIV.NAVFOOTER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-top: 10px; width: 100%; border: 2px solid #a3b1bc; } DIV.NUKEFOOTER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-top: 10px; width: 100%; border: thin solid #a3b1bc; } DIV.NAVHEADER { color: #000000; background-color: #e8ecf2; padding: 5px; margin-bottom: 10px; width: 100%; border: 2px solid #a3b1bc; } DIV.SECT1,DIV.SECT2,DIV.SECT3 { margin-left: 20px; } DIV.EXAMPLE,DIV.TOC { border: thin dotted #4e5f6e; padding-left: 10px; padding-right: 10px; color: #000000; background-color: #e8ecf2; } DIV.EXAMPLE { border: thin dotted #22AA22; background-color: #EEE; } DIV.TOC { margin-left: 20px; margin-right: 20px; width: 95%; } UL { /* list-style: url("images/tux-bullet.png") disc; */ } .namespaces { border: 1px solid black; } .namespaces td { padding: 0.2em 1em; /* font-weight: bold; */ } .namespaces thead { background-color: #aaf; } .namespaces tr.init { background-color: #e88; } .namespaces tr.childinit { background-color: #eee; } .namespaces tr.processing { background-color: #e88; } .namespaces tr.childexit { background-color: #eee; } table.directives { border-collapse: collapse; } .directives thead { background-color: #bbf; font-size: 1em; text-decoration: none; } .directives thead td { padding: 8px; } .directives tbody tr > :first-child { background-color: #eee; padding-left: 2em; padding-right: 2em; text-align: left; } .directives tbody tr > :last-child { text-decoration: none; font-weight: normal; font-size: small; border-left: 1px solid black; text-align: left; } .directives tbody tr td { text-align: center; text-decoration: none; font-weight: normal; padding-left: 1em; padding-right: 1em; padding-bottom: 4px; padding-top: 4px; border-bottom: 1px solid black; } .note td { font-size: small; } li.listitem { font-size: small; } rivet-3.0.0/doc/html/with_binary_output.html000664 001750 001750 00000007560 15224455137 021773 0ustar00manghimanghi000000 000000 with_binary_output

    Name

    with_binary_output — evaluate a script while the response channel is configured for binary output.

    Synopsis

    ::rivet::with_binary_output script

    Description

    Flushes stdout, saves its channel configuration, configures it with -translation binary, and evaluates script. After flushing the binary output, the previous translation, encoding, and end-of-file character settings are restored. Restoration also takes place when the script returns an error or another non-standard Tcl completion code.

    Use this command to group multiple binary writes. Values written in the script must be byte-oriented Tcl values whose characters are in the range U+0000 through U+00FF. Text that is to form part of a binary protocol must first be converted explicitly, for example with encoding convertto utf-8.

    ::rivet::with_binary_output {
        puts -nonewline stdout $headerBytes
        puts -nonewline stdout $payloadBytes
    }
    [Note]Note
    This command is not placed in the export list of the ::rivet namespace
    rivet-3.0.0/doc/example.tcl000664 001750 001750 00000001742 15224454746 016342 0ustar00manghimanghi000000 000000 # we have complete access to the interpreter here, so it is best to # run per-page code in a namespace, just like we do with .rvt pages. proc getcode { filename } { set fl [ open $filename r ] set sourcecode [ read $fl ] close $fl regsub -all "&" "$sourcecode" "\\&" sourcecode regsub -all "<" "$sourcecode" "\\<" sourcecode regsub -all ">" "$sourcecode" "\\>" sourcecode return $sourcecode } if { ! [ info exists header ] } { set header { .tcl example } } if { ! [ info exists footer ] } { set footer { } } namespace eval request { hgetvars puts $header puts {

    This is an example of a .tcl file being processed in Rivet

    Here is the source code:


        }
        puts [ getcode $ENVS(SCRIPT_FILENAME) ]
        puts {
    	

    } puts $footer }rivet-3.0.0/rivet/packages/dtcl/000775 001750 001750 00000000000 15224454746 017267 5ustar00manghimanghi000000 000000 rivet-3.0.0/doc/html/form_package.html000664 001750 001750 00000123540 15224455137 020447 0ustar00manghimanghi000000 000000 form

    Name

    form — a Tcl command object for creating HTML forms

    Synopsis

    form form_name ?-option1 value_1? ?-option2 value_2? ?...?

    creates and returns a new Tcl command named form_name.

    Options

    -method ?post|get?
    The http method for sending the form data back to the server. Possible values are get or post
    -name ?form_name?
    a name for the form being created: this value becomes the value of the attribute 'name' in the <form> tag.
    -defaults ?default_values?
    an array of default values to be assigned to the fields of the form. Every name in the array is matched with an input field, when a given field gets added to the form it is initialized with the value of the corresponding variable in the array. This option works well in conjuction with the load_response command of Rivet when default values come from another form.
    -emit ?true(default)|false?
    a Tcl accepted representation of a Boolean value. Change a form object instance behavior so that methods generating HTML form entries return to the caller their output as string instead of directly sending it to stdout
    -action ?URL?
    The URL the data are being sent to. If no ?-action? switch is specified the data are sent to the form's URL.

    Form Object Commands

    Form object commands follow the usual syntax of Tcl commands with a ?subcommand? argument playing the role of a switch among various functionalities of the command. Form objects also need the ?name? parameter which is to become the value of the 'name' attribute in an input field. This argument is the key that has to be used by the server-side script to retrieve the input field value.

    form_object subcommand ?name? ?-option1 value1? ?-option2 value2? ?...?

    Options passed to a subcommand are copied into the tag as attribute="value" pairs. Some subcommands (e.g. form, radiobuttons and checkboxes) treat specific options in a way that fits the specific organization and function of these fields.

    Exceptions to this general syntax are the field and end subcommands. field is an abstract input field creation method and requires an additional parameter specifiyng the type of field to create. Every concrete input field generation command uses this subcommand internally to print the final html.

    Subcommands

    start ?name? ?-method get | post? ?-name form_name? ?-defaults default_values? ?-action URL? ?args?
    Print the <form> tag with all its attributes. This command must be called as first in the form generation process. The following is a sample of code creating a form named 'formname' whose data will be sent via the GET method. Initial form fields values will be obtained from array response
    form myform -defaults response -method get -name formname
    myform start
    myform text	  text_entry -size 20
    myform select option_selected -values {opt1 opt2 opt3 opt4}
    myform submit submit -value Search
    myform end
    The code prints a form that sends a text entry content and the option value associated with a radiobutton. The URL of the server script is the same that created the form. Use the ?-url? option to specify a different url.
    Options
    -method ?post|get?
    The method to be used to encode the form data. Possible values are get or post
    -name ?form_name?
    a name for the form being generated: this value becomes the value of the attribute 'name' in the <form> tag.
    -defaults ?default_values?
    an array of default values to be assigned to the fields of the form. Every name in the array is matched with an input field, when a given field gets added to the form it is initialized with the value of the corresponding variable in the array. This option works well in conjuction with the load_response command of Rivet when default values come from another form.
    -action ?URL?
    The URL the data will be sent to. If no ?-action? switch is specified the data are sent to the form's URL.
    end
    Print the </form> closing tag. This command must be called last in the form generation process
    field ?name? ?type? ?args?
    Print a field of the given ?type? and ?name?, including any default key-value pairs defined for this field type and optional key-value pairs included with the statement
    Options
    -opt1 ?val1?
    Option description
    radiobuttons ?name? ?-values values? ?-labels labels? ?args?
    the radiobutton creates a whole radiobutton group with the values and labels specified in the argument list. If no ?-labels? switch is passed to the subcommand the values are printed as labels of the radiobutton.
    Options
    -values ?values_list?
    List of values associated with the radiobuttons to be displayed
    -labels ?labels_list?
    List of labels to be printed with every radiobutton. There must be a label for every radiobutton
    Example:
    form myform -defaults response -method get -name formname
    myform start
    myform text text_entry -size 20
    myform radiobuttons fruit -values {big medium small} \
                  -labels {Watermelon Orange Strawberry} \
                  -class myradiobclass
    myform submit submit -value Search
    myform end
    will print the following HTML code.
    <input type="radio" name="fruit" class="myradiobclass" value="big" />Watermelon
    <input type="radio" name="fruit" class="myradiobclass" value="medium" />Orange
    <input type="radio" name="fruit" class="myradiobclass" value="small" />Strawberry
    
    if the response array has a variable for the name 'fruit' the corresponding radiobutton field is automatically checked. The options ?values? and ?labels? are used internally and don't get into the tag attributes. If a ?labels? option is not given, labels are assigned using the ?values? list.
    checkbox ?name? ?-label label? ?-value value? ?args?
    The checkbox subcommand emits a checkbox type input field with the name, label and value attributes set according to the parameters passed to the subcommand.
    Example:
    form myform -defaults response -method get -name formname -action <form_url>
    myform start
    myform checkbox options -value opt1 -label "Option 1"
    myform checkbox options -value opt2 -label "Option 2"
    myform checkbox options -value opt3 -label "Option 3"
    myform checkbox options -value opt4 -label "Option 4"
    myform submit save_tps -value "Send Options"
    myform end
    myform destroy
    Provided opt2 was in response array (in the list valued 'options' variable) that initialized the form, the output would look like this
    <form  action="<form_url>" method="get" name="formname">
    <input type="checkbox" name="options"  id="autogen_1" label="Option 1" value="sopt1" /><label for="autogen_1">Option 1</label>
    <input type="checkbox" name="options"  id="autogen_2" label="Option 2" value="sopt2" /><label for="autogen_2">Option 2</label>
    <input type="checkbox" name="options"  id="autogen_3" label="Option 3" value="sopt3" /><label for="autogen_3">Option 3</label>
    <input type="checkbox" name="options"  id="autogen_4" label="Option 4" value="sopt4" /><label for="autogen_4">Option 4</label>
    <input type="submit" name="submit"  value="Send" />
    </form>
    checkboxes ?name? ?-labels labels_list? ?-values values_list? ?args?
    The checkboxes is an extended form of the checkbox subcommand. checkboxes prints as many checkboxes as the number of elements in the ?labels_list? argument
    Options
    -values ?values_list?
    List of values associated with the checkboxes to be displayed
    -labels ?labels_list?
    List of labels to be printed with every checkbox. There must be a label for every checkbox
    Example:
    form myform -defaults response -method post -action <form_url>
    myform start
    myform checkboxes options -values {opt1 opt2 opt3 opt4} -labels {"Option 1" "Option 2" "Option 3" "Option 4"}
    myform submit save_tps -value "Send Options"
    myform end
    myform destroy
    will print the following HTML code
    <form  action="<form_url>" method="post">
    <input type="checkbox" name="options"  id="autogen_1" label="Option 1" value="opt1" /><label for="autogen_1">Option 1</label>
    <input type="checkbox" name="options"  id="autogen_2" label="Option 2" value="opt2" /><label for="autogen_2">Option 2</label>
    <input type="checkbox" name="options"  id="autogen_3" label="Option 3" value="opt3" /><label for="autogen_3">Option 3</label>
    <input type="checkbox" name="options"  id="autogen_4" label="Option 4" value="opt4" /><label for="autogen_4">Option 4</label>
    <input type="submit" name="save_tps"  value="Send Options" />
    </form>
    password ?name? ?args?
    Same as text, but the input is obfuscated so as not to reveal the text being typed
    hidden ?name? ?args?
    hidden input element: typicall embedded in a form in order to pass status variables.
    submit ?name? ?args?
    emits the code for a classical HTML submit button. Example: the following code
    	form myform -defaults response -method get -name feedsearch
    	myform start
    	myform submit submit -value Search
    Would emit a form like this
    	<form...>
    	<input type="submit" name="submit" value="Search" /> 
    	</form>
    button ?name? ?args?
    emits the code for a button field having ?name? as name
    reset ?name? ?args?
    Classical HTML reset button that resets the input fields back to their initial values
    image ?name? ?args?
    Emits an image input field
    radio ?name? ?args?
    Emits a radiobutton input field
    color ?name? ?args?
    Emits an HTML 5 "color" form field
    date ?name? ?args?
    Emits an HTML 5 "date" form field
    datetime ?name? ?args?
    Emits an HTML 5 "datetime" form field
    datetime_local ?name? ?args?
    Emits an HTML 5 "datetime_local" form field
    email ?name? ?args?
    Emits an HTML 5 "email" form field
    file ?name? ?args?
    Emits an HTML 5 "file" form field
    month ?name? ?args?
    Emits an HTML 5 "month" form field
    number ?name? ?args?
    Emits an HTML 5 "number" form field
    range ?name? ?args?
    Emits an HTML 5 "range" form field
    search ?name? ?args?
    Emits an HTML 5 "search" form field
    tel ?name? ?args?
    Emits an HTML 5 "tel" form field
    time ?name? ?args?
    Emits an HTML 5 "time" form field
    url ?name? ?args?
    Emits an HTML 5 "url" form field
    week ?name? ?args?
    Emits an HTML 5 "week" form field
    rivet-3.0.0/INSTALL000664 001750 001750 00000006034 15224454746 014466 0ustar00manghimanghi000000 000000 Rivet 3.2 Installation ====================== For more detailed instructions, see the docs/html/ directory. Rivet build system is based on autotools - autoconf, automake and libtool, and so compilation is simple. 1) run 'configure' with the appropiate options for your installation. (if you are building Rivet from a working copy created by svn you have also to prepare the source tree running 'aclocal; autoreconf' beforehand) Example: ./configure --with-tcl=/usr/lib/tcl8.6 \ --with-apache=/usr/local/apache2 \ --with-apxs=/usr/local/apache2/bin/apxs \ --with-rivet-target-dir=/usr/local/lib/rivet3.2 \ --enable-version-display 2) if 'configure' was successful Rivet is ready for compilation make 3) Install Rivet with the usual sudo make install binary module and Tcl packages can be installed separately by calling make install-binaries and make install-packages Along with the usual 'configure' variables Rivet's configure script handles other specific options. --with-tcl=DIR Directory where tclConfig.sh is stored. This is a shell script that defines all the relevant symbols needed to build Tcl related applications. --with-apache-version=VER Values are 1 or 2 depending on the apache server you're builing the module for. --with-apache=DIR Apache server's root directory. --with-apxs=FILE Path to the apxs program to be used in the compilation process. --with-apache-include=DIR Apache's include files path. --with-apr-config=FILE Apache Portable Runtime metainformation program --with-rivet-target-dir=DIR Rivet library installation directory. --enable-version-display Apache signature shows Rivet version number in the form Rivet/VERSION. Default=no These are the basic Apache configuration directives that are needed: # Loads the module. LoadModule rivet_module /path/to/your/copy/of/mod_rivet.so # Let the module handle .rvt and .tcl files. AddType application/x-httpd-rivet rvt AddType application/x-rivet-tcl tcl # The default charset can be specified in the configuration AddType "application/x-httpd-rivet; charset=utf-8" rvt Examples: On a Debian system apxs for Apache2.x is named apxs2 ./configure --with-apache-include=/usr/include/apr-1.0 \ --with-apxs=/usr/bin/apxs2 \ --with-tcl=/usr/lib/tcl8.6 \ --with-apache=/usr Here is another example reported by a user who successfully built Rivet on Slackware 12.1 aclocal autoreconf ./configure --with-tcl=/usr/lib --with-apxs=/usr/bin/apxs make Rivet is packaged for various Linux flavours. A list is available at http://tcl.apache.org/download.html rivet-3.0.0/src/librivet/rivetPkgInit.c000664 001750 001750 00000007170 15224454746 020631 0ustar00manghimanghi000000 000000 /* * rivetPkgInit.c - Initialize all of the Rivet commands into a Tcl interp. */ /* Copyright 2002-2004 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif #include /* Function prototypes are defined with EXTERN. Since we are in the same DLL, * no need to keep this extern... */ #ifdef EXTERN # undef EXTERN # define EXTERN #endif /* EXTERN */ #include "rivet.h" //#include "mod_rivet.h" /*----------------------------------------------------------------------------- * Rivet_GetNamespace -- * * Get the rivet namespace pointer. The procedure attempts to retrieve a * pointer to the Tcl_Namespace structure for the ::rivet namespace. This * pointer is stored in the interpreter's associated data (pointing to a * rivet_interp_globals structure) if the interpreter is passed by mod_rivet. * Otherwise a new ::rivet namespace is created and its Tcl_Namespace * pointer is returned * * Parameters: * * o interp - Interpreter to add commands to. * * Returned value: * * o rivet_ns - Tcl_Namespace* pointer to the RIVET_NS (::rivet) namespace * *----------------------------------------------------------------------------- */ #if RIVET_NAMESPACE_EXPORT == 1 Tcl_Namespace* Rivet_GetNamespace( Tcl_Interp* interp) { Tcl_Namespace *rivet_ns; rivet_ns = Tcl_FindNamespace(interp,RIVET_NS,NULL,TCL_GLOBAL_ONLY); if (rivet_ns == NULL) { rivet_ns = Tcl_CreateNamespace (interp,RIVET_NS,NULL, (Tcl_NamespaceDeleteProc *)NULL); } return rivet_ns; } #endif /*----------------------------------------------------------------------------- * Rivetlib_Init -- * * Install the commands provided by librivet into an interpreter. * * Parameters: * * o interp - Interpreter to add commands to. * *----------------------------------------------------------------------------- */ DLLEXPORT int Rivetlib_Init( Tcl_Interp *interp ) { #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { #else if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { #endif return TCL_ERROR; } Rivet_InitList (interp); Rivet_InitCrypt(interp); Rivet_InitWWW (interp); return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION ); } /*----------------------------------------------------------------------------- * Rivetlib_SafeInit -- * * Install the commands provided by librivet that are believed to be * safe for use in safe interpreters, into a safe interpreter. * * Parameters: * * o interp - Interpreter to add commands to. * *----------------------------------------------------------------------------- */ DLLEXPORT int Rivetlib_SafeInit( Tcl_Interp *interp ) { #ifdef USE_TCL_STUBS if (Tcl_InitStubs(interp, TCL_VERSION, 0) == NULL) { #else if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, 0) == NULL) { #endif return TCL_ERROR; } Rivet_InitList(interp); Rivet_InitCrypt(interp); Rivet_InitWWW(interp); return Tcl_PkgProvide( interp, RIVETLIB_TCL_PACKAGE, RIVET_VERSION ); } rivet-3.0.0/rivet/init.tcl.in000664 001750 001750 00000021270 15224454746 016641 0ustar00manghimanghi000000 000000 # # init.tcl -- # # # Copyright 2002-2017 The Apache Rivet Team # # 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. package require @RIVETLIB_PACKAGE@ @RIVETLIB_PACKAGE_VERSION@ # the ::rivet namespace is created in mod_rivet_commoc.c:Rivet_PerInterpInit # namespace eval ::rivet {} ; ## create namespace namespace eval ::Rivet {} ; ## create namespace ## ::Rivet::init ## ## Initialize the interpreter with all that Rivet goodness. This is called ## once when this file is loaded (down at the bottom) and sets up the interp ## for all things Rivet. proc ::Rivet::init {} { set ::Rivet::init [info script] set ::Rivet::root [file dirname $::Rivet::init] set ::Rivet::packages [file join $::Rivet::root packages] set ::Rivet::rivet_tcl [file join $::Rivet::root rivet-tcl] ## Setup auto_path within the interp to include all the places ## we've stored Rivet's scripts: rivet-tcl, packages, packages-local, ## packages$tcl_version, init_script_dir, and . ## Put these at the head of the list. set ::auto_path [linsert $::auto_path 0 $::Rivet::root \ $::Rivet::rivet_tcl $::Rivet::packages $::Rivet::packages-local] ## This will allow users to create proc libraries and tclIndex files ## in the local directory that can be autoloaded. ## Perhaps this must go to the front of the list to allow the user ## to override even Rivet's procs. lappend ::auto_path ${::Rivet::packages}${::tcl_version} . ## As we moved the command set to the ::rivet namespace we ## still want to guarantee the commands to be accessible ## at the global level by putting them on the export list. ## Importing the ::rivet namespace is deprecated and we should ## make it clear in the manual. if {[string is true -strict [::rivet::inspect ExportRivetNS]] || [string is true -strict [::rivet::inspect ImportRivetNS]]} { set ::rivet::cmd_export_list \ [tcl_commands_export_list $::Rivet::rivet_tcl] ## init.tcl is run by mod_rivet (which creates the ::rivet ## namespace) but it gets run standalone by mkPkgindex during ## the installation phase. We have to make sure the procedure ## won't fail in this case, so we check for the existence of ## the variable. namespace eval ::rivet { ## Commands in cmd_export_list are prefixed with ::rivet, ## so we have to remove it to build an export list. set export_list [list] foreach c $cmd_export_list { lappend export_list [namespace tail $c] } namespace export {*}$export_list } } ## If we are running from within mod_rivet we have already ## defined ::rivet::exit (mod_rivet_common.c: Rivet_PerInterpInit) ## and we move Tcl's exit command out of the way and replace it with ## our own that handles bailing from a page request properly. if {[info commands ::rivet::exit] != ""} { rename ::exit ::Rivet::tclcore_exit proc ::exit {code} { if {![string is integer -strict $code]} { set code 0 } ::rivet::exit $code } } ## If Rivet was configured for backward compatibility, import commands ## from the ::rivet namespace into the global namespace. if {[string is true -strict [::rivet::inspect ImportRivetNS]]} { uplevel #0 { namespace import ::rivet::* } } #unset -nocomplain ::module_conf } ### ## This routine gets called each time a new request comes in. ## It sets up the request namespace and creates a global command ## to replace the default global. This ensures that when a user ## uses global variables, they're actually contained within the ## namespace. So, everything gets deleted when the request is finished. ### proc ::Rivet::initialize_request {} { catch { namespace delete ::request } namespace eval ::request {} proc ::request::global {args} { foreach arg $args { uplevel "::global ::request::$arg" } } } ## ::Rivet::handle_error ## ## If an ErrorScript has been specified, this routine will not be called. proc ::Rivet::handle_error {} { puts "
    $::errorInfo

    OUTPUT BUFFER:

    $::Rivet::script
    " } ## ::Rivet::request_handling ## ## Process the actual request. This is the main handler for each request. ## This collects all of the necessary BeforeScripts, AfterScripts, and ## other bits and calls them in order. proc ::Rivet::request_handling {} { ::try { uplevel #0 ::Rivet::initialize_request } on error {err} { ::rivet::apache_log_error crit \ "Rivet request initialization failed: $::errorInfo" } ::try { set script [::rivet::inspect BeforeScript] if {$script ne ""} { set ::Rivet::script $script uplevel #0 $script } set script [::rivet::url_script] if {$script ne ""} { set ::Rivet::script $script namespace eval ::request $script } set script [::rivet::inspect AfterScript] if {$script ne ""} { set ::Rivet::script $script uplevel #0 $script } } trap {RIVET ABORTPAGE} {err opts} { ::Rivet::finish_request $script $err $opts AbortScript } trap {RIVET THREAD_EXIT} {err opts} { ::Rivet::finish_request $script $err $opts AbortScript } on error {err opts} { ::Rivet::finish_request $script $err $opts } finally { ::Rivet::finish_request $script "" "" AfterEveryScript } } ## ::Rivet::finish_request ## ## Finish processing the request by checking our error state and executing ## whichever script we need to close things up. If this script results in ## an error, we'll try to call ErrorScript before bailing. proc ::Rivet::finish_request {script errorCode errorOpts {scriptName ""}} { set ::Rivet::errorCode $errorCode set ::Rivet::errorOpts $errorOpts if {$scriptName ne ""} { set scriptBody [::rivet::inspect $scriptName] ::try { uplevel #0 $scriptBody } on ok {} { return } on error {} { ::rivet::apache_log_error err \ "Rivet $scriptName failed: $::errorInfo" print_error_message "Rivet $scriptName failed" } } set error_script [::rivet::inspect ErrorScript] if {$error_script eq ""} { set ::errorOutbuf $script ; ## legacy variable set error_script ::Rivet::handle_error } ::try { set ::Rivet::script $script uplevel #0 $error_script } on error {err} { ::rivet::apache_log_error err "Rivet ErrorScript failed: $::errorInfo" print_error_message "Rivet ErrorScript failed" } } ## ::Rivet::print_error_message ## ## This message should be transparently equivalent to the ## Rivet_PrintErrorMessage function in mod_rivet_generator.c proc ::Rivet::print_error_message {error_header} { puts "$error_header
    $::errorInfo
    " } ## ::Rivet::tcl_commands_export_list ## ## this is temporary hack to export names of Tcl commands in rivet-tcl/. ## This function will be removed in future versions of Rivet and it's ## meant to provide a basic way to guarantee compatibility with older ## versions of Rivet (see code in ::Rivet::init) proc ::Rivet::tcl_commands_export_list {tclpath} { # we collect the commands in rivet-tcl by reading the tclIndex # file and then we extract the command list from auto_index namespace eval ::Rivet::temp {} set ::Rivet::temp::tclpath $tclpath namespace eval ::Rivet::temp { variable auto_index array set auto_index {} # The auto_index in ${tclpath}/tclIndex is loaded. # This array is used to fetch a list of Rivet commands # implemented in Rivet set dir $tclpath source [file join $tclpath tclIndex] # Rivet Tcl commands not meant to go onto the export list must # be unset from auto_index here unset auto_index(::rivet::catch) unset auto_index(::rivet::try) } set commands [namespace eval ::Rivet::temp {array names auto_index}] # we won't leave anything behind namespace delete ::Rivet::temp return $commands } ::Rivet::init package provide Rivet @INIT_VERSION@ rivet-3.0.0/NOTICE000664 001750 001750 00000000247 15224454746 014341 0ustar00manghimanghi000000 000000 Apache Rivet Copyright 2002-2018 The Apache Software Foundation This product includes software developed by The Apache Software Foundation (http://www.apache.org/). rivet-3.0.0/doc/html/try.html000664 001750 001750 00000015012 15224455137 016641 0ustar00manghimanghi000000 000000 try

    Name

    try — Catch error and exception conditions

    Synopsis

    ::rivet::try ?script? ?script? ?handlers? ?finally script?

    Description

    ::rivet::try wraps the core language command and simply traps exceptions that might have raised by ::rivet::abort_page and ::rivet::exit to throw them again and thus causing AbortScript to be executed.

    If neither ::rivet::abort_page nor ::rivet::exit are called from ?script? then any handlers specified in the command are tested for execution. Thus ::rivet::try can transparently be used as a replacement for Tcl's own try and it's needed if you want ?script? to safely bail out to AbortScript

    [Note]Note
    This command is not exported from the ::rivet namespace and therefore has to be fully qualified.

    This script shows how ::rivet:try handles different exceptions or errors. You can drive this script within mod_rivet adding the arguments fail or abort or exit to its URL. You can handle the exit and abort cases with an AbortScript. See the section called “Apache Rivet 3.3 Configuration”

    <html><?
    ::rivet::try {
    	if {[::rivet::var_qs exists exit]} {
    	    ::rivet::exit [::rivet::var_qs get exit]
    	} elseif {[::rivet::var_qs exists abort]} {
    	    ::rivet::abort_page [::rivet::var_qs get abort]
    	} elseif {[::rivet::var_qs exists fail]} {
    	    # this is just a non existent command
    	    wrong_command
    	} else {
    	    puts "<b>OK</b>"
    	}
    
    } on error {e o} {
      puts "catching error -&gt; $e<br/>"
      dict for {fd fv} $o {
    
       puts "$fd --&gt;&gt; $fv<br/>"
    
      }
    }
    ?></html>

    Placing this code in a file (try.rvt) on the web server DocumentRoot directory and setting for example the browser to http://localhost/try.rvt?fail=1.

    catching error -> invalid command name "wrong_command"
    -errorcode -->> TCL LOOKUP COMMAND wrong_command
    -code -->> 1
    -level -->> 0
    -errorstack -->> INNER {invokeStk1 wrong_command} UP 1
    -errorinfo -->> invalid command name "wrong_command" while executing "wrong_command" ("::try" body line 9)
    -errorline -->> 9
    rivet-3.0.0/doc/xml/calendar.xml000664 001750 001750 00000031303 15224454746 017272 0ustar00manghimanghi000000 000000
    Calendar Package
    Introduction The package is based on the Calendar class, a class capable of printing an ascii calendar table that closely resembles the output of the typical Unix cal command. The internal code is written entirely in Tcl, therefore doesn't rely on the existance of cal on the system. XmlCalendar inherits the basic methods and adds XML tagging to the table. XmlCalendar prints an XML calendar table whose header, weekdays banner and days rows tags are configurable. Also specific days or specific weeks can be given arbitrary attributes. Calendar core methods are based on the cal procedure written by Richard Suchenwirth and published on the Tcl Wiki The Calendar package uses Tcl dict command to manage markup information. Hence either Tcl8.5 or Tcl8.4 with package dict are required.
    Calendar Utility class the builds and prints a calendar table Calendar calendar_name Calendar object subcommands The main public command for a calendar object is emit that returns a calendar table calendar_obj emit calendar_obj emit month year calendar_obj emit month | year The method 'emit' if invoked without arguments returns an ASCII formatted calendar of the current month set cal [Calendar #auto] set current_month [$cal emit] puts $current_month Jun 2010 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 The method emit when invoked with a single argument takes it as an year number and prints the whole calendar of that year. When invoked with 2 arguments takes the first as a month, either expressed in its shortened form ('Jan','Feb',...) or as a number in the range 1-12. The second argument is a year number. XmlCalendar Prints XML formatted calendar tables XmlCalendar calendar_name -option1 option_list -option2 option_list ... An XmlCalendar object is created and returned. XmlCalendar objects print XML formatted calendar tables. The markup can be customized using the configuration options. Configuration options accept odd-length lists as values. An option_list has the following structure tag_name The first element of an option list is a tag name, the remaining terms are therefore an even-length sublist which is interpreted as a sequence of attribute-value pairs that will in turn become attributes of the tag. Methods cal_obj emit cal_obj emit month year cal_obj emit month | year The method 'emit' if invoked without arguments returns an XML calendar table of the current month Options -container tag_name Assigns an options list to the XML element that will hold the whole table. The default tag for the container is 'calendar', with no attributes. -header tag_name Assigns tag name and attributes to the XML header element (default: calheader) -body tag_name Assigns tag name and attributes to the XML body element of the table (default: calbody) -banner tag_name Assigns tag name and attributes to the XML banner element of the table (default: monthyear) The header of a calendar table is made of a banner, showing the Month and Year number, and of a weekdays bar. -foot tag_name Assigns tag name and attributes to the XML foot element of the table (default: calfoot). This option was added for completeness, but it's not implemented yet -banner_month tag_name Tag name and attributes for the XML element holding the month name (default:month) -banner_year tag_name Tag name and attributes for the XML element holding the month name (default: year) -weekdays tag_name Tag name and attributes for the XML element holding the weekday header (default: weekdays) -weekdays_cell tag_name Tag name and attributes for the XML element holding the each single weekday (default: wkdays) -days_row tag_name Tag name and attributes for the XML element holding the each row of the calendar table (default: week) -days_cell tag_name Tag name and attributes for the XML element representing a cell in the calendar table (default: day) -cell_function If set this option is the name of a procedure that gets called for every day of the month. The procedure must accept 4 argument representing day, month, year and weekday and must return an odd-length list interpreted in the same way as options lists. -current_day This option works as a simple method for pointing out a specific day of the month. If set with a day number that day will get the class attribute automatically set as "current" -current_weekday This option works as a simple method for pointing out a specific weekday of the month. If set with a weekday index (0: Sunday, 6: Saturday) the corresponding cell in the weekdays header will get the class attribute automatically set as "current_wkday" HtmlCalendar Concrete class derived from XmlCalendar HtmlCalendar calendar_name -option1 option_list -option2 option_list ... Concrete XmlCalendar class for printing html calendar tables. The markup of the class is xhtml compliant and prints a code fragment for inclusion in a webpage. The following is the class definition. ::itcl::class HtmlCalendar { inherit XmlCalendar constructor {args} {XmlCalendar::constructor $args} { $this configure -container table \ -header thead \ -body tbody \ -banner tr \ -banner_month {th colspan 3 style "text-align: right;"} \ -banner_year {th colspan 4 style "text-align: left;"} \ -weekdays tr \ -weekday_cell th \ -days_row tr \ -days_cell td } } A sample output from HtmlCalendar (with some styling)
    rivet-3.0.0/src/mod_rivet_ng/apache_config.c000664 001750 001750 00000050152 15224454746 021612 0ustar00manghimanghi000000 000000 /* apache_config.c -- configuration functions for apache 2.x */ /* Copyright 2002-2020 The Apache Tcl Team 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. */ /* Rivet config */ #ifdef HAVE_CONFIG_H #include #endif /* httpd includes */ #include #include /* APR includes */ #include #include #include #include "mod_rivet.h" #include "apache_config.h" #include "rivet.h" extern module rivet_module; extern mod_rivet_globals* module_globals; /* * -- Rivet_AssignStringtoConf -- * * Assign a string to a Tcl_Obj valued configuration parameter * * Arguments: * * - objPnt: Pointer to a pointer to a Tcl_Obj. If the pointer *objPnt * is NULL (configuration script obj pointers are initialized to NULL) * a new Tcl_Obj is created * - string_value: a string to be assigned to the Tcl_Obj * * Results: * * - Pointer to a Tcl_Obj containing the parameter value. * */ #if 0 static Tcl_Obj* Rivet_AssignStringToConf (Tcl_Obj** objPnt, const char* string_value) { Tcl_Obj *objarg = NULL; if (*objPnt == NULL) { objarg = Tcl_NewStringObj(string_value,-1); Tcl_IncrRefCount(objarg); *objPnt = objarg; } else { objarg = *objPnt; Tcl_AppendToObj(objarg, string_value, -1); } Tcl_AppendToObj( objarg, "\n", 1 ); return objarg; } #endif static char* Rivet_AppendStringToConf (char* p,const char* string,apr_pool_t *pool) { if (p == NULL) { p = apr_pstrdup(pool,string); } else { p = apr_pstrcat(pool,p,"\n",string,NULL); } return p; } /* * -- Rivet_SetScript -- * * Add the text from an apache directive, such as UserConf, to * the corresponding variable in the rivet_server_conf structure. * In most cases, we append the new value to any previously * existing value, but Before, After and Error scripts override * the old directive completely. * * Results: * * Returns a Tcl_Obj* pointing to the string representation of * the current value for the directive. * */ static const char * Rivet_SetScript (apr_pool_t *pool, rivet_server_conf *rsc, const char *script, const char *string) { char** c = NULL; if ( STREQU( script, "GlobalInitScript" ) ) { c = &rsc->rivet_global_init_script; } else if ( STREQU( script, "ChildInitScript" ) ) { c = &rsc->rivet_child_init_script; } else if ( STREQU( script, "ChildExitScript" ) ) { c = &rsc->rivet_child_exit_script; } else if ( STREQU( script, "RequestHandler" ) ) { c = &rsc->request_handler; } else if ( STREQU( script, "BeforeScript" ) ) { c = &rsc->rivet_before_script; } else if ( STREQU( script, "AfterScript" ) ) { c = &rsc->rivet_after_script; } else if ( STREQU( script, "ErrorScript" ) ) { c = &rsc->rivet_error_script; } else if ( STREQU( script, "AbortScript" ) ) { c = &rsc->rivet_abort_script; } else if ( STREQU( script, "AfterEveryScript" ) ) { c = &rsc->after_every_script; } else if ( STREQU( script, "ServerInitScript" ) ) { c = (char **) &module_globals->rivet_server_init_script; } else { return NULL; } *c = Rivet_AppendStringToConf(*c,string,pool); return *c; } /* * -- Rivet_GetConf * * Rivet_GetConf fetches the confguration from the server record * and carries out a merge with server variables stored in directory * specific configuration * * Arguments: * * - request_rec* r: pointer to the request data * * Results: * * - rivet_server_conf* rsc: the server merged configuration * * Side Effects: * * None. * */ rivet_server_conf * Rivet_GetConf(request_rec *r) { rivet_server_conf *rsc = RIVET_SERVER_CONF( r->server->module_config ); void *dconf = r->per_dir_config; rivet_server_conf *newconfig = NULL; rivet_server_conf *rdc; FILEDEBUGINFO; /* If there is no per dir config, just return the server config */ if (dconf == NULL) { return rsc; } /* things might become tedious when there are scripts set in a ... stanza. Especially since we are calling this function at every single request. We compute the new configuration merging the per-dir conf with the server configuration and then we return it. */ rdc = RIVET_SERVER_CONF ( dconf ); newconfig = RIVET_NEW_CONF ( r->pool ); Rivet_CopyConfig( rsc, newconfig ); Rivet_MergeDirConfigVars( r->pool, newconfig, rsc, rdc ); return newconfig; } /* * -- Rivet_CopyConfig -- * * Copy the rivet_server_conf struct. * * Results: * None. * * Side Effects: * None. * */ void Rivet_CopyConfig(rivet_server_conf *oldrsc, rivet_server_conf *newrsc) { FILEDEBUGINFO; //newrsc->rivet_server_init_script = oldrsc->rivet_server_init_script; newrsc->rivet_global_init_script = oldrsc->rivet_global_init_script; newrsc->request_handler = oldrsc->request_handler; newrsc->rivet_before_script = oldrsc->rivet_before_script; newrsc->rivet_after_script = oldrsc->rivet_after_script; newrsc->rivet_error_script = oldrsc->rivet_error_script; newrsc->rivet_abort_script = oldrsc->rivet_abort_script; newrsc->after_every_script = oldrsc->after_every_script; //newrsc->user_scripts_updated = oldrsc->user_scripts_updated; //newrsc->rivet_default_error_script = oldrsc->rivet_default_error_script; newrsc->default_cache_size = oldrsc->default_cache_size; newrsc->upload_max = oldrsc->upload_max; newrsc->upload_files_to_var = oldrsc->upload_files_to_var; //newrsc->separate_virtual_interps = oldrsc->separate_virtual_interps; newrsc->export_rivet_ns = oldrsc->export_rivet_ns; newrsc->import_rivet_ns = oldrsc->import_rivet_ns; newrsc->honor_head_requests = oldrsc->honor_head_requests; //newrsc->single_thread_exit = oldrsc->single_thread_exit; //newrsc->separate_channels = oldrsc->separate_channels; newrsc->server_name = oldrsc->server_name; newrsc->upload_dir = oldrsc->upload_dir; newrsc->rivet_server_vars = oldrsc->rivet_server_vars; newrsc->rivet_dir_vars = oldrsc->rivet_dir_vars; newrsc->rivet_user_vars = oldrsc->rivet_user_vars; newrsc->idx = oldrsc->idx; newrsc->path = oldrsc->path; //newrsc->mpm_bridge = oldrsc->mpm_bridge; newrsc->user_scripts_status = oldrsc->user_scripts_status; } /* * -- Rivet_MergeDirConfigVars * * Merging of base configuration with per directory configuration * is done checking each field in the configuration record. If * a more specific (per directory) conf variable is defined then * it supersedes the base record variable * * Arguments: * * - apr_pool_t* t: pointer to an APR memory pool * - rivet_server_conf* new: pointer to a record to store the * merged configuration * - rivet_server_conf* base: * - rivet_server_conf* add: * * Results: * * configuration record are merge in place * * Side Effects: * * None. */ void Rivet_MergeDirConfigVars(apr_pool_t *p, rivet_server_conf *new, rivet_server_conf *base, rivet_server_conf *add ) { FILEDEBUGINFO; RIVET_CONF_SELECT(new,base,add,rivet_child_init_script) RIVET_CONF_SELECT(new,base,add,rivet_child_exit_script) RIVET_CONF_SELECT(new,base,add,request_handler) RIVET_CONF_SELECT(new,base,add,rivet_before_script) RIVET_CONF_SELECT(new,base,add,rivet_after_script) RIVET_CONF_SELECT(new,base,add,rivet_error_script) RIVET_CONF_SELECT(new,base,add,rivet_abort_script) RIVET_CONF_SELECT(new,base,add,after_every_script) RIVET_CONF_SELECT(new,base,add,upload_dir) /* Merge the tables of dir and user variables. */ if (base->rivet_dir_vars && add->rivet_dir_vars) { new->rivet_dir_vars = apr_table_overlay ( p, base->rivet_dir_vars, add->rivet_dir_vars ); } else { new->rivet_dir_vars = base->rivet_dir_vars; } if (base->rivet_user_vars && add->rivet_user_vars) { new->rivet_user_vars = apr_table_overlay ( p, base->rivet_user_vars, add->rivet_user_vars ); } else { new->rivet_user_vars = base->rivet_user_vars; } RIVET_CONF_SELECT(new,base,add,path) new->user_scripts_status = add->user_scripts_status; //new->user_conf = add->user_conf; } /* * -- Rivet_CreateDirConfig * * Apache HTTP server framework calls this function to * have a pointer to newly initialized directory specific * configuration record. * * Arguments: * * - apr_pool_t*: pointer to an APR memory pool * - char*: string pointer to the directory name * * Returned value: * * - void* pointer to a brand new rivet configuration record * */ void * Rivet_CreateDirConfig(apr_pool_t *p, char *dir) { rivet_server_conf *rdc = RIVET_NEW_CONF(p); FILEDEBUGINFO; rdc->rivet_server_vars = (apr_table_t *) apr_table_make ( p, 4 ); rdc->rivet_dir_vars = (apr_table_t *) apr_table_make ( p, 4 ); rdc->rivet_user_vars = (apr_table_t *) apr_table_make ( p, 4 ); return rdc; } /* * -- Rivet_MergeDirConfig * * Apache framework callback merging 2 per directory config records * * Arguments: * * - apr_pool_t* p: pointer to an APR memory pool * - void* basev, addv: pointers to configuration records to be * merged * * Results: * * - void*: pointer to the resulting configuration */ void * Rivet_MergeDirConfig( apr_pool_t *p, void *basev, void *addv ) { rivet_server_conf *base = (rivet_server_conf *)basev; rivet_server_conf *add = (rivet_server_conf *)addv; rivet_server_conf *new = RIVET_NEW_CONF(p); FILEDEBUGINFO; Rivet_MergeDirConfigVars( p, new, base, add ); return new; } /* * -- Rivet_MergeConfig -- * * This function is called when there is a config option set both * at the 'global' level, and for a virtual host. It "resolves * the conflicts" so to speak, by creating a new configuration, * and this function is where we get to have our say about how to * go about doing that. For most of the options, we override the * global option with the local one. * * Results: * Returns a new server configuration. * * Side Effects: * None. * */ void * Rivet_MergeConfig(apr_pool_t *p, void *basev, void *overridesv) { rivet_server_conf *rsc = RIVET_NEW_CONF(p); rivet_server_conf *base = (rivet_server_conf *) basev; rivet_server_conf *overrides = (rivet_server_conf *) overridesv; FILEDEBUGINFO; /* For completeness' sake, we list the fate of all the members of * the rivet_server_conf struct. */ /* server_interp isn't set at this point. */ /* rivet_global_init_script is global, not per server. */ RIVET_CONF_SELECT(rsc,base,overrides,rivet_child_init_script) RIVET_CONF_SELECT(rsc,base,overrides,rivet_child_exit_script) RIVET_CONF_SELECT(rsc,base,overrides,request_handler) RIVET_CONF_SELECT(rsc,base,overrides,rivet_before_script) RIVET_CONF_SELECT(rsc,base,overrides,rivet_after_script) RIVET_CONF_SELECT(rsc,base,overrides,rivet_error_script) //RIVET_CONF_SELECT(rsc,base,overrides,rivet_default_error_script) RIVET_CONF_SELECT(rsc,base,overrides,rivet_abort_script) RIVET_CONF_SELECT(rsc,base,overrides,after_every_script) RIVET_CONF_SELECT(rsc,base,overrides,default_cache_size); //rsc->separate_virtual_interps = base->separate_virtual_interps; rsc->honor_head_requests = base->honor_head_requests; rsc->upload_files_to_var = base->upload_files_to_var; //rsc->single_thread_exit = base->single_thread_exit; //rsc->separate_channels = base->separate_channels; rsc->import_rivet_ns = base->import_rivet_ns; rsc->export_rivet_ns = base->export_rivet_ns; //rsc->mpm_bridge = base->mpm_bridge; rsc->upload_max = base->upload_max; rsc->upload_dir = base->upload_dir; RIVET_CONF_SELECT(rsc,base,overrides,upload_dir) RIVET_CONF_SELECT(rsc,base,overrides,rivet_server_vars) RIVET_CONF_SELECT(rsc,base,overrides,rivet_dir_vars) RIVET_CONF_SELECT(rsc,base,overrides,rivet_user_vars) RIVET_CONF_SELECT(rsc,base,overrides,path) return rsc; } /* * -- Rivet_CreateConfig * * * */ void * Rivet_CreateConfig(apr_pool_t *p, server_rec *s ) { rivet_server_conf *rsc = RIVET_NEW_CONF(p); FILEDEBUGINFO; //rsc->server_interp = NULL; /* scripts obj pointers *must* be initialized to NULL */ //rsc->rivet_server_init_script = NULL; rsc->rivet_global_init_script = NULL; rsc->rivet_child_init_script = NULL; rsc->rivet_child_exit_script = NULL; rsc->rivet_before_script = NULL; //rsc->request_handler = "::Rivet::request_handling"; rsc->request_handler = NULL; rsc->rivet_after_script = NULL; rsc->rivet_error_script = NULL; rsc->rivet_abort_script = NULL; rsc->after_every_script = NULL; rsc->user_scripts_status = 0; //rsc->rivet_default_error_script = "::Rivet::handle_error"; rsc->default_cache_size = -1; rsc->upload_max = RIVET_MAX_POST; rsc->upload_files_to_var = RIVET_UPLOAD_FILES_TO_VAR; //rsc->separate_virtual_interps = RIVET_SEPARATE_VIRTUAL_INTERPS; rsc->export_rivet_ns = RIVET_NAMESPACE_EXPORT; rsc->import_rivet_ns = RIVET_NAMESPACE_IMPORT; rsc->honor_head_requests = RIVET_HEAD_REQUESTS; //rsc->single_thread_exit = 0; //rsc->separate_channels = RIVET_SEPARATE_CHANNELS; rsc->upload_dir = RIVET_UPLOAD_DIR; rsc->server_name = NULL; //rsc->mpm_bridge = NULL; rsc->rivet_server_vars = (apr_table_t *) apr_table_make ( p, 4 ); rsc->rivet_dir_vars = (apr_table_t *) apr_table_make ( p, 4 ); rsc->rivet_user_vars = (apr_table_t *) apr_table_make ( p, 4 ); rsc->idx = 0; rsc->path = NULL; return rsc; } /* * -- Rivet_UserConf * * Implements the RivetUserConf Apache Directive * * Command Arguments: * RivetUserConf BeforeScript