summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog27
-rw-r--r--doc/tcltest.n6
-rw-r--r--library/msgcat/msgcat.tcl267
-rw-r--r--library/tcltest/tcltest.tcl27
-rw-r--r--macosx/Tcl.xcodeproj/project.pbxproj11
-rw-r--r--tests/msgcat.test14
-rwxr-xr-xunix/configure687
-rw-r--r--unix/configure.in10
-rw-r--r--unix/tcl.m4515
-rw-r--r--unix/tclConfig.h.in63
-rw-r--r--unix/tclUnixInit.c26
11 files changed, 907 insertions, 746 deletions
diff --git a/ChangeLog b/ChangeLog
index dbccde9..43b4ae7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2006-09-10 Daniel Steffen <das@users.sourceforge.net>
+
+ * library/msgcat/msgcat.tcl (msgcat::Init): on Darwin, add fallback of
+ * tests/msgcat.test: default msgcat locale to
+ * unix/tclUnixInit.c (TclpSetVariables): current CFLocale identifier
+ if available (via private ::tcl::mac::locale global, set at interp init
+ when on Mac OS X 10.3 or later with CoreFoundation).
+
+ * library/tcltest/tcltest.tcl: add 'line' verbose level: prints source
+ * doc/tcltest.n: file line information of failing tests.
+
+ * macosx/Tcl.xcodeproj/project.pbxproj: add new tclUnixCompat.c file;
+ revise tests target to use new tcltest 'line' verbose level.
+
+ * unix/configure.in: add descriptions to new AC_DEFINEs for MT-safe.
+ * unix/tcl.m4: add caching to new SC_TCL_* macros for MT-safe wrappers.
+ * unix/configure: autoconf-2.59
+ * unix/tclConfig.h.in: autoheader-2.59
+
2006-09-08 Zoran Vasiljevic <vasiljevic@users.sourceforge.net>
* unix/tclUnixCompat.c: Added fallback to gethostbyname()
@@ -141,7 +160,7 @@
* tests/upvar.test: bugfix, docs clarification and new tests for
[namespace upvar] as follow up to [Bug 1546833], reported by Will
Duquette.
-
+
2006-08-24 Kevin Kenny <kennykb@acm.org>
* library/tzdata: Regenerated, including several new files,
@@ -151,7 +170,7 @@
loading 'registry' from the build tree rather than an installed
one. This is a workaround for [Bug 15232730], which remains open
because it's a symptom of a deeper underlying problem.
-
+
2006-08-23 Don Porter <dgp@users.sourceforge.net>
* generic/tclParseExpr.c: Minimal collection of new tests
@@ -161,8 +180,8 @@
2006-08-21 Don Porter <dgp@users.sourceforge.net>
- * generic/tclIOUtil.c: Revisions to complete the thread finalization
- of the cwdPathPtr. [Bug 1536142]
+ * generic/tclIOUtil.c: Revisions to complete the thread finalization
+ of the cwdPathPtr. [Bug 1536142]
* generic/tclParseExpr.c: Revised mistaken call to
TclCheckBadOctal(), so both [expr 08] and [expr 08z] have same
diff --git a/doc/tcltest.n b/doc/tcltest.n
index b673db7..219de80 100644
--- a/doc/tcltest.n
+++ b/doc/tcltest.n
@@ -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: tcltest.n,v 1.44 2004/10/27 14:43:54 dkf Exp $
+'\" RCS: @(#) $Id: tcltest.n,v 1.45 2006/09/10 17:04:05 das Exp $
'\"
.so man.macros
.TH "tcltest" n 2.2 tcltest "Tcl Bundled Packages"
@@ -763,7 +763,7 @@ harness are doing.
\fB-verbose \fIlevel\fR
Sets the type of output verbosity desired to \fIlevel\fR,
a list of zero or more of the elements \fBbody\fR, \fBpass\fR,
-\fBskip\fR, \fBstart\fR, and \fBerror\fR. Default value
+\fBskip\fR, \fBstart\fR, \fBerror\fR and \fBline\fR. Default value
is \fB{body error}\fR.
Levels are defined as:
.RS
@@ -778,6 +778,8 @@ Print output whenever a test starts
.IP "error (e)"
Print errorInfo and errorCode, if they exist, when a test return code
does not match its expected return code
+.IP "line (l)"
+Print source file line information of failed tests
.RE
The single letter abbreviations noted above are also recognized
so that [\fBconfigure -verbose pt\fR] is the same as
diff --git a/library/msgcat/msgcat.tcl b/library/msgcat/msgcat.tcl
index a4cf23e..81e90eb 100644
--- a/library/msgcat/msgcat.tcl
+++ b/library/msgcat/msgcat.tcl
@@ -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: msgcat.tcl,v 1.22 2004/08/13 21:39:24 dgp Exp $
+# RCS: @(#) $Id: msgcat.tcl,v 1.23 2006/09/10 17:04:06 das Exp $
package require Tcl 8.5
# When the version number changes, be sure to update the pkgIndex.tcl file,
@@ -34,132 +34,134 @@ namespace eval msgcat {
variable Msgs [dict create]
# Map of language codes used in Windows registry to those of ISO-639
- variable WinRegToISO639 [dict create {expand}{
- 01 ar 0401 ar_SA 0801 ar_IQ 0c01 ar_EG 1001 ar_LY 1401 ar_DZ
- 1801 ar_MA 1c01 ar_TN 2001 ar_OM 2401 ar_YE 2801 ar_SY
- 2c01 ar_JO 3001 ar_LB 3401 ar_KW 3801 ar_AE 3c01 ar_BH
- 4001 ar_QA
- 02 bg 0402 bg_BG
- 03 ca 0403 ca_ES
- 04 zh 0404 zh_TW 0804 zh_CN 0c04 zh_HK 1004 zh_SG 1404 zh_MO
- 05 cs 0405 cs_CZ
- 06 da 0406 da_DK
- 07 de 0407 de_DE 0807 de_CH 0c07 de_AT 1007 de_LU 1407 de_LI
- 08 el 0408 el_GR
- 09 en 0409 en_US 0809 en_GB 0c09 en_AU 1009 en_CA 1409 en_NZ
- 1809 en_IE 1c09 en_ZA 2009 en_JM 2409 en_GD 2809 en_BZ
- 2c09 en_TT 3009 en_ZW 3409 en_PH
- 0a es 040a es_ES 080a es_MX 0c0a es_ES@modern 100a es_GT 140a es_CR
- 180a es_PA 1c0a es_DO 200a es_VE 240a es_CO 280a es_PE
- 2c0a es_AR 300a es_EC 340a es_CL 380a es_UY 3c0a es_PY
- 400a es_BO 440a es_SV 480a es_HN 4c0a es_NI 500a es_PR
- 0b fi 040b fi_FI
- 0c fr 040c fr_FR 080c fr_BE 0c0c fr_CA 100c fr_CH 140c fr_LU
- 180c fr_MC
- 0d he 040d he_IL
- 0e hu 040e hu_HU
- 0f is 040f is_IS
- 10 it 0410 it_IT 0810 it_CH
- 11 ja 0411 ja_JP
- 12 ko 0412 ko_KR
- 13 nl 0413 nl_NL 0813 nl_BE
- 14 no 0414 no_NO 0814 nn_NO
- 15 pl 0415 pl_PL
- 16 pt 0416 pt_BR 0816 pt_PT
- 17 rm 0417 rm_CH
- 18 ro 0418 ro_RO
- 19 ru
- 1a hr 041a hr_HR 081a sr_YU 0c1a sr_YU@cyrillic
- 1b sk 041b sk_SK
- 1c sq 041c sq_AL
- 1d sv 041d sv_SE 081d sv_FI
- 1e th 041e th_TH
- 1f tr 041f tr_TR
- 20 ur 0420 ur_PK 0820 ur_IN
- 21 id 0421 id_ID
- 22 uk 0422 uk_UA
- 23 be 0423 be_BY
- 24 sl 0424 sl_SI
- 25 et 0425 et_EE
- 26 lv 0426 lv_LV
- 27 lt 0427 lt_LT
- 28 tg 0428 tg_TJ
- 29 fa 0429 fa_IR
- 2a vi 042a vi_VN
- 2b hy 042b hy_AM
- 2c az 042c az_AZ@latin 082c az_AZ@cyrillic
- 2d eu
- 2e wen 042e wen_DE
- 2f mk 042f mk_MK
- 30 bnt 0430 bnt_TZ
- 31 ts 0431 ts_ZA
- 33 ven 0433 ven_ZA
- 34 xh 0434 xh_ZA
- 35 zu 0435 zu_ZA
- 36 af 0436 af_ZA
- 37 ka 0437 ka_GE
- 38 fo 0438 fo_FO
- 39 hi 0439 hi_IN
- 3a mt 043a mt_MT
- 3b se 043b se_NO
- 043c gd_UK 083c ga_IE
- 3d yi 043d yi_IL
- 3e ms 043e ms_MY 083e ms_BN
- 3f kk 043f kk_KZ
- 40 ky 0440 ky_KG
- 41 sw 0441 sw_KE
- 42 tk 0442 tk_TM
- 43 uz 0443 uz_UZ@latin 0843 uz_UZ@cyrillic
- 44 tt 0444 tt_RU
- 45 bn 0445 bn_IN
- 46 pa 0446 pa_IN
- 47 gu 0447 gu_IN
- 48 or 0448 or_IN
- 49 ta
- 4a te 044a te_IN
- 4b kn 044b kn_IN
- 4c ml 044c ml_IN
- 4d as 044d as_IN
- 4e mr 044e mr_IN
- 4f sa 044f sa_IN
- 50 mn
- 51 bo 0451 bo_CN
- 52 cy 0452 cy_GB
- 53 km 0453 km_KH
- 54 lo 0454 lo_LA
- 55 my 0455 my_MM
- 56 gl 0456 gl_ES
- 57 kok 0457 kok_IN
- 58 mni 0458 mni_IN
- 59 sd
- 5a syr 045a syr_TR
- 5b si 045b si_LK
- 5c chr 045c chr_US
- 5d iu 045d iu_CA
- 5e am 045e am_ET
- 5f ber 045f ber_MA
- 60 ks 0460 ks_PK 0860 ks_IN
- 61 ne 0461 ne_NP 0861 ne_IN
- 62 fy 0462 fy_NL
- 63 ps
- 64 tl 0464 tl_PH
- 65 div 0465 div_MV
- 66 bin 0466 bin_NG
- 67 ful 0467 ful_NG
- 68 ha 0468 ha_NG
- 69 nic 0469 nic_NG
- 6a yo 046a yo_NG
- 70 ibo 0470 ibo_NG
- 71 kau 0471 kau_NG
- 72 om 0472 om_ET
- 73 ti 0473 ti_ET
- 74 gn 0474 gn_PY
- 75 cpe 0475 cpe_US
- 76 la 0476 la_VA
- 77 so 0477 so_SO
- 78 sit 0478 sit_CN
- 79 pap 0479 pap_AN
- }]
+ if { $::tcl_platform(platform) eq "windows" } {
+ variable WinRegToISO639 [dict create {expand}{
+ 01 ar 0401 ar_SA 0801 ar_IQ 0c01 ar_EG 1001 ar_LY 1401 ar_DZ
+ 1801 ar_MA 1c01 ar_TN 2001 ar_OM 2401 ar_YE 2801 ar_SY
+ 2c01 ar_JO 3001 ar_LB 3401 ar_KW 3801 ar_AE 3c01 ar_BH
+ 4001 ar_QA
+ 02 bg 0402 bg_BG
+ 03 ca 0403 ca_ES
+ 04 zh 0404 zh_TW 0804 zh_CN 0c04 zh_HK 1004 zh_SG 1404 zh_MO
+ 05 cs 0405 cs_CZ
+ 06 da 0406 da_DK
+ 07 de 0407 de_DE 0807 de_CH 0c07 de_AT 1007 de_LU 1407 de_LI
+ 08 el 0408 el_GR
+ 09 en 0409 en_US 0809 en_GB 0c09 en_AU 1009 en_CA 1409 en_NZ
+ 1809 en_IE 1c09 en_ZA 2009 en_JM 2409 en_GD 2809 en_BZ
+ 2c09 en_TT 3009 en_ZW 3409 en_PH
+ 0a es 040a es_ES 080a es_MX 0c0a es_ES@modern 100a es_GT 140a es_CR
+ 180a es_PA 1c0a es_DO 200a es_VE 240a es_CO 280a es_PE
+ 2c0a es_AR 300a es_EC 340a es_CL 380a es_UY 3c0a es_PY
+ 400a es_BO 440a es_SV 480a es_HN 4c0a es_NI 500a es_PR
+ 0b fi 040b fi_FI
+ 0c fr 040c fr_FR 080c fr_BE 0c0c fr_CA 100c fr_CH 140c fr_LU
+ 180c fr_MC
+ 0d he 040d he_IL
+ 0e hu 040e hu_HU
+ 0f is 040f is_IS
+ 10 it 0410 it_IT 0810 it_CH
+ 11 ja 0411 ja_JP
+ 12 ko 0412 ko_KR
+ 13 nl 0413 nl_NL 0813 nl_BE
+ 14 no 0414 no_NO 0814 nn_NO
+ 15 pl 0415 pl_PL
+ 16 pt 0416 pt_BR 0816 pt_PT
+ 17 rm 0417 rm_CH
+ 18 ro 0418 ro_RO
+ 19 ru
+ 1a hr 041a hr_HR 081a sr_YU 0c1a sr_YU@cyrillic
+ 1b sk 041b sk_SK
+ 1c sq 041c sq_AL
+ 1d sv 041d sv_SE 081d sv_FI
+ 1e th 041e th_TH
+ 1f tr 041f tr_TR
+ 20 ur 0420 ur_PK 0820 ur_IN
+ 21 id 0421 id_ID
+ 22 uk 0422 uk_UA
+ 23 be 0423 be_BY
+ 24 sl 0424 sl_SI
+ 25 et 0425 et_EE
+ 26 lv 0426 lv_LV
+ 27 lt 0427 lt_LT
+ 28 tg 0428 tg_TJ
+ 29 fa 0429 fa_IR
+ 2a vi 042a vi_VN
+ 2b hy 042b hy_AM
+ 2c az 042c az_AZ@latin 082c az_AZ@cyrillic
+ 2d eu
+ 2e wen 042e wen_DE
+ 2f mk 042f mk_MK
+ 30 bnt 0430 bnt_TZ
+ 31 ts 0431 ts_ZA
+ 33 ven 0433 ven_ZA
+ 34 xh 0434 xh_ZA
+ 35 zu 0435 zu_ZA
+ 36 af 0436 af_ZA
+ 37 ka 0437 ka_GE
+ 38 fo 0438 fo_FO
+ 39 hi 0439 hi_IN
+ 3a mt 043a mt_MT
+ 3b se 043b se_NO
+ 043c gd_UK 083c ga_IE
+ 3d yi 043d yi_IL
+ 3e ms 043e ms_MY 083e ms_BN
+ 3f kk 043f kk_KZ
+ 40 ky 0440 ky_KG
+ 41 sw 0441 sw_KE
+ 42 tk 0442 tk_TM
+ 43 uz 0443 uz_UZ@latin 0843 uz_UZ@cyrillic
+ 44 tt 0444 tt_RU
+ 45 bn 0445 bn_IN
+ 46 pa 0446 pa_IN
+ 47 gu 0447 gu_IN
+ 48 or 0448 or_IN
+ 49 ta
+ 4a te 044a te_IN
+ 4b kn 044b kn_IN
+ 4c ml 044c ml_IN
+ 4d as 044d as_IN
+ 4e mr 044e mr_IN
+ 4f sa 044f sa_IN
+ 50 mn
+ 51 bo 0451 bo_CN
+ 52 cy 0452 cy_GB
+ 53 km 0453 km_KH
+ 54 lo 0454 lo_LA
+ 55 my 0455 my_MM
+ 56 gl 0456 gl_ES
+ 57 kok 0457 kok_IN
+ 58 mni 0458 mni_IN
+ 59 sd
+ 5a syr 045a syr_TR
+ 5b si 045b si_LK
+ 5c chr 045c chr_US
+ 5d iu 045d iu_CA
+ 5e am 045e am_ET
+ 5f ber 045f ber_MA
+ 60 ks 0460 ks_PK 0860 ks_IN
+ 61 ne 0461 ne_NP 0861 ne_IN
+ 62 fy 0462 fy_NL
+ 63 ps
+ 64 tl 0464 tl_PH
+ 65 div 0465 div_MV
+ 66 bin 0466 bin_NG
+ 67 ful 0467 ful_NG
+ 68 ha 0468 ha_NG
+ 69 nic 0469 nic_NG
+ 6a yo 046a yo_NG
+ 70 ibo 0470 ibo_NG
+ 71 kau 0471 kau_NG
+ 72 om 0472 om_ET
+ 73 ti 0473 ti_ET
+ 74 gn 0474 gn_PY
+ 75 cpe 0475 cpe_US
+ 76 la 0476 la_VA
+ 77 so 0477 so_SO
+ 78 sit 0478 sit_CN
+ 79 pap 0479 pap_AN
+ }]
+ }
}
# msgcat::mc --
@@ -454,6 +456,17 @@ proc msgcat::Init {} {
}
}
#
+ # On Darwin, fallback to current CFLocale identifier if available.
+ #
+ if {$::tcl_platform(os) eq "Darwin" && $::tcl_platform(platform) eq "unix"
+ && [info exists ::tcl::mac::locale] && $::tcl::mac::locale ne ""} {
+ if {![catch {
+ mclocale [ConvertLocale $::tcl::mac::locale]
+ }]} {
+ return
+ }
+ }
+ #
# The rest of this routine is special processing for Windows;
# all other platforms, get out now.
#
diff --git a/library/tcltest/tcltest.tcl b/library/tcltest/tcltest.tcl
index 0e7f549..9ec1471 100644
--- a/library/tcltest/tcltest.tcl
+++ b/library/tcltest/tcltest.tcl
@@ -16,7 +16,7 @@
# Contributions from Don Porter, NIST, 2002. (not subject to US copyright)
# All rights reserved.
#
-# RCS: @(#) $Id: tcltest.tcl,v 1.95 2005/05/10 18:34:54 kennykb Exp $
+# RCS: @(#) $Id: tcltest.tcl,v 1.96 2006/09/10 17:04:06 das Exp $
package require Tcl 8.3 ;# uses [glob -directory]
namespace eval tcltest {
@@ -609,15 +609,15 @@ namespace eval tcltest {
proc AcceptVerbose { level } {
set level [AcceptList $level]
if {[llength $level] == 1} {
- if {![regexp {^(pass|body|skip|start|error)$} $level]} {
+ if {![regexp {^(pass|body|skip|start|error|line)$} $level]} {
# translate single characters abbreviations to expanded list
- set level [string map {p pass b body s skip t start e error} \
+ set level [string map {p pass b body s skip t start e error l line} \
[split $level {}]]
}
}
set valid [list]
foreach v $level {
- if {[regexp {^(pass|body|skip|start|error)$} $v]} {
+ if {[regexp {^(pass|body|skip|start|error|line)$} $v]} {
lappend valid $v
}
}
@@ -631,11 +631,12 @@ namespace eval tcltest {
# Default verbosity is to show bodies of failed tests
Option -verbose {body error} {
- Takes any combination of the values 'p', 's', 'b', 't' and 'e'.
+ Takes any combination of the values 'p', 's', 'b', 't', 'e' and 'l'.
Test suite will display all passed tests if 'p' is specified, all
skipped tests if 's' is specified, the bodies of failed tests if
'b' is specified, and when tests start if 't' is specified.
- ErrorInfo is displayed if 'e' is specified.
+ ErrorInfo is displayed if 'e' is specified. Source file line
+ information of failed tests is displayed if 'l' is specified.
} AcceptVerbose verbose
# Match and skip patterns default to the empty list, except for
@@ -2087,7 +2088,19 @@ proc tcltest::test {name description args} {
if {![IsVerbose body]} {
set body ""
}
- puts [outputChannel] "\n==== $name\
+ puts [outputChannel] "\n"
+ if {[IsVerbose line]} {
+ set testFile [file normalize [uplevel 1 {info script}]]
+ if {[file readable $testFile]} {
+ set testFd [open $testFile r]
+ set lineNo [expr {[lsearch -regexp [split [read $testFd] "\n"] \
+ "^\[ \t\]*test [string map {. \\.} $name] "]+1}]
+ close $testFd
+ puts [outputChannel] "$testFile:$lineNo: test failed:\
+ $name [string trim $description]"
+ }
+ }
+ puts [outputChannel] "==== $name\
[string trim $description] FAILED"
if {[string length $body]} {
puts [outputChannel] "==== Contents of test case:"
diff --git a/macosx/Tcl.xcodeproj/project.pbxproj b/macosx/Tcl.xcodeproj/project.pbxproj
index 563ed90..6979db5 100644
--- a/macosx/Tcl.xcodeproj/project.pbxproj
+++ b/macosx/Tcl.xcodeproj/project.pbxproj
@@ -161,6 +161,7 @@
F9E61D30090A48E2002B3151 /* bn_mp_to_unsigned_bin_n.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C708F272B3004A47F5 /* bn_mp_to_unsigned_bin_n.c */; };
F9E61D31090A48F9002B3151 /* bn_mp_to_unsigned_bin.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42C608F272B3004A47F5 /* bn_mp_to_unsigned_bin.c */; };
F9E61D32090A48FA002B3151 /* bn_mp_unsigned_bin_size.c in Sources */ = {isa = PBXBuildFile; fileRef = F96D42CC08F272B3004A47F5 /* bn_mp_unsigned_bin_size.c */; };
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */ = {isa = PBXBuildFile; fileRef = F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -900,6 +901,7 @@
F9903CB0094FAADA004613E9 /* tclTomMathDecls.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tclTomMathDecls.h; sourceTree = "<group>"; };
F9A3084B08F2D4CE00BAE1AB /* tclsh8.5 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; name = tclsh8.5; path = ../tclsh8.5; sourceTree = BUILT_PRODUCTS_DIR; };
F9A3084E08F2D4F400BAE1AB /* Tcl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Tcl.framework; path = ../Tcl.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = tclUnixCompat.c; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -1726,6 +1728,7 @@
F96D445D08F272B9004A47F5 /* tclLoadOSF.c */,
F96D445E08F272B9004A47F5 /* tclLoadShl.c */,
F96D445F08F272B9004A47F5 /* tclUnixChan.c */,
+ F9FC77B70AB29E9100B7077D /* tclUnixCompat.c */,
F96D446008F272B9004A47F5 /* tclUnixEvent.c */,
F96D446108F272B9004A47F5 /* tclUnixFCmd.c */,
F96D446208F272B9004A47F5 /* tclUnixFile.c */,
@@ -1892,7 +1895,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "if [ \"${ACTION:-build}\" == \"build\" ]; then\nprintf '%s%s%s' '\npackage require tcltest 2.2\nnamespace import tcltest::*\nconfigure -testdir [file normalize {' \"${SRCROOT}\" '/../../tcl/tests}]\nconfigure -singleproc 1\nset b [info body ::tcltest::test]; set i [string first {puts [outputChannel] \"\\n====} $b]\nproc ::tcltest::test [info args ::tcltest::test] [string replace $b $i [expr {$i+27}] {set t [uplevel 1 {info script}]; set f [open $t r]; set n [expr {[lsearch -regex [split [read $f] \"\\n\"] \"^test [string map {. \\\\.} $name]\"]+1}]; close $f; puts [outputChannel] \"\\n$t:$n: test failed: $name [string trim $description]\\n====}]\nrunAllTests\n' | \"${TEST_RIG}\"; TEST_RIG_RESULT=$?\n[ ${TEST_RIG_RESULT} -ne 0 ] && echo \"tcltest:0: error: tcltest exited abnormally with code ${TEST_RIG_RESULT}.\"\nexit ${TEST_RIG_RESULT}\nfi";
+ shellScript = "if [ \"${ACTION:-build}\" == \"build\" ]; then\ncd \"${TARGET_TEMP_DIR}\"; rm -rf \"${DERIVED_FILE_DIR}\"; mkdir -p \"${DERIVED_FILE_DIR}\"\nprintf '%s%s%s%s%s' '\npackage require tcltest 2.2\nnamespace import tcltest::*\nconfigure -testdir [file normalize {' \"${TCL_SRCROOT}\" '/tests}]\nconfigure -tmpdir [file normalize {' \"${DERIVED_FILE_DIR}\" '}]\nconfigure -verbose [concat [configure -verbose] line]\nrunAllTests\n' | \"${TEST_RIG}\"; TEST_RIG_RESULT=$?\n[ ${TEST_RIG_RESULT} -ne 0 ] && echo \"tcltest:0: error: tcltest exited abnormally with code ${TEST_RIG_RESULT}.\"\nexit ${TEST_RIG_RESULT}\nfi";
};
F9A5C5F508F651A2008AE941 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -2063,6 +2066,7 @@
F90509300913A72400327603 /* tclAppInit.c in Sources */,
F96D4AC608F272C9004A47F5 /* tclLoadDyld.c in Sources */,
F96D4ACA08F272C9004A47F5 /* tclUnixChan.c in Sources */,
+ F9FC77B80AB29E9100B7077D /* tclUnixCompat.c in Sources */,
F96D4ACB08F272C9004A47F5 /* tclUnixEvent.c in Sources */,
F96D4ACC08F272C9004A47F5 /* tclUnixFCmd.c in Sources */,
F96D4ACD08F272C9004A47F5 /* tclUnixFile.c in Sources */,
@@ -2411,8 +2415,9 @@
isa = XCBuildConfiguration;
buildSettings = {
PRODUCT_NAME = tests;
- TCLTEST_OPTIONS = "-verbose bet";
- TCL_LIBRARY = "${SRCROOT}/../../tcl/library";
+ TCLTEST_OPTIONS = "";
+ TCL_LIBRARY = "${TCL_SRCROOT}/library";
+ TCL_SRCROOT = "${SRCROOT}/../../tcl";
TEST_RIG = "$(OBJROOT)/$(CONFIGURATION)/tcltest";
};
name = DebugNoFixZL;
diff --git a/tests/msgcat.test b/tests/msgcat.test
index 06fccf6..e626883 100644
--- a/tests/msgcat.test
+++ b/tests/msgcat.test
@@ -12,7 +12,7 @@
# Note that after running these tests, entries will be left behind in the
# message catalogs for locales foo, foo_BAR, and foo_BAR_baz.
#
-# RCS: @(#) $Id: msgcat.test,v 1.18 2005/05/10 18:35:22 kennykb Exp $
+# RCS: @(#) $Id: msgcat.test,v 1.19 2006/09/10 17:04:06 das Exp $
package require Tcl 8.2
if {[catch {package require tcltest 2}]} {
@@ -54,11 +54,15 @@ namespace eval ::msgcat::test {
foreach setVars [PowerSet $envVars] {
set result [string tolower [lindex $setVars 0]]
if {[string length $result] == 0} {
- set result c
+ if {[info exists ::tcl::mac::locale]} {
+ set result [string tolower $::tcl::mac::locale]
+ } else {
+ set result c
+ }
}
- test msgcat-0.$count {
- locale initialization from environment variables
- } -setup {
+ test msgcat-0.$count [list \
+ locale initialization from environment variables $setVars \
+ ] -setup {
variable var
foreach var $envVars {
catch {variable $var $::env($var)}
diff --git a/unix/configure b/unix/configure
index a4a658c..0159d5c 100755
--- a/unix/configure
+++ b/unix/configure
@@ -9904,6 +9904,10 @@ if test $ac_cv_func_getpwuid_r = yes; then
echo "$as_me:$LINENO: checking for getpwuid_r with 5 args" >&5
echo $ECHO_N "checking for getpwuid_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwuid_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -9911,19 +9915,19 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <pwd.h>
+ #include <sys/types.h>
+ #include <pwd.h>
int
main ()
{
- uid_t uid;
- struct passwd pw, *pwp;
- char buf[512];
- int buflen = 512;
+ uid_t uid;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
- (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
+ (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
;
return 0;
@@ -9951,49 +9955,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getpwuid_r_5=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWUID_R 1
-_ACEOF
-
+tcl_cv_api_getpwuid_r_5=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwuid_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwuid_r_5" >&6
+ tcl_ok=$tcl_cv_api_getpwuid_r_5
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETPWUID_R_5 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for getpwuid_r with 4 args" >&5
+echo $ECHO_N "checking for getpwuid_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwuid_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for getpwuid_r with 4 args" >&5
-echo $ECHO_N "checking for getpwuid_r with 4 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <pwd.h>
+ #include <sys/types.h>
+ #include <pwd.h>
int
main ()
{
- uid_t uid;
- struct passwd pw;
- char buf[512];
- int buflen = 512;
+ uid_t uid;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
- (void)getpwnam_r(uid, &pw, buf, buflen);
+ (void)getpwnam_r(uid, &pw, buf, buflen);
;
return 0;
@@ -10021,37 +10027,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getpwuid_r_4=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_getpwuid_r_4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwuid_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwuid_r_4" >&6
+ tcl_ok=$tcl_cv_api_getpwuid_r_4
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWUID_R 1
+#define HAVE_GETPWUID_R_4 1
_ACEOF
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWUID_R_4 1
+#define HAVE_GETPWUID_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
echo "$as_me:$LINENO: checking for getpwnam_r" >&5
echo $ECHO_N "checking for getpwnam_r... $ECHO_C" >&6
if test "${ac_cv_func_getpwnam_r+set}" = set; then
@@ -10146,6 +10151,10 @@ if test $ac_cv_func_getpwnam_r = yes; then
echo "$as_me:$LINENO: checking for getpwnam_r with 5 args" >&5
echo $ECHO_N "checking for getpwnam_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwnam_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10153,19 +10162,19 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <pwd.h>
+ #include <sys/types.h>
+ #include <pwd.h>
int
main ()
{
- char *name;
- struct passwd pw, *pwp;
- char buf[512];
- int buflen = 512;
+ char *name;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
- (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
+ (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
;
return 0;
@@ -10193,49 +10202,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getpwnam_r_5=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWNAM_R 1
-_ACEOF
-
+tcl_cv_api_getpwnam_r_5=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwnam_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwnam_r_5" >&6
+ tcl_ok=$tcl_cv_api_getpwnam_r_5
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETPWNAM_R_5 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for getpwnam_r with 4 args" >&5
+echo $ECHO_N "checking for getpwnam_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getpwnam_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for getpwnam_r with 4 args" >&5
-echo $ECHO_N "checking for getpwnam_r with 4 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <pwd.h>
+ #include <sys/types.h>
+ #include <pwd.h>
int
main ()
{
- char *name;
- struct passwd pw;
- char buf[512];
- int buflen = 512;
+ char *name;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
- (void)getpwnam_r(name, &pw, buf, buflen);
+ (void)getpwnam_r(name, &pw, buf, buflen);
;
return 0;
@@ -10263,37 +10274,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getpwnam_r_4=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_getpwnam_r_4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getpwnam_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getpwnam_r_4" >&6
+ tcl_ok=$tcl_cv_api_getpwnam_r_4
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWNAM_R 1
+#define HAVE_GETPWNAM_R_4 1
_ACEOF
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETPWNAM_R_4 1
+#define HAVE_GETPWNAM_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
echo "$as_me:$LINENO: checking for getgrgid_r" >&5
echo $ECHO_N "checking for getgrgid_r... $ECHO_C" >&6
if test "${ac_cv_func_getgrgid_r+set}" = set; then
@@ -10388,6 +10398,10 @@ if test $ac_cv_func_getgrgid_r = yes; then
echo "$as_me:$LINENO: checking for getgrgid_r with 5 args" >&5
echo $ECHO_N "checking for getgrgid_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrgid_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10395,19 +10409,19 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <grp.h>
+ #include <sys/types.h>
+ #include <grp.h>
int
main ()
{
- gid_t gid;
- struct group gr, *grp;
- char buf[512];
- int buflen = 512;
+ gid_t gid;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
- (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
+ (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
;
return 0;
@@ -10435,49 +10449,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getgrgid_r_5=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRGID_R 1
-_ACEOF
-
+tcl_cv_api_getgrgid_r_5=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrgid_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrgid_r_5" >&6
+ tcl_ok=$tcl_cv_api_getgrgid_r_5
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETGRGID_R_5 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for getgrgid_r with 4 args" >&5
+echo $ECHO_N "checking for getgrgid_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrgid_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for getgrgid_r with 4 args" >&5
-echo $ECHO_N "checking for getgrgid_r with 4 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <grp.h>
+ #include <sys/types.h>
+ #include <grp.h>
int
main ()
{
- gid_t gid;
- struct group gr;
- char buf[512];
- int buflen = 512;
+ gid_t gid;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
- (void)getgrgid_r(gid, &gr, buf, buflen);
+ (void)getgrgid_r(gid, &gr, buf, buflen);
;
return 0;
@@ -10505,37 +10521,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getgrgid_r_4=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_getgrgid_r_4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrgid_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrgid_r_4" >&6
+ tcl_ok=$tcl_cv_api_getgrgid_r_4
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRGID_R 1
+#define HAVE_GETGRGID_R_4 1
_ACEOF
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRGID_R_4 1
+#define HAVE_GETGRGID_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
echo "$as_me:$LINENO: checking for getgrnam_r" >&5
echo $ECHO_N "checking for getgrnam_r... $ECHO_C" >&6
if test "${ac_cv_func_getgrnam_r+set}" = set; then
@@ -10630,6 +10645,10 @@ if test $ac_cv_func_getgrnam_r = yes; then
echo "$as_me:$LINENO: checking for getgrnam_r with 5 args" >&5
echo $ECHO_N "checking for getgrnam_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrnam_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10637,19 +10656,19 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <grp.h>
+ #include <sys/types.h>
+ #include <grp.h>
int
main ()
{
- char *name;
- struct group gr, *grp;
- char buf[512];
- int buflen = 512;
+ char *name;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
- (void) getgrnam_r(name, &gr, buf, buflen, &grp);
+ (void) getgrnam_r(name, &gr, buf, buflen, &grp);
;
return 0;
@@ -10677,49 +10696,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getgrnam_r_5=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRNAM_R 1
-_ACEOF
-
+tcl_cv_api_getgrnam_r_5=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrnam_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrnam_r_5" >&6
+ tcl_ok=$tcl_cv_api_getgrnam_r_5
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETGRNAM_R_5 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for getgrnam_r with 4 args" >&5
+echo $ECHO_N "checking for getgrnam_r with 4 args... $ECHO_C" >&6
+if test "${tcl_cv_api_getgrnam_r_4+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for getgrnam_r with 4 args" >&5
-echo $ECHO_N "checking for getgrnam_r with 4 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <sys/types.h>
- #include <grp.h>
+ #include <sys/types.h>
+ #include <grp.h>
int
main ()
{
- char *name;
- struct group gr;
- char buf[512];
- int buflen = 512;
+ char *name;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
- (void)getgrnam_r(name, &gr, buf, buflen);
+ (void)getgrnam_r(name, &gr, buf, buflen);
;
return 0;
@@ -10747,47 +10768,48 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_getgrnam_r_4=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_getgrnam_r_4=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_getgrnam_r_4" >&5
+echo "${ECHO_T}$tcl_cv_api_getgrnam_r_4" >&6
+ tcl_ok=$tcl_cv_api_getgrnam_r_4
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRNAM_R 1
+#define HAVE_GETGRNAM_R_4 1
_ACEOF
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETGRNAM_R_4 1
+#define HAVE_GETGRNAM_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
if test "`uname -s`" = "Darwin" && \
test "`uname -r | awk -F. '{print $1}'`" -gt 5; then
# Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
# are actually MT-safe as they always return pointers
- # from the TSD instead of the static storage.
- cat >>confdefs.h <<\_ACEOF
+ # from TSD instead of static storage.
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MTSAFE_GETHOSTBYNAME 1
_ACEOF
- cat >>confdefs.h <<\_ACEOF
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_MTSAFE_GETHOSTBYADDR 1
_ACEOF
@@ -10886,6 +10908,10 @@ if test $ac_cv_func_gethostbyname_r = yes; then
echo "$as_me:$LINENO: checking for gethostbyname_r with 6 args" >&5
echo $ECHO_N "checking for gethostbyname_r with 6 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_6+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -10893,19 +10919,19 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <netdb.h>
+ #include <netdb.h>
int
main ()
{
- char *name;
- struct hostent *he, *res;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
+ char *name;
+ struct hostent *he, *res;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
+ (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
;
return 0;
@@ -10933,49 +10959,51 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_gethostbyname_r_6=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYNAME_R 1
-_ACEOF
-
+tcl_cv_api_gethostbyname_r_6=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_6" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_6" >&6
+ tcl_ok=$tcl_cv_api_gethostbyname_r_6
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_6 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for gethostbyname_r with 5 args" >&5
+echo $ECHO_N "checking for gethostbyname_r with 5 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_5+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for gethostbyname_r with 5 args" >&5
-echo $ECHO_N "checking for gethostbyname_r with 5 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <netdb.h>
+ #include <netdb.h>
int
main ()
{
- char *name;
- struct hostent *he;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
+ char *name;
+ struct hostent *he;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
;
return 0;
@@ -11003,47 +11031,49 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_gethostbyname_r_5=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYNAME_R 1
-_ACEOF
-
+tcl_cv_api_gethostbyname_r_5=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_5" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_5" >&6
+ tcl_ok=$tcl_cv_api_gethostbyname_r_5
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_5 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for gethostbyname_r with 3 args" >&5
+echo $ECHO_N "checking for gethostbyname_r with 3 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyname_r_3+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for gethostbyname_r with 3 args" >&5
-echo $ECHO_N "checking for gethostbyname_r with 3 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <netdb.h>
+ #include <netdb.h>
int
main ()
{
- char *name;
- struct hostent *he;
- struct hostent_data data;
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
- (void) gethostbyname_r(name, he, &data);
+ (void) gethostbyname_r(name, he, &data);
;
return 0;
@@ -11071,40 +11101,37 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_gethostbyname_r_3=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_gethostbyname_r_3=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyname_r_3" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyname_r_3" >&6
+ tcl_ok=$tcl_cv_api_gethostbyname_r_3
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYNAME_R 1
+#define HAVE_GETHOSTBYNAME_R_3 1
_ACEOF
+ fi
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYNAME_R_3 1
+#define HAVE_GETHOSTBYNAME_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
echo "$as_me:$LINENO: checking for gethostbyaddr_r" >&5
echo $ECHO_N "checking for gethostbyaddr_r... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyaddr_r+set}" = set; then
@@ -11199,6 +11226,10 @@ if test $ac_cv_func_gethostbyaddr_r = yes; then
echo "$as_me:$LINENO: checking for gethostbyaddr_r with 7 args" >&5
echo $ECHO_N "checking for gethostbyaddr_r with 7 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyaddr_r_7+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -11206,22 +11237,22 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <netdb.h>
+ #include <netdb.h>
int
main ()
{
- char *addr;
- int length;
- int type;
- struct hostent *result;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
- &h_errnop);
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &h_errnop);
;
return 0;
@@ -11249,52 +11280,54 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_gethostbyaddr_r_7=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-
-cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYADDR_R 1
-_ACEOF
-
+tcl_cv_api_gethostbyaddr_r_7=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyaddr_r_7" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyaddr_r_7" >&6
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYADDR_R_7 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
+ else
+ echo "$as_me:$LINENO: checking for gethostbyaddr_r with 8 args" >&5
+echo $ECHO_N "checking for gethostbyaddr_r with 8 args... $ECHO_C" >&6
+if test "${tcl_cv_api_gethostbyaddr_r_8+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
- echo "$as_me:$LINENO: checking for gethostbyaddr_r with 8 args" >&5
-echo $ECHO_N "checking for gethostbyaddr_r with 8 args... $ECHO_C" >&6
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
- #include <netdb.h>
+ #include <netdb.h>
int
main ()
{
- char *addr;
- int length;
- int type;
- struct hostent *result, *resultp;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result, *resultp;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
- (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
- &resultp, &h_errnop);
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &resultp, &h_errnop);
;
return 0;
@@ -11322,38 +11355,36 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
+ tcl_cv_api_gethostbyaddr_r_8=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+tcl_cv_api_gethostbyaddr_r_8=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $tcl_cv_api_gethostbyaddr_r_8" >&5
+echo "${ECHO_T}$tcl_cv_api_gethostbyaddr_r_8" >&6
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYADDR_R 1
+#define HAVE_GETHOSTBYADDR_R_8 1
_ACEOF
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
cat >>confdefs.h <<\_ACEOF
-#define HAVE_GETHOSTBYADDR_R_8 1
+#define HAVE_GETHOSTBYADDR_R 1
_ACEOF
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
fi
-
fi
fi
diff --git a/unix/configure.in b/unix/configure.in
index 16cf959..1abf209 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.146 2006/09/08 20:57:19 vasiljevic Exp $
+# RCS: @(#) $Id: configure.in,v 1.147 2006/09/10 17:04:07 das Exp $
AC_INIT([tcl],[8.5])
AC_PREREQ(2.59)
@@ -175,9 +175,11 @@ if test "${TCL_THREADS}" = 1; then
test "`uname -r | awk -F. '{print [$]1}'`" -gt 5; then
# Starting with Darwin 6 (Mac OSX 10.2), gethostbyX
# are actually MT-safe as they always return pointers
- # from the TSD instead of the static storage.
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME)
- AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR)
+ # from TSD instead of static storage.
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYNAME, 1,
+ [Do we have MT-safe gethostbyname() ?])
+ AC_DEFINE(HAVE_MTSAFE_GETHOSTBYADDR, 1,
+ [Do we have MT-safe gethostbyaddr() ?])
else
SC_TCL_GETHOSTBYNAME_R
SC_TCL_GETHOSTBYADDR_R
diff --git a/unix/tcl.m4 b/unix/tcl.m4
index 39bcb34..6f67011 100644
--- a/unix/tcl.m4
+++ b/unix/tcl.m4
@@ -2803,55 +2803,52 @@ AC_DEFUN([SC_TCL_CHECK_BROKEN_FUNC],[
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
- AC_MSG_CHECKING([for gethostbyaddr_r with 7 args])
+ AC_CACHE_CHECK([for gethostbyaddr_r with 7 args], tcl_cv_api_gethostbyaddr_r_7, [
AC_TRY_COMPILE([
- #include <netdb.h>
+ #include <netdb.h>
], [
- char *addr;
- int length;
- int type;
- struct hostent *result;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
-
- (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
- &h_errnop);
- ], [
- AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1,
- [Define to 1 if gethostbyaddr_r is available.])
- AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1,
- [Define to 1 if gethostbyaddr_r takes 7 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for gethostbyaddr_r with 8 args])
- AC_TRY_COMPILE([
- #include <netdb.h>
- ], [
- char *addr;
- int length;
- int type;
- struct hostent *result, *resultp;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
-
- (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
- &resultp, &h_errnop);
- ], [
- AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1,
- [Define to 1 if gethostbyaddr_r is available.])
- AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1,
- [Define to 1 if gethostbyaddr_r takes 8 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
-
- ])
- ])
-])
-])
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &h_errnop);
+ ], tcl_cv_api_gethostbyaddr_r_7=yes, tcl_cv_api_gethostbyaddr_r_7=no)])
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_7
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_7, 1,
+ [Define to 1 if gethostbyaddr_r takes 7 args.])
+ else
+ AC_CACHE_CHECK([for gethostbyaddr_r with 8 args], tcl_cv_api_gethostbyaddr_r_8, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *addr;
+ int length;
+ int type;
+ struct hostent *result, *resultp;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyaddr_r(addr, length, type, result, buffer, buflen,
+ &resultp, &h_errnop);
+ ], tcl_cv_api_gethostbyaddr_r_8=yes, tcl_cv_api_gethostbyaddr_r_8=no)])
+ tcl_ok=$tcl_cv_api_gethostbyaddr_r_8
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R_8, 1,
+ [Define to 1 if gethostbyaddr_r takes 8 args.])
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYADDR_R, 1,
+ [Define to 1 if gethostbyaddr_r is available.])
+ fi
+])])
#--------------------------------------------------------------------
# SC_TCL_GETHOSTBYNAME_R
@@ -2874,66 +2871,62 @@ AC_DEFUN([SC_TCL_GETHOSTBYADDR_R], [AC_CHECK_FUNC(gethostbyaddr_r, [
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
- AC_MSG_CHECKING([for gethostbyname_r with 6 args])
+ AC_CACHE_CHECK([for gethostbyname_r with 6 args], tcl_cv_api_gethostbyname_r_6, [
AC_TRY_COMPILE([
- #include <netdb.h>
- ], [
- char *name;
- struct hostent *he, *res;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
-
- (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
- ], [
- AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
- [Define to 1 if gethostbyname_r is available.])
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1,
- [Define to 1 if gethostbyname_r takes 6 args.])
- AC_MSG_RESULT(yes)
+ #include <netdb.h>
], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for gethostbyname_r with 5 args])
- AC_TRY_COMPILE([
- #include <netdb.h>
- ], [
- char *name;
- struct hostent *he;
- char buffer[2048];
- int buflen = 2048;
- int h_errnop;
-
- (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
- ], [
- AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
- [Define to 1 if gethostbyname_r is available.])
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1,
- [Define to 1 if gethostbyname_r takes 5 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for gethostbyname_r with 3 args])
- AC_TRY_COMPILE([
- #include <netdb.h>
- ], [
- char *name;
- struct hostent *he;
- struct hostent_data data;
-
- (void) gethostbyname_r(name, he, &data);
- ], [
- AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
- [Define to 1 if gethostbyname_r is available.])
- AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1,
- [Define to 1 if gethostbyname_r takes 3 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
- ])
-])
-])
+ char *name;
+ struct hostent *he, *res;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop);
+ ], tcl_cv_api_gethostbyname_r_6=yes, tcl_cv_api_gethostbyname_r_6=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_6
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_6, 1,
+ [Define to 1 if gethostbyname_r takes 6 args.])
+ else
+ AC_CACHE_CHECK([for gethostbyname_r with 5 args], tcl_cv_api_gethostbyname_r_5, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he;
+ char buffer[2048];
+ int buflen = 2048;
+ int h_errnop;
+
+ (void) gethostbyname_r(name, he, buffer, buflen, &h_errnop);
+ ], tcl_cv_api_gethostbyname_r_5=yes, tcl_cv_api_gethostbyname_r_5=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_5, 1,
+ [Define to 1 if gethostbyname_r takes 5 args.])
+ else
+ AC_CACHE_CHECK([for gethostbyname_r with 3 args], tcl_cv_api_gethostbyname_r_3, [
+ AC_TRY_COMPILE([
+ #include <netdb.h>
+ ], [
+ char *name;
+ struct hostent *he;
+ struct hostent_data data;
+
+ (void) gethostbyname_r(name, he, &data);
+ ], tcl_cv_api_gethostbyname_r_3=yes, tcl_cv_api_gethostbyname_r_3=no)])
+ tcl_ok=$tcl_cv_api_gethostbyname_r_3
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R_3, 1,
+ [Define to 1 if gethostbyname_r takes 3 args.])
+ fi
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETHOSTBYNAME_R, 1,
+ [Define to 1 if gethostbyname_r is available.])
+ fi
+])])
#--------------------------------------------------------------------
# SC_TCL_GETPWUID_R
@@ -2954,48 +2947,46 @@ AC_DEFUN([SC_TCL_GETHOSTBYNAME_R], [AC_CHECK_FUNC(gethostbyname_r, [
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
- AC_MSG_CHECKING([for getpwuid_r with 5 args])
+ AC_CACHE_CHECK([for getpwuid_r with 5 args], tcl_cv_api_getpwuid_r_5, [
AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <pwd.h>
- ], [
- uid_t uid;
- struct passwd pw, *pwp;
- char buf[512];
- int buflen = 512;
-
- (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
+ #include <sys/types.h>
+ #include <pwd.h>
], [
- AC_DEFINE(HAVE_GETPWUID_R, 1,
- [Define to 1 if getpwuid_r is available.])
- AC_DEFINE(HAVE_GETPWUID_R_5, 1,
- [Define to 1 if getpwuid_r takes 5 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for getpwuid_r with 4 args])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <pwd.h>
- ], [
- uid_t uid;
- struct passwd pw;
- char buf[512];
- int buflen = 512;
-
- (void)getpwnam_r(uid, &pw, buf, buflen);
- ], [
- AC_DEFINE(HAVE_GETPWUID_R, 1,
- [Define to 1 if getpwuid_r is available.])
- AC_DEFINE(HAVE_GETPWUID_R_4, 1,
- [Define to 1 if getpwuid_r takes 4 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
-])
+ uid_t uid;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getpwuid_r(uid, &pw, buf, buflen, &pwp);
+ ], tcl_cv_api_getpwuid_r_5=yes, tcl_cv_api_getpwuid_r_5=no)])
+ tcl_ok=$tcl_cv_api_getpwuid_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R_5, 1,
+ [Define to 1 if getpwuid_r takes 5 args.])
+ else
+ AC_CACHE_CHECK([for getpwuid_r with 4 args], tcl_cv_api_getpwuid_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ uid_t uid;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getpwnam_r(uid, &pw, buf, buflen);
+ ], tcl_cv_api_getpwuid_r_4=yes, tcl_cv_api_getpwuid_r_4=no)])
+ tcl_ok=$tcl_cv_api_getpwuid_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R_4, 1,
+ [Define to 1 if getpwuid_r takes 4 args.])
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWUID_R, 1,
+ [Define to 1 if getpwuid_r is available.])
+ fi
+])])
#--------------------------------------------------------------------
# SC_TCL_GETPWNAM_R
@@ -3016,48 +3007,46 @@ AC_DEFUN([SC_TCL_GETPWUID_R], [AC_CHECK_FUNC(getpwuid_r, [
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
- AC_MSG_CHECKING([for getpwnam_r with 5 args])
+ AC_CACHE_CHECK([for getpwnam_r with 5 args], tcl_cv_api_getpwnam_r_5, [
AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <pwd.h>
- ], [
- char *name;
- struct passwd pw, *pwp;
- char buf[512];
- int buflen = 512;
-
- (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
- ], [
- AC_DEFINE(HAVE_GETPWNAM_R, 1,
- [Define to 1 if getpwnam_r is available.])
- AC_DEFINE(HAVE_GETPWNAM_R_5, 1,
- [Define to 1 if getpwnam_r takes 5 args.])
- AC_MSG_RESULT(yes)
+ #include <sys/types.h>
+ #include <pwd.h>
], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for getpwnam_r with 4 args])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <pwd.h>
- ], [
- char *name;
- struct passwd pw;
- char buf[512];
- int buflen = 512;
-
- (void)getpwnam_r(name, &pw, buf, buflen);
- ], [
- AC_DEFINE(HAVE_GETPWNAM_R, 1,
- [Define to 1 if getpwnam_r is available.])
- AC_DEFINE(HAVE_GETPWNAM_R_4, 1,
- [Define to 1 if getpwnam_r takes 4 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
-])
+ char *name;
+ struct passwd pw, *pwp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getpwnam_r(name, &pw, buf, buflen, &pwp);
+ ], tcl_cv_api_getpwnam_r_5=yes, tcl_cv_api_getpwnam_r_5=no)])
+ tcl_ok=$tcl_cv_api_getpwnam_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R_5, 1,
+ [Define to 1 if getpwnam_r takes 5 args.])
+ else
+ AC_CACHE_CHECK([for getpwnam_r with 4 args], tcl_cv_api_getpwnam_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <pwd.h>
+ ], [
+ char *name;
+ struct passwd pw;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getpwnam_r(name, &pw, buf, buflen);
+ ], tcl_cv_api_getpwnam_r_4=yes, tcl_cv_api_getpwnam_r_4=no)])
+ tcl_ok=$tcl_cv_api_getpwnam_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R_4, 1,
+ [Define to 1 if getpwnam_r takes 4 args.])
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETPWNAM_R, 1,
+ [Define to 1 if getpwnam_r is available.])
+ fi
+])])
#--------------------------------------------------------------------
# SC_TCL_GETGRGID_R
@@ -3078,48 +3067,46 @@ AC_DEFUN([SC_TCL_GETPWNAM_R], [AC_CHECK_FUNC(getpwnam_r, [
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
- AC_MSG_CHECKING([for getgrgid_r with 5 args])
+ AC_CACHE_CHECK([for getgrgid_r with 5 args], tcl_cv_api_getgrgid_r_5, [
AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <grp.h>
- ], [
- gid_t gid;
- struct group gr, *grp;
- char buf[512];
- int buflen = 512;
-
- (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
- ], [
- AC_DEFINE(HAVE_GETGRGID_R, 1,
- [Define to 1 if getgrgid_r is available.])
- AC_DEFINE(HAVE_GETGRGID_R_5, 1,
- [Define to 1 if getgrgid_r takes 5 args.])
- AC_MSG_RESULT(yes)
+ #include <sys/types.h>
+ #include <grp.h>
], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for getgrgid_r with 4 args])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <grp.h>
- ], [
- gid_t gid;
- struct group gr;
- char buf[512];
- int buflen = 512;
-
- (void)getgrgid_r(gid, &gr, buf, buflen);
- ], [
- AC_DEFINE(HAVE_GETGRGID_R, 1,
- [Define to 1 if getgrgid_r is available.])
- AC_DEFINE(HAVE_GETGRGID_R_4, 1,
- [Define to 1 if getgrgid_r takes 4 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
-])
+ gid_t gid;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getgrgid_r(gid, &gr, buf, buflen, &grp);
+ ], tcl_cv_api_getgrgid_r_5=yes, tcl_cv_api_getgrgid_r_5=no)])
+ tcl_ok=$tcl_cv_api_getgrgid_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R_5, 1,
+ [Define to 1 if getgrgid_r takes 5 args.])
+ else
+ AC_CACHE_CHECK([for getgrgid_r with 4 args], tcl_cv_api_getgrgid_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ gid_t gid;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getgrgid_r(gid, &gr, buf, buflen);
+ ], tcl_cv_api_getgrgid_r_4=yes, tcl_cv_api_getgrgid_r_4=no)])
+ tcl_ok=$tcl_cv_api_getgrgid_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R_4, 1,
+ [Define to 1 if getgrgid_r takes 4 args.])
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRGID_R, 1,
+ [Define to 1 if getgrgid_r is available.])
+ fi
+])])
#--------------------------------------------------------------------
# SC_TCL_GETGRNAM_R
@@ -3140,48 +3127,46 @@ AC_DEFUN([SC_TCL_GETGRGID_R], [AC_CHECK_FUNC(getgrgid_r, [
#--------------------------------------------------------------------
AC_DEFUN([SC_TCL_GETGRNAM_R], [AC_CHECK_FUNC(getgrnam_r, [
- AC_MSG_CHECKING([for getgrnam_r with 5 args])
+ AC_CACHE_CHECK([for getgrnam_r with 5 args], tcl_cv_api_getgrnam_r_5, [
AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <grp.h>
- ], [
- char *name;
- struct group gr, *grp;
- char buf[512];
- int buflen = 512;
-
- (void) getgrnam_r(name, &gr, buf, buflen, &grp);
- ], [
- AC_DEFINE(HAVE_GETGRNAM_R, 1,
- [Define to 1 if getgrnam_r is available.])
- AC_DEFINE(HAVE_GETGRNAM_R_5, 1,
- [Define to 1 if getgrnam_r takes 5 args.])
- AC_MSG_RESULT(yes)
+ #include <sys/types.h>
+ #include <grp.h>
], [
- AC_MSG_RESULT(no)
- AC_MSG_CHECKING([for getgrnam_r with 4 args])
- AC_TRY_COMPILE([
- #include <sys/types.h>
- #include <grp.h>
- ], [
- char *name;
- struct group gr;
- char buf[512];
- int buflen = 512;
-
- (void)getgrnam_r(name, &gr, buf, buflen);
- ], [
- AC_DEFINE(HAVE_GETGRNAM_R, 1,
- [Define to 1 if getgrnam_r is available.])
- AC_DEFINE(HAVE_GETGRNAM_R_4, 1,
- [Define to 1 if getgrnam_r takes 4 args.])
- AC_MSG_RESULT(yes)
- ], [
- AC_MSG_RESULT(no)
- ])
- ])
-])
-])
+ char *name;
+ struct group gr, *grp;
+ char buf[512];
+ int buflen = 512;
+
+ (void) getgrnam_r(name, &gr, buf, buflen, &grp);
+ ], tcl_cv_api_getgrnam_r_5=yes, tcl_cv_api_getgrnam_r_5=no)])
+ tcl_ok=$tcl_cv_api_getgrnam_r_5
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R_5, 1,
+ [Define to 1 if getgrnam_r takes 5 args.])
+ else
+ AC_CACHE_CHECK([for getgrnam_r with 4 args], tcl_cv_api_getgrnam_r_4, [
+ AC_TRY_COMPILE([
+ #include <sys/types.h>
+ #include <grp.h>
+ ], [
+ char *name;
+ struct group gr;
+ char buf[512];
+ int buflen = 512;
+
+ (void)getgrnam_r(name, &gr, buf, buflen);
+ ], tcl_cv_api_getgrnam_r_4=yes, tcl_cv_api_getgrnam_r_4=no)])
+ tcl_ok=$tcl_cv_api_getgrnam_r_4
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R_4, 1,
+ [Define to 1 if getgrnam_r takes 4 args.])
+ fi
+ fi
+ if test "$tcl_ok" = yes; then
+ AC_DEFINE(HAVE_GETGRNAM_R, 1,
+ [Define to 1 if getgrnam_r is available.])
+ fi
+])])
# Local Variables:
# mode: autoconf
diff --git a/unix/tclConfig.h.in b/unix/tclConfig.h.in
index 501c83f..e08540e 100644
--- a/unix/tclConfig.h.in
+++ b/unix/tclConfig.h.in
@@ -40,6 +40,63 @@
/* Define to 1 if you have the `getcwd' function. */
#undef HAVE_GETCWD
+/* Define to 1 if getgrgid_r is available. */
+#undef HAVE_GETGRGID_R
+
+/* Define to 1 if getgrgid_r takes 4 args. */
+#undef HAVE_GETGRGID_R_4
+
+/* Define to 1 if getgrgid_r takes 5 args. */
+#undef HAVE_GETGRGID_R_5
+
+/* Define to 1 if getgrnam_r is available. */
+#undef HAVE_GETGRNAM_R
+
+/* Define to 1 if getgrnam_r takes 4 args. */
+#undef HAVE_GETGRNAM_R_4
+
+/* Define to 1 if getgrnam_r takes 5 args. */
+#undef HAVE_GETGRNAM_R_5
+
+/* Define to 1 if gethostbyaddr_r is available. */
+#undef HAVE_GETHOSTBYADDR_R
+
+/* Define to 1 if gethostbyaddr_r takes 7 args. */
+#undef HAVE_GETHOSTBYADDR_R_7
+
+/* Define to 1 if gethostbyaddr_r takes 8 args. */
+#undef HAVE_GETHOSTBYADDR_R_8
+
+/* Define to 1 if gethostbyname_r is available. */
+#undef HAVE_GETHOSTBYNAME_R
+
+/* Define to 1 if gethostbyname_r takes 3 args. */
+#undef HAVE_GETHOSTBYNAME_R_3
+
+/* Define to 1 if gethostbyname_r takes 5 args. */
+#undef HAVE_GETHOSTBYNAME_R_5
+
+/* Define to 1 if gethostbyname_r takes 6 args. */
+#undef HAVE_GETHOSTBYNAME_R_6
+
+/* Define to 1 if getpwnam_r is available. */
+#undef HAVE_GETPWNAM_R
+
+/* Define to 1 if getpwnam_r takes 4 args. */
+#undef HAVE_GETPWNAM_R_4
+
+/* Define to 1 if getpwnam_r takes 5 args. */
+#undef HAVE_GETPWNAM_R_5
+
+/* Define to 1 if getpwuid_r is available. */
+#undef HAVE_GETPWUID_R
+
+/* Define to 1 if getpwuid_r takes 4 args. */
+#undef HAVE_GETPWUID_R_4
+
+/* Define to 1 if getpwuid_r takes 5 args. */
+#undef HAVE_GETPWUID_R_5
+
/* Define to 1 if you have the `gmtime_r' function. */
#undef HAVE_GMTIME_R
@@ -67,6 +124,12 @@
/* Define to 1 if you have the `mktime' function. */
#undef HAVE_MKTIME
+/* Do we have MT-safe gethostbyaddr() ? */
+#undef HAVE_MTSAFE_GETHOSTBYADDR
+
+/* Do we have MT-safe gethostbyname() ? */
+#undef HAVE_MTSAFE_GETHOSTBYNAME
+
/* Do we have <net/errno.h>? */
#undef HAVE_NET_ERRNO_H
diff --git a/unix/tclUnixInit.c b/unix/tclUnixInit.c
index 6fe79d9..7db0e4c 100644
--- a/unix/tclUnixInit.c
+++ b/unix/tclUnixInit.c
@@ -7,7 +7,7 @@
* Copyright (c) 1999 by Scriptics Corporation.
* All rights reserved.
*
- * RCS: @(#) $Id: tclUnixInit.c,v 1.66 2006/08/29 05:33:36 mistachkin Exp $
+ * RCS: @(#) $Id: tclUnixInit.c,v 1.67 2006/09/10 17:04:07 das Exp $
*/
#include "tclInt.h"
@@ -766,6 +766,30 @@ TclpSetVariables(
#ifdef HAVE_COREFOUNDATION
char tclLibPath[MAXPATHLEN + 1];
+#if MAC_OS_X_VERSION_MAX_ALLOWED > 1020
+ /*
+ * Set msgcat fallback locale to current CFLocale identifier.
+ */
+ CFLocaleRef localeRef;
+
+ if (CFLocaleCopyCurrent != NULL && CFLocaleGetIdentifier != NULL &&
+ (localeRef = CFLocaleCopyCurrent())) {
+ CFStringRef locale = CFLocaleGetIdentifier(localeRef);
+
+ if (locale) {
+ char loc[256];
+
+ if (CFStringGetCString(locale, loc, 256, kCFStringEncodingUTF8)) {
+ if (!Tcl_CreateNamespace(interp, "::tcl::mac", NULL, NULL)) {
+ Tcl_ResetResult(interp);
+ }
+ Tcl_SetVar(interp, "::tcl::mac::locale", loc, TCL_GLOBAL_ONLY);
+ }
+ }
+ CFRelease(localeRef);
+ }
+#endif
+
if (MacOSXGetLibraryPath(interp, MAXPATHLEN, tclLibPath) == TCL_OK) {
CONST char *str;
Tcl_DString ds;