diff options
-rw-r--r-- | ChangeLog | 79 | ||||
-rw-r--r-- | doc/http.n | 37 | ||||
-rw-r--r-- | doc/info.n | 4 | ||||
-rw-r--r-- | generic/tclEncoding.c | 13 | ||||
-rw-r--r-- | generic/tclVar.c | 10 | ||||
-rw-r--r-- | library/http/http.tcl | 699 | ||||
-rw-r--r-- | library/http/pkgIndex.tcl | 10 | ||||
-rw-r--r-- | macosx/GNUmakefile | 42 | ||||
-rw-r--r-- | macosx/Tcl-Common.xcconfig | 12 | ||||
-rw-r--r-- | macosx/Tcl.xcodeproj/default.pbxuser | 2 | ||||
-rw-r--r-- | macosx/Tcl.xcodeproj/project.pbxproj | 219 | ||||
-rw-r--r-- | macosx/tclMacOSXNotify.c | 10 | ||||
-rw-r--r-- | tests/exec.test | 6 | ||||
-rw-r--r-- | tests/fCmd.test | 9 | ||||
-rw-r--r-- | tests/http.test | 16 | ||||
-rw-r--r-- | tests/ioCmd.test | 8 | ||||
-rw-r--r-- | tests/socket.test | 3 | ||||
-rw-r--r-- | tests/var.test | 18 | ||||
-rw-r--r-- | unix/Makefile.in | 144 | ||||
-rwxr-xr-x | unix/configure | 38 | ||||
-rw-r--r-- | unix/configure.in | 30 | ||||
-rwxr-xr-x | unix/install-sh | 22 | ||||
-rw-r--r-- | unix/tcl.m4 | 88 | ||||
-rw-r--r-- | unix/tclUnixNotfy.c | 4 | ||||
-rw-r--r-- | unix/tclUnixPort.h | 16 | ||||
-rw-r--r-- | win/Makefile.in | 6 |
26 files changed, 1128 insertions, 417 deletions
@@ -1,3 +1,82 @@ +2008-03-12 Daniel Steffen <das@users.sourceforge.net> + + * macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1 + * macosx/Tcl.xcodeproj/default.pbxuser: CODE_SIGN_IDENTITY and + * macosx/Tcl-Common.xcconfig: 'xcodebuild install'. + +2008-03-12 Andreas Kupries <andreask@activestate.com> + + * doc/info.n: Replaced {expand} with {*}. + +2008-03-12 Jeff Hobbs <jeffh@ActiveState.com> + + * unix/Makefile.in (install-libraries): Bump http to 2.7 + * win/Makefile.in (install-libraries): Added -myaddr option to allow + * library/http/http.tcl (http::geturl): control of selected socket + * library/http/pkgIndex.tcl: interface. [Bug 559898] + * doc/http.n, tests/http.test: Added -keepalive and + -protocol 1.1 with chunked transfer encoding support. [Bug + 1063703, 1470377, 219225] (default keepalive is 0) + Added ability to override Host in -headers. [Bug 928154] + Added -strict option to control URL validation on per-call basis. + [Bug 1560506] + +2008-03-11 Jeff Hobbs <jeffh@ActiveState.com> + + * library/http/http.tcl (http::geturl): add -method option to support + * tests/http.test (http-3.1): http PUT and DELETE requests. + * doc/http.n: [Bug 1599901, 862554] + + * library/http/http.tcl: whitespace changes, code cleanup. Allow + http to be re-sourced without overwriting http state. + +2008-03-11 Daniel Steffen <das@users.sourceforge.net> + + * generic/tclEncoding.c (LoadEscapeEncoding): avoid leaking escape + sub-encodings, fixes encoding-11.1 failing after iso2022-jp loaded. + [Bug 1893053] + + * macosx/tclMacOSXNotify.c: avoid using CoreFoundation after fork() on + Darwin 9 even when TclpCreateProcess() uses vfork(). + + * macosx/Tcl.xcodeproj/project.pbxproj: add support for Xcode 3.1 and + * macosx/Tcl.xcodeproj/default.pbxuser: targets for building with + * macosx/Tcl-Common.xcconfig: gcc-4.2 and llvm-gcc-4.2. + + * unix/tclUnixPort.h: workaround vfork() problems + in llvm-gcc-4.2.1 -O4 build. + + * unix/tclUnixPort.h: move MODULE_SCOPE compat define + to top [Bug 1911102]. + + * macosx/GNUmakefile: fix quoting to allow paths to + * macosx/Tcl-Common.xcconfig: ${builddir} and ${INSTALL_ROOT} + * unix/Makefile.in: to contain spaces. + * unix/configure.in: + * unix/install-sh: + * unix/tcl.m4: + * tests/ioCmd.test: + + * unix/configure: autoconf-2.59 + + * unix/Makefile.in (install-strip): strip non-global symbols from + dynamic library. + + * unix/tclUnixNotfy.c: fix warning. + + * tests/exec.test (exec-9.7): reduce timing sensitivity + * tests/socket.test (socket-2.11): (esp. on multi-proc machines). + + * tests/fCmd.test (fCmd-9.4): skip on Darwin 9 (xfail). + +2008-03-11 Miguel Sofer <msofer@users.sf.net> + + * generic/tclVar.c (TclDeleteNamespaceVars): + * tests/var.test (var-8.2): unset traces on vars should be called + with a FQ named during namespace deletion. This was causing + infinite loops when unset traces recreated the var, as reported by + Julian Noble on [Bug 1911919]. + 2008-03-10 Don Porter <dgp@users.sourceforge.net> * changes: Updated for 8.5.2 release. @@ -6,16 +6,16 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: http.n,v 1.24.2.4 2008/03/10 19:33:12 dgp Exp $ +'\" RCS: @(#) $Id: http.n,v 1.24.2.5 2008/03/13 14:47:28 dgp Exp $ '\" .so man.macros -.TH "http" n 2.5.5 http "Tcl Bundled Packages" +.TH "http" n 2.7 http "Tcl Bundled Packages" .BS '\" Note: do not modify the .SH NAME line immediately below! .SH NAME -http \- Client-side implementation of the HTTP/1.0 protocol +http \- Client-side implementation of the HTTP/1.1 protocol .SH SYNOPSIS -\fBpackage require http ?2.5.5?\fR +\fBpackage require http ?2.7?\fR .\" See Also -useragent option documentation in body! .sp \fB::http::config \fI?options?\fR @@ -50,9 +50,9 @@ http \- Client-side implementation of the HTTP/1.0 protocol .BE .SH DESCRIPTION .PP -The \fBhttp\fR package provides the client side of the HTTP/1.0 +The \fBhttp\fR package provides the client side of the HTTP/1.1 protocol. The package implements the GET, POST, and HEAD operations -of HTTP/1.0. It allows configuration of a proxy host to get through +of HTTP/1.1. It allows configuration of a proxy host to get through firewalls. The package is compatible with the \fBSafesock\fR security policy, so it can be used by untrusted applets to do URL fetching from a restricted set of hosts. This package can be extended to support @@ -123,7 +123,7 @@ characters. .TP \fB\-useragent\fR \fIstring\fR The value of the User-Agent header in the HTTP request. The default is -.QW "\fBTcl http client package 2.5\fR" . +.QW "\fBTcl http client package 2.7\fR" . .RE .TP \fB::http::geturl\fR \fIurl\fR ?\fIoptions\fR? @@ -206,6 +206,19 @@ HTTP request: Pragma: no-cache .CE .TP +\fB\-keepalive\fR \fIboolean\fR +If true, attempt to keep the connection open for servicing +multiple requests. Default is 0. +.TP +\fB\-method\fR \fItype\fR +Force the HTTP request method to \fItype\fR. \fB::http::geturl\fR will +auto-select GET, POST or HEAD based on other options, but this option +enables choices like PUT and DELETE for webdav support. +.TP +\fB\-myaddr\fR \fIaddress\fR +Pass an specific local address to the underlying \fBsocket\fR call in case +multiple interfaces are available. +.TP \fB\-progress\fR \fIcallback\fR The \fIcallback\fR is made after each transfer of data from the URL. The callback gets three additional arguments: the \fItoken\fR from @@ -222,6 +235,11 @@ proc httpProgress {token total current} { .CE .RE .TP +\fB\-protocol\fR \fIversion\fR +Select the HTTP protocol version to use. This should be 1.0 or 1.1 (the +default). Should only be necessary for servers that do not understand or +otherwise complain about HTTP/1.1. +.TP \fB\-query\fR \fIquery\fR This flag causes \fB::http::geturl\fR to do a POST request that passes the \fIquery\fR to the server. The \fIquery\fR must be an x-url-encoding @@ -251,6 +269,9 @@ The \fIcallback\fR is made after each transfer of data to the URL (i.e. POST) and acts exactly like the \fB\-progress\fR option (the callback format is the same). .TP +\fB\-strict\fR \fIboolean\fR +Whether to enforce RFC 3986 URL validation on the request. Default is 1. +.TP \fB\-timeout\fR \fImilliseconds\fR If \fImilliseconds\fR is non-zero, then \fB::http::geturl\fR sets up a timeout to occur after the specified number of milliseconds. @@ -453,7 +474,7 @@ The HTTP status reply from the server. This value is returned by the \fB::http::code\fR command. The format of this value is: .RS .CS -\fIHTTP/1.0 code string\fR +\fIHTTP/1.1 code string\fR .CE The \fIcode\fR is a three-digit number defined in the HTTP standard. A code of 200 is OK. Codes beginning with 4 or 5 indicate errors. @@ -7,7 +7,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: info.n,v 1.18.2.2 2007/11/01 16:25:49 dgp Exp $ +'\" RCS: @(#) $Id: info.n,v 1.18.2.3 2008/03/13 14:47:29 dgp Exp $ '\" .so man.macros .TH info n 8.4 Tcl "Tcl Built-In Commands" @@ -186,7 +186,7 @@ possible the lines are counted based on the smallest possible \fBeval\fR or procedure body, as that scope is usually easier to find than any dynamic outer scope. .PP -The syntactic form \fB{expand}\fR is handled like \fBeval\fR. I.e. if it +The syntactic form \fB{*}\fR is handled like \fBeval\fR. I.e. if it is given a literal list argument the system tracks the linenumber within the list words as well, and otherwise all linenumbers are counted relative to the start of each word (smallest scope) diff --git a/generic/tclEncoding.c b/generic/tclEncoding.c index 619c2b4..5fd3f20 100644 --- a/generic/tclEncoding.c +++ b/generic/tclEncoding.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclEncoding.c,v 1.55.2.2 2007/11/12 19:18:16 dgp Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.55.2.3 2008/03/13 14:47:29 dgp Exp $ */ #include "tclInt.h" @@ -1972,6 +1972,7 @@ LoadEscapeEncoding( final[sizeof(final) - 1] = '\0'; } else { EscapeSubTable est; + Encoding *e; strncpy(est.sequence, argv[1], sizeof(est.sequence)); est.sequence[sizeof(est.sequence) - 1] = '\0'; @@ -1984,9 +1985,13 @@ LoadEscapeEncoding( * To avoid infinite recursion in [encoding system iso2022-*] */ - Tcl_GetEncoding(NULL, est.name); - - est.encodingPtr = NULL; + e = (Encoding *) Tcl_GetEncoding(NULL, est.name); + if (e && e->toUtfProc != TableToUtfProc && + e->toUtfProc != Iso88591ToUtfProc) { + Tcl_FreeEncoding((Tcl_Encoding) e); + e = NULL; + } + est.encodingPtr = e; Tcl_DStringAppend(&escapeData, (char *) &est, sizeof(est)); } } diff --git a/generic/tclVar.c b/generic/tclVar.c index 14b37a6..1244053 100644 --- a/generic/tclVar.c +++ b/generic/tclVar.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclVar.c,v 1.135.2.13 2007/11/25 06:45:44 dgp Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.135.2.14 2008/03/13 14:47:29 dgp Exp $ */ #include "tclInt.h" @@ -4360,10 +4360,16 @@ TclDeleteNamespaceVars( for (varPtr = VarHashFirstVar(tablePtr, &search); varPtr != NULL; varPtr = VarHashFirstVar(tablePtr, &search)) { + Tcl_Obj *objPtr = Tcl_NewObj(); + Tcl_IncrRefCount(objPtr); + VarHashRefCount(varPtr)++; /* Make sure we get to remove from * hash. */ - UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ VarHashGetKey(varPtr), + Tcl_GetVariableFullName(interp, (Tcl_Var) varPtr, objPtr); + UnsetVarStruct(varPtr, NULL, iPtr, /* part1 */ objPtr, NULL, flags); + Tcl_DecrRefCount(objPtr); /* free no longer needed obj */ + /* * Remove the variable from the table and force it undefined in case diff --git a/library/http/http.tcl b/library/http/http.tcl index e59d12c..d6777fb 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -8,34 +8,27 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: http.tcl,v 1.60.2.1 2008/03/07 22:05:06 dgp Exp $ - -# 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. +# RCS: @(#) $Id: http.tcl,v 1.60.2.2 2008/03/13 14:47:30 dgp Exp $ package require Tcl 8.4 # Keep this in sync with pkgIndex.tcl and with the install directories # in Makefiles -package provide http 2.5.5 +package provide http 2.7 namespace eval http { + # Allow resourcing to not clobber existing data + variable http - array set http { - -accept */* - -proxyhost {} - -proxyport {} - -proxyfilter http::ProxyRequired - -urlencoding utf-8 + if {![info exists http]} { + array set http { + -accept */* + -proxyhost {} + -proxyport {} + -proxyfilter http::ProxyRequired + -urlencoding utf-8 + } + set http(-useragent) "Tcl http client package [package provide http]" } - set http(-useragent) "Tcl http client package [package provide http]" proc init {} { # Set up the map for quoting chars. RFC3986 Section 2.3 say percent @@ -52,25 +45,57 @@ namespace eval http { # These are handled specially set map(\n) %0d%0a variable formMap [array get map] + + # Create a map for HTTP/1.1 open sockets + variable socketmap + if {[info exists socketmap]} { + # Close but don't remove open sockets on re-init + foreach {url sock} [array get socketmap] { + catch {close $sock} + } + } + array set socketmap {} } init variable urlTypes - array set urlTypes { - http {80 ::socket} + if {![info exists urlTypes]} { + set urlTypes(http) [list 80 ::socket] } variable encodings [string tolower [encoding names]] # This can be changed, but iso8859-1 is the RFC standard. - variable defaultCharset "iso8859-1" + variable defaultCharset + if {![info exists defaultCharset]} { + set defaultCharset "iso8859-1" + } # Force RFC 3986 strictness in geturl url verification? - variable strict 1 + variable strict + if {![info exists strict]} { + set strict 1 + } + + # Let user control default keepalive for compatibility + variable defaultKeepalive + if {![info exists defaultKeepalive]} { + set defaultKeepalive 0 + } namespace export geturl config reset wait formatQuery register unregister # Useful, but not exported: data size status code } +# http::Log -- +# +# Debugging output -- define this to observe HTTP/1.1 socket usage. +# Should echo any args received. +# +# Arguments: +# msg Message to output +# +proc http::Log {args} {} + # http::register -- # # See documentation for details. @@ -165,22 +190,63 @@ proc http::Finish { token {errormsg ""} {skipCB 0}} { variable $token upvar 0 $token state global errorInfo errorCode - if {[string length $errormsg] != 0} { + if {$errormsg ne ""} { set state(error) [list $errormsg $errorInfo $errorCode] - set state(status) error + set state(status) "error" + } + if {($state(status) eq "timeout") || ($state(status) eq "error") + || ([info exists state(connection)] && ($state(connection) eq "close")) + } { + CloseSocket $state(sock) $token } - catch {close $state(sock)} - catch {after cancel $state(after)} + if {[info exists state(after)]} { after cancel $state(after) } if {[info exists state(-command)] && !$skipCB} { if {[catch {eval $state(-command) {$token}} err]} { - if {[string length $errormsg] == 0} { + if {$errormsg eq ""} { 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) + # Command callback may already have unset our state + unset -nocomplain state(-command) + } +} + +# http::CloseSocket - +# +# Close a socket and remove it from the persistent sockets table. +# If possible an http token is included here but when we are called +# from a fileevent on remote closure we need to find the correct +# entry - hence the second section. + +proc ::http::CloseSocket {s {token {}}} { + variable socketmap + catch {fileevent $s readable {}} + set conn_id {} + if {$token ne ""} { + variable $token + upvar 0 $token state + if {[info exists state(socketinfo)]} { + set conn_id $state(socketinfo) + } + } else { + set map [array get socketmap] + set ndx [lsearch -exact $map $s] + if {$ndx != -1} { + incr ndx -1 + set conn_id [lindex $map $ndx] + } + } + if {$conn_id eq {} || ![info exists socketmap($conn_id)]} { + Log "Closing socket $s (no connection info)" + if {[catch {close $s} err]} { Log "Error: $err" } + } else { + if {[info exists socketmap($conn_id)]} { + Log "Closing connection $conn_id (sock $socketmap($conn_id))" + if {[catch {close $socketmap($conn_id)} err]} { Log "Error: $err" } + unset socketmap($conn_id) + } else { + Log "Cannot close connection $conn_id - no socket in socket map" } } } @@ -226,6 +292,7 @@ proc http::geturl { url args } { variable http variable urlTypes variable defaultCharset + variable defaultKeepalive variable strict # Initialize the state variable, an array. We'll return the name of this @@ -243,13 +310,15 @@ proc http::geturl { url args } { array set state { -binary false - -blocksize 8192 + -blocksize 8192 -queryblocksize 8192 - -validate 0 - -headers {} - -timeout 0 - -type application/x-www-form-urlencoded + -validate 0 + -headers {} + -timeout 0 + -type application/x-www-form-urlencoded -queryprogress {} + -protocol 1.1 + binary 0 state header meta {} coding {} @@ -257,31 +326,37 @@ proc http::geturl { url args } { totalsize 0 querylength 0 queryoffset 0 - type text/html - body {} + type text/html + body {} status "" - http "" + http "" + connection close } + set state(-keepalive) $defaultKeepalive + set state(-strict) $strict # These flags have their types verified [Bug 811170] array set type { -binary boolean -blocksize integer -queryblocksize integer - -validate boolean + -strict boolean -timeout integer + -validate boolean } 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 { + -binary -blocksize -channel -command -handler -headers -keepalive + -method -myaddr -progress -protocol -query -queryblocksize + -querychannel -queryprogress -strict -timeout -type -validate + } + set usage [join [lsort $options] ", "] set options [string map {- ""} $options] set pat ^-([join $options |])$ foreach {flag value} $args { - if {[regexp $pat $flag]} { + if {[regexp -- $pat $flag]} { # Validate numbers - if {[info exists type($flag)] && \ - ![string is $type($flag) -strict $value]} { + 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)" } @@ -334,7 +409,8 @@ proc http::geturl { url args } { # # From a validation perspective, we need to ensure that the parts of the # URL that are going to the server are correctly encoded. - # This is only done if $::http::strict is true (default 0 for compat). + # This is only done if $state(-strict) is true (inherited from + # $::http::strict). set URLmatcher {(?x) # this is _expanded_ syntax ^ @@ -367,7 +443,7 @@ proc http::geturl { url args } { # Note that we don't check the hostname for validity here; if it's # invalid, we'll simply fail to resolve it later on. } - if {$port ne "" && $port>65535} { + if {$port ne "" && $port > 65535} { unset $token return -code error "Invalid port number: $port" } @@ -380,7 +456,7 @@ proc http::geturl { url args } { (?: [-\w.~!$&'()*+,;=:] | %[0-9a-f][0-9a-f] )+ $ } - if {$strict && ![regexp -- $validityRE $user]} { + if {$state(-strict) && ![regexp -- $validityRE $user]} { unset $token # Provide a better error message in this error case if {[regexp {(?i)%(?![0-9a-f][0-9a-f]).?.?} $user bad]} { @@ -400,7 +476,7 @@ proc http::geturl { url args } { (?: \? (?: [-\w.~!$&'()*+,;=:@/?] | %[0-9a-f][0-9a-f] )* )? $ } - if {$strict && ![regexp -- $validityRE $srvurl]} { + if {$state(-strict) && ![regexp -- $validityRE $srvurl]} { unset $token # Provide a better error message in this error case if {[regexp {(?i)%(?![0-9a-f][0-9a-f])..} $srvurl bad]} { @@ -412,7 +488,7 @@ proc http::geturl { url args } { } else { set srvurl / } - if {[string length $proto] == 0} { + if {$proto eq ""} { set proto http } if {![info exists urlTypes($proto)]} { @@ -422,7 +498,7 @@ proc http::geturl { url args } { set defport [lindex $urlTypes($proto) 0] set defcmd [lindex $urlTypes($proto) 1] - if {[string length $port] == 0} { + if {$port eq ""} { set port $defport } if {![catch {$http(-proxyfilter) $host} proxy]} { @@ -447,39 +523,70 @@ proc http::geturl { url args } { # If a timeout is specified we set up the after event and arrange for an # asynchronous socket connection. + set sockopts [list] if {$state(-timeout) > 0} { set state(after) [after $state(-timeout) \ [list http::reset $token timeout]] - set async -async - } else { - set async "" + lappend sockopts -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]} { + if {[info exists phost] && ($phost ne "")} { set srvurl $url - set conStat [catch {eval $defcmd $async {$phost $pport}} s] + set targetAddr [list $phost $pport] } else { - set conStat [catch {eval $defcmd $async {$host $port}} s] + set targetAddr [list $host $port] } - - 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 + # Proxy connections aren't shared among different hosts. + set state(socketinfo) $host:$port + + # See if we are supposed to use a previously opened channel. + if {$state(-keepalive)} { + variable socketmap + if {[info exists socketmap($state(socketinfo))]} { + if {[catch {fconfigure $socketmap($state(socketinfo))}]} { + Log "WARNING: socket for $state(socketinfo) was closed" + unset socketmap($state(socketinfo)) + } else { + set sock $socketmap($state(socketinfo)) + Log "reusing socket $sock for $state(socketinfo)" + catch {fileevent $sock writable {}} + catch {fileevent $sock readable {}} + } + } + # don't automatically close this connection socket + set state(connection) {} + } + if {![info exists sock]} { + # Pass -myaddr directly to the socket command + if {[info exists state(-myaddr)]} { + lappend sockopts -myaddr $state(-myaddr) + } + if {[catch {eval $defcmd $sockopts $targetAddr} sock]} { + # 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 state(sock) $sock + Finish $token "" 1 + cleanup $token + return -code error $sock + } + } + set state(sock) $sock + Log "Using $sock for $state(socketinfo)" \ + [expr {$state(-keepalive)?"keepalive":""}] + if {$state(-keepalive)} { + set socketmap($state(socketinfo)) $sock } - set state(sock) $s # Wait for the connection to complete. if {$state(-timeout) > 0} { - fileevent $s writable [list http::Connect $token] + fileevent $sock writable [list http::Connect $token] http::wait $token if {![info exists state]} { @@ -487,31 +594,29 @@ proc http::geturl { url args } { # command callback may have cleaned up the token. If so # we end up here with nothing left to do. return $token - } else { - if {$state(status) eq "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 {$state(status) ne "connect"} { - # Likely to be connection timeout - return $token - } - set state(status) "" + } elseif {$state(status) eq "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 {$state(status) ne "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) + fconfigure $sock -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} + catch {fconfigure $sock -blocking off} set how GET if {$isQuery} { set state(querylength) [string length $state(-query)] @@ -532,29 +637,57 @@ proc http::geturl { url args } { fconfigure $state(-querychannel) -blocking 1 -translation binary set contDone 0 } + if {[info exists state(-method)] && $state(-method) ne ""} { + set how $state(-method) + } if {[catch { - puts $s "$how $srvurl HTTP/1.0" - puts $s "Accept: $http(-accept)" - if {$port == $defport} { - # Don't add port in this case, to handle broken servers. [Bug - # 504508] - puts $s "Host: $host" + puts $sock "$how $srvurl HTTP/$state(-protocol)" + puts $sock "Accept: $http(-accept)" + array set hdrs $state(-headers) + if {[info exists hdrs(Host)]} { + # Allow Host spoofing [Bug 928154] + puts $sock "Host: $hdrs(Host)" + } elseif {$port == $defport} { + # Don't add port in this case, to handle broken servers. + # [Bug #504508] + puts $sock "Host: $host" } else { - puts $s "Host: $host:$port" + puts $sock "Host: $host:$port" } - puts $s "User-Agent: $http(-useragent)" + unset hdrs + puts $sock "User-Agent: $http(-useragent)" + if {$state(-protocol) == 1.0 && $state(-keepalive)} { + puts $sock "Connection: keep-alive" + } + if {$state(-protocol) > 1.0 && !$state(-keepalive)} { + puts $sock "Connection: close" ;# RFC2616 sec 8.1.2.1 + } + if {[info exists phost] && ($phost ne "") && $state(-keepalive)} { + puts $sock "Proxy-Connection: Keep-Alive" + } + set accept_encoding_seen 0 foreach {key value} $state(-headers) { + if {[string equal -nocase $key "host"]} { continue } + if {[string equal -nocase $key "accept-encoding"]} { + set accept_encoding_seen 1 + } set value [string map [list \n "" \r ""] $value] set key [string trim $key] - if {$key eq "Content-Length"} { + if {[string equal -nocase $key "content-length"]} { set contDone 1 set state(querylength) $value } if {[string length $key]} { - puts $s "$key: $value" + puts $sock "$key: $value" } } + # Soft zlib dependency check - no package require + if {!$accept_encoding_seen && [llength [package provide zlib]] + && !([info exists state(-channel)] || [info exists state(-handler)]) + } { + puts $sock "Accept-Encoding: gzip, identity, *;q=0.1" + } if {$isQueryChannel && $state(querylength) == 0} { # Try to determine size of data in channel. If we cannot seek, the # surrounding catch will trap us @@ -583,17 +716,17 @@ proc http::geturl { url args } { # their POST data if they expect the client to read their response. if {$isQuery || $isQueryChannel} { - puts $s "Content-Type: $state(-type)" + puts $sock "Content-Type: $state(-type)" if {!$contDone} { - puts $s "Content-Length: $state(querylength)" + puts $sock "Content-Length: $state(querylength)" } - puts $s "" - fconfigure $s -translation {auto binary} - fileevent $s writable [list http::Write $token] + puts $sock "" + fconfigure $sock -translation {auto binary} + fileevent $sock writable [list http::Write $token] } else { - puts $s "" - flush $s - fileevent $s readable [list http::Event $token] + puts $sock "" + flush $sock + fileevent $sock readable [list http::Event $sock $token] } if {! [info exists state(-command)]} { @@ -639,7 +772,7 @@ proc http::data {token} { return $state(body) } proc http::status {token} { - if {![info exists $token]} { return "error" } + if {![info exists $token]} { return "error" } variable $token upvar 0 $token state return $state(status) @@ -733,7 +866,7 @@ proc http::Connect {token} { proc http::Write {token} { variable $token upvar 0 $token state - set s $state(sock) + set sock $state(sock) # Output a block. Tcl will buffer this if the socket blocks set done 0 @@ -744,19 +877,20 @@ proc http::Write {token} { # 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}]] + puts -nonewline $sock \ + [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) + puts $sock "" set done 1 } } else { # Copy blocks from the query channel set outStr [read $state(-querychannel) $state(-queryblocksize)] - puts -nonewline $s $outStr + puts -nonewline $sock $outStr incr state(queryoffset) [string length $outStr] if {[eof $state(-querychannel)]} { set done 1 @@ -770,16 +904,16 @@ proc http::Write {token} { set done 1 } if {$done} { - catch {flush $s} - fileevent $s writable {} - fileevent $s readable [list http::Event $token] + catch {flush $sock} + fileevent $sock writable {} + fileevent $sock readable [list http::Event $sock $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)] + eval $state(-queryprogress) \ + [list $token $state(querylength) $state(queryoffset)] } } @@ -788,112 +922,223 @@ proc http::Write {token} { # Handle input on the socket # # Arguments +# sock The socket receiving input. # token The token returned from http::geturl # # Side Effects # Read the socket and handle callbacks. -proc http::Event {token} { +proc http::Event {sock token} { variable $token upvar 0 $token state - set s $state(sock) + if {![info exists state]} { + Log "Event $sock with invalid token '$token' - remote close?" + if {! [eof $sock]} { + if {[string length [set d [read $sock]]] != 0} { + Log "WARNING: additional data left on closed socket" + } + } + CloseSocket $sock + return + } if {$state(state) eq "header"} { - if {[catch {gets $s line} n]} { + if {[catch {gets $sock line} n]} { return [Finish $token $n] } elseif {$n == 0} { - variable encodings + # We have now read all headers + # We ignore HTTP/1.1 100 Continue returns. RFC2616 sec 8.2.3 + if {$state(http) == "" || [lindex $state(http) 1] == 100} { return } + set state(state) body - if {$state(-binary) || ![string match -nocase text* $state(type)] - || [string match *gzip* $state(coding)] - || [string match *compress* $state(coding)]} { + + # If doing a HEAD, then we won't get any body + if {$state(-validate)} { + Eof $token + return + } + + # For non-chunked transfer we may have no body -- in this case we + # may get no further file event if the connection doesn't close and + # no more data is sent. We can tell and must finish up now - not + # later. + if {!(([info exists state(connection)] + && ($state(connection) eq "close")) + || [info exists state(transfer)]) + && $state(totalsize) == 0 + } then { + Log "body size is 0 and no events likely - complete." + Eof $token + return + } + + # We have to use binary translation to count bytes properly. + fconfigure $sock -translation binary + + if {$state(-binary) || ![string match -nocase text* $state(type)]} { # Turn off conversions for non-text data - fconfigure $s -translation binary + set state(binary) 1 + } + if {$state(binary) || [string match *gzip* $state(coding)] + || [string match *compress* $state(coding)]} { 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)]} { + if {[info exists state(-channel)] && + ![info exists state(-handler)]} { # Initiate a sequence of background fcopies - fileevent $s readable {} - CopyStart $s $token + fileevent $sock readable {} + CopyStart $sock $token return } } 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] - } + # Process header lines if {[regexp -nocase {^([^:]+):(.+)$} $line x key value]} { + switch -- [string tolower $key] { + content-type { + set state(type) [string trim [string tolower $value]] + # grab the optional charset information + regexp -nocase {charset\s*=\s*(\S+?);?} \ + $state(type) -> state(charset) + } + content-length { + set state(totalsize) [string trim $value] + } + content-encoding { + set state(coding) [string trim $value] + } + transfer-encoding { + set state(transfer) \ + [string trim [string tolower $value]] + } + proxy-connection - + connection { + set state(connection) \ + [string trim [string tolower $value]] + } + } lappend state(meta) $key [string trim $value] } elseif {[string match HTTP* $line]} { set state(http) $line } } } else { + # Now reading body if {[catch { if {[info exists state(-handler)]} { - set n [eval $state(-handler) {$s $token}] + set n [eval $state(-handler) [list $sock $token]] + } elseif {[info exists state(transfer_final)]} { + set line [getTextLine $sock] + set n [string length $line] + if {$n > 0} { + Log "found $n bytes following final chunk" + append state(transfer_final) $line + } else { + Log "final chunk part" + Eof $token + } + } elseif {[info exists state(transfer)] + && $state(transfer) eq "chunked"} { + set size 0 + set chunk [getTextLine $sock] + set n [string length $chunk] + if {[string trim $chunk] ne ""} { + scan $chunk %x size + if {$size != 0} { + set bl [fconfigure $sock -blocking] + fconfigure $sock -blocking 1 + set chunk [read $sock $size] + fconfigure $sock -blocking $bl + set n [string length $chunk] + if {$n >= 0} { + append state(body) $chunk + } + if {$size != [string length $chunk]} { + Log "WARNING: mis-sized chunk:\ + was [string length $chunk], should be $size" + } + getTextLine $sock + } else { + set state(transfer_final) {} + } + } } else { - set block [read $s $state(-blocksize)] + #Log "read non-chunk $state(currentsize) of $state(totalsize)" + set block [read $sock $state(-blocksize)] set n [string length $block] if {$n >= 0} { append state(body) $block } } - if {$n >= 0} { - incr state(currentsize) $n + if {[info exists state]} { + if {$n >= 0} { + incr state(currentsize) $n + } + # If Content-Length - check for end of data. + if {($state(totalsize) > 0) + && ($state(currentsize) >= $state(totalsize))} { + Eof $token + } } } err]} { return [Finish $token $err] } else { if {[info exists state(-progress)]} { eval $state(-progress) \ - {$token $state(totalsize) $state(currentsize)} + [list $token $state(totalsize) $state(currentsize)] } } } - if {[eof $s]} { - Eof $token + # catch as an Eof above may have closed the socket already + if {![catch {eof $sock} eof] && $eof} { + if {[info exists $token]} { + set state(connection) close + Eof $token + } else { + # open connection closed on a token that has been cleaned up. + CloseSocket $sock + } return } } +# http::getTextLine -- +# +# Get one line with the stream in blocking crlf mode +# +# Arguments +# sock The socket receiving input. +# +# Results: +# The line of text, without trailing newline + +proc http::getTextLine {sock} { + set tr [fconfigure $sock -translation] + set bl [fconfigure $sock -blocking] + fconfigure $sock -translation crlf -blocking 1 + set r [gets $sock] + fconfigure $sock -translation $tr -blocking $bl + return $r +} + # http::CopyStart # # Error handling wrapper around fcopy # # Arguments -# s The socket to copy from +# sock 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} { +proc http::CopyStart {sock token} { variable $token upvar 0 $token state if {[catch { - fcopy $s $state(-channel) -size $state(-blocksize) -command \ + fcopy $sock $state(-channel) -size $state(-blocksize) -command \ [list http::CopyDone $token] } err]} { Finish $token $err @@ -914,18 +1159,19 @@ proc http::CopyStart {s token} { proc http::CopyDone {token count {error {}}} { variable $token upvar 0 $token state - set s $state(sock) + set sock $state(sock) incr state(currentsize) $count if {[info exists state(-progress)]} { - eval $state(-progress) {$token $state(totalsize) $state(currentsize)} + eval $state(-progress) \ + [list $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} { + } elseif {[catch {eof $sock} iseof] || $iseof} { Eof $token } else { - CopyStart $s $token + CopyStart $sock $token } } @@ -939,7 +1185,7 @@ proc http::CopyDone {token count {error {}}} { # Side Effects # Clean up the socket -proc http::Eof {token} { +proc http::Eof {token {force 0}} { variable $token upvar 0 $token state if {$state(state) eq "header"} { @@ -948,7 +1194,31 @@ proc http::Eof {token} { } else { set state(status) ok } - set state(state) eof + + if {($state(coding) eq "gzip") && [string length $state(body)] > 0} { + if {[catch { + set state(body) [Gunzip $state(body)] + } err]} { + return [Finish $token $err] + } + } + + if {!$state(binary)} { + + # 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 enc [CharsetToEncoding $state(charset)] + if {$enc ne "binary"} { + set state(body) [encoding convertfrom $enc $state(body)] + } + + # Translate text line endings. + set state(body) [string map {\r\n \n \r \n} $state(body)] + } + Finish $token } @@ -966,9 +1236,9 @@ proc http::wait {token} { variable $token upvar 0 $token state - if {![info exists state(status)] || [string length $state(status)] == 0} { + if {![info exists state(status)] || $state(status) eq ""} { # We must wait on the original variable name, not the upvar alias - vwait $token\(status) + vwait ${token}(status) } return [status $token] @@ -976,7 +1246,7 @@ proc http::wait {token} { # http::formatQuery -- # -# See documentation for details. Call http::formatQuery with an even +# 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. # @@ -1052,6 +1322,99 @@ proc http::ProxyRequired {host} { } } +# http::CharsetToEncoding -- +# +# Tries to map a given IANA charset to a tcl encoding. +# If no encoding can be found, returns binary. +# + +proc http::CharsetToEncoding {charset} { + variable encodings + + set charset [string tolower $charset] + if {[regexp {iso-?8859-([0-9]+)} $charset - num]} { + set encoding "iso8859-$num" + } elseif {[regexp {iso-?2022-(jp|kr)} $charset - ext]} { + set encoding "iso2022-$ext" + } elseif {[regexp {shift[-_]?js} $charset -]} { + set encoding "shiftjis" + } elseif {[regexp {(windows|cp)-?([0-9]+)} $charset - - num]} { + set encoding "cp$num" + } elseif {$charset eq "us-ascii"} { + set encoding "ascii" + } elseif {[regexp {(iso-?)?lat(in)?-?([0-9]+)} $charset - - - num]} { + switch -- $num { + 5 {set encoding "iso8859-9"} + 1 - + 2 - + 3 {set encoding "iso8859-$num"} + } + } else { + # other charset, like euc-xx, utf-8,... may directly maps to encoding + set encoding $charset + } + set idx [lsearch -exact $encodings $encoding] + if {$idx >= 0} { + return $encoding + } else { + return "binary" + } +} + +# http::Gunzip -- +# +# Decompress data transmitted using the gzip transfer coding. +# + +# FIX ME: redo using zlib sinflate +proc http::Gunzip {data} { + binary scan $data Scb5icc magic method flags time xfl os + set pos 10 + if {$magic != 0x1f8b} { + return -code error "invalid data: supplied data is not in gzip format" + } + if {$method != 8} { + return -code error "invalid compression method" + } + + foreach {f_text f_crc f_extra f_name f_comment} [split $flags ""] break + set extra "" + if { $f_extra } { + binary scan $data @${pos}S xlen + incr pos 2 + set extra [string range $data $pos $xlen] + set pos [incr xlen] + } + + set name "" + if { $f_name } { + set ndx [string first \0 $data $pos] + set name [string range $data $pos $ndx] + set pos [incr ndx] + } + + set comment "" + if { $f_comment } { + set ndx [string first \0 $data $pos] + set comment [string range $data $pos $ndx] + set pos [incr ndx] + } + + set fcrc "" + if { $f_crc } { + set fcrc [string range $data $pos [incr pos]] + incr pos + } + + binary scan [string range $data end-7 end] ii crc size + set inflated [zlib inflate [string range $data $pos end-8]] + + if { $crc != [set chk [zlib crc32 $inflated]] } { + return -code error "invalid data: checksum mismatch $crc != $chk" + } + return $inflated +} + # Local variables: # indent-tabs-mode: t # End: diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index cf6a1ff..870019a 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,12 +1,4 @@ # 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. if {![package vsatisfies [package provide Tcl] 8.4]} {return} -package ifneeded http 2.5.5 [list tclPkgSetup $dir http 2.5.5 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.7 [list tclPkgSetup $dir http 2.7 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] diff --git a/macosx/GNUmakefile b/macosx/GNUmakefile index 7d7a8b5..3a44c20 100644 --- a/macosx/GNUmakefile +++ b/macosx/GNUmakefile @@ -4,12 +4,12 @@ # uses the standard unix build system in tcl/unix (which can be used directly instead of this # if you are not using the tk/macosx projects). # -# Copyright (c) 2002-2007 Daniel A. Steffen <das@users.sourceforge.net> +# Copyright (c) 2002-2008 Daniel A. Steffen <das@users.sourceforge.net> # # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: GNUmakefile,v 1.5.2.2 2007/09/14 16:28:35 dgp Exp $ +# RCS: @(#) $Id: GNUmakefile,v 1.5.2.3 2008/03/13 14:47:31 dgp Exp $ # ######################################################################################################## @@ -74,6 +74,10 @@ BUILD_STYLE = CONFIGURE_ARGS = OBJ_DIR = ${OBJROOT}/${BUILD_STYLE} +empty := +space := ${empty} ${empty} +objdir := $(subst ${space},\ ,${OBJ_DIR}) + develop_make_args := BUILD_STYLE=Development CONFIGURE_ARGS=--enable-symbols deploy_make_args := BUILD_STYLE=Deployment INSTALL_TARGET=install-strip \ EXTRA_CFLAGS=-DNDEBUG @@ -118,31 +122,31 @@ install-${PROJECT}: target = ${INSTALL_TARGET} clean-${PROJECT} distclean-${PROJECT} test-${PROJECT}: \ target = $* -DO_MAKE = +${MAKE} -C ${OBJ_DIR} ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS} +DO_MAKE = +${MAKE} -C "${OBJ_DIR}" ${target} ${MAKE_ARGS_V} ${MAKE_ARGS} ${EXTRA_MAKE_ARGS} #------------------------------------------------------------------------------------------------------- # build rules ${PROJECT}: - ${MAKE} install-${PROJECT} INSTALL_ROOT=${OBJ_DIR}/ + ${MAKE} install-${PROJECT} INSTALL_ROOT="${OBJ_DIR}/" -${OBJ_DIR}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ +${objdir}/Makefile: ${UNIX_DIR}/Makefile.in ${UNIX_DIR}/configure \ ${UNIX_DIR}/tclConfig.sh.in Tcl-Info.plist.in - mkdir -p ${OBJ_DIR} && cd ${OBJ_DIR} && \ + mkdir -p "${OBJ_DIR}" && cd "${OBJ_DIR}" && \ if [ ${UNIX_DIR}/configure -nt config.status ]; then ${UNIX_DIR}/configure -C \ - --prefix=${PREFIX} --bindir=${BINDIR} --libdir=${LIBDIR} \ - --mandir=${MANDIR} --enable-threads --enable-framework --enable-dtrace \ + --prefix="${PREFIX}" --bindir="${BINDIR}" --libdir="${LIBDIR}" \ + --mandir="${MANDIR}" --enable-threads --enable-framework --enable-dtrace \ ${CONFIGURE_ARGS} ${EXTRA_CONFIGURE_ARGS}; else ./config.status; fi -build-${PROJECT}: ${OBJ_DIR}/Makefile +build-${PROJECT}: ${objdir}/Makefile ${DO_MAKE} ifeq (${INSTALL_BUILD},) # symolic link hackery to trick # 'make install INSTALL_ROOT=${OBJ_DIR}' # into building Tcl.framework and tclsh in ${SYMROOT} - @cd ${OBJ_DIR} && mkdir -p $(dir ./${LIBDIR}) $(dir ./${BINDIR}) ${SYMROOT} && \ - rm -f ./${LIBDIR} ./${BINDIR} && ln -fs ${SYMROOT} ./${LIBDIR} && \ - ln -fs ${SYMROOT} ./${BINDIR} && ln -fs ${OBJ_DIR}/tcltest ${SYMROOT} + @cd "${OBJ_DIR}" && mkdir -p $(dir $(subst ${space},\ ,./${LIBDIR})) $(dir $(subst ${space},\ ,./${BINDIR})) "${SYMROOT}" && \ + rm -f "./${LIBDIR}" "./${BINDIR}" && ln -fs "${SYMROOT}" "./${LIBDIR}" && \ + ln -fs "${SYMROOT}" "./${BINDIR}" && ln -fs "${OBJ_DIR}/tcltest" "${SYMROOT}" endif install-${PROJECT}: build-${PROJECT} @@ -171,7 +175,7 @@ else if [ -n "$${RM_USRLIB:-}" ]; then rm -f usr/lib; rmdir -p usr 2>&-; fi; \ if [ -n "$${RM_SYSTEM:-}" ]; then rm -f System; fi; fi # install tclsh symbolic link - @ln -fs ${TCLSH} ${INSTALL_ROOT}${BINDIR}/tclsh + @ln -fs ${TCLSH} "${INSTALL_ROOT}${BINDIR}/tclsh" endif endif ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_) @@ -179,20 +183,20 @@ ifeq (${BUILD_STYLE}_${EMBEDDED_BUILD},Development_) # Deployment build can be installed on top # of Development build without overwriting # the debug library - @cd ${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION} && \ + @cd "${INSTALL_ROOT}${LIBDIR}/${PRODUCT_NAME}.framework/Versions/${VERSION}" && \ ln -f "${PRODUCT_NAME}" "${PRODUCT_NAME}_debug" endif clean-${PROJECT}: %-${PROJECT}: ${DO_MAKE} - rm -rf ${SYMROOT}/{${PRODUCT_NAME}.framework,${TCLSH},tcltest} - rm -f ${OBJ_DIR}{${LIBDIR},${BINDIR}} && \ - rmdir -p ${OBJ_DIR}$(dir ${LIBDIR}) 2>&- || true && \ - rmdir -p ${OBJ_DIR}$(dir ${BINDIR}) 2>&- || true + rm -rf "${SYMROOT}"/{${PRODUCT_NAME}.framework,${TCLSH},tcltest} + rm -f "${OBJ_DIR}"{"${LIBDIR}","${BINDIR}"} && \ + rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${LIBDIR})) 2>&- || true && \ + rmdir -p "${OBJ_DIR}"$(dir $(subst ${space},\ ,${BINDIR})) 2>&- || true distclean-${PROJECT}: %-${PROJECT}: clean-${PROJECT} ${DO_MAKE} - rm -rf ${OBJ_DIR} + rm -rf "${OBJ_DIR}" test-${PROJECT}: %-${PROJECT}: build-${PROJECT} ${DO_MAKE} diff --git a/macosx/Tcl-Common.xcconfig b/macosx/Tcl-Common.xcconfig index b40d9d9..c0a8b95 100644 --- a/macosx/Tcl-Common.xcconfig +++ b/macosx/Tcl-Common.xcconfig @@ -4,17 +4,18 @@ // This file contains the Xcode build settings comon to all // project configurations in Tcl.xcodeproj. // -// Copyright (c) 2007 Daniel A. Steffen <das@users.sourceforge.net> +// Copyright (c) 2007-2008 Daniel A. Steffen <das@users.sourceforge.net> // // See the file "license.terms" for information on usage and redistribution // of this file, and for a DISCLAIMER OF ALL WARRANTIES. // -// RCS: @(#) $Id: Tcl-Common.xcconfig,v 1.3.2.4 2007/09/14 16:28:37 dgp Exp $ +// RCS: @(#) $Id: Tcl-Common.xcconfig,v 1.3.2.5 2008/03/13 14:47:31 dgp Exp $ // -HEADER_SEARCH_PATHS = $(DERIVED_FILE_DIR)/tcl $(HEADER_SEARCH_PATHS) -OTHER_LDFLAGS = -headerpad_max_install_names -sectcreate __TEXT __info_plist $(DERIVED_FILE_DIR)/tcl/Tclsh-Info.plist $(OTHER_LDFLAGS) -INSTALL_PATH = "$(BINDIR)" +HEADER_SEARCH_PATHS = "$(DERIVED_FILE_DIR)/tcl" $(HEADER_SEARCH_PATHS) +OTHER_LDFLAGS = -headerpad_max_install_names -sectcreate __TEXT __info_plist "$(DERIVED_FILE_DIR)/tcl/Tclsh-Info.plist" $(OTHER_LDFLAGS) +INSTALL_PATH = $(BINDIR) +INSTALL_MODE_FLAG = go-w,a+rX GCC_PREFIX_HEADER = $(DERIVED_FILE_DIR)/tcl/tclConfig.h GCC_GENERATE_DEBUGGING_SYMBOLS = YES GCC_NO_COMMON_BLOCKS = YES @@ -22,6 +23,7 @@ GCC_DYNAMIC_NO_PIC = YES GCC = $(DEVELOPER_DIR)/usr/bin/gcc GCC_VERSION = 4.0 CC = $(GCC)-$(GCC_VERSION) +LD = $(CC) WARNING_CFLAGS_GCC3 = -Wall -Wno-implicit-int -Wno-unused-parameter -Wno-deprecated-declarations WARNING_CFLAGS = -Wextra -Wno-missing-field-initializers -Winit-self -Wpointer-arith -Wcast-align -Wdisabled-optimization -Winline $(WARNING_CFLAGS_GCC3) $(WARNING_CFLAGS) BINDIR = $(PREFIX)/bin diff --git a/macosx/Tcl.xcodeproj/default.pbxuser b/macosx/Tcl.xcodeproj/default.pbxuser index 47e6f9b..45224d6 100644 --- a/macosx/Tcl.xcodeproj/default.pbxuser +++ b/macosx/Tcl.xcodeproj/default.pbxuser @@ -16,7 +16,7 @@ userBuildSettings = { AUTOCONF = "/usr/local/bin/autoconf-2.59"; AUTOHEADER = "/usr/local/bin/autoheader-2.59"; - GCC = "${DEVELOPER_DIR}/usr/bin/gcc"; + CODE_SIGN_IDENTITY = ""; SYMROOT = "${SRCROOT}/../../build/tcl"; TCL_SRCROOT = "${SRCROOT}/../../tcl"; }; diff --git a/macosx/Tcl.xcodeproj/project.pbxproj b/macosx/Tcl.xcodeproj/project.pbxproj index 6490464..4a15a35 100644 --- a/macosx/Tcl.xcodeproj/project.pbxproj +++ b/macosx/Tcl.xcodeproj/project.pbxproj @@ -933,7 +933,7 @@ F966C06F08F281DC005CB29B /* Frameworks */, 1AB674ADFE9D54B511CA2CBB /* Products */, ); - comments = "Copyright (c) 2004-2007 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.21.2.6 2007/11/16 07:20:55 dgp Exp $\n"; + comments = "Copyright (c) 2004-2008 Daniel A. Steffen <das@users.sourceforge.net>\n\nSee the file \"license.terms\" for information on usage and redistribution of\nthis file, and for a DISCLAIMER OF ALL WARRANTIES.\n\nRCS: @(#) $Id: project.pbxproj,v 1.21.2.7 2008/03/13 14:47:32 dgp Exp $\n"; name = Tcl; path = .; sourceTree = SOURCE_ROOT; @@ -1959,12 +1959,14 @@ files = ( ); inputPaths = ( + "${TARGET_TEMP_DIR}/.none", ); outputPaths = ( + "${TARGET_BUILD_DIR}/${EXECUTABLE_NAME}", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/bash; - shellScript = "if [ -e \"${BUILT_PRODUCTS_DIR}/tclsh\" ]; then\n mv -f \"${BUILT_PRODUCTS_DIR}/tclsh\" \"${BUILT_PRODUCTS_DIR}/tclsh${VERSION}\"\nfi\ngnumake -C \"${TCL_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${BUILT_PRODUCTS_DIR}/tclsh${VERSION}\" ]; then\n mv -f \"${BUILT_PRODUCTS_DIR}/tclsh${VERSION}\" \"${BUILT_PRODUCTS_DIR}/tclsh\"\nfi\nif [ -e \"${BUILT_PRODUCTS_DIR}/tcltest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tcltest\"\nfi\necho \"Done\"\nexit ${result}\n"; + shellScript = "if [ -e \"${TARGET_BUILD_DIR}/tclsh\" ]; then\n mv -f \"${TARGET_BUILD_DIR}/tclsh\" \"${TARGET_BUILD_DIR}/tclsh${VERSION}\"\nfi\ngnumake -C \"${TCL_SRCROOT}/macosx\" -j \"$(sysctl -n hw.activecpu)\" \"$(echo \"${ACTION}\" | sed -e s/build// -e s/clean/distclean/ -e s/..\\*/\\&-/)${MAKE_TARGET}\" CFLAGS_WARNING=\"${WARNING_CFLAGS}\" CFLAGS_OPTIMIZE=\"-O${GCC_OPTIMIZATION_LEVEL}\" SYMROOT=\"${BUILT_PRODUCTS_DIR}\" OBJ_DIR=\"${OBJECT_FILE_DIR}\" INSTALL_ROOT=\"${DSTROOT}\" PREFIX=\"${PREFIX}\" BINDIR=\"${BINDIR}\" LIBDIR=\"${FRAMEWORK_INSTALL_PATH}\" MANDIR=\"${MANDIR}\" EXTRA_CONFIGURE_ARGS=\"${CONFIGURE_ARGS}\" ${EXTRA_MAKE_FLAGS}\nresult=$?\nif [ -e \"${TARGET_BUILD_DIR}/tclsh${VERSION}\" ]; then\n mv -f \"${TARGET_BUILD_DIR}/tclsh${VERSION}\" \"${TARGET_BUILD_DIR}/tclsh\"\nfi\nif [ -e \"${BUILT_PRODUCTS_DIR}/tcltest\" ]; then\n\trm -f \"${BUILT_PRODUCTS_DIR}/tcltest\"\nfi\necho \"Done\"\nrm -f \"${SCRIPT_INPUT_FILE_0}\"\nexit ${result}\n"; showEnvVarsInLog = 0; }; F9A5C5F508F651A2008AE941 /* ShellScript */ = { @@ -2168,6 +2170,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = ReleaseUniversal; }; @@ -2202,6 +2205,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = DebugMemCompile; }; @@ -2236,6 +2240,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = Debug; }; @@ -2243,6 +2248,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = Release; }; @@ -2250,6 +2256,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = DebugNoFixZL; }; @@ -2384,6 +2391,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = Debug64bit; }; @@ -2416,10 +2424,196 @@ }; name = Debug64bit; }; + F9988AB10D814C6500B6B03B /* Debug gcc42 */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tcl-Debug.xcconfig */; + buildSettings = { + GCC_VERSION = 4.2; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + }; + name = "Debug gcc42"; + }; + F9988AB20D814C6500B6B03B /* Debug gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; + }; + name = "Debug gcc42"; + }; + F9988AB30D814C6500B6B03B /* Debug gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "$(GCC_PREPROCESSOR_DEFINITIONS)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + PRODUCT_NAME = tcltest; + ZERO_LINK = YES; + }; + name = "Debug gcc42"; + }; + F9988AB40D814C6500B6B03B /* Debug gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tests; + TCLTEST_OPTIONS = ""; + TCL_LIBRARY = "$(TCL_SRCROOT)/library"; + TEST_RIG = "$(OBJROOT)/$(CONFIGURATION)/tcltest"; + }; + name = "Debug gcc42"; + }; + F9988AB50D814C7500B6B03B /* Debug llvmgcc42 */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE8330B65C87F00310EA2 /* Tcl-Debug.xcconfig */; + buildSettings = { + GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc"; + GCC_VERSION = 4.2; + MACOSX_DEPLOYMENT_TARGET = 10.5; + PREBINDING = NO; + }; + name = "Debug llvmgcc42"; + }; + F9988AB60D814C7500B6B03B /* Debug llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; + }; + name = "Debug llvmgcc42"; + }; + F9988AB70D814C7500B6B03B /* Debug llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + CONFIGURE_ARGS = "tcl_cv_cc_visibility_hidden=no $(CONFIGURE_ARGS)"; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_FIX_AND_CONTINUE = YES; + GCC_PREPROCESSOR_DEFINITIONS = ( + "__private_extern__=extern", + "$(GCC_PREPROCESSOR_DEFINITIONS)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + PRODUCT_NAME = tcltest; + ZERO_LINK = YES; + }; + name = "Debug llvmgcc42"; + }; + F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tests; + TCLTEST_OPTIONS = ""; + TCL_LIBRARY = "$(TCL_SRCROOT)/library"; + TEST_RIG = "$(OBJROOT)/$(CONFIGURATION)/tcltest"; + }; + name = "Debug llvmgcc42"; + }; + F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc42 */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + ppc64, + i386, + x86_64, + ); + CFLAGS = "-arch ppc -arch ppc64 -arch i386 -arch x86_64 $(CFLAGS)"; + GCC_VERSION = 4.2; + MACOSX_DEPLOYMENT_TARGET = 10.5; + OTHER_LDFLAGS = ( + "-Wl,-no_arch_warnings", + "$(OTHER_LDFLAGS)", + ); + PREBINDING = NO; + }; + name = "ReleaseUniversal gcc42"; + }; + F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; + }; + name = "ReleaseUniversal gcc42"; + }; + F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tcltest; + }; + name = "ReleaseUniversal gcc42"; + }; + F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tests; + TCLTEST_OPTIONS = ""; + TCL_LIBRARY = "$(TCL_SRCROOT)/library"; + TEST_RIG = "$(OBJROOT)/$(CONFIGURATION)/tcltest"; + }; + name = "ReleaseUniversal gcc42"; + }; + F9988BB50D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { + isa = XCBuildConfiguration; + baseConfigurationReference = F97AE82B0B65C69B00310EA2 /* Tcl-Release.xcconfig */; + buildSettings = { + ARCHS = ( + ppc, + i386, + x86_64, + ); + CFLAGS = "-arch ppc -arch i386 -arch x86_64 $(CFLAGS)"; + DEBUG_INFORMATION_FORMAT = dwarf; + GCC = "$(DEVELOPER_DIR)/usr/bin/llvm-gcc"; + GCC_OPTIMIZATION_LEVEL = 4; + GCC_VERSION = 4.2; + MACOSX_DEPLOYMENT_TARGET = 10.5; + OTHER_CFLAGS = "-emit-llvm"; + OTHER_LDFLAGS = ( + "-Wl,-no_arch_warnings", + "$(OTHER_LDFLAGS)", + ); + PREBINDING = NO; + TCL_CONFIGURE_ARGS = "$(TCL_CONFIGURE_ARGS) --disable-dtrace"; + }; + name = "ReleaseUniversal llvmgcc42"; + }; + F9988BB60D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; + }; + name = "ReleaseUniversal llvmgcc42"; + }; + F9988BB70D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tcltest; + }; + name = "ReleaseUniversal llvmgcc42"; + }; + F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = tests; + TCLTEST_OPTIONS = ""; + TCL_LIBRARY = "$(TCL_SRCROOT)/library"; + TEST_RIG = "$(OBJROOT)/$(CONFIGURATION)/tcltest"; + }; + name = "ReleaseUniversal llvmgcc42"; + }; F99EE73B0BE835310060D4AF /* DebugUnthreaded */ = { isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = DebugUnthreaded; }; @@ -2427,6 +2621,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = DebugLeaks; }; @@ -2491,6 +2686,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = ReleaseUniversal10.4uSDK; }; @@ -2528,6 +2724,7 @@ buildSettings = { LDFLAGS = "-force_cpusubtype_ALL $(LDFLAGS)"; PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = ReleasePPC10.3.9SDK; }; @@ -2555,6 +2752,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = ReleasePPC10.2.8SDK; }; @@ -2590,6 +2788,7 @@ isa = XCBuildConfiguration; buildSettings = { PRODUCT_NAME = tclsh; + SKIP_INSTALL = NO; }; name = ReleaseUniversal10.5SDK; }; @@ -2635,6 +2834,8 @@ isa = XCConfigurationList; buildConfigurations = ( F95CC8AC09158F3100EA5ACE /* Debug */, + F9988AB20D814C6500B6B03B /* Debug gcc42 */, + F9988AB60D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8AE09158F3100EA5ACE /* DebugNoFixZL */, F99EE73B0BE835310060D4AF /* DebugUnthreaded */, F93084370BB93D2800CD0B9E /* DebugMemCompile */, @@ -2642,6 +2843,8 @@ F97AED1B0B660B2100310EA2 /* Debug64bit */, F95CC8AD09158F3100EA5ACE /* Release */, F91BCC4F093152310042A6BF /* ReleaseUniversal */, + F9988BB20D81586D00B6B03B /* ReleaseUniversal gcc42 */, + F9988BB60D81587400B6B03B /* ReleaseUniversal llvmgcc42 */, F9EEED960C2FEFD300396116 /* ReleaseUniversal10.5SDK */, F9DB62080B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, F9DB621F0B65AFDE00A370FB /* ReleasePPC10.3.9SDK */, @@ -2654,6 +2857,8 @@ isa = XCConfigurationList; buildConfigurations = ( F95CC8B109158F3100EA5ACE /* Debug */, + F9988AB30D814C6500B6B03B /* Debug gcc42 */, + F9988AB70D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8B309158F3100EA5ACE /* DebugNoFixZL */, F99EE73D0BE835310060D4AF /* DebugUnthreaded */, F93084380BB93D2800CD0B9E /* DebugMemCompile */, @@ -2661,6 +2866,8 @@ F97AED1C0B660B2100310EA2 /* Debug64bit */, F95CC8B209158F3100EA5ACE /* Release */, F91BCC50093152310042A6BF /* ReleaseUniversal */, + F9988BB30D81586D00B6B03B /* ReleaseUniversal gcc42 */, + F9988BB70D81587400B6B03B /* ReleaseUniversal llvmgcc42 */, F9EEED970C2FEFD300396116 /* ReleaseUniversal10.5SDK */, F9DB62090B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, F9DB62200B65AFDE00A370FB /* ReleasePPC10.3.9SDK */, @@ -2673,6 +2880,8 @@ isa = XCConfigurationList; buildConfigurations = ( F95CC8B609158F3100EA5ACE /* Debug */, + F9988AB10D814C6500B6B03B /* Debug gcc42 */, + F9988AB50D814C7500B6B03B /* Debug llvmgcc42 */, F95CC8B809158F3100EA5ACE /* DebugNoFixZL */, F99EE7410BE835310060D4AF /* DebugUnthreaded */, F930843A0BB93D2800CD0B9E /* DebugMemCompile */, @@ -2680,6 +2889,8 @@ F97AED1E0B660B2100310EA2 /* Debug64bit */, F95CC8B709158F3100EA5ACE /* Release */, F91BCC51093152310042A6BF /* ReleaseUniversal */, + F9988BB10D81586D00B6B03B /* ReleaseUniversal gcc42 */, + F9988BB50D81587400B6B03B /* ReleaseUniversal llvmgcc42 */, F9EEED990C2FEFD300396116 /* ReleaseUniversal10.5SDK */, F9DB620A0B65ADA800A370FB /* ReleaseUniversal10.4uSDK */, F9DB62210B65AFDE00A370FB /* ReleasePPC10.3.9SDK */, @@ -2692,6 +2903,8 @@ isa = XCConfigurationList; buildConfigurations = ( F97258A90A86873D00096C78 /* Debug */, + F9988AB40D814C6500B6B03B /* Debug gcc42 */, + F9988AB80D814C7500B6B03B /* Debug llvmgcc42 */, F97258AB0A86873D00096C78 /* DebugNoFixZL */, F99EE73F0BE835310060D4AF /* DebugUnthreaded */, F93084390BB93D2800CD0B9E /* DebugMemCompile */, @@ -2699,6 +2912,8 @@ F97AED1D0B660B2100310EA2 /* Debug64bit */, F97258AA0A86873D00096C78 /* Release */, F97258AC0A86873D00096C78 /* ReleaseUniversal */, + F9988BB40D81586D00B6B03B /* ReleaseUniversal gcc42 */, + F9988BB80D81587400B6B03B /* ReleaseUniversal llvmgcc42 */, F9EEED980C2FEFD300396116 /* ReleaseUniversal10.5SDK */, F97AED080B660A6C00310EA2 /* ReleaseUniversal10.4uSDK */, F97AED0F0B660AA300310EA2 /* ReleasePPC10.3.9SDK */, diff --git a/macosx/tclMacOSXNotify.c b/macosx/tclMacOSXNotify.c index d139921..73f1108 100644 --- a/macosx/tclMacOSXNotify.c +++ b/macosx/tclMacOSXNotify.c @@ -7,12 +7,12 @@ * * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright 2001, Apple Computer, Inc. - * Copyright (c) 2005-2007 Daniel A. Steffen <das@users.sourceforge.net> + * Copyright (c) 2005-2008 Daniel A. Steffen <das@users.sourceforge.net> * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.14.2.2 2007/09/04 17:44:02 dgp Exp $ + * RCS: @(#) $Id: tclMacOSXNotify.c,v 1.14.2.3 2008/03/13 14:47:31 dgp Exp $ */ #include "tclInt.h" @@ -319,9 +319,8 @@ static void AtForkChild(void); extern int pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void)) WEAK_IMPORT_ATTRIBUTE; #endif /* HAVE_WEAK_IMPORT */ -#ifdef __LP64__ /* - * On 64bit Darwin 9 and later, it is not possible to call CoreFoundation after + * On Darwin 9 and later, it is not possible to call CoreFoundation after * a fork. */ #if !defined(MAC_OS_X_VERSION_MIN_REQUIRED) || \ @@ -331,9 +330,6 @@ MODULE_SCOPE long tclMacOSXDarwinRelease; #else /* MAC_OS_X_VERSION_MIN_REQUIRED */ #define noCFafterFork 1 #endif /* MAC_OS_X_VERSION_MIN_REQUIRED */ -#else /* __LP64__ */ -#define noCFafterFork 0 -#endif /* __LP64__ */ #endif /* HAVE_PTHREAD_ATFORK */ /* diff --git a/tests/exec.test b/tests/exec.test index b0b9d65..5ee4273 100644 --- a/tests/exec.test +++ b/tests/exec.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: exec.test,v 1.28 2006/12/07 10:35:38 patthoyts Exp $ +# RCS: @(#) $Id: exec.test,v 1.28.2.1 2008/03/13 14:47:32 dgp Exp $ package require tcltest 2 namespace import -force ::tcltest::* @@ -339,8 +339,8 @@ test exec-9.6 {commands returning errors} {exec} { list [catch {exec [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>&2"} msg] $msg } {1 {error msg}} test exec-9.7 {commands returning errors} {exec stdio} { - list [catch {exec [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>&2" \ - | [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>&2"} msg] $msg + list [catch {exec [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>&2 ; \"$path(sleep)\" 1" \ + | [interpreter] "$path(sh)" -c "\"$path(echo)\" error msg 1>&2 ; \"$path(sleep)\" 1"} msg] $msg } {1 {error msg error msg}} diff --git a/tests/fCmd.test b/tests/fCmd.test index 41dc1b1..db3db56 100644 --- a/tests/fCmd.test +++ b/tests/fCmd.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fCmd.test,v 1.57 2006/11/10 01:55:57 das Exp $ +# RCS: @(#) $Id: fCmd.test,v 1.57.2.1 2008/03/13 14:47:33 dgp Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -36,6 +36,11 @@ if {[testConstraint unix]} { } } +testConstraint darwin9 [expr {[testConstraint unix] && + $tcl_platform(os) eq "Darwin" && + int([string range $tcl_platform(osVersion) 0 \ + [string first . $tcl_platform(osVersion)]]) >= 9}] + testConstraint fileSharing 0 testConstraint notFileSharing 1 testConstraint xdev 0 @@ -701,7 +706,7 @@ test fCmd-9.3 {file rename: comprehensive: file to new name} {notRoot testchmod} file rename tf2 tf4 list [lsort [glob tf*]] [file writable tf3] [file writable tf4] } {{tf3 tf4} 1 0} -test fCmd-9.4 {file rename: comprehensive: dir to new name} {unixOrPc notRoot testchmod} { +test fCmd-9.4 {file rename: comprehensive: dir to new name} {unixOrPc notRoot testchmod !darwin9} { cleanup file mkdir td1 td2 testchmod 555 td2 diff --git a/tests/http.test b/tests/http.test index 777fef4..b75da61 100644 --- a/tests/http.test +++ b/tests/http.test @@ -12,7 +12,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # -# RCS: @(#) $Id: http.test,v 1.44.2.1 2007/11/16 07:20:56 dgp Exp $ +# RCS: @(#) $Id: http.test,v 1.44.2.2 2008/03/13 14:47:33 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -117,7 +117,7 @@ test http-2.1 {http::reset} { test http-3.1 {http::geturl} { list [catch {http::geturl -bogus flag} msg] $msg -} {1 {Unknown option flag, can be: -binary, -blocksize, -channel, -command, -handler, -headers, -progress, -query, -queryblocksize, -querychannel, -queryprogress, -validate, -timeout, -type}} +} {1 {Unknown option flag, can be: -binary, -blocksize, -channel, -command, -handler, -headers, -keepalive, -method, -myaddr, -progress, -protocol, -query, -queryblocksize, -querychannel, -queryprogress, -strict, -timeout, -type, -validate}} test http-3.2 {http::geturl} { catch {http::geturl http:junk} err set err @@ -205,7 +205,7 @@ test http-3.10 {http::geturl queryprogress} { lappend postProgress $y } set postProgress {} - set t [http::geturl $posturl -query $query \ + set t [http::geturl $posturl -keepalive 0 -query $query \ -queryprogress postProgress -queryblocksize 16384] http::wait $t list [http::status $t] [string length $query] $postProgress [http::data $t] @@ -332,7 +332,7 @@ test http-3.24 {http::geturl parse failures} -body { } -returnCodes error -result {Illegal encoding character usage "%qu" in URL path} test http-4.1 {http::Event} { - set token [http::geturl $url] + set token [http::geturl $url -keepalive 0] upvar #0 $token data array set meta $data(meta) expr ($data(totalsize) == $meta(Content-Length)) @@ -398,7 +398,7 @@ if 0 { } {111 111} } test http-4.7 {http::Event} { - set token [http::geturl $url -progress myProgress] + set token [http::geturl $url -keepalive 0 -progress myProgress] set progress } {111 111} test http-4.8 {http::Event} { @@ -417,20 +417,20 @@ test http-4.10 {http::Event} { # Short timeout to working server (the test server). This lets us try a # reset during the connection. test http-4.11 {http::Event} { - set token [http::geturl $url -timeout 1 -command {#}] + set token [http::geturl $url -timeout 1 -keepalive 0 -command {#}] http::reset $token http::status $token } {reset} # Longer timeout with reset. test http-4.12 {http::Event} { - set token [http::geturl $url/?timeout=10 -command {#}] + set token [http::geturl $url/?timeout=10 -keepalive 0 -command {#}] http::reset $token http::status $token } {reset} # Medium timeout to working server that waits even longer. The timeout # hits while waiting for a reply. test http-4.13 {http::Event} { - set token [http::geturl $url?timeout=30 -timeout 10 -command {#}] + set token [http::geturl $url?timeout=30 -keepalive 0 -timeout 10 -command {#}] http::wait $token http::status $token } {timeout} diff --git a/tests/ioCmd.test b/tests/ioCmd.test index 6bb72af..d808db0 100644 --- a/tests/ioCmd.test +++ b/tests/ioCmd.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: ioCmd.test,v 1.31.2.3 2007/11/25 06:45:45 dgp Exp $ +# RCS: @(#) $Id: ioCmd.test,v 1.31.2.4 2008/03/13 14:47:33 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -372,13 +372,13 @@ file delete $path(test5) test iocmd-11.1 {I/O to command pipelines} {unixOrPc unixExecs} { set f [open $path(test4) w] close $f - list [catch {open "| cat < $path(test4) > $path(test5)" w} msg] $msg $::errorCode + list [catch {open "| cat < \"$path(test4)\" > \"$path(test5)\"" w} msg] $msg $::errorCode } {1 {can't write input to command: standard input was redirected} NONE} test iocmd-11.2 {I/O to command pipelines} {unixOrPc unixExecs} { - list [catch {open "| echo > $path(test5)" r} msg] $msg $::errorCode + list [catch {open "| echo > \"$path(test5)\"" r} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} NONE} test iocmd-11.3 {I/O to command pipelines} {unixOrPc unixExecs} { - list [catch {open "| echo > $path(test5)" r+} msg] $msg $::errorCode + list [catch {open "| echo > \"$path(test5)\"" r+} msg] $msg $::errorCode } {1 {can't read output from command: standard output was redirected} NONE} test iocmd-12.1 {POSIX open access modes: RDONLY} { diff --git a/tests/socket.test b/tests/socket.test index 90dfcb1..e1a1600 100644 --- a/tests/socket.test +++ b/tests/socket.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: socket.test,v 1.40 2006/11/03 11:45:34 dkf Exp $ +# RCS: @(#) $Id: socket.test,v 1.40.2.1 2008/03/13 14:47:34 dgp Exp $ # Running socket tests with a remote server: # ------------------------------------------ @@ -566,6 +566,7 @@ test socket-2.11 {detecting new data} {socket} { fconfigure $sock -blocking 1 puts $s2 two flush $s2 + after 500 fconfigure $sock -blocking 0 lappend result c:[gets $sock] fconfigure $sock -blocking 1 diff --git a/tests/var.test b/tests/var.test index 42a1024..8c4f6a9 100644 --- a/tests/var.test +++ b/tests/var.test @@ -14,7 +14,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: var.test,v 1.28.2.1 2007/11/25 06:45:45 dgp Exp $ +# RCS: @(#) $Id: var.test,v 1.28.2.2 2008/03/13 14:47:34 dgp Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -527,6 +527,22 @@ test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var list [unset test_ns_var::v] $test_ns_var::info } {{} {test_ns_var::v {} u}} +test var-8.2 {TclDeleteNamespaceVars, "unset" traces on ns delete are called with fully-qualified var names} { + catch {namespace delete test_ns_var} + catch {unset a} + set info "" + namespace eval test_ns_var { + variable v 123 1 + trace var v u ::traceUnset + } + + proc traceUnset {name1 name2 op} { + set ::info [concat $::info [list $name1 $name2 $op]] + } + + list [namespace delete test_ns_var] $::info +} {{} {::test_ns_var::v {} u}} + test var-9.1 {behaviour of TclGet/SetVar simple get/set} testsetnoerr { catch {unset u}; catch {unset v} list \ diff --git a/unix/Makefile.in b/unix/Makefile.in index c9e102d..116e793 100644 --- a/unix/Makefile.in +++ b/unix/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.207.2.14 2008/03/07 22:05:08 dgp Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.207.2.15 2008/03/13 14:47:34 dgp Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -147,7 +147,7 @@ SHELL = /bin/sh # distribution, which is slower but guaranteed to work. INSTALL_STRIP_PROGRAM = -s -INSTALL_STRIP_LIBRARY = -S -S +INSTALL_STRIP_LIBRARY = -S -x INSTALL = @srcdir@/../unix/install-sh -c INSTALL_PROGRAM = ${INSTALL} @@ -257,7 +257,7 @@ DDD = ddd #-------------------------------------------------------------------------- STUB_CC_SWITCHES = ${CFLAGS} ${CFLAGS_WARNING} ${SHLIB_CFLAGS} \ --I${BUILD_DIR} -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \ +-I"${BUILD_DIR}" -I${UNIX_DIR} -I${GENERIC_DIR} -I${TOMMATH_DIR} \ ${AC_FLAGS} ${PROTO_FLAGS} ${ENV_FLAGS} ${EXTRA_CFLAGS} @EXTRA_CC_SWITCHES@ CC_SWITCHES = $(STUB_CC_SWITCHES) ${NO_DEPRECATED_FLAGS} @@ -575,7 +575,7 @@ tclsh: ${TCLSH_OBJS} ${TCL_LIB_FILE} # library. tcltest: ${TCLTEST_OBJS} ${TCL_LIB_FILE} ${BUILD_DLTEST} - $(MAKE) tcltest-real LIB_RUNTIME_DIR=`pwd` + $(MAKE) tcltest-real LIB_RUNTIME_DIR="`pwd`" tcltest-real: ${CC} ${CFLAGS} ${LDFLAGS} ${TCLTEST_OBJS} @TCL_BUILD_LIB_SPEC@ ${LIBS} @EXTRA_TCLSH_LIBS@ \ @@ -590,12 +590,12 @@ tcltest-real: # % make test TESTFLAGS="-verbose bps -file fileName.test" test: tcltest - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tcltest $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) gdb-test: tcltest - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run @echo "set args $(TOP_DIR)/tests/all.tcl $(TESTFLAGS) -singleproc 1" >> gdb.run $(GDB) ./tcltest --command=gdb.run @@ -603,34 +603,34 @@ gdb-test: tcltest # Useful target to launch a built tcltest with the proper path,... runtest: tcltest - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tcltest # Useful target for running the test suite with an unwritable current # directory... ro-test: tcltest - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ echo 'exec chmod -w .;package require tcltest;tcltest::temporaryDirectory /tmp;source ../tests/all.tcl;exec chmod +w .' | ./tcltest # This target can be used to run tclsh from the build directory # via `make shell SCRIPT=/tmp/foo.tcl` shell: tclsh - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tclsh $(SCRIPT) # This target can be used to run tclsh inside either gdb or insight gdb: tclsh - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run $(GDB) ./tclsh --command=gdb.run rm gdb.run # This target can be used to run tclsh inside ddd ddd: tclsh - @echo "set env @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}" > gdb.run + @echo "set env @LD_LIBRARY_PATH_VAR@=\"`pwd`:$${@LD_LIBRARY_PATH_VAR@}\"" > gdb.run @echo "set env TCL_LIBRARY=${TCL_BUILDTIME_LIBRARY}" >> gdb.run $(DDD) -command=gdb.run ./tclsh rm gdb.run @@ -638,12 +638,12 @@ ddd: tclsh VALGRINDARGS=--tool=memcheck --num-callers=8 --leak-resolution=high --leak-check=yes --show-reachable=yes -v valgrind: tclsh tcltest - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ valgrind $(VALGRINDARGS) ./tcltest $(TOP_DIR)/tests/all.tcl -singleproc 1 $(TESTFLAGS) valgrindshell: tclsh - @LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ valgrind $(VALGRINDARGS) ./tclsh $(SCRIPT) @@ -711,30 +711,30 @@ install-strip: # (e.g. if installing as root). install-binaries: binaries - @for i in $(LIB_INSTALL_DIR) $(BIN_INSTALL_DIR) ; \ + @for i in "$(LIB_INSTALL_DIR)" "$(BIN_INSTALL_DIR)" ; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; - @if test ! -x $(SRC_DIR)../unix/install-sh; then \ + @if test ! -x $(SRC_DIR)/../unix/install-sh; then \ chmod +x $(SRC_DIR)/../unix/install-sh; \ fi @echo "Installing $(LIB_FILE) to $(LIB_INSTALL_DIR)/" @@INSTALL_LIB@ - @chmod 555 $(LIB_INSTALL_DIR)/$(LIB_FILE) + @chmod 555 "$(LIB_INSTALL_DIR)"/$(LIB_FILE) @if test "$(TCL_BUILD_EXP_FILE)" != ""; then \ echo "Installing $(TCL_EXP_FILE) to $(LIB_INSTALL_DIR)/"; \ $(INSTALL_DATA) $(TCL_BUILD_EXP_FILE) \ - $(LIB_INSTALL_DIR)/$(TCL_EXP_FILE); \ + "$(LIB_INSTALL_DIR)"/$(TCL_EXP_FILE); \ fi @echo "Installing tclsh as $(BIN_INSTALL_DIR)/tclsh$(VERSION)" - @$(INSTALL_PROGRAM) tclsh $(BIN_INSTALL_DIR)/tclsh$(VERSION) + @$(INSTALL_PROGRAM) tclsh "$(BIN_INSTALL_DIR)"/tclsh$(VERSION) @echo "Installing tclConfig.sh to $(LIB_INSTALL_DIR)/" - @$(INSTALL_DATA) tclConfig.sh $(LIB_INSTALL_DIR)/tclConfig.sh + @$(INSTALL_DATA) tclConfig.sh "$(LIB_INSTALL_DIR)"/tclConfig.sh @if test "$(STUB_LIB_FILE)" != "" ; then \ echo "Installing $(STUB_LIB_FILE) to $(LIB_INSTALL_DIR)/"; \ @INSTALL_STUB_LIB@ ; \ @@ -742,21 +742,21 @@ install-binaries: binaries @EXTRA_INSTALL_BINARIES@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs - @for i in $(INCLUDE_INSTALL_DIR) $(SCRIPT_INSTALL_DIR); \ + @for i in "$(INCLUDE_INSTALL_DIR)" "$(SCRIPT_INSTALL_DIR)"; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @for i in opt0.4 http1.0 encoding ../tcl8 ../tcl8/8.3 ../tcl8/8.4 ../tcl8/8.4/platform ../tcl8/8.5; \ do \ - if [ ! -d $(SCRIPT_INSTALL_DIR)/$$i ] ; then \ + if [ ! -d "$(SCRIPT_INSTALL_DIR)"/$$i ] ; then \ echo "Making directory $(SCRIPT_INSTALL_DIR)/$$i"; \ - mkdir -p $(SCRIPT_INSTALL_DIR)/$$i; \ - chmod 755 $(SCRIPT_INSTALL_DIR)/$$i; \ + mkdir -p "$(SCRIPT_INSTALL_DIR)"/$$i; \ + chmod 755 "$(SCRIPT_INSTALL_DIR)"/$$i; \ else true; \ fi; \ done; @@ -769,96 +769,96 @@ install-libraries: libraries $(INSTALL_TZDATA) install-msgs $(GENERIC_DIR)/tclTomMath.h \ $(GENERIC_DIR)/tclTomMathDecls.h ; \ do \ - $(INSTALL_DATA) $$i $(INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(INCLUDE_INSTALL_DIR)"; \ done; @echo "Installing library files to $(SCRIPT_INSTALL_DIR)"; @for i in $(TOP_DIR)/library/*.tcl $(TOP_DIR)/library/tclIndex \ $(UNIX_DIR)/tclAppInit.c $(UNIX_DIR)/ldAix @DTRACE_SRC@; \ do \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"; \ done; @echo "Installing library http1.0 directory"; - @for j in $(TOP_DIR)/library/http1.0/*.tcl ; \ + @for i in $(TOP_DIR)/library/http1.0/*.tcl ; \ do \ - $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/http1.0; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/http1.0; \ done; - @echo "Installing package http 2.5.5 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.5.5.tm; + @echo "Installing package http 2.7 as a Tcl Module"; + @$(INSTALL_DATA) $(TOP_DIR)/library/http/http.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/http-2.7.tm; @echo "Installing library opt0.4 directory"; - @for j in $(TOP_DIR)/library/opt/*.tcl ; \ + @for i in $(TOP_DIR)/library/opt/*.tcl ; \ do \ - $(INSTALL_DATA) $$j $(SCRIPT_INSTALL_DIR)/opt0.4; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/opt0.4; \ done; @echo "Installing package msgcat 1.4.2 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/msgcat-1.4.2.tm; + @$(INSTALL_DATA) $(TOP_DIR)/library/msgcat/msgcat.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/msgcat-1.4.2.tm; @echo "Installing package tcltest 2.3.0 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.5/tcltest-2.3.0.tm; + @$(INSTALL_DATA) $(TOP_DIR)/library/tcltest/tcltest.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.5/tcltest-2.3.0.tm; @echo "Installing package platform 1.0.3 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform-1.0.3.tm; + @$(INSTALL_DATA) $(TOP_DIR)/library/platform/platform.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform-1.0.3.tm; @echo "Installing package platform::shell 1.1.3 as a Tcl Module"; - @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/platform/shell-1.1.3.tm; + @$(INSTALL_DATA) $(TOP_DIR)/library/platform/shell.tcl "$(SCRIPT_INSTALL_DIR)"/../tcl8/8.4/platform/shell-1.1.3.tm; @echo "Installing library encoding directory"; @for i in $(TOP_DIR)/library/encoding/*.enc ; do \ - $(INSTALL_DATA) $$i $(SCRIPT_INSTALL_DIR)/encoding; \ + $(INSTALL_DATA) $$i "$(SCRIPT_INSTALL_DIR)"/encoding; \ done; @if [ -n "$(TCL_MODULE_PATH)" -a -f $(TOP_DIR)/library/tm.tcl ]; then \ echo "Customizing tcl module path"; \ echo "::tcl::tm::roots {$(TCL_MODULE_PATH)}" >> \ - $(SCRIPT_INSTALL_DIR)/tm.tcl; \ + "$(SCRIPT_INSTALL_DIR)"/tm.tcl; \ fi install-tzdata: tclsh @echo "Installing time zone data" - @@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tclsh $(TOOL_DIR)/installData.tcl \ - $(TOP_DIR)/library/tzdata $(SCRIPT_INSTALL_DIR)/tzdata + $(TOP_DIR)/library/tzdata "$(SCRIPT_INSTALL_DIR)"/tzdata install-msgs: tclsh @echo "Installing message catalogs" - @@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ ./tclsh $(TOOL_DIR)/installData.tcl \ - $(TOP_DIR)/library/msgs $(SCRIPT_INSTALL_DIR)/msgs + $(TOP_DIR)/library/msgs "$(SCRIPT_INSTALL_DIR)"/msgs install-doc: doc @if test ! -x $(UNIX_DIR)/installManPage; then \ chmod +x $(UNIX_DIR)/installManPage; \ fi - @for i in $(MAN_INSTALL_DIR) $(MAN1_INSTALL_DIR) $(MAN3_INSTALL_DIR) $(MANN_INSTALL_DIR) ; \ + @for i in "$(MAN_INSTALL_DIR)" "$(MAN1_INSTALL_DIR)" "$(MAN3_INSTALL_DIR)" "$(MANN_INSTALL_DIR)" ; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @echo "Installing and cross-linking top-level (.1) docs"; @for i in $(TOP_DIR)/doc/*.1; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN1_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN1_INSTALL_DIR)"; \ done @echo "Installing and cross-linking C API (.3) docs"; @for i in $(TOP_DIR)/doc/*.3; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MAN3_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MAN3_INSTALL_DIR)"; \ done @echo "Installing and cross-linking command (.n) docs"; @for i in $(TOP_DIR)/doc/*.n; do \ - $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i $(MANN_INSTALL_DIR); \ + $(UNIX_DIR)/installManPage $(MAN_FLAGS) $$i "$(MANN_INSTALL_DIR)"; \ done # Optional target to install private headers install-private-headers: libraries - @for i in $(PRIVATE_INCLUDE_INSTALL_DIR); \ + @for i in "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ do \ - if [ ! -d $$i ] ; then \ + if [ ! -d "$$i" ] ; then \ echo "Making directory $$i"; \ - mkdir -p $$i; \ - chmod 755 $$i; \ + mkdir -p "$$i"; \ + chmod 755 "$$i"; \ else true; \ fi; \ done; @@ -870,10 +870,10 @@ install-private-headers: libraries $(GENERIC_DIR)/tclIntPlatDecls.h $(GENERIC_DIR)/tclPort.h \ $(UNIX_DIR)/tclUnixPort.h; \ do \ - $(INSTALL_DATA) $$i $(PRIVATE_INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) $$i "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ done; @if test -f tclConfig.h; then\ - $(INSTALL_DATA) tclConfig.h $(PRIVATE_INCLUDE_INSTALL_DIR); \ + $(INSTALL_DATA) tclConfig.h "$(PRIVATE_INCLUDE_INSTALL_DIR)"; \ fi; Makefile: $(UNIX_DIR)/Makefile.in $(DLTEST_DIR)/Makefile.in @@ -1130,17 +1130,17 @@ tclPkg.o: $(GENERIC_DIR)/tclPkg.c tclPkgConfig.o: $(GENERIC_DIR)/tclPkgConfig.c $(CC) -c $(CC_SWITCHES) \ - -DCFG_INSTALL_LIBDIR=\"$(LIB_INSTALL_DIR)\" \ - -DCFG_INSTALL_BINDIR=\"$(BIN_INSTALL_DIR)\" \ - -DCFG_INSTALL_SCRDIR=\"$(SCRIPT_INSTALL_DIR)\" \ - -DCFG_INSTALL_INCDIR=\"$(INCLUDE_INSTALL_DIR)\" \ - -DCFG_INSTALL_DOCDIR=\"$(MAN_INSTALL_DIR)\" \ + -DCFG_INSTALL_LIBDIR="\"$(LIB_INSTALL_DIR)\"" \ + -DCFG_INSTALL_BINDIR="\"$(BIN_INSTALL_DIR)\"" \ + -DCFG_INSTALL_SCRDIR="\"$(SCRIPT_INSTALL_DIR)\"" \ + -DCFG_INSTALL_INCDIR="\"$(INCLUDE_INSTALL_DIR)\"" \ + -DCFG_INSTALL_DOCDIR="\"$(MAN_INSTALL_DIR)\"" \ \ - -DCFG_RUNTIME_LIBDIR=\"$(libdir)\" \ - -DCFG_RUNTIME_BINDIR=\"$(bindir)\" \ - -DCFG_RUNTIME_SCRDIR=\"$(TCL_LIBRARY)\" \ - -DCFG_RUNTIME_INCDIR=\"$(includedir)\" \ - -DCFG_RUNTIME_DOCDIR=\"$(mandir)\" \ + -DCFG_RUNTIME_LIBDIR="\"$(libdir)\"" \ + -DCFG_RUNTIME_BINDIR="\"$(bindir)\"" \ + -DCFG_RUNTIME_SCRDIR="\"$(TCL_LIBRARY)\"" \ + -DCFG_RUNTIME_INCDIR="\"$(includedir)\"" \ + -DCFG_RUNTIME_DOCDIR="\"$(mandir)\"" \ \ $(GENERIC_DIR)/tclPkgConfig.c @@ -1761,9 +1761,9 @@ html-tk: tclsh @EXTRA_BUILD_HTML@ BUILD_HTML = \ - @@LD_LIBRARY_PATH_VAR@=`pwd`:$${@LD_LIBRARY_PATH_VAR@}; export @LD_LIBRARY_PATH_VAR@; \ + @@LD_LIBRARY_PATH_VAR@="`pwd`:$${@LD_LIBRARY_PATH_VAR@}"; export @LD_LIBRARY_PATH_VAR@; \ TCL_LIBRARY="${TCL_BUILDTIME_LIBRARY}"; export TCL_LIBRARY; \ - ./tclsh $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(HTML_INSTALL_DIR) \ + ./tclsh $(TOOL_DIR)/tcltk-man2html.tcl --htmldir="$(HTML_INSTALL_DIR)" \ --srcdir=$(TOP_DIR)/.. $(BUILD_HTML_FLAGS) # diff --git a/unix/configure b/unix/configure index 1e5a28f..2aff0b6 100755 --- a/unix/configure +++ b/unix/configure @@ -1349,8 +1349,8 @@ if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # Make sure srcdir is fully qualified! -srcdir=`cd $srcdir ; pwd` -TCL_SRC_DIR=`cd $srcdir/..; pwd` +srcdir="`cd "$srcdir" ; pwd`" +TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ # Compress and/or soft link the manpages? @@ -8657,7 +8657,7 @@ fi LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o $@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' else @@ -8666,12 +8666,12 @@ else if test "$RANLIB" = ""; then MAKE_LIB='$(STLIB_LD) $@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' else MAKE_LIB='${STLIB_LD} $@ ${OBJS} ; ${RANLIB} $@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' fi @@ -8683,12 +8683,12 @@ fi if test "$RANLIB" = ""; then MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS}' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' else MAKE_STUB_LIB='${STLIB_LD} $@ ${STUB_LIB_OBJS} ; ${RANLIB} $@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)"/$(STUB_LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' fi @@ -18504,7 +18504,7 @@ echo "${ECHO_T}static library" >&6 fi TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk '{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}'`" - TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE}' + TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' @@ -18531,15 +18531,15 @@ _ACEOF fi TCL_LIB_FILE="Tcl" TCL_LIB_FLAG="-framework Tcl" - TCL_BUILD_LIB_SPEC="-F`pwd` -framework Tcl" - TCL_LIB_SPEC="-F${libdir} -framework Tcl" + TCL_BUILD_LIB_SPEC="-F\"`pwd`\" -framework Tcl" + TCL_LIB_SPEC="-F\"${libdir}\" -framework Tcl" libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" TCL_LIBRARY="${libdir}/Resources/Scripts" includedir="${libdir}/Headers" PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" EXTRA_INSTALL="install-private-headers html-tcl" - EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TclTOC.html' + EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TclTOC.html' EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' @@ -18557,18 +18557,18 @@ else else TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi - TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}" - TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" + TCL_BUILD_LIB_SPEC="-L\"`pwd`\" ${TCL_LIB_FLAG}" + TCL_LIB_SPEC="-L\"${libdir}\" ${TCL_LIB_FLAG}" else TCL_BUILD_EXP_FILE="lib.exp" eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}" if test "$GCC" = "yes" ; then - TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TCL_BUILD_EXP_FILE} -L`pwd`" - TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L`pwd`" + TCL_BUILD_LIB_SPEC="-Wl,-bI:\"`pwd`\"/${TCL_BUILD_EXP_FILE} -L\"`pwd`\"" + TCL_LIB_SPEC="-Wl,-bI:\"${libdir}\"/${TCL_EXP_FILE} -L\"`pwd`\"" else - TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}" - TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}" + TCL_BUILD_LIB_SPEC="-bI:\"`pwd`\"/${TCL_BUILD_EXP_FILE}" + TCL_LIB_SPEC="-bI:\"${libdir}\"/${TCL_EXP_FILE}" fi fi fi @@ -18614,8 +18614,8 @@ else TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`" fi -TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}" -TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" +TCL_BUILD_STUB_LIB_SPEC="-L\"`pwd`\" ${TCL_STUB_LIB_FLAG}" +TCL_STUB_LIB_SPEC="-L\"${TCL_STUB_LIB_DIR}\" ${TCL_STUB_LIB_FLAG}" TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" diff --git a/unix/configure.in b/unix/configure.in index a4f6bf6..ca6c6a3 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tcl installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.157.2.15 2008/03/07 22:05:10 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.157.2.16 2008/03/13 14:47:37 dgp Exp $ AC_INIT([tcl],[8.5]) AC_PREREQ(2.59) @@ -41,8 +41,8 @@ if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix fi # Make sure srcdir is fully qualified! -srcdir=`cd $srcdir ; pwd` -TCL_SRC_DIR=`cd $srcdir/..; pwd` +srcdir="`cd "$srcdir" ; pwd`" +TCL_SRC_DIR="`cd "$srcdir"/..; pwd`" #------------------------------------------------------------------------ # Compress and/or soft link the manpages? @@ -704,7 +704,7 @@ HTML_DIR='$(DISTDIR)/html' if test "`uname -s`" = "Darwin" ; then SC_ENABLE_FRAMEWORK TCL_SHLIB_LD_EXTRAS="-compatibility_version ${TCL_VERSION} -current_version ${TCL_VERSION}`echo ${TCL_PATCH_LEVEL} | awk ['{match($0, "\\\.[0-9]+"); print substr($0,RSTART,RLENGTH)}']`" - TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name ${DYLIB_INSTALL_DIR}/${TCL_LIB_FILE}' + TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -install_name "${DYLIB_INSTALL_DIR}"/${TCL_LIB_FILE}' echo "$LDFLAGS " | grep -q -- '-prebind ' && TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -seg1addr 0xa000000' TCL_SHLIB_LD_EXTRAS="${TCL_SHLIB_LD_EXTRAS}"' -sectcreate __TEXT __info_plist Tcl-Info.plist' EXTRA_TCLSH_LIBS='-sectcreate __TEXT __info_plist Tclsh-Info.plist' @@ -731,15 +731,15 @@ if test "$FRAMEWORK_BUILD" = "1" ; then fi TCL_LIB_FILE="Tcl" TCL_LIB_FLAG="-framework Tcl" - TCL_BUILD_LIB_SPEC="-F`pwd` -framework Tcl" - TCL_LIB_SPEC="-F${libdir} -framework Tcl" + TCL_BUILD_LIB_SPEC="-F\"`pwd`\" -framework Tcl" + TCL_LIB_SPEC="-F\"${libdir}\" -framework Tcl" libdir="${libdir}/Tcl.framework/Versions/\${VERSION}" TCL_LIBRARY="${libdir}/Resources/Scripts" includedir="${libdir}/Headers" PRIVATE_INCLUDE_DIR="${libdir}/PrivateHeaders" HTML_DIR="${libdir}/Resources/Documentation/Reference/Tcl" EXTRA_INSTALL="install-private-headers html-tcl" - EXTRA_BUILD_HTML='@ln -fs contents.htm $(HTML_INSTALL_DIR)/TclTOC.html' + EXTRA_BUILD_HTML='@ln -fs contents.htm "$(HTML_INSTALL_DIR)"/TclTOC.html' EXTRA_INSTALL_BINARIES='@echo "Installing Info.plist to $(LIB_INSTALL_DIR)/Resources" && mkdir -p "$(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) Tcl-Info.plist "$(LIB_INSTALL_DIR)/Resources/Info.plist"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Installing license.terms to $(LIB_INSTALL_DIR)/Resources" && $(INSTALL_DATA) "$(TOP_DIR)/license.terms" "$(LIB_INSTALL_DIR)/Resources"' EXTRA_INSTALL_BINARIES="$EXTRA_INSTALL_BINARIES"' && echo "Finalizing Tcl.framework" && rm -f "$(LIB_INSTALL_DIR)/../Current" && ln -s "$(VERSION)" "$(LIB_INSTALL_DIR)/../Current" && for f in "$(LIB_FILE)" tclConfig.sh Resources Headers PrivateHeaders; do rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/Current/$$f" "$(LIB_INSTALL_DIR)/../.."; done && f="$(STUB_LIB_FILE)" && rm -f "$(LIB_INSTALL_DIR)/../../$$f" && ln -s "Versions/$(VERSION)/$$f" "$(LIB_INSTALL_DIR)/../.."' @@ -757,18 +757,18 @@ else else TCL_LIB_FLAG="-ltcl`echo ${TCL_VERSION} | tr -d .`" fi - TCL_BUILD_LIB_SPEC="-L`pwd` ${TCL_LIB_FLAG}" - TCL_LIB_SPEC="-L${libdir} ${TCL_LIB_FLAG}" + TCL_BUILD_LIB_SPEC="-L\"`pwd`\" ${TCL_LIB_FLAG}" + TCL_LIB_SPEC="-L\"${libdir}\" ${TCL_LIB_FLAG}" else TCL_BUILD_EXP_FILE="lib.exp" eval "TCL_EXP_FILE=libtcl${TCL_EXPORT_FILE_SUFFIX}" if test "$GCC" = "yes" ; then - TCL_BUILD_LIB_SPEC="-Wl,-bI:`pwd`/${TCL_BUILD_EXP_FILE} -L`pwd`" - TCL_LIB_SPEC="-Wl,-bI:${libdir}/${TCL_EXP_FILE} -L`pwd`" + TCL_BUILD_LIB_SPEC="-Wl,-bI:\"`pwd`\"/${TCL_BUILD_EXP_FILE} -L\"`pwd`\"" + TCL_LIB_SPEC="-Wl,-bI:\"${libdir}\"/${TCL_EXP_FILE} -L\"`pwd`\"" else - TCL_BUILD_LIB_SPEC="-bI:`pwd`/${TCL_BUILD_EXP_FILE}" - TCL_LIB_SPEC="-bI:${libdir}/${TCL_EXP_FILE}" + TCL_BUILD_LIB_SPEC="-bI:\"`pwd`\"/${TCL_BUILD_EXP_FILE}" + TCL_LIB_SPEC="-bI:\"${libdir}\"/${TCL_EXP_FILE}" fi fi fi @@ -814,8 +814,8 @@ else TCL_STUB_LIB_FLAG="-ltclstub`echo ${TCL_VERSION} | tr -d .`" fi -TCL_BUILD_STUB_LIB_SPEC="-L`pwd` ${TCL_STUB_LIB_FLAG}" -TCL_STUB_LIB_SPEC="-L${TCL_STUB_LIB_DIR} ${TCL_STUB_LIB_FLAG}" +TCL_BUILD_STUB_LIB_SPEC="-L\"`pwd`\" ${TCL_STUB_LIB_FLAG}" +TCL_STUB_LIB_SPEC="-L\"${TCL_STUB_LIB_DIR}\" ${TCL_STUB_LIB_FLAG}" TCL_BUILD_STUB_LIB_PATH="`pwd`/${TCL_STUB_LIB_FILE}" TCL_STUB_LIB_PATH="${TCL_STUB_LIB_DIR}/${TCL_STUB_LIB_FILE}" diff --git a/unix/install-sh b/unix/install-sh index a9a1f27..8cff938 100755 --- a/unix/install-sh +++ b/unix/install-sh @@ -94,31 +94,31 @@ fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic -if [ -d $dst ] +if [ -d "$dst" ] then - dst="$dst"/`basename $src` + dst="$dst/`basename "$src"`" fi # Make a temp file name in the proper directory. -dstdir=`dirname $dst` -dsttmp=$dstdir/#inst.$$# +dstdir="`dirname "$dst"`" +dsttmp="$dstdir"/#inst.$$# # Move or copy the file name to the temp name -$doit $instcmd $src $dsttmp +$doit $instcmd "$src" "$dsttmp" # and set any options; do chmod last to preserve setuid bits -if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi -if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi -if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi -if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi +if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; fi +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; fi +if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; fi +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; fi # Now rename the file to the real destination. -$doit $rmcmd $dst -$doit $mvcmd $dsttmp $dst +$doit $rmcmd "$dst" +$doit $mvcmd "$dsttmp" "$dst" exit 0 diff --git a/unix/tcl.m4 b/unix/tcl.m4 index 3cc5dc9..2e9b80e 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -30,21 +30,21 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ AC_ARG_WITH(tcl, AC_HELP_STRING([--with-tcl], [directory containing tcl configuration (tclConfig.sh)]), - with_tclconfig=${withval}) + with_tclconfig="${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 + case "${with_tclconfig}" in */tclConfig.sh ) - if test -f ${with_tclconfig}; then + 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$!!'` + 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)` + ac_cv_c_tclconfig="`(cd "${with_tclconfig}"; pwd)`" else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi @@ -66,7 +66,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done @@ -80,7 +80,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tcl.framework/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/Tcl.framework; pwd)` + ac_cv_c_tclconfig="`(cd $i/Tcl.framework; pwd)`" break fi done @@ -96,7 +96,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` + ac_cv_c_tclconfig="`(cd $i; pwd)`" break fi done @@ -110,7 +110,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ `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 -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + ac_cv_c_tclconfig="`(cd $i/unix; pwd)`" break fi done @@ -123,7 +123,7 @@ AC_DEFUN([SC_PATH_TCLCONFIG], [ exit 0 else no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} + TCL_BIN_DIR="${ac_cv_c_tclconfig}" AC_MSG_RESULT([found ${TCL_BIN_DIR}/tclConfig.sh]) fi fi @@ -160,21 +160,21 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ AC_ARG_WITH(tk, AC_HELP_STRING([--with-tk], [directory containing tk configuration (tkConfig.sh)]), - with_tkconfig=${withval}) + 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 + case "${with_tkconfig}" in */tkConfig.sh ) - if test -f ${with_tkconfig}; then + 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$!!'` + 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)` + ac_cv_c_tkconfig="`(cd "${with_tkconfig}"; pwd)`" else AC_MSG_ERROR([${with_tkconfig} directory doesn't contain tkConfig.sh]) fi @@ -196,7 +196,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done @@ -210,7 +210,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /System/Library/Frameworks 2>/dev/null` \ ; do if test -f "$i/Tk.framework/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/Tk.framework; pwd)` + ac_cv_c_tkconfig="`(cd $i/Tk.framework; pwd)`" break fi done @@ -226,7 +226,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `ls -d /usr/lib 2>/dev/null` \ ; do if test -f "$i/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i; pwd)` + ac_cv_c_tkconfig="`(cd $i; pwd)`" break fi done @@ -240,7 +240,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ `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 -f "$i/unix/tkConfig.sh" ; then - ac_cv_c_tkconfig=`(cd $i/unix; pwd)` + ac_cv_c_tkconfig="`(cd $i/unix; pwd)`" break fi done @@ -253,7 +253,7 @@ AC_DEFUN([SC_PATH_TKCONFIG], [ exit 0 else no_tk= - TK_BIN_DIR=${ac_cv_c_tkconfig} + TK_BIN_DIR="${ac_cv_c_tkconfig}" AC_MSG_RESULT([found ${TK_BIN_DIR}/tkConfig.sh]) fi fi @@ -299,9 +299,9 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # 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} + 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 @@ -309,16 +309,16 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ 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 + 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"` -framework ${TCL_LIB_FILE}" + TCL_LIB_SPEC="-F\"`dirname "$i"`\" -framework ${TCL_LIB_FILE}" break fi done fi if test -f "${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}"; then - TCL_STUB_LIB_SPEC="-L${TCL_BIN_DIR} ${TCL_STUB_LIB_FLAG}" + TCL_STUB_LIB_SPEC="-L\"${TCL_BIN_DIR}\" ${TCL_STUB_LIB_FLAG}" TCL_STUB_LIB_PATH="${TCL_BIN_DIR}/${TCL_STUB_LIB_FILE}" fi ;; @@ -327,9 +327,9 @@ AC_DEFUN([SC_LOAD_TCLCONFIG], [ # eval is required to do the TCL_DBGX substitution eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + eval "TCL_LIB_SPEC=\"`echo "${TCL_LIB_SPEC}" | sed -e 's/"/\\\\"/g'`\"" eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + eval "TCL_STUB_LIB_SPEC=\"`echo "${TCL_STUB_LIB_SPEC}" | sed -e 's/"/\\\\"/g'`\"" AC_SUBST(TCL_VERSION) AC_SUBST(TCL_PATCH_LEVEL) @@ -382,9 +382,9 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # 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} + 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 @@ -392,16 +392,16 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ 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 + 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"` -framework ${TK_LIB_FILE}" + TK_LIB_SPEC="-F\"`dirname "$i"`\" -framework ${TK_LIB_FILE}" break fi done fi if test -f "${TK_BIN_DIR}/${TK_STUB_LIB_FILE}"; then - TK_STUB_LIB_SPEC="-L${TK_BIN_DIR} ${TK_STUB_LIB_FLAG}" + TK_STUB_LIB_SPEC="-L\"${TK_BIN_DIR}\" ${TK_STUB_LIB_FLAG}" TK_STUB_LIB_PATH="${TK_BIN_DIR}/${TK_STUB_LIB_FILE}" fi ;; @@ -410,9 +410,9 @@ AC_DEFUN([SC_LOAD_TKCONFIG], [ # eval is required to do the TK_DBGX substitution eval "TK_LIB_FLAG=\"${TK_LIB_FLAG}\"" - eval "TK_LIB_SPEC=\"${TK_LIB_SPEC}\"" + eval "TK_LIB_SPEC=\"`echo "${TK_LIB_SPEC}" | sed -e 's/"/\\\\"/g'`\"" eval "TK_STUB_LIB_FLAG=\"${TK_STUB_LIB_FLAG}\"" - eval "TK_STUB_LIB_SPEC=\"${TK_STUB_LIB_SPEC}\"" + eval "TK_STUB_LIB_SPEC=\"`echo "${TK_STUB_LIB_SPEC}" | sed -e 's/"/\\\\"/g'`\"" AC_SUBST(TK_VERSION) AC_SUBST(TK_BIN_DIR) @@ -494,7 +494,7 @@ AC_DEFUN([SC_PROG_TCLSH], [ AC_DEFUN([SC_BUILD_TCLSH], [ AC_MSG_CHECKING([for tclsh in Tcl build directory]) - BUILD_TCLSH=${TCL_BIN_DIR}/tclsh + BUILD_TCLSH="${TCL_BIN_DIR}"/tclsh AC_MSG_RESULT([$BUILD_TCLSH]) AC_SUBST(BUILD_TCLSH) ]) @@ -2043,26 +2043,26 @@ dnl # preprocessing tests use only CPPFLAGS. AS_IF([test "${SHARED_BUILD}" = 1 -a "${SHLIB_SUFFIX}" != ""], [ LIB_SUFFIX=${SHARED_LIB_SUFFIX} MAKE_LIB='${SHLIB_LD} -o [$]@ ${OBJS} ${SHLIB_LD_LIBS} ${TCL_SHLIB_LD_EXTRAS} ${TK_SHLIB_LD_EXTRAS} ${LD_SEARCH_FLAGS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' ], [ LIB_SUFFIX=${UNSHARED_LIB_SUFFIX} AS_IF([test "$RANLIB" = ""], [ MAKE_LIB='$(STLIB_LD) [$]@ ${OBJS}' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE)' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE)' ], [ MAKE_LIB='${STLIB_LD} [$]@ ${OBJS} ; ${RANLIB} [$]@' - INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) $(LIB_INSTALL_DIR)/$(LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(LIB_FILE))' + INSTALL_LIB='$(INSTALL_LIBRARY) $(LIB_FILE) "$(LIB_INSTALL_DIR)"/$(LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(LIB_FILE))' ]) ]) # Stub lib does not depend on shared/static configuration AS_IF([test "$RANLIB" = ""], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS}' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)/$(STUB_LIB_FILE)"' ], [ MAKE_STUB_LIB='${STLIB_LD} [$]@ ${STUB_LIB_OBJS} ; ${RANLIB} [$]@' - INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) $(LIB_INSTALL_DIR)/$(STUB_LIB_FILE) ; (cd $(LIB_INSTALL_DIR) ; $(RANLIB) $(STUB_LIB_FILE))' + INSTALL_STUB_LIB='$(INSTALL_LIBRARY) $(STUB_LIB_FILE) "$(LIB_INSTALL_DIR)"/$(STUB_LIB_FILE) ; (cd "$(LIB_INSTALL_DIR)" ; $(RANLIB) $(STUB_LIB_FILE))' ]) # Define TCL_LIBS now that we know what DL_LIBS is. diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c index b459c49..3a6c742 100644 --- a/unix/tclUnixNotfy.c +++ b/unix/tclUnixNotfy.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixNotfy.c,v 1.32.6.1 2008/03/07 22:05:10 dgp Exp $ + * RCS: @(#) $Id: tclUnixNotfy.c,v 1.32.6.2 2008/03/13 14:47:38 dgp Exp $ */ #include "tclInt.h" @@ -907,7 +907,7 @@ NotifierThreadProc( fd_set writableMask; fd_set exceptionalMask; int fds[2]; - int i, status, numFdBits = 0, receivePipe; + int i, numFdBits = 0, receivePipe; long found; struct timeval poll = {0., 0.}, *timePtr; char buf[2]; diff --git a/unix/tclUnixPort.h b/unix/tclUnixPort.h index 4824699..88fcccd 100644 --- a/unix/tclUnixPort.h +++ b/unix/tclUnixPort.h @@ -19,12 +19,16 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixPort.h,v 1.56.2.3 2008/03/07 22:05:11 dgp Exp $ + * RCS: @(#) $Id: tclUnixPort.h,v 1.56.2.4 2008/03/13 14:47:38 dgp Exp $ */ #ifndef _TCLUNIXPORT #define _TCLUNIXPORT +#ifndef MODULE_SCOPE +#define MODULE_SCOPE extern +#endif + /* *--------------------------------------------------------------------------- * The following sets of #includes and #ifdefs are required to get Tcl to @@ -540,6 +544,12 @@ extern char **environ; # if defined(__x86_64__) && !defined(FIXED_RDAR_4685553) # undef USE_VFORK # endif /* __x86_64__ */ +/* Workaround problems with vfork() when building with llvm-gcc-4.2 */ +# if defined (__llvm__) && \ + (__GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ > 2 || \ + (__GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ > 0)))) +# undef USE_VFORK +# endif /* __llvm__ */ #endif /* __APPLE__ */ /* @@ -623,10 +633,6 @@ EXTERN int pthread_getattr_np _ANSI_ARGS_((pthread_t, pthread_attr_t *)); #include <pwd.h> #include <grp.h> -#ifndef MODULE_SCOPE -#define MODULE_SCOPE extern -#endif - MODULE_SCOPE struct passwd* TclpGetPwNam(const char *name); MODULE_SCOPE struct group* TclpGetGrNam(const char *name); MODULE_SCOPE struct passwd* TclpGetPwUid(uid_t uid); diff --git a/win/Makefile.in b/win/Makefile.in index 83baaf3..d2351e2 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -4,7 +4,7 @@ # "./configure", which is a configuration script generated by the "autoconf" # program (constructs like "@foo@" will get replaced in the actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.115.2.6 2008/03/07 22:05:11 dgp Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.115.2.7 2008/03/13 14:47:38 dgp Exp $ VERSION = @TCL_VERSION@ @@ -635,8 +635,8 @@ install-libraries: libraries install-tzdata install-msgs do \ $(COPY) "$$j" "$(SCRIPT_INSTALL_DIR)/http1.0"; \ done; - @echo "Installing package http 2.5.5 as a Tcl Module"; - @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.5.5.tm; + @echo "Installing package http 2.7 as a Tcl Module"; + @$(COPY) $(ROOT_DIR)/library/http/http.tcl $(SCRIPT_INSTALL_DIR)/../tcl8/8.4/http-2.7.tm; @echo "Installing library opt0.4 directory"; @for j in $(ROOT_DIR)/library/opt/*.tcl; \ do \ |