# strip everything before this # cd to your version of Tk-804.025_beta10 # and feed this file to /bin/sh # # touch demos/demos/widget_lib/slide.pl chmod 0444 demos/demos/widget_lib/slide.pl touch demos/demos/widget_lib/hello.pl chmod 0444 demos/demos/widget_lib/hello.pl touch demos/demos/widget_lib/mega.pl chmod 0444 demos/demos/widget_lib/mega.pl patch -p1 -N <<'__END_OF_PATCH__' Index: Change.log --- Tk-804.025_beta10/Change.log 2003-12-14 19:46:51.000000000 +0000 +++ Tk-804.025_beta11/Change.log 2003-12-19 13:30:12.000000000 +0000 @@ -1,3 +1,25 @@ +Change 3049 on 2003/12/19 by nick@llama + + tk8.4.5 tests for image1 etc. already existing with + Tcl_GetCommandInfo() on the image, so we need to honour + that and return info for images. + +Change 3048 on 2003/12/19 by nick@llama + + Trivial typo in dirtree comment + +Change 3047 on 2003/12/19 by nick@llama + + Generated files + +Change 3046 on 2003/12/19 by nick@dromedary + + Raw merge of tcl/tk8.4.5 + +Change 3043 on 2003/12/14 by nick@llama + + Steve's widget patch + Change 3042 on 2003/12/14 by nick@llama Switch $VERSION stuff to new style when file Index: MANIFEST --- Tk-804.025_beta10/MANIFEST 2003-12-11 09:42:41.000000000 +0000 +++ Tk-804.025_beta11/MANIFEST 2003-12-14 22:25:34.000000000 +0000 @@ -117,6 +117,7 @@ demos/demos/widget_lib/filebox.pl demos/demos/widget_lib/floor.pl demos/demos/widget_lib/form.pl +demos/demos/widget_lib/hello.pl demos/demos/widget_lib/hscale.pl demos/demos/widget_lib/icon.pl demos/demos/widget_lib/image1.pl @@ -124,6 +125,7 @@ demos/demos/widget_lib/items.pl demos/demos/widget_lib/labelframe.pl demos/demos/widget_lib/labels.pl +demos/demos/widget_lib/mega.pl demos/demos/widget_lib/menbut.pl demos/demos/widget_lib/menus.pl demos/demos/widget_lib/menus2.pl @@ -140,6 +142,7 @@ demos/demos/widget_lib/sayings.pl demos/demos/widget_lib/search.pl demos/demos/widget_lib/showVars.pl +demos/demos/widget_lib/slide.pl demos/demos/widget_lib/spin.pl demos/demos/widget_lib/states.pl demos/demos/widget_lib/style.pl Index: demos/demos/widget_lib/hello.pl --- /dev/null 2003-09-23 18:59:22.000000000 +0100 +++ Tk-804.025_beta11/demos/demos/widget_lib/hello.pl 2003-12-14 22:25:34.000000000 +0000 @@ -0,0 +1,45 @@ +# hello.pl + +use Config; +use File::Basename; +use Tk::widgets qw/ ROText /; +use vars qw/ $TOP /; +use strict; + +sub hello { + + my( $demo ) = @_; + + $TOP = $MW->WidgetDemo( + -name => $demo, + -text => "This demonstration describes the basics of Perl/Tk programming. MORE HERE, PLEASE.", + -title => 'Perl/Tk User Guide', + -iconname => 'hello', + ); + + # Pipe perldoc help output via fileevent() into a Scrolled ROText widget. + + my $t = $TOP->Scrolled( + qw/ ROText -width 80 -height 25 -wrap none -scrollbars osow/, + ); + my $cmd = dirname( $Config{perlpath} ) . '/perldoc -t Tk::UserGuide'; + $t->pack( qw/ -expand 1 -fill both / ); + + open( H, "$cmd|" ) or die "Cannot get pTk user guide: $!"; + $TOP->fileevent( \*H, 'readable' => [ \&hello_fill, $t ] ); + +} # end hello + +sub hello_fill { + + my( $t ) = @_; + + my $stat = sysread H, my $data, 4096; + die "sysread error: $!" unless defined $stat; + if( $stat == 0 ) { # EOF + $TOP->fileevent( \*H, 'readable' => '' ); + return; + } + $t->insert( 'end', $data ); + +} # end hello_fill Index: demos/demos/widget_lib/mega.pl --- /dev/null 2003-09-23 18:59:22.000000000 +0100 +++ Tk-804.025_beta11/demos/demos/widget_lib/mega.pl 2003-12-14 22:25:34.000000000 +0000 @@ -0,0 +1,134 @@ +# mega.pl + +use vars qw / $TOP /; +use strict; + +sub mega { + + my( $demo ) = @_; + + $TOP = $MW->WidgetDemo( + -name => $demo, + -text => [ "Perl/Tk provides a powerful framework for creating custom widgets. There are two types of these mega-widgets: composite and derived. Subsequent demonstrations detail a complete mega-widget of each type. Regardless of the type of mega-widget, they share a common programming structure. The key that differentiates the various types of mega-widget is the definition of the new widget's base class(es).", -wraplength => '7i' ], + -title => 'Introduction to writing pure Perl mega-widgets ', + -iconname => 'mega', + ); + + my $t = $TOP->Scrolled( qw/ ROText -wrap word -scrollbars ow/ ); + $t->pack( qw/ -fill both -expand 1 / ); + $t->insert( 'end', <<'end-of-instructions' ); + +Here, briefly, is the Perl/Tk mega-widget implementation for pure Perl mega-widgets. As much of the work as possible has been abstracted and incorporated into the pTk core. This mimimizes the code the mega-widget author has to write, increasing consistency. + +There are two varieties of mega-widgets in Perl/Tk: composite and derived. A composite is Toplevel or Frame-based, having other, more elemental, widgets packed (or gridded) inside. A derived widget has a ISA-like relationship, generally adding (but sometimes subtracting) options/methods to/from a single, existing, widget. Of course, that single widget may itself be a composite widget. + +To create a Perl/Tk mega-widget one: + +. chooses a namespace (class name) +. defines a subroutine to initialize the class (optional) +. defines an instance constructor (subroutine) that (optional): + . builds the new widget + . defines options (configuration specifications, analagous to C widgets) + . defines delegates for widget methods +. defines private and instance methods (optional) + +As with core widgets, methods like configure() and cget() are automatically provided by the mega-widget framework and are "just there", and option database operations "just work". + +Here is a minimal Perl/Tk Toplevel-based composite mega-widget: + + package Tk::Nil; + use base qw/Tk::Toplevel/; + Construct Tk::Widget 'Nil'; + +Unless overridden, options and methods are inherited from the mega-widget's base class(es). + +You create a Nil just like any other Perl/Tk widget: + + my $nil = $mw->Nil; + +And an empty Nil window appears that functions just like a Toplevel! But other than that, the Nil widget doesn't do anything more since no additonal subwidgets or behavior has been defined. The purpose of that example was to demonstrate how much the Perl/Tk mega-widget mechanism did for the mega-widget author - a fully functional composite mega-widget in three lines of code. + +There's a second container-like mega-widget in Perl/Tk, based on a Frame. But other than the logical container, the two mega-widget types are more-or-less equivalent. The third and final mega-widget type we call a derived mega-widget, because it adds or subtracts behavior to/from an existing widget. + +Functional mega-widgets look more like this: + + package Tk::MyNewWidget; + + # Declare base class. + use base qw/ Tk::Frame /; # Frame-based composite +or + use base qw/ Tk::Toplevel /; # Toplevel-based composite +or + use Tk:SomeWidget; + use base qw/ Tk::Derived Tk::SomeWidget /; # derived from SomeWidget + + Construct Tk::Widget 'MyNewWidget'; # install MyNewWidget in pTk namespace + + sub ClassInit{ # called once to initialize new class + my($class, $mw) = @_; + $class->SUPER::ClassInit($mw); + } + + sub Populate { # called to build each widget instance + my($self, $args) = @_; + $self->SUPER::Populate($args); + $self->Advertise(); # advertise subwidgets + $self->Callback(); # create -command callbacks + $self->Component(); # define a subwidget component + $self->ConfigSpecs(); # define cget() / configure() options + $self->Delegates(); # how methods are delegated to subwidgets + $self->Subwidget(); # map a subwidget name to subwidget reference + } + + # Private methods. + + # Public methods. + + 1; # end class MyNewWidget + + # Don't forget POD documentation here! + +Here's an excerpt from a Text dervived mega-widget called TraceText; you can examine the complete code in another demonstration. This widget defines its content using a new -textvariable option. + + package Tk::TraceText; + use base qw/Tk::Derived Tk::Text/; + Construct Tk::Widget 'TraceText'; + + sub Populate { + + my( $self, $args ) = @_; + + $self->ConfigSpecs( + -textvariable => 'METHOD', 'textVariable', 'TextVariable', undef, + ); + + } # end Populate + + # Private methods. + + sub textvariable { + + my ( $self, $vref ) = @_; + + $self->traceVariable( $vref, 'w', [ \&tracew => $self, $vref ] ); + $self->{_vref} = $vref; # store watchpoint in an instance variable + + } # end textvariable + +If you compare the preamble (the first three lines) with that of the Nil mega-widget, you'll note that they are virtually identical - the important difference is the addition of the Tk::Derived class that provides additional methods specifically for derived mega-widgets. + +At that point, with three lines of code, we have a completely functional mega-widget called TraceText that is identical to the standard Text widget in every way, and the key to all this is the Construct() call, which, among other duties, installs the new widget name in the symbol table. + +Construct() also arranges for the TraceText "instantiator" to call-out to the well-known method Populate() - this is how the mega-widget author adds behavior to the new widget. Similarly, the mega-widget author can provide a ClassInit() method that is called once per MainWindow to initialize class bindings, variables, images, etcetera. + +Tk::TraceText::Populate defines the -textvariable option and provides a private method to establish the watchpoint. In Perl/Tk, all mega-widget options are specified via a ConfigSpecs() call, named after the C structure. + +Briefly, ConfigSpecs() names options and tells Perl/Tk what to do when one is specified on a configure() or cget() call. It also specifies the option's database name, class name and default value for option DB lookups. For our -textvariable option, the Perl/Tk framework invokes a METHOD (subroutine) by the same name as the option, minus the dash, of course. Other choices include CHILDREN, DECENDENTS, a name (or list of names) of a subwidget, etcetera. + +More details on mega-widget construction can be found in these man pages: + +Tk::ConfigSpecs, Tk::Derived, Tk::composite, Tk::mega + +end-of-instructions + +} # end mega Index: demos/demos/widget_lib/slide.pl --- /dev/null 2003-09-23 18:59:22.000000000 +0100 +++ Tk-804.025_beta11/demos/demos/widget_lib/slide.pl 2003-12-14 22:25:34.000000000 +0000 @@ -0,0 +1,179 @@ +# slide.pl + +$Tk::SlideSwitch::VERSION = '1.1'; + +package Tk::SlideSwitch; + +use Tk; +use Tk::widgets qw/Label Scale/; +use base qw/Tk::Frame/; +use strict; + +Construct Tk::Widget 'SlideSwitch'; + +sub Populate { + + my($self, $args) = @_; + + $self->SUPER::Populate($args); + + my $ll = $self->Label->pack(-side => 'left'); + my $sl = $self->Scale->pack(-side => 'left'); + my $rl = $self->Label->pack(-side => 'left'); + + $self->ConfigSpecs( + -command => [$sl, qw/command Command /], + -from => [$sl, qw/from From 0/], + -highlightthickness => [$sl, + qw/highlightThickness HighlightThickness 0/], + -length => [$sl, qw/length Length 30/], + -llabel => [qw/METHOD llabel Llabel /], + -orient => [$sl, qw/orient Orient horizontal/], + -rlabel => [qw/METHOD rlabel Rlabel /], + -showvalue => [$sl, qw/showValue ShowValue 0/], + -sliderlength => [$sl, qw/sliderLength SliderLength 15/], + -sliderrelief => [$sl, qw/sliderRelief SliderRelief raised/], + -to => [$sl, qw/to To 1/], + -troughcolor => [$sl, qw/troughColor TroughColor /], + -width => [$sl, qw/width Width 8/], + -variable => [$sl, qw/variable Variable /], + 'DEFAULT' => [$ll, $rl], + ); + + $self->{ll} = $ll; + $self->{sl} = $sl; + $self->{rl} = $rl; + + $self->bind('' => sub { + my ($self) = @_; + my $orient = $self->cget(-orient); + return if $orient eq 'horizontal'; + my ($ll, $sl, $rl) = ($self->{ll}, $self->{sl}, $self->{rl}); + $ll->packForget; + $sl->packForget; + $rl->packForget; + $ll->pack; + $sl->pack; + $rl->pack; + }); + +} # end Populate + +# Private methods and subroutines. + +sub llabel { + my ($self, $args) = @_; + $self->{ll}->configure(@$args); +} # end llabel + +sub rlabel { + my ($self, $args) = @_; + $self->{rl}->configure(@$args); +} # end rlabel + +1; + +package main; + +use Tk::widgets qw/ Trace /; +use vars qw / $TOP /; +use strict; + +sub slide { + + my( $demo ) = @_; + + $TOP = $MW->WidgetDemo( + -name => $demo, + -text => "This demonstration creates a new composite SlideSwitch widget that can be either on or off. The widget is really a customized Scale widget.", + -title => 'A binary sliding switch', + -iconname => 'slide', + ); + + my $mw = $TOP; + + my $sl = $mw->SlideSwitch( + -bg => 'gray', + -orient => 'horizontal', + -command => sub {print "Switch value is @_\n"}, + -llabel => [-text => 'OFF', -foreground => 'blue'], + -rlabel => [-text => 'ON', -foreground => 'blue'], + -troughcolor => 'tan', + )->pack(qw/-side left -expand 1/); + +} # end slide + +__END__ + +=head1 NAME + +Tk::SlideSwitch - a 2 position horizontal or vertical switch. + +=head1 SYNOPSIS + + use Tk::SlideSwitch; + + my $sl = $frame1->SlideSwitch( + -bg => 'gray', + -orient => 'horizontal', + -command => [$self => 'on'], + -llabel => [-text => 'OFF', -foreground => 'blue'], + -rlabel => [-text => 'ON', -foreground => 'blue'], + -troughcolor => 'tan', + )->pack(qw/-side left -expand 1/); + +=head1 DESCRIPTION + +Tk::SlideSwitch is a Frame based composite mega-widget featuring a binary Scale +widget surrounded by two Label widgets. The Scale's value can be either 0 or +1. The Labels are positioned to the left and right of the Scale if its +orientation is horizontal, else on the top and bottom of the Scale. + +=head1 OPTIONS + +In addition to all Scale options, the following option/value pairs are +also supported: + +=over 4 + +=item B<-llabel> + +A reference to an array of left (or top) Label configuration options. + +=item B<-rlabel> + +A reference to an array of right (or bottom) Label configuration options. + +=back + +=head1 METHODS + +There are no special methods. + +=head1 ADVERTISED WIDGETS + +Component subwidgets can be accessed via the B method. +This mega widget has no advertised subwidgets. + +=head1 EXAMPLE + +See Synopsis. + +=head1 BUGS + +This widget uses only the pack geometry manager. + +=head1 AUTHOR + +sol0@Lehigh.EDU + +Copyright (C) 2002 - 2003, Steve Lidie. All rights reserved. + +This program is free software; you can redistribute it and/or +modify it under the same terms as Perl itself. + +=head1 KEYWORDS + +SlideSwitch, Scale + +=cut Index: demos/demos/widget_lib/trace2.pl --- Tk-804.025_beta10/demos/demos/widget_lib/trace2.pl 2003-12-10 20:37:32.000000000 +0000 +++ Tk-804.025_beta11/demos/demos/widget_lib/trace2.pl 2003-12-14 22:25:37.000000000 +0000 @@ -99,7 +99,7 @@ $TOP = $MW->WidgetDemo( -name => $demo, -text => "This demonstration derives a new Text widget whose contents are modified using a normal Perl variable.", - -title => 'Contents of a Text idget tied to a variable', + -title => 'Contents of a Text widget tied to a variable', -iconname => 'trace2', ); Index: demos/demos/widtrib/dirtree.pl --- Tk-804.025_beta10/demos/demos/widtrib/dirtree.pl 2003-07-19 09:39:05.000000000 +0100 +++ Tk-804.025_beta11/demos/demos/widtrib/dirtree.pl 2003-12-14 22:29:29.000000000 +0000 @@ -1,4 +1,4 @@ -# DirTree, diplay directory tree. +# DirTree, display directory tree. use Tk; use Tk::DirTree; Index: demos/widget --- Tk-804.025_beta10/demos/widget 2003-12-06 13:39:31.000000000 +0000 +++ Tk-804.025_beta11/demos/widget 2003-12-14 22:25:39.000000000 +0000 @@ -2,14 +2,17 @@ use 5.008; use Tk 804.000; -use lib Tk->findINC('demos/widget_lib'); -use Tk::widgets qw/Dialog ErrorDialog ROText/; +use lib Tk->findINC( 'demos/widget_lib' ); +use Tk::widgets qw/ DialogBox ErrorDialog LabEntry ROText /; use WidgetDemo; -use subs qw/demos invoke lsearch see_code see_vars show_stat view_widget/; -use vars qw/$MW $FONT $WIDTRIB/; -use vars qw/$CODE $CODE_RERUN $CODE_TEXT $VARS $VIEW $VIEW_TEXT/; -use vars qw/$ALIGN $BRAKES $LIGHTS $OIL $SOBER $TRANS $WIPERS/; -use vars qw/$COLOR $FONT_STYLE $POINT_SIZE $DEMO_FILE %DEMO_DESCRIPTION/; +use subs qw/ + build_about_dialog demos invoke lsearch + see_code see_vars show_stat view_widget +/; +use vars qw/ $MW $FONT $WIDTRIB /; +use vars qw/ $CODE $CODE_RERUN $CODE_TEXT $VARS $VIEW $VIEW_TEXT /; +use vars qw/ $ALIGN $BRAKES $LIGHTS $OIL $SOBER $TRANS $WIPERS /; +use vars qw/ $COLOR $FONT_STYLE $POINT_SIZE $DEMO_FILE %DEMO_DESCRIPTION /; use strict; @@ -141,6 +144,10 @@ $T->insert('end', "\nThis application provides a front end for several short scripts that demonstrate what you can do with Tk widgets. Each of the numbered lines below describes a demonstration; you can click on it to invoke the demonstration. Once the demonstration window appears, you can click the ", '', 'See Code', 'bold', " button to see the Perl/Tk code that created the demonstration. If you wish, you can edit the code and click the ", '', "Rerun Demo", 'bold', " button in the code window to reinvoke the demonstration with the modified code.\n"); +demos 'Getting Started', ( + 'hello' => 'An introduction to Perl/Tk', +); + demos 'Labels, buttons, checkbuttons, and radiobuttons', ( 'labels' => 'Labels (text and images)', 'unicodeout' => 'Labels and Unicode text', @@ -219,8 +226,10 @@ 'bounce' => 'Balls bouncing in a cavity', ); -demos 'Pure Perl Mega-Widgets', ( - 'trace2' => 'Derived Tk::TraceText - Text contents defined by a traced variable', +demos 'Sample Perl Mega-Widgets', ( + 'mega' => 'Introduction to writing pure Perl mega-widgets', + 'slide' => 'Composite Tk::SlideSwitch - binary on/off switch', + 'trace2' => 'Derived Tk::TraceText - Text contents defined by a traced variable', ); demos 'Miscellaneous', ( @@ -250,19 +259,7 @@ $T->insert('end', ++$i . ". $title\n", ['demo', "demo-$name"]); } -# Create all the dialogs required by this demonstration. - -my $DIALOG_ABOUT = $MW->Dialog( - -title => 'About widget', - -bitmap => 'info', - -default_button => 'OK', - -buttons => ['OK'], - -text => " widget\n\nPerl Version $]" . - "\nTk Version $Tk::VERSION\n\n 2004/01/02", -); -$help->cget(-menu)->entryconfigure('About', - -command => [$DIALOG_ABOUT => 'Show'], -); +build_about_dialog $help; MainLoop; @@ -284,6 +281,47 @@ } # end AUTOLOAD +sub build_about_dialog { + + my $help = shift; + + my $dialog = $MW->DialogBox( + -title => 'About widget', + -default_button => 'OK', + -buttons => ['OK'], + ); + my $df = $dialog->add( 'Labelframe', -text => ' 2004 - Jan - 02 ' ); + $df->pack( qw/ -fill both -expand 1 / ); + my( $change ) = $Tk::CHANGE =~ /Change:\s+(.*)/; + my( $tk ) = "$Tk::VERSION, change $change"; + + foreach my $item ( + [ 'Perl', $] ], + [ 'Tk', $tk ], + [ 'Platform', $Tk::platform ], + [ 'Library', $Tk::library ], + ) { + my $l = $item->[0] . ':'; + my $le = $df->LabEntry( + -font => $FONT, + -label => ' ' x (13 - length $l) . $l, + -labelPack => [qw/-side left -anchor w/], + -labelFont => 'Courier 12 bold', + -relief => 'flat', + -takefocus => 0, + -textvariable => $item->[1], + -width => 50, + ); + $le->pack(qw/ -fill x -expand 1/); + $le->Subwidget( 'entry' )->bindtags( [ ] ); + } + + $help->cget(-menu)->entryconfigure('About', + -command => [$dialog => 'Show'], + ); + +} # end build_about_dialog + sub demos { # Generate one demo section. @@ -354,8 +392,7 @@ -command => [$CODE => 'withdraw'], ); $CODE_RERUN = $code_buttons->Button(-text => 'Rerun Demo'); - $CODE_TEXT = $CODE->Scrolled('Text', - qw/-scrollbars e -height 40 -setgrid 1/); + $CODE_TEXT = $CODE->Scrolled('Text', qw/ -height 40 -scrollbars ow /); $code_buttons_dismiss->pack(qw/-side left -expand 1/); $CODE_RERUN->pack(qw/-side left -expand 1/); $CODE_TEXT->pack(qw/-side left -expand 1 -fill both/); @@ -449,14 +486,13 @@ $VIEW = $MW->Toplevel; $VIEW->iconname('widget'); my $view_buttons = $VIEW->Frame; - $view_buttons->pack(qw/-side bottom -expand 1 -fill x/); + $view_buttons->pack(qw/-side bottom -fill x/); my $view_buttons_dismiss = $view_buttons->Button( -text => 'Dismiss', -command => [$VIEW => 'withdraw'], ); $view_buttons_dismiss->pack(qw/-side left -expand 1/); - $VIEW_TEXT = $VIEW->Scrolled('Text', - qw/-scrollbars e -height 40 -setgrid 1/); + $VIEW_TEXT = $VIEW->Scrolled('Text', qw/ -height 40 -wrap none /); $VIEW_TEXT->pack(qw/-side left -expand 1 -fill both/); } else { $VIEW->deiconify; @@ -476,8 +512,6 @@ } # end view_widget -__END__ - =head1 NAME widget - Demonstration of Perl/Tk widgets Index: pTk/mTk/generic/tk.h --- Tk-804.025_beta10/pTk/mTk/generic/tk.h 2003-08-31 16:28:41.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tk.h 2003-12-19 11:54:51.000000000 +0000 @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.74.2.2 2003/07/15 22:46:35 dgp Exp $ + * RCS: @(#) $Id: tk.h,v 1.74.2.3 2003/10/03 16:32:39 dgp Exp $ */ #ifndef _TK @@ -50,10 +50,10 @@ #define TK_MAJOR_VERSION 8 #define TK_MINOR_VERSION 4 #define TK_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TK_RELEASE_SERIAL 4 +#define TK_RELEASE_SERIAL 5 -#define TK_VERSION "8.4" -#define TK_PATCH_LEVEL "8.4.4" +#define TK_VERSION "8.4" +#define TK_PATCH_LEVEL "8.4.5" /* * The following definitions set up the proper options for Macintosh Index: pTk/mTk/generic/tkButton.c --- Tk-804.025_beta10/pTk/mTk/generic/tkButton.c 2003-08-23 19:54:50.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkButton.c 2003-12-19 11:54:51.000000000 +0000 @@ -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: tkButton.c,v 1.20.2.1 2003/04/26 02:53:46 hobbs Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.20.2.2 2003/11/12 00:05:13 hobbs Exp $ */ #include "tkButton.h" #include "default.h" @@ -1082,6 +1082,13 @@ Tk_RestoreSavedOptions(&savedOptions); } + if ((butPtr->flags & BUTTON_DELETED)) { + /* + * Somehow button was deleted - just abort now. [Bug #824479] + */ + return TCL_ERROR; + } + /* * A few options need special processing, such as setting the * background from a 3-D border, or filling in complicated Index: pTk/mTk/generic/tkImage.c --- Tk-804.025_beta10/pTk/mTk/generic/tkImage.c 2003-08-31 16:32:22.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkImage.c 2003-12-19 11:54:52.000000000 +0000 @@ -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: tkImage.c,v 1.19.2.1 2003/07/07 09:43:01 dkf Exp $ + * RCS: @(#) $Id: tkImage.c,v 1.19.2.2 2003/09/17 23:45:05 dgp Exp $ */ #include "tkInt.h" @@ -233,9 +233,12 @@ */ if ((objc == 3) || (*(arg = Tcl_GetString(objv[3])) == '-')) { - dispPtr->imageId++; - sprintf(idString, "image%d", dispPtr->imageId); - name = idString; + Tcl_CmdInfo dummy; + do { + dispPtr->imageId++; + sprintf(idString, "image%d", dispPtr->imageId); + name = idString; + } while (Tcl_GetCommandInfo(interp, name, &dummy) != 0); firstOption = 3; } else { TkWindow *topWin; Index: pTk/mTk/generic/tkImgPhoto.c --- Tk-804.025_beta10/pTk/mTk/generic/tkImgPhoto.c 2003-09-27 21:15:10.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkImgPhoto.c 2003-12-19 11:54:53.000000000 +0000 @@ -8,6 +8,7 @@ * Copyright (c) 1994 The Australian National University. * Copyright (c) 1994-1997 Sun Microsystems, Inc. * Copyright (c) 2002 Donal K. Fellows + * Copyright (c) 2003 ActiveState Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -16,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.2 2003/07/17 13:05:53 dkf Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.36.2.3 2003/11/11 00:05:19 hobbs Exp $ */ #include "Lang.h" @@ -179,14 +180,17 @@ /* * Bit definitions for the flags field of a PhotoMaster. - * COLOR_IMAGE: 1 means that the image has different color - * components. - * IMAGE_CHANGED: 1 means that the instances of this image - * need to be redithered. + * COLOR_IMAGE: 1 means that the image has different color + * components. + * IMAGE_CHANGED: 1 means that the instances of this image + * need to be redithered. + * COMPLEX_ALPHA: 1 means that the instances of this image + * have alpha values that aren't 0 or 255. */ -#define COLOR_IMAGE 1 -#define IMAGE_CHANGED 2 +#define COLOR_IMAGE 1 +#define IMAGE_CHANGED 2 +#define COMPLEX_ALPHA 4 /* * The following data structure represents all of the instances of @@ -398,7 +402,12 @@ int objc, Tcl_Obj *CONST objv[], int flags)); static void ImgPhotoConfigureInstance _ANSI_ARGS_(( PhotoInstance *instancePtr)); -static int ImgPhotoSetSize _ANSI_ARGS_((PhotoMaster *masterPtr, +static int ToggleComplexAlphaIfNeeded _ANSI_ARGS_(( + PhotoMaster *mPtr)); +static void ImgPhotoBlendComplexAlpha _ANSI_ARGS_(( + XImage *bgImg, PhotoInstance *iPtr, + int xOffset, int yOffset, int width, int height)); +static int ImgPhotoSetSize _ANSI_ARGS_((PhotoMaster *masterPtr, int width, int height)); static void ImgPhotoInstanceSetSize _ANSI_ARGS_(( PhotoInstance *instancePtr)); @@ -2098,6 +2107,9 @@ if (oldFormat != NULL) { Tcl_DecrRefCount(oldFormat); } + + ToggleComplexAlphaIfNeeded(masterPtr); + return TCL_OK; errorExit: @@ -2250,7 +2262,6 @@ validBox.width, validBox.height); } } - } /* @@ -2450,6 +2461,200 @@ /* *---------------------------------------------------------------------- * + * ToggleComplexAlphaIfNeeded -- + * + * This procedure is called when an image is modified to + * check if any partially transparent pixels exist, which + * requires blending instead of straight copy. + * + * Results: + * None. + * + * Side effects: + * (Re)sets COMPLEX_ALPHA flag of master. + * + *---------------------------------------------------------------------- + */ + +static int +ToggleComplexAlphaIfNeeded(PhotoMaster *mPtr) +{ + size_t len = MAX(mPtr->userWidth, mPtr->width) * + MAX(mPtr->userHeight, mPtr->height) * 4; + unsigned char *c = mPtr->pix32; + unsigned char *end = c + len; + + /* + * Set the COMPLEX_ALPHA flag if we have an image with partially + * transparent bits. + */ + mPtr->flags &= ~COMPLEX_ALPHA; + c += 3; /* start at first alpha byte */ + for (; c < end; c += 4) { + if (*c && *c != 255) { + mPtr->flags |= COMPLEX_ALPHA; + break; + } + } + return (mPtr->flags & COMPLEX_ALPHA); +} + +/* + *---------------------------------------------------------------------- + * + * ImgPhotoBlendComplexAlpha -- + * + * This procedure is called when an image with partially + * transparent pixels must be drawn over another image. + * + * Results: + * None. + * + * Side effects: + * Background image passed in gets drawn over with image data. + * + *---------------------------------------------------------------------- + */ +/* + * This should work on all platforms that set mask and shift data properly + * from the visualInfo. + * RGB is really only a 24+ bpp version whereas RGB15 is the correct version + * and works for 15bpp+, but it slower, so it's only used for 15bpp+. + */ +#ifndef __WIN32__ +#define GetRValue(rgb) (UCHAR((rgb & red_mask) >> red_shift)) +#define GetGValue(rgb) (UCHAR((rgb & green_mask) >> green_shift)) +#define GetBValue(rgb) (UCHAR((rgb & blue_mask) >> blue_shift)) +#define RGB(r,g,b) ((unsigned)((UCHAR(r)<masterPtr->pix32; + unsigned char *masterPtr; + +#ifndef __WIN32__ + /* + * We have to get the mask and shift info from the visual. + * This might be cached for better performance. + */ + unsigned long red_mask, green_mask, blue_mask; + unsigned long red_shift, green_shift, blue_shift; + Visual *visual = iPtr->visualInfo.visual; + + red_mask = visual->red_mask; + green_mask = visual->green_mask; + blue_mask = visual->blue_mask; + red_shift = 0; + green_shift = 0; + blue_shift = 0; + while ((0x0001 & (red_mask >> red_shift)) == 0) red_shift++; + while ((0x0001 & (green_mask >> green_shift)) == 0) green_shift++; + while ((0x0001 & (blue_mask >> blue_shift)) == 0) blue_shift++; +#endif + +#define ALPHA_BLEND(bgPix, imgPix, alpha, unalpha) \ + ((bgPix * unalpha + imgPix * alpha) / 255) + +#if !(defined(__WIN32__) || defined(MAC_OSX_TK)) + /* + * Only unix requires the special case for <24bpp. It varies with + * 3 extra shifts and uses RGB15. The 24+bpp version could also + * then be further optimized. + */ + if (bgImg->depth < 24) { + unsigned char red_mlen, green_mlen, blue_mlen; + + red_mlen = 8 - CountBits(red_mask >> red_shift); + green_mlen = 8 - CountBits(green_mask >> green_shift); + blue_mlen = 8 - CountBits(blue_mask >> blue_shift); + for (y = 0; y < height; y++) { + line = (y + yOffset) * iPtr->masterPtr->width; + for (x = 0; x < width; x++) { + masterPtr = alphaAr + ((line + x + xOffset) * 4); + alpha = masterPtr[3]; + /* + * Ignore pixels that are fully transparent + */ + if (alpha) { + /* + * We could perhaps be more efficient than XGetPixel for + * 24 and 32 bit displays, but this seems "fast enough". + */ + r = masterPtr[0]; + g = masterPtr[1]; + b = masterPtr[2]; + if (alpha != 255) { + /* + * Only blend pixels that have some transparency + */ + unsigned char ra, ga, ba; + + pixel = XGetPixel(bgImg, x, y); + ra = GetRValue(pixel) << red_mlen; + ga = GetGValue(pixel) << green_mlen; + ba = GetBValue(pixel) << blue_mlen; + unalpha = 255 - alpha; + r = ALPHA_BLEND(ra, r, alpha, unalpha); + g = ALPHA_BLEND(ga, g, alpha, unalpha); + b = ALPHA_BLEND(ba, b, alpha, unalpha); + } + XPutPixel(bgImg, x, y, RGB15(r, g, b)); + } + } + } + } else +#endif + for (y = 0; y < height; y++) { + line = (y + yOffset) * iPtr->masterPtr->width; + for (x = 0; x < width; x++) { + masterPtr = alphaAr + ((line + x + xOffset) * 4); + alpha = masterPtr[3]; + /* + * Ignore pixels that are fully transparent + */ + if (alpha) { + /* + * We could perhaps be more efficient than XGetPixel for + * 24 and 32 bit displays, but this seems "fast enough". + */ + r = masterPtr[0]; + g = masterPtr[1]; + b = masterPtr[2]; + if (alpha != 255) { + /* + * Only blend pixels that have some transparency + */ + unsigned char ra, ga, ba; + + pixel = XGetPixel(bgImg, x, y); + ra = GetRValue(pixel); + ga = GetGValue(pixel); + ba = GetBValue(pixel); + unalpha = 255 - alpha; + r = ALPHA_BLEND(ra, r, alpha, unalpha); + g = ALPHA_BLEND(ga, g, alpha, unalpha); + b = ALPHA_BLEND(ba, b, alpha, unalpha); + } + XPutPixel(bgImg, x, y, RGB(r, g, b)); + } + } + } +#undef ALPHA_BLEND +} + +/* + *---------------------------------------------------------------------- + * * ImgPhotoDisplay -- * * This procedure is invoked to draw a photo image. @@ -2477,6 +2682,7 @@ * correspond to imageX and imageY. */ { PhotoInstance *instancePtr = (PhotoInstance *) clientData; + XVisualInfo visInfo = instancePtr->visualInfo; /* * If there's no pixmap, it means that an error occurred @@ -2487,21 +2693,56 @@ return; } - /* - * masterPtr->region describes which parts of the image contain - * valid data. We set this region as the clip mask for the gc, - * setting its origin appropriately, and use it when drawing the - * image. - */ + if ( +#if defined(MAC_TCL) || defined(MAC_OSX_TK) + /* + * The retrieval of bgImg is currently not functional on OSX + * (and likely not OS9 either), so skip attempts to alpha blend. + */ + 0 && +#endif + (instancePtr->masterPtr->flags & COMPLEX_ALPHA) + && visInfo.depth >= 15 + && (visInfo.class == DirectColor || visInfo.class == TrueColor)) { + XImage *bgImg = NULL; + + /* + * Pull the current background from the display to blend with + */ + bgImg = XGetImage(display, drawable, drawableX, drawableY, + (unsigned int)width, (unsigned int)height, AllPlanes, ZPixmap); + if (bgImg == NULL) { + return; + } + + ImgPhotoBlendComplexAlpha(bgImg, instancePtr, + imageX, imageY, width, height); - TkSetRegion(display, instancePtr->gc, instancePtr->masterPtr->validRegion); - XSetClipOrigin(display, instancePtr->gc, drawableX - imageX, - drawableY - imageY); - XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc, - imageX, imageY, (unsigned) width, (unsigned) height, - drawableX, drawableY); - XSetClipMask(display, instancePtr->gc, None); - XSetClipOrigin(display, instancePtr->gc, 0, 0); + /* + * Color info is unimportant as we only do this operation for + * depth >= 15. + */ + TkPutImage(NULL, 0, display, drawable, instancePtr->gc, + bgImg, 0, 0, drawableX, drawableY, + (unsigned int) width, (unsigned int) height); + XDestroyImage(bgImg); + } else { + /* + * masterPtr->region describes which parts of the image contain + * valid data. We set this region as the clip mask for the gc, + * setting its origin appropriately, and use it when drawing the + * image. + */ + TkSetRegion(display, instancePtr->gc, instancePtr->masterPtr->validRegion); + XSetClipOrigin(display, instancePtr->gc, drawableX - imageX, + drawableY - imageY); + XCopyArea(display, instancePtr->pixels, drawable, instancePtr->gc, + imageX, imageY, (unsigned) width, (unsigned) height, + drawableX, drawableY); + XSetClipMask(display, instancePtr->gc, None); + XSetClipOrigin(display, instancePtr->gc, 0, 0); + } + XFlush (display); } /* @@ -2814,6 +3055,8 @@ } } + ToggleComplexAlphaIfNeeded(masterPtr); + /* * Now adjust the sizes of the pixmaps for all of the instances. */ Index: pTk/mTk/generic/tkInt.decls --- Tk-804.025_beta10/pTk/mTk/generic/tkInt.decls 2003-07-24 20:37:10.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkInt.decls 2003-12-19 11:54:53.000000000 +0000 @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: tkInt.decls,v 1.33 2003/01/22 14:32:59 dkf Exp $ +# RCS: @(#) $Id: tkInt.decls,v 1.33.2.1 2003/10/13 03:30:04 hobbs Exp $ library tk @@ -673,6 +673,11 @@ CONST char *cmdName) } +declare 149 generic { + CONST Tk_OptionSpec * TkGetOptionSpec (CONST char *name, + Tk_OptionTable optionTable) +} + ############################################################################## # Define the platform specific internal Tcl interface. These functions are Index: pTk/mTk/generic/tkInt.h --- Tk-804.025_beta10/pTk/mTk/generic/tkInt.h 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkInt.h 2003-12-19 11:54:53.000000000 +0000 @@ -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: tkInt.h,v 1.56 2003/02/18 06:22:44 mdejong Exp $ + * RCS: $Id: tkInt.h,v 1.56.2.1 2003/10/13 03:30:05 hobbs Exp $ */ #ifndef _TKINT @@ -1113,9 +1113,6 @@ EXTERN int TkGetDoublePixels _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin, CONST char *string, double *doublePtr)); -EXTERN CONST Tk_OptionSpec * - TkGetOptionSpec _ANSI_ARGS_((CONST char *name, - Tk_OptionTable optionTable)); EXTERN int TkOffsetParseProc _ANSI_ARGS_(( ClientData clientData, Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *value, char *widgRec, Index: pTk/mTk/generic/tkIntDecls.h --- Tk-804.025_beta10/pTk/mTk/generic/tkIntDecls.h 2003-09-08 19:55:49.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkIntDecls.h 2003-12-19 11:54:53.000000000 +0000 @@ -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: tkIntDecls.h,v 1.22 2003/01/22 14:33:00 dkf Exp $ + * RCS: @(#) $Id: tkIntDecls.h,v 1.22.2.1 2003/10/13 03:30:05 hobbs Exp $ */ #ifndef _TKINTDECLS @@ -565,6 +565,9 @@ /* 148 */ EXTERN Tk_Window TkToplevelWindowForCommand _ANSI_ARGS_(( Tcl_Interp * interp, CONST char * cmdName)); +/* 149 */ +EXTERN CONST Tk_OptionSpec * TkGetOptionSpec _ANSI_ARGS_((CONST char * name, + Tk_OptionTable optionTable)); typedef struct TkIntStubs { int magic; @@ -840,6 +843,7 @@ void (*tkStylePkgInit) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 146 */ void (*tkStylePkgFree) _ANSI_ARGS_((TkMainInfo * mainPtr)); /* 147 */ Tk_Window (*tkToplevelWindowForCommand) _ANSI_ARGS_((Tcl_Interp * interp, CONST char * cmdName)); /* 148 */ + CONST Tk_OptionSpec * (*tkGetOptionSpec) _ANSI_ARGS_((CONST char * name, Tk_OptionTable optionTable)); /* 149 */ } TkIntStubs; #ifdef __cplusplus @@ -1549,6 +1553,10 @@ #define TkToplevelWindowForCommand \ (tkIntStubsPtr->tkToplevelWindowForCommand) /* 148 */ #endif +#ifndef TkGetOptionSpec +#define TkGetOptionSpec \ + (tkIntStubsPtr->tkGetOptionSpec) /* 149 */ +#endif #endif /* defined(USE_TK_STUBS) && !defined(USE_TK_STUB_PROCS) */ Index: pTk/mTk/generic/tkListbox.c --- Tk-804.025_beta10/pTk/mTk/generic/tkListbox.c 2003-12-13 12:10:29.000000000 +0000 +++ Tk-804.025_beta11/pTk/mTk/generic/tkListbox.c 2003-12-19 11:54:53.000000000 +0000 @@ -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: tkListbox.c,v 1.29 2003/02/25 02:07:25 hobbs Exp $ + * RCS: @(#) $Id: tkListbox.c,v 1.29.2.1 2003/11/11 19:41:50 hobbs Exp $ */ #include "tkPort.h" @@ -1404,8 +1404,7 @@ Tcl_HashEntry *entry; ItemAttr *attrs; - entry = Tcl_CreateHashEntry(listPtr->itemAttrTable, (char *)index, - &new); + entry = Tcl_CreateHashEntry(listPtr->itemAttrTable, (char *)index, &new); if (new) { attrs = (ItemAttr *) ckalloc(sizeof(ItemAttr)); attrs->border = NULL; @@ -2417,6 +2416,7 @@ entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i); if (entry != NULL) { + ckfree((char *)Tcl_GetHashValue(entry)); Tcl_DeleteHashEntry(entry); } @@ -3380,6 +3380,7 @@ /* Clean up attributes */ entry = Tcl_FindHashEntry(listPtr->itemAttrTable, (char *)i); if (entry != NULL) { + ckfree((char *)Tcl_GetHashValue(entry)); Tcl_DeleteHashEntry(entry); } } Index: pTk/mTk/generic/tkMenuDraw.c --- Tk-804.025_beta10/pTk/mTk/generic/tkMenuDraw.c 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkMenuDraw.c 2003-12-19 11:54:53.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenuDraw.c,v 1.3.20.1 2003/07/15 13:59:06 vincentdarley Exp $ + * RCS: @(#) $Id: tkMenuDraw.c,v 1.3.20.2 2003/11/12 00:04:53 hobbs Exp $ */ #include "tkMenu.h" @@ -993,6 +993,7 @@ result = LangMethodCall(interp, menuPtr->postedCascade->namePtr, "unpost", 0, 0); + menuPtr->postedCascade = NULL; if (result != TCL_OK) { return result; Index: pTk/mTk/generic/tkMenubutton.c --- Tk-804.025_beta10/pTk/mTk/generic/tkMenubutton.c 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkMenubutton.c 2003-12-19 11:54:53.000000000 +0000 @@ -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: tkMenubutton.c,v 1.12 2002/08/05 04:30:40 dgp Exp $ + * RCS: @(#) $Id: tkMenubutton.c,v 1.12.2.1 2003/11/17 23:29:36 hobbs Exp $ */ #include "tkPort.h" @@ -278,6 +278,7 @@ mbPtr->activeTextGC = None; mbPtr->gray = None; mbPtr->disabledGC = None; + mbPtr->stippleGC = None; mbPtr->leftBearing = 0; mbPtr->rightBearing = 0; mbPtr->widthString = NULL; @@ -453,14 +454,16 @@ if (mbPtr->disabledGC != None) { Tk_FreeGC(mbPtr->display, mbPtr->disabledGC); } + if (mbPtr->stippleGC != None) { + Tk_FreeGC(mbPtr->display, mbPtr->stippleGC); + } if (mbPtr->gray != None) { Tk_FreeBitmap(mbPtr->display, mbPtr->gray); } if (mbPtr->textLayout != NULL) { Tk_FreeTextLayout(mbPtr->textLayout); } - Tk_FreeConfigOptions((char *) mbPtr, mbPtr->optionTable, - mbPtr->tkwin); + Tk_FreeConfigOptions((char *) mbPtr, mbPtr->optionTable, mbPtr->tkwin); mbPtr->tkwin = NULL; Tcl_EventuallyFree((ClientData) mbPtr, TCL_DYNAMIC); } @@ -706,7 +709,6 @@ } mbPtr->normalTextGC = gc; - gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.foreground = mbPtr->activeFg->pixel; gcValues.background = Tk_3DBorderColor(mbPtr->activeBorder)->pixel; mask = GCForeground | GCBackground | GCFont; @@ -716,23 +718,36 @@ } mbPtr->activeTextGC = gc; - gcValues.font = Tk_FontId(mbPtr->tkfont); gcValues.background = Tk_3DBorderColor(mbPtr->normalBorder)->pixel; - if ((mbPtr->disabledFg != NULL) && (mbPtr->imageString == NULL)) { - gcValues.foreground = mbPtr->disabledFg->pixel; - mask = GCForeground | GCBackground | GCFont; - } else { + + /* + * Create the GC that can be used for stippling + */ + + if (mbPtr->stippleGC == None) { gcValues.foreground = gcValues.background; mask = GCForeground; if (mbPtr->gray == None) { - mbPtr->gray = Tk_GetBitmap(NULL, mbPtr->tkwin, - Tk_GetUid("gray50")); + mbPtr->gray = Tk_GetBitmap(NULL, mbPtr->tkwin, "gray50"); } if (mbPtr->gray != None) { gcValues.fill_style = FillStippled; gcValues.stipple = mbPtr->gray; mask |= GCFillStyle | GCStipple; } + mbPtr->stippleGC = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); + } + + /* + * Allocate the disabled graphics context, for drawing text in + * its disabled state. + */ + + mask = GCForeground | GCBackground | GCFont; + if (mbPtr->disabledFg != NULL) { + gcValues.foreground = mbPtr->disabledFg->pixel; + } else { + gcValues.foreground = gcValues.background; } gc = Tk_GetGC(mbPtr->tkwin, mask, &gcValues); if (mbPtr->disabledGC != None) { Index: pTk/mTk/generic/tkMenubutton.h --- Tk-804.025_beta10/pTk/mTk/generic/tkMenubutton.h 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkMenubutton.h 2003-12-19 11:54:53.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenubutton.h,v 1.8 2001/10/12 13:30:31 tmh Exp $ + * RCS: @(#) $Id: tkMenubutton.h,v 1.8.4.1 2003/11/17 23:29:36 hobbs Exp $ */ #ifndef _TKMENUBUTTON @@ -125,12 +125,9 @@ * means use normalTextGC). */ Pixmap gray; /* Pixmap for displaying disabled text/icon if * disabledFg is NULL. */ - GC disabledGC; /* Used to produce disabled effect. If - * disabledFg isn't NULL, this GC is used to - * draw button text or icon. Otherwise - * text or icon is drawn with normalGC and - * this GC is used to stipple background - * across it. */ + GC disabledGC; /* Used to produce disabled effect for text. */ + GC stippleGC; /* Used to produce disabled stipple effect + * for images when disabled. */ int leftBearing; /* Distance from text origin to leftmost drawn * pixel (positive means to right). */ int rightBearing; /* Amount text sticks right from its origin. */ Index: pTk/mTk/generic/tkPanedWindow.c --- Tk-804.025_beta10/pTk/mTk/generic/tkPanedWindow.c 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkPanedWindow.c 2003-12-19 11:54:54.000000000 +0000 @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.3 2003/07/18 09:53:16 dkf Exp $ + * RCS: @(#) $Id: tkPanedWindow.c,v 1.13.2.4 2003/08/19 21:00:13 jenglish Exp $ */ #include "tkPort.h" @@ -1224,7 +1224,7 @@ /* * Allocated a graphics context for drawing the paned window widget - * elements (background, sashes, etc.). + * elements (background, sashes, etc.) and set the window background. */ gcValues.background = Tk_3DBorderColor(pwPtr->background)->pixel; @@ -1233,6 +1233,7 @@ Tk_FreeGC(pwPtr->display, pwPtr->gc); } pwPtr->gc = newGC; + Tk_SetWindowBackground(pwPtr->tkwin, gcValues.background); /* * Issue geometry size requests to Tk. Index: pTk/mTk/generic/tkStubInit.c --- Tk-804.025_beta10/pTk/mTk/generic/tkStubInit.c 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkStubInit.c 2003-12-19 11:54:55.000000000 +0000 @@ -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: tkStubInit.c,v 1.41 2003/01/22 14:33:00 dkf Exp $ + * RCS: @(#) $Id: tkStubInit.c,v 1.41.2.1 2003/10/13 03:30:05 hobbs Exp $ */ #include "tkInt.h" @@ -329,6 +329,7 @@ TkStylePkgInit, /* 146 */ TkStylePkgFree, /* 147 */ TkToplevelWindowForCommand, /* 148 */ + TkGetOptionSpec, /* 149 */ }; TkIntPlatStubs tkIntPlatStubs = { Index: pTk/mTk/generic/tkUnixMenubu.c --- Tk-804.025_beta10/pTk/mTk/generic/tkUnixMenubu.c 2003-07-27 17:44:09.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/generic/tkUnixMenubu.c 2003-12-19 11:54:55.000000000 +0000 @@ -1,4 +1,4 @@ -/* +/* * tkUnixMenubu.c -- * * This file implements the Unix specific portion of the @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixMenubu.c,v 1.6 2001/05/21 14:07:33 tmh Exp $ + * RCS: @(#) $Id: tkUnixMenubu.c,v 1.6.4.1 2003/11/17 23:29:36 hobbs Exp $ */ #include "default.h" @@ -25,7 +25,7 @@ sizeof(Tk_ClassProcs), /* size */ TkMenuButtonWorldChanged, /* worldChangedProc */ }; - + /* *---------------------------------------------------------------------- * @@ -48,7 +48,7 @@ { return (TkMenuButton *)ckalloc(sizeof(TkMenuButton)); } - + /* *---------------------------------------------------------------------- * @@ -79,7 +79,10 @@ int y = 0; register Tk_Window tkwin = mbPtr->tkwin; int width, height, fullWidth, fullHeight; - int imageXOffset, imageYOffset, textXOffset, textYOffset; + int textXOffset, textYOffset; + int imageWidth, imageHeight; + int imageXOffset, imageYOffset; /* image information that will be used to + * restrict disabled pixmap as well */ int haveImage = 0, haveText = 0; mbPtr->flags &= ~REDRAW_PENDING; @@ -106,6 +109,9 @@ Tk_SizeOfBitmap(mbPtr->display, mbPtr->bitmap, &width, &height); haveImage = 1; } + imageWidth = width; + imageHeight = height; + haveText = (mbPtr->textWidth != 0 && mbPtr->textHeight != 0); /* @@ -128,7 +134,6 @@ fullHeight = 0; if (mbPtr->compound != COMPOUND_NONE && haveImage && haveText) { - switch ((enum compound) mbPtr->compound) { case COMPOUND_TOP: case COMPOUND_BOTTOM: { @@ -176,49 +181,49 @@ } TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0, - mbPtr->indicatorWidth + fullWidth, fullHeight, - &x, &y); + mbPtr->indicatorWidth + fullWidth, fullHeight, &x, &y); - if (mbPtr->image != NULL) { - Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap, - x + imageXOffset, y + imageYOffset); - } - if (mbPtr->bitmap != None) { - XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap, - gc, 0, 0, (unsigned) width, (unsigned) height, - x + imageXOffset, y + imageYOffset, 1); - } - if (haveText) { - Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, - x + textXOffset, y + textYOffset , - 0, -1); - Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, - mbPtr->textLayout, x + textXOffset, y + textYOffset , - mbPtr->underline); - } + imageXOffset += x; + imageYOffset += y; + if (mbPtr->image != NULL) { + Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap, + imageXOffset, imageYOffset); + } else if (mbPtr->bitmap != None) { + XSetClipOrigin(mbPtr->display, gc, imageXOffset, imageYOffset); + XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap, + gc, 0, 0, (unsigned) width, (unsigned) height, + imageXOffset, imageYOffset, 1); + XSetClipOrigin(mbPtr->display, gc, 0, 0); + } + + Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, + x + textXOffset, y + textYOffset, 0, -1); + Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, + x + textXOffset, y + textYOffset, mbPtr->underline); + } else if (haveImage) { + TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0, + width + mbPtr->indicatorWidth, height, &x, &y); + imageXOffset += x; + imageYOffset += y; + if (mbPtr->image != NULL) { + Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap, + imageXOffset, imageYOffset); + } else if (mbPtr->bitmap != None) { + XSetClipOrigin(mbPtr->display, gc, x, y); + XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap, + gc, 0, 0, (unsigned) width, (unsigned) height, + x, y, 1); + XSetClipOrigin(mbPtr->display, gc, 0, 0); + } } else { - if (mbPtr->image != NULL) { - TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0, - width + mbPtr->indicatorWidth, height, &x, &y); - Tk_RedrawImage(mbPtr->image, 0, 0, width, height, pixmap, - x + imageXOffset, y + imageYOffset); - } else if (mbPtr->bitmap != None) { - TkComputeAnchor(mbPtr->anchor, tkwin, 0, 0, - width + mbPtr->indicatorWidth, height, &x, &y); - XCopyPlane(mbPtr->display, mbPtr->bitmap, pixmap, - gc, 0, 0, (unsigned) width, (unsigned) height, - x + imageXOffset, y + imageYOffset, 1); - } else { - TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY, - mbPtr->textWidth + mbPtr->indicatorWidth, - mbPtr->textHeight, &x, &y); - Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, - x + textXOffset, y + textYOffset , - 0, -1); - Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, - mbPtr->textLayout, x + textXOffset, y + textYOffset , - mbPtr->underline); - } + TkComputeAnchor(mbPtr->anchor, tkwin, mbPtr->padX, mbPtr->padY, + mbPtr->textWidth + mbPtr->indicatorWidth, + mbPtr->textHeight, &x, &y); + Tk_DrawTextLayout(mbPtr->display, pixmap, gc, mbPtr->textLayout, + x + textXOffset, y + textYOffset, 0, -1); + Tk_UnderlineTextLayout(mbPtr->display, pixmap, gc, + mbPtr->textLayout, x + textXOffset, y + textYOffset, + mbPtr->underline); } /* @@ -226,12 +231,22 @@ * foreground color, generate the stippled effect. */ - if ((mbPtr->state == STATE_DISABLED) + if ((mbPtr->state == STATE_DISABLED) && ((mbPtr->disabledFg == NULL) || (mbPtr->image != NULL))) { - XFillRectangle(mbPtr->display, pixmap, mbPtr->disabledGC, - mbPtr->inset, mbPtr->inset, - (unsigned) (Tk_Width(tkwin) - 2*mbPtr->inset), - (unsigned) (Tk_Height(tkwin) - 2*mbPtr->inset)); + /* + * Stipple the whole button if no disabledFg was specified, + * otherwise restrict stippling only to displayed image + */ + if (mbPtr->disabledFg == NULL) { + XFillRectangle(mbPtr->display, pixmap, mbPtr->stippleGC, + mbPtr->inset, mbPtr->inset, + (unsigned) (Tk_Width(tkwin) - 2*mbPtr->inset), + (unsigned) (Tk_Height(tkwin) - 2*mbPtr->inset)); + } else { + XFillRectangle(mbPtr->display, pixmap, mbPtr->stippleGC, + imageXOffset, imageYOffset, + (unsigned) imageWidth, (unsigned) imageHeight); + } } /* @@ -289,7 +304,7 @@ (unsigned) Tk_Height(tkwin), 0, 0); Tk_FreePixmap(mbPtr->display, pixmap); } - + /* *---------------------------------------------------------------------- * @@ -311,7 +326,7 @@ TkMenuButton *mbPtr; { } - + /* *---------------------------------------------------------------------- * Index: pTk/mTk/tclGeneric/regcomp.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/regcomp.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/regcomp.c 2003-12-19 11:54:56.000000000 +0000 @@ -3,20 +3,20 @@ * This file #includes several others (see the bottom). * * Copyright (c) 1998, 1999 Henry Spencer. All rights reserved. - * + * * Development of this software was funded, in part, by Cray Research Inc., * UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics * Corporation, none of whom are responsible for the results. The author - * thanks all of them. - * + * thanks all of them. + * * Redistribution and use in source and binary forms -- with or without * modification -- are permitted for any purpose, provided that * redistributions in source form retain this entire copyright notice and * indicate the origin and nature of any modifications. - * + * * I'd appreciate being given credit for this package in the documentation * of software which uses it, but that is not a requirement. - * + * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL @@ -553,8 +553,12 @@ if (b->from != pre) break; if (b != NULL) { /* must be split */ - s->tmp = slist; - slist = s; + if (s->tmp == NULL) { /* if not already in the list */ + /* (fixes bugs 505048, 230589, */ + /* 840258, 504785) */ + s->tmp = slist; + slist = s; + } } } @@ -1352,7 +1356,7 @@ assert(right->nins == 0); freestate(v->nfa, right); } - + /* - brackpart - handle one item (or range) within a bracket expression ^ static VOID brackpart(struct vars *, struct state *, struct state *); @@ -2063,7 +2067,7 @@ GUTSMAGIC); fprintf(f, "\n\n\n========= DUMP ==========\n"); - fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n", + fprintf(f, "nsub %d, info 0%lo, csize %d, ntree %d\n", re->re_nsub, re->re_info, re->re_csize, g->ntree); dumpcolors(&g->cmap, f); Index: pTk/mTk/tclGeneric/tclBasic.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclBasic.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclBasic.c 2003-12-19 11:54:56.000000000 +0000 @@ -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: tclBasic.c,v 1.75.2.5 2003/07/18 23:35:38 dgp Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.75.2.8 2003/10/08 23:18:17 dgp Exp $ */ #include "tclInt.h" @@ -2550,16 +2550,17 @@ * must get the name from cmdPtr */ CONST char *newName; /* Command's new name, or NULL if * the command is not being renamed */ - int flags; /* Flags passed to trace procedures: - * indicates what's happening to command, - * plus other stuff like TCL_GLOBAL_ONLY, - * TCL_NAMESPACE_ONLY, and - * TCL_INTERP_DESTROYED. */ + int flags; /* Flags indicating the type of traces + * to trigger, either TCL_TRACE_DELETE + * or TCL_TRACE_RENAME. */ { register CommandTrace *tracePtr; ActiveCommandTrace active; char *result; Tcl_Obj *oldNamePtr = NULL; + int mask = (TCL_TRACE_DELETE | TCL_TRACE_RENAME); /* Safety */ + + flags &= mask; if (cmdPtr->flags & CMD_TRACE_ACTIVE) { /* @@ -2595,11 +2596,13 @@ for (tracePtr = cmdPtr->tracePtr; tracePtr != NULL; tracePtr = active.nextTracePtr) { + int traceFlags = (tracePtr->flags & mask); + active.nextTracePtr = tracePtr->nextPtr; - if (!(tracePtr->flags & flags)) { + if (!(traceFlags & flags)) { continue; } - cmdPtr->flags |= tracePtr->flags; + cmdPtr->flags |= traceFlags; if (oldName == NULL) { TclNewObj(oldNamePtr); Tcl_IncrRefCount(oldNamePtr); @@ -2610,7 +2613,7 @@ tracePtr->refCount++; (*tracePtr->traceProc)(tracePtr->clientData, (Tcl_Interp *) iPtr, oldName, newName, flags); - cmdPtr->flags &= ~tracePtr->flags; + cmdPtr->flags &= ~traceFlags; if ((--tracePtr->refCount) <= 0) { ckfree((char*)tracePtr); } @@ -3092,6 +3095,8 @@ * Call 'leave' command traces */ if (!(cmdPtr->flags & CMD_IS_DELETED)) { + int saveErrFlags = iPtr->flags + & (ERR_IN_PROGRESS | ERR_ALREADY_LOGGED | ERROR_CODE_SET); if ((cmdPtr->flags & CMD_HAS_EXEC_TRACES) && (traceCode == TCL_OK)) { traceCode = TclCheckExecutionTraces (interp, command, length, cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv); @@ -3100,6 +3105,9 @@ traceCode = TclCheckInterpTraces(interp, command, length, cmdPtr, code, TCL_TRACE_LEAVE_EXEC, objc, objv); } + if (traceCode == TCL_OK) { + iPtr->flags |= saveErrFlags; + } } TclCleanupCommand(cmdPtr); Index: pTk/mTk/tclGeneric/tclCmdAH.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclCmdAH.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclCmdAH.c 2003-12-19 11:54:56.000000000 +0000 @@ -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: tclCmdAH.c,v 1.27.2.6 2003/05/14 23:01:56 dkf Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.27.2.7 2003/10/22 08:21:15 dkf Exp $ */ #include "tclInt.h" @@ -801,16 +801,16 @@ (char *) NULL }; enum options { - FILE_ATIME, FILE_ATTRIBUTES, FILE_CHANNELS, FILE_COPY, - FILE_DELETE, - FILE_DIRNAME, FILE_EXECUTABLE, FILE_EXISTS, FILE_EXTENSION, - FILE_ISDIRECTORY, FILE_ISFILE, FILE_JOIN, FILE_LINK, - FILE_LSTAT, FILE_MTIME, FILE_MKDIR, FILE_NATIVENAME, - FILE_NORMALIZE, FILE_OWNED, - FILE_PATHTYPE, FILE_READABLE, FILE_READLINK, FILE_RENAME, - FILE_ROOTNAME, FILE_SEPARATOR, FILE_SIZE, FILE_SPLIT, - FILE_STAT, FILE_SYSTEM, - FILE_TAIL, FILE_TYPE, FILE_VOLUMES, FILE_WRITABLE + FCMD_ATIME, FCMD_ATTRIBUTES, FCMD_CHANNELS, FCMD_COPY, + FCMD_DELETE, + FCMD_DIRNAME, FCMD_EXECUTABLE, FCMD_EXISTS, FCMD_EXTENSION, + FCMD_ISDIRECTORY, FCMD_ISFILE, FCMD_JOIN, FCMD_LINK, + FCMD_LSTAT, FCMD_MTIME, FCMD_MKDIR, FCMD_NATIVENAME, + FCMD_NORMALIZE, FCMD_OWNED, + FCMD_PATHTYPE, FCMD_READABLE, FCMD_READLINK, FCMD_RENAME, + FCMD_ROOTNAME, FCMD_SEPARATOR, FCMD_SIZE, FCMD_SPLIT, + FCMD_STAT, FCMD_SYSTEM, + FCMD_TAIL, FCMD_TYPE, FCMD_VOLUMES, FCMD_WRITABLE }; if (objc < 2) { @@ -823,7 +823,7 @@ } switch ((enum options) index) { - case FILE_ATIME: { + case FCMD_ATIME: { Tcl_StatBuf buf; struct utimbuf tval; @@ -862,10 +862,10 @@ Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) buf.st_atime); return TCL_OK; } - case FILE_ATTRIBUTES: { + case FCMD_ATTRIBUTES: { return TclFileAttrsCmd(interp, objc, objv); } - case FILE_CHANNELS: { + case FCMD_CHANNELS: { if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 2, objv, "?pattern?"); return TCL_ERROR; @@ -873,13 +873,13 @@ return Tcl_GetChannelNamesEx(interp, ((objc == 2) ? NULL : Tcl_GetString(objv[2]))); } - case FILE_COPY: { + case FCMD_COPY: { return TclFileCopyCmd(interp, objc, objv); } - case FILE_DELETE: { + case FCMD_DELETE: { return TclFileDeleteCmd(interp, objc, objv); } - case FILE_DIRNAME: { + case FCMD_DIRNAME: { Tcl_Obj *dirPtr; if (objc != 3) { goto only3Args; @@ -893,19 +893,19 @@ return TCL_OK; } } - case FILE_EXECUTABLE: { + case FCMD_EXECUTABLE: { if (objc != 3) { goto only3Args; } return CheckAccess(interp, objv[2], X_OK); } - case FILE_EXISTS: { + case FCMD_EXISTS: { if (objc != 3) { goto only3Args; } return CheckAccess(interp, objv[2], F_OK); } - case FILE_EXTENSION: { + case FCMD_EXTENSION: { char *fileName, *extension; if (objc != 3) { goto only3Args; @@ -917,7 +917,7 @@ } return TCL_OK; } - case FILE_ISDIRECTORY: { + case FCMD_ISDIRECTORY: { int value; Tcl_StatBuf buf; @@ -931,7 +931,7 @@ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value); return TCL_OK; } - case FILE_ISFILE: { + case FCMD_ISFILE: { int value; Tcl_StatBuf buf; @@ -945,7 +945,7 @@ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value); return TCL_OK; } - case FILE_JOIN: { + case FCMD_JOIN: { Tcl_Obj *resObj; if (objc < 3) { @@ -956,7 +956,7 @@ Tcl_SetObjResult(interp, resObj); return TCL_OK; } - case FILE_LINK: { + case FCMD_LINK: { Tcl_Obj *contents; int index; @@ -1046,7 +1046,7 @@ } return TCL_OK; } - case FILE_LSTAT: { + case FCMD_LSTAT: { char *varName; Tcl_StatBuf buf; @@ -1060,7 +1060,7 @@ varName = Tcl_GetString(objv[3]); return StoreStatData(interp, varName, &buf); } - case FILE_MTIME: { + case FCMD_MTIME: { Tcl_StatBuf buf; struct utimbuf tval; @@ -1099,14 +1099,14 @@ Tcl_SetLongObj(Tcl_GetObjResult(interp), (long) buf.st_mtime); return TCL_OK; } - case FILE_MKDIR: { + case FCMD_MKDIR: { if (objc < 3) { Tcl_WrongNumArgs(interp, 2, objv, "name ?name ...?"); return TCL_ERROR; } return TclFileMakeDirsCmd(interp, objc, objv); } - case FILE_NATIVENAME: { + case FCMD_NATIVENAME: { CONST char *fileName; Tcl_DString ds; @@ -1123,7 +1123,7 @@ Tcl_DStringFree(&ds); return TCL_OK; } - case FILE_NORMALIZE: { + case FCMD_NORMALIZE: { Tcl_Obj *fileName; if (objc != 3) { @@ -1135,7 +1135,7 @@ Tcl_SetObjResult(interp, fileName); return TCL_OK; } - case FILE_OWNED: { + case FCMD_OWNED: { int value; Tcl_StatBuf buf; @@ -1158,7 +1158,7 @@ Tcl_SetBooleanObj(Tcl_GetObjResult(interp), value); return TCL_OK; } - case FILE_PATHTYPE: { + case FCMD_PATHTYPE: { if (objc != 3) { goto only3Args; } @@ -1176,13 +1176,13 @@ } return TCL_OK; } - case FILE_READABLE: { + case FCMD_READABLE: { if (objc != 3) { goto only3Args; } return CheckAccess(interp, objv[2], R_OK); } - case FILE_READLINK: { + case FCMD_READLINK: { Tcl_Obj *contents; if (objc != 3) { @@ -1205,10 +1205,10 @@ Tcl_DecrRefCount(contents); return TCL_OK; } - case FILE_RENAME: { + case FCMD_RENAME: { return TclFileRenameCmd(interp, objc, objv); } - case FILE_ROOTNAME: { + case FCMD_ROOTNAME: { int length; char *fileName, *extension; @@ -1225,7 +1225,7 @@ } return TCL_OK; } - case FILE_SEPARATOR: { + case FCMD_SEPARATOR: { if ((objc < 2) || (objc > 3)) { Tcl_WrongNumArgs(interp, 2, objv, "?name?"); return TCL_ERROR; @@ -1256,7 +1256,7 @@ } return TCL_OK; } - case FILE_SIZE: { + case FCMD_SIZE: { Tcl_StatBuf buf; if (objc != 3) { @@ -1269,14 +1269,14 @@ (Tcl_WideInt) buf.st_size); return TCL_OK; } - case FILE_SPLIT: { + case FCMD_SPLIT: { if (objc != 3) { goto only3Args; } Tcl_SetObjResult(interp, Tcl_FSSplitPath(objv[2], NULL)); return TCL_OK; } - case FILE_STAT: { + case FCMD_STAT: { char *varName; Tcl_StatBuf buf; @@ -1290,7 +1290,7 @@ varName = Tcl_GetString(objv[3]); return StoreStatData(interp, varName, &buf); } - case FILE_SYSTEM: { + case FCMD_SYSTEM: { Tcl_Obj* fsInfo; if (objc != 3) { goto only3Args; @@ -1305,7 +1305,7 @@ return TCL_ERROR; } } - case FILE_TAIL: { + case FCMD_TAIL: { int splitElements; Tcl_Obj *splitPtr; @@ -1346,7 +1346,7 @@ Tcl_DecrRefCount(splitPtr); return TCL_OK; } - case FILE_TYPE: { + case FCMD_TYPE: { Tcl_StatBuf buf; if (objc != 3) { @@ -1359,7 +1359,7 @@ GetTypeFromMode((unsigned short) buf.st_mode), -1); return TCL_OK; } - case FILE_VOLUMES: { + case FCMD_VOLUMES: { if (objc != 2) { Tcl_WrongNumArgs(interp, 2, objv, NULL); return TCL_ERROR; @@ -1367,7 +1367,7 @@ Tcl_SetObjResult(interp, Tcl_FSListVolumes()); return TCL_OK; } - case FILE_WRITABLE: { + case FCMD_WRITABLE: { if (objc != 3) { goto only3Args; } Index: pTk/mTk/tclGeneric/tclCmdMZ.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclCmdMZ.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclCmdMZ.c 2003-12-19 11:54:56.000000000 +0000 @@ -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: tclCmdMZ.c,v 1.82.2.6 2003/07/16 08:24:20 dkf Exp $ + * RCS: @(#) $Id: tclCmdMZ.c,v 1.82.2.9 2003/10/14 18:21:59 vincentdarley Exp $ */ #include "tclInt.h" @@ -738,7 +738,7 @@ match = Tcl_RegExpExecObj(interp, regExpr, objPtr, offset, 10 /* matches */, ((offset > 0 && - (Tcl_GetUniChar(objPtr,offset-1) != (Tcl_UniChar)'\n')) + (wstring[offset-1] != (Tcl_UniChar)'\n')) ? TCL_REG_NOTBOL : 0)); if (match < 0) { @@ -833,6 +833,17 @@ offset++; } else { offset += end; + if (start == end) { + /* + * We matched an empty string, which means we must go + * forward one more step so we don't match again at the + * same spot. + */ + if (offset < wlen) { + Tcl_AppendUnicodeToObj(resultPtr, wstring + offset, 1); + } + offset++; + } } if (!all) { break; @@ -3257,8 +3268,10 @@ tcmdPtr->length = length; tcmdPtr->refCount = 1; flags |= TCL_TRACE_DELETE; - if (flags & (TRACE_EXEC_ENTER_STEP | TRACE_EXEC_LEAVE_STEP)) { - flags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC); + if (flags & (TCL_TRACE_ENTER_DURING_EXEC | + TCL_TRACE_LEAVE_DURING_EXEC)) { + flags |= (TCL_TRACE_ENTER_EXEC | + TCL_TRACE_LEAVE_EXEC); } strcpy(tcmdPtr->command, command); name = Tcl_GetString(objv[3]); @@ -3299,8 +3312,8 @@ && (strncmp(command, tcmdPtr->command, (size_t) length) == 0)) { flags |= TCL_TRACE_DELETE; - if (flags & (TRACE_EXEC_ENTER_STEP | - TRACE_EXEC_LEAVE_STEP)) { + if (flags & (TCL_TRACE_ENTER_DURING_EXEC | + TCL_TRACE_LEAVE_DURING_EXEC)) { flags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC); } @@ -3321,7 +3334,11 @@ /* Postpone deletion */ tcmdPtr->flags = 0; } - if ((--tcmdPtr->refCount) <= 0) { + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TclTraceExecutionObjCmd: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { ckfree((char*)tcmdPtr); } break; @@ -3350,6 +3367,7 @@ resultListPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); while ((clientData = Tcl_CommandTraceInfo(interp, name, 0, TraceCommandProc, clientData)) != NULL) { + int numOps = 0; TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData; @@ -3363,6 +3381,7 @@ */ elemObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); + Tcl_IncrRefCount(elemObjPtr); if (tcmdPtr->flags & TCL_TRACE_ENTER_EXEC) { Tcl_ListObjAppendElement(NULL, elemObjPtr, Tcl_NewStringObj("enter",5)); @@ -3379,7 +3398,13 @@ Tcl_ListObjAppendElement(NULL, elemObjPtr, Tcl_NewStringObj("leavestep",9)); } + Tcl_ListObjLength(NULL, elemObjPtr, &numOps); + if (0 == numOps) { + Tcl_DecrRefCount(elemObjPtr); + continue; + } Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); + Tcl_DecrRefCount(elemObjPtr); elemObjPtr = NULL; Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, @@ -3516,7 +3541,11 @@ flags | TCL_TRACE_DELETE, TraceCommandProc, clientData); tcmdPtr->flags |= TCL_TRACE_DESTROYED; - if ((--tcmdPtr->refCount) <= 0) { + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TclTraceCommandObjCmd: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { ckfree((char *) tcmdPtr); } break; @@ -3545,6 +3574,7 @@ resultListPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); while ((clientData = Tcl_CommandTraceInfo(interp, name, 0, TraceCommandProc, clientData)) != NULL) { + int numOps = 0; TraceCommandInfo *tcmdPtr = (TraceCommandInfo *) clientData; @@ -3558,6 +3588,7 @@ */ elemObjPtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); + Tcl_IncrRefCount(elemObjPtr); if (tcmdPtr->flags & TCL_TRACE_RENAME) { Tcl_ListObjAppendElement(NULL, elemObjPtr, Tcl_NewStringObj("rename",6)); @@ -3566,7 +3597,13 @@ Tcl_ListObjAppendElement(NULL, elemObjPtr, Tcl_NewStringObj("delete",6)); } + Tcl_ListObjLength(NULL, elemObjPtr, &numOps); + if (0 == numOps) { + Tcl_DecrRefCount(elemObjPtr); + continue; + } Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); + Tcl_DecrRefCount(elemObjPtr); elemObjPtr = Tcl_NewStringObj(tcmdPtr->command, -1); Tcl_ListObjAppendElement(NULL, eachTraceObjPtr, elemObjPtr); @@ -4080,6 +4117,8 @@ * because command deletes are unconditional, so the trace must go away. */ if (flags & (TCL_TRACE_DESTROYED | TCL_TRACE_DELETE)) { + int untraceFlags = tcmdPtr->flags; + if (tcmdPtr->stepTrace != NULL) { Tcl_DeleteTrace(interp, tcmdPtr->stepTrace); tcmdPtr->stepTrace = NULL; @@ -4091,13 +4130,38 @@ /* Postpone deletion, until exec trace returns */ tcmdPtr->flags = 0; } + /* - * Decrement the refCount since the command which held our - * reference (ever since we were created) has just gone away + * We need to construct the same flags for Tcl_UntraceCommand + * as were passed to Tcl_TraceCommand. Reproduce the processing + * of [trace add execution/command]. Be careful to keep this + * code in sync with that. */ + + if (untraceFlags & TCL_TRACE_ANY_EXEC) { + untraceFlags |= TCL_TRACE_DELETE; + if (untraceFlags & (TCL_TRACE_ENTER_DURING_EXEC + | TCL_TRACE_LEAVE_DURING_EXEC)) { + untraceFlags |= (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC); + } + } else if (untraceFlags & TCL_TRACE_RENAME) { + untraceFlags |= TCL_TRACE_DELETE; + } + + /* + * Remove the trace since TCL_TRACE_DESTROYED tells us to, or the + * command we're tracing has just gone away. Then decrement the + * clientData refCount that was set up by trace creation. + */ + Tcl_UntraceCommand(interp, oldName, untraceFlags, + TraceCommandProc, clientData); tcmdPtr->refCount--; } - if ((--tcmdPtr->refCount) <= 0) { + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TraceCommandProc: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { ckfree((char*)tcmdPtr); } return; @@ -4181,7 +4245,11 @@ tcmdPtr->refCount++; traceCode = TraceExecutionProc((ClientData)tcmdPtr, interp, curLevel, command, (Tcl_Command)cmdPtr, objc, objv); - if ((--tcmdPtr->refCount) <= 0) { + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TclCheckExecutionTraces: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { ckfree((char*)tcmdPtr); } } @@ -4388,8 +4456,12 @@ static void CommandObjTraceDeleted(ClientData clientData) { TraceCommandInfo* tcmdPtr = (TraceCommandInfo*)clientData; - if ((--tcmdPtr->refCount) <= 0) { - ckfree((char*)tcmdPtr); + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("CommandObjTraceDeleted: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { + ckfree((char*)tcmdPtr); } } @@ -4448,8 +4520,8 @@ * operations, but with either of the step operations. */ if (flags & TCL_TRACE_EXEC_DIRECT) { - call = flags & tcmdPtr->flags & (TCL_TRACE_ENTER_EXEC | - TCL_TRACE_LEAVE_EXEC); + call = flags & tcmdPtr->flags + & (TCL_TRACE_ENTER_EXEC | TCL_TRACE_LEAVE_EXEC); } else { call = 1; } @@ -4589,7 +4661,11 @@ } } if (call) { - if ((--tcmdPtr->refCount) <= 0) { + tcmdPtr->refCount--; + if (tcmdPtr->refCount < 0) { + Tcl_Panic("TraceExecutionProc: negative TraceCommandInfo refCount"); + } + if (tcmdPtr->refCount == 0) { ckfree((char*)tcmdPtr); } } Index: pTk/mTk/tclGeneric/tclEncoding.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclEncoding.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclEncoding.c 2003-12-19 11:54:57.000000000 +0000 @@ -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.16 2003/02/21 02:40:58 hobbs Exp $ + * RCS: @(#) $Id: tclEncoding.c,v 1.16.2.2 2003/11/06 21:47:33 hobbs Exp $ */ #include "Lang.h" @@ -2805,7 +2805,6 @@ return (char *) p - src; } - /* *------------------------------------------------------------------------- * @@ -2830,10 +2829,6 @@ CONST char *argv0; /* Name of executable from argv[0] to main() * in native multi-byte encoding. */ { - char *native; - Tcl_Obj *pathPtr; - Tcl_DString libPath, buffer; - if (encodingsInitialized == 0) { /* * Double check inside the mutex. There may be calls @@ -2842,6 +2837,10 @@ TclpInitLock(); if (encodingsInitialized == 0) { + char *native; + Tcl_Obj *pathPtr; + Tcl_DString libPath, buffer; + /* * Have to set this bit here to avoid deadlock with the * routines below us that call into TclInitSubsystems. @@ -2885,4 +2884,3 @@ } } - Index: pTk/mTk/tclGeneric/tclExecute.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclExecute.c 2003-07-27 17:39:28.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclExecute.c 2003-12-19 11:54:57.000000000 +0000 @@ -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: tclExecute.c,v 1.94.2.3 2003/06/10 19:58:35 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.94.2.5 2003/09/19 18:43:00 msofer Exp $ */ #include "tclInt.h" @@ -1399,8 +1399,8 @@ * Finally, let TclEvalObjvInternal handle the command. */ - Tcl_ResetResult(interp); DECACHE_STACK_INFO(); + Tcl_ResetResult(interp); result = TclEvalObjvInternal(interp, objc, objv, bytes, length, 0); CACHE_STACK_INFO(); @@ -1425,7 +1425,26 @@ objc, cmdNameBuf), Tcl_GetObjResult(interp)); objResultPtr = Tcl_GetObjResult(interp); - NEXT_INST_V(pcAdjustment, opnd, 1); + + /* + * Reset the interp's result to avoid possible duplications + * of large objects [Bug 781585]. We do not call + * Tcl_ResetResult() to avoid any side effects caused by + * the resetting of errorInfo and errorCode [Bug 804681], + * which are not needed here. We chose instead to manipulate + * the interp's object result directly. + * + * Note that the result object is now in objResultPtr, it + * keeps the refCount it had in its role of iPtr->objResultPtr. + */ + { + Tcl_Obj *newObjResultPtr; + TclNewObj(newObjResultPtr); + Tcl_IncrRefCount(newObjResultPtr); + iPtr->objResultPtr = newObjResultPtr; + } + + NEXT_INST_V(pcAdjustment, opnd, -1); } else { cleanup = opnd; goto processExceptionReturn; @@ -1451,7 +1470,26 @@ objResultPtr = Tcl_GetObjResult(interp); TRACE_WITH_OBJ(("\"%.30s\" => ", O2S(objPtr)), Tcl_GetObjResult(interp)); - NEXT_INST_F(1, 1, 1); + + /* + * Reset the interp's result to avoid possible duplications + * of large objects [Bug 781585]. We do not call + * Tcl_ResetResult() to avoid any side effects caused by + * the resetting of errorInfo and errorCode [Bug 804681], + * which are not needed here. We chose instead to manipulate + * the interp's object result directly. + * + * Note that the result object is now in objResultPtr, it + * keeps the refCount it had in its role of iPtr->objResultPtr. + */ + { + Tcl_Obj *newObjResultPtr; + TclNewObj(newObjResultPtr); + Tcl_IncrRefCount(newObjResultPtr); + iPtr->objResultPtr = newObjResultPtr; + } + + NEXT_INST_F(1, 1, -1); } else { cleanup = 1; goto processExceptionReturn; @@ -1459,8 +1497,8 @@ case INST_EXPR_STK: objPtr = stackPtr[stackTop]; - Tcl_ResetResult(interp); DECACHE_STACK_INFO(); + Tcl_ResetResult(interp); result = Tcl_ExprObj(interp, objPtr, &valuePtr); CACHE_STACK_INFO(); if (result != TCL_OK) { @@ -1889,7 +1927,9 @@ if (result != TCL_OK) { TRACE_WITH_OBJ(("%u (by %s) => ERROR converting increment amount to int: ", opnd, O2S(valuePtr)), Tcl_GetObjResult(interp)); + DECACHE_STACK_INFO(); Tcl_AddErrorInfo(interp, "\n (reading increment)"); + CACHE_STACK_INFO(); goto checkForCatch; } FORCE_LONG(valuePtr, i, w); @@ -1931,8 +1971,10 @@ varPtr = TclObjLookupVar(interp, objPtr, part2, TCL_LEAVE_ERR_MSG, "read", 0, 1, &arrayPtr); if (varPtr == NULL) { + DECACHE_STACK_INFO(); Tcl_AddObjErrorInfo(interp, "\n (reading value of variable to increment)", -1); + CACHE_STACK_INFO(); TRACE_APPEND(("ERROR: %.30s\n", O2S(Tcl_GetObjResult(interp)))); result = TCL_ERROR; goto checkForCatch; @@ -2146,7 +2188,9 @@ if (result != TCL_OK) { TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(valuePtr), (t1Ptr? t1Ptr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -2173,7 +2217,9 @@ if (result != TCL_OK) { TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", O2S(value2Ptr), (t2Ptr? t2Ptr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, value2Ptr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -2899,7 +2945,9 @@ O2S(valuePtr), O2S(value2Ptr), (valuePtr->typePtr? valuePtr->typePtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -2914,7 +2962,9 @@ O2S(valuePtr), O2S(value2Ptr), (value2Ptr->typePtr? value2Ptr->typePtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, value2Ptr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -3157,7 +3207,9 @@ s, O2S(valuePtr), (valuePtr->typePtr? valuePtr->typePtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } t1Ptr = valuePtr->typePtr; @@ -3189,7 +3241,9 @@ O2S(value2Ptr), s, (value2Ptr->typePtr? value2Ptr->typePtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, value2Ptr); + CACHE_STACK_INFO(); goto checkForCatch; } t2Ptr = value2Ptr->typePtr; @@ -3235,7 +3289,9 @@ if (IS_NAN(dResult) || IS_INF(dResult)) { TRACE(("%.20s %.20s => IEEE FLOATING PT ERROR\n", O2S(valuePtr), O2S(value2Ptr))); + DECACHE_STACK_INFO(); TclExprFloatError(interp, dResult); + CACHE_STACK_INFO(); result = TCL_ERROR; goto checkForCatch; } @@ -3375,7 +3431,9 @@ if (result != TCL_OK) { TRACE(("\"%.20s\" => ILLEGAL TYPE %s \n", s, (tPtr? tPtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } tPtr = valuePtr->typePtr; @@ -3448,7 +3506,9 @@ if (result != TCL_OK) { TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", s, (tPtr? tPtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -3538,7 +3598,9 @@ if (result != TCL_OK) { /* try to convert to double */ TRACE(("\"%.20s\" => ILLEGAL TYPE %s\n", O2S(valuePtr), (tPtr? tPtr->name : "null"))); + DECACHE_STACK_INFO(); IllegalExprOperandType(interp, pc, valuePtr); + CACHE_STACK_INFO(); goto checkForCatch; } } @@ -3703,7 +3765,9 @@ if (IS_NAN(d) || IS_INF(d)) { TRACE(("\"%.20s\" => IEEE FLOATING PT ERROR\n", O2S(objResultPtr))); + DECACHE_STACK_INFO(); TclExprFloatError(interp, d); + CACHE_STACK_INFO(); result = TCL_ERROR; goto checkForCatch; } @@ -3723,13 +3787,17 @@ } case INST_BREAK: + DECACHE_STACK_INFO(); Tcl_ResetResult(interp); + CACHE_STACK_INFO(); result = TCL_BREAK; cleanup = 0; goto processExceptionReturn; case INST_CONTINUE: + DECACHE_STACK_INFO(); Tcl_ResetResult(interp); + CACHE_STACK_INFO(); result = TCL_CONTINUE; cleanup = 0; goto processExceptionReturn; @@ -3931,7 +3999,18 @@ case INST_PUSH_RESULT: objResultPtr = Tcl_GetObjResult(interp); TRACE_WITH_OBJ(("=> "), Tcl_GetObjResult(interp)); - NEXT_INST_F(1, 0, 1); + + /* + * See the comments at INST_INVOKE_STK + */ + { + Tcl_Obj *newObjResultPtr; + TclNewObj(newObjResultPtr); + Tcl_IncrRefCount(newObjResultPtr); + iPtr->objResultPtr = newObjResultPtr; + } + + NEXT_INST_F(1, 0, -1); case INST_PUSH_RETURN_CODE: objResultPtr = Tcl_NewLongObj(result); @@ -3948,10 +4027,13 @@ */ divideByZero: + DECACHE_STACK_INFO(); Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "divide by zero", -1); Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", (char *) NULL); + CACHE_STACK_INFO(); + result = TCL_ERROR; goto checkForCatch; @@ -4041,7 +4123,9 @@ if ((result == TCL_ERROR) && !(iPtr->flags & ERR_ALREADY_LOGGED)) { bytes = GetSrcInfoForPc(pc, codePtr, &length); if (bytes != NULL) { + DECACHE_STACK_INFO(); Tcl_LogCommandInfo(interp, codePtr->source, bytes, length); + CACHE_STACK_INFO(); iPtr->flags |= ERR_ALREADY_LOGGED; } } Index: pTk/mTk/tclGeneric/tclFileName.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclFileName.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclFileName.c 2003-12-19 11:54:57.000000000 +0000 @@ -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: tclFileName.c,v 1.40.2.3 2003/07/17 00:16:04 hobbs Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.40.2.5 2003/10/06 09:49:19 vincentdarley Exp $ */ #include "tclInt.h" @@ -1380,17 +1380,19 @@ * with name after tilde substitution. */ { Tcl_Obj *path = Tcl_NewStringObj(name, -1); - CONST char *result; + Tcl_Obj *transPtr; Tcl_IncrRefCount(path); - result = Tcl_FSGetTranslatedStringPath(interp, path); - if (result == NULL) { + transPtr = Tcl_FSGetTranslatedPath(interp, path); + if (transPtr == NULL) { Tcl_DecrRefCount(path); return NULL; } + Tcl_DStringInit(bufferPtr); - Tcl_DStringAppend(bufferPtr, result, -1); + Tcl_DStringAppend(bufferPtr, Tcl_GetString(transPtr), -1); Tcl_DecrRefCount(path); + Tcl_DecrRefCount(transPtr); /* * Convert forward slashes to backslashes in Windows paths because Index: pTk/mTk/tclGeneric/tclIOUtil.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclIOUtil.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclIOUtil.c 2003-12-19 11:54:58.000000000 +0000 @@ -17,7 +17,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.7 2003/07/18 20:28:32 hobbs Exp $ + * RCS: @(#) $Id: tclIOUtil.c,v 1.77.2.12 2003/11/20 19:05:44 vincentdarley Exp $ */ #include "tclInt.h" @@ -102,6 +102,10 @@ static FilesystemRecord* FsGetFirstFilesystem(void); static void FsThrExitProc(ClientData cd); +static Tcl_Obj* FsListMounts _ANSI_ARGS_((Tcl_Obj *pathPtr, + CONST char *pattern)); +static Tcl_Obj* FsAddMountsToGlobResult _ANSI_ARGS_((Tcl_Obj *result, + Tcl_Obj *pathPtr, CONST char *pattern, Tcl_GlobTypeData *types)); #ifdef TCL_THREADS static void FsRecacheFilesystemList(void); @@ -586,11 +590,11 @@ /* Trash the current cache */ fsRecPtr = tsdPtr->filesystemList; while (fsRecPtr != NULL) { - tmpFsRecPtr = fsRecPtr; + tmpFsRecPtr = fsRecPtr->nextPtr; if (--fsRecPtr->fileRefCount <= 0) { ckfree((char *)fsRecPtr); } - fsRecPtr = tmpFsRecPtr->nextPtr; + fsRecPtr = tmpFsRecPtr; } tsdPtr->filesystemList = NULL; @@ -1008,7 +1012,12 @@ if (fsPtr != NULL) { Tcl_FSMatchInDirectoryProc *proc = fsPtr->matchInDirectoryProc; if (proc != NULL) { - return (*proc)(interp, result, pathPtr, pattern, types); + int ret = (*proc)(interp, result, pathPtr, pattern, types); + if (ret == TCL_OK && pattern != NULL) { + result = FsAddMountsToGlobResult(result, pathPtr, + pattern, types); + } + return ret; } } else { Tcl_Obj* cwd; @@ -1053,6 +1062,9 @@ if (ret == TCL_OK) { int resLength; + tmpResultPtr = FsAddMountsToGlobResult(tmpResultPtr, cwd, + pattern, types); + ret = Tcl_ListObjLength(interp, tmpResultPtr, &resLength); if (ret == TCL_OK) { int i; @@ -1079,6 +1091,92 @@ /* *---------------------------------------------------------------------- * + * FsAddMountsToGlobResult -- + * + * This routine is used by the globbing code to take the results + * of a directory listing and add any mounted paths to that + * listing. This is required so that simple things like + * 'glob *' merge mounts and listings correctly. + * + * Results: + * + * The passed in 'result' may be modified (in place, if + * necessary), and the correct list is returned. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static Tcl_Obj* +FsAddMountsToGlobResult(result, pathPtr, pattern, types) + Tcl_Obj *result; /* The current list of matching paths */ + Tcl_Obj *pathPtr; /* The directory in question */ + CONST char *pattern; + Tcl_GlobTypeData *types; +{ + int mLength, gLength, i; + int dir = (types == NULL || (types->type & TCL_GLOB_TYPE_DIR)); + Tcl_Obj *mounts = FsListMounts(pathPtr, pattern); + + if (mounts == NULL) return result; + + if (Tcl_ListObjLength(NULL, mounts, &mLength) != TCL_OK || mLength == 0) { + goto endOfMounts; + } + if (Tcl_ListObjLength(NULL, result, &gLength) != TCL_OK) { + goto endOfMounts; + } + for (i = 0; i < mLength; i++) { + Tcl_Obj *mElt; + int j; + int found = 0; + + Tcl_ListObjIndex(NULL, mounts, i, &mElt); + + for (j = 0; j < gLength; j++) { + Tcl_Obj *gElt; + Tcl_ListObjIndex(NULL, result, j, &gElt); + if (Tcl_FSEqualPaths(mElt, gElt)) { + found = 1; + if (!dir) { + /* We don't want to list this */ + if (Tcl_IsShared(result)) { + Tcl_Obj *newList; + newList = Tcl_DuplicateObj(result); + Tcl_DecrRefCount(result); + result = newList; + } + Tcl_ListObjReplace(NULL, result, j, 1, 0, NULL); + gLength--; + } + /* Break out of for loop */ + break; + } + } + if (!found && dir) { + if (Tcl_IsShared(result)) { + Tcl_Obj *newList; + newList = Tcl_DuplicateObj(result); + Tcl_DecrRefCount(result); + result = newList; + } + Tcl_ListObjAppendElement(NULL, result, mElt); + /* + * No need to increment gLength, since we + * don't want to compare mounts against + * mounts. + */ + } + } + endOfMounts: + Tcl_DecrRefCount(mounts); + return result; +} + +/* + *---------------------------------------------------------------------- + * * Tcl_FSMountsChanged -- * * Notify the filesystem that the available mounted filesystems @@ -1810,6 +1908,9 @@ retVal = (*statProcPtr->proc)(path, &oldStyleStatBuffer); statProcPtr = statProcPtr->nextPtr; } + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } } Tcl_MutexUnlock(&obsoleteFsHookMutex); @@ -1937,6 +2038,9 @@ retVal = (*accessProcPtr->proc)(path, mode); accessProcPtr = accessProcPtr->nextPtr; } + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } } Tcl_MutexUnlock(&obsoleteFsHookMutex); @@ -2014,6 +2118,9 @@ modeString, permissions); openFileChannelProcPtr = openFileChannelProcPtr->nextPtr; } + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } } Tcl_MutexUnlock(&obsoleteFsHookMutex); if (retVal != NULL) { @@ -3018,6 +3125,59 @@ /* *--------------------------------------------------------------------------- * + * FsListMounts -- + * + * List all mounts within the given directory, which match the + * given pattern. + * + * Results: + * The list of mounts, in a list object which has refCount 0, or + * NULL if we didn't even find any filesystems to try to list + * mounts. + * + * Side effects: + * None + * + *--------------------------------------------------------------------------- + */ + +static Tcl_Obj* +FsListMounts(pathPtr, pattern) + Tcl_Obj *pathPtr; /* Contains path to directory to search. */ + CONST char *pattern; /* Pattern to match against. */ +{ + FilesystemRecord *fsRecPtr; + Tcl_GlobTypeData mountsOnly = { TCL_GLOB_TYPE_MOUNT, 0, NULL, NULL }; + Tcl_Obj *resultPtr = NULL; + + /* + * Call each of the "listMounts" functions in succession. + * A non-NULL return value indicates the particular function has + * succeeded. We call all the functions registered, since we want + * a list from each filesystems. + */ + + fsRecPtr = FsGetFirstFilesystem(); + while (fsRecPtr != NULL) { + if (fsRecPtr != &nativeFilesystemRecord) { + Tcl_FSMatchInDirectoryProc *proc = + fsRecPtr->fsPtr->matchInDirectoryProc; + if (proc != NULL) { + if (resultPtr == NULL) { + resultPtr = Tcl_NewObj(); + } + (*proc)(NULL, resultPtr, pathPtr, pattern, &mountsOnly); + } + } + fsRecPtr = fsRecPtr->nextPtr; + } + + return resultPtr; +} + +/* + *--------------------------------------------------------------------------- + * * Tcl_FSSplitPath -- * * This function takes the given Tcl_Obj, which should be a valid @@ -4506,25 +4666,34 @@ } } - if (elements == 2) { - /* - * This is a special case where we can be much more - * efficient - */ - Tcl_Obj *base; + res = Tcl_NewObj(); + + for (i = 0; i < elements; i++) { + Tcl_Obj *elt; + int driveNameLength; + Tcl_PathType type; + char *strElt; + int strEltLen; + int length; + char *ptr; + Tcl_Obj *driveName = NULL; + + Tcl_ListObjIndex(NULL, listObj, i, &elt); - Tcl_ListObjIndex(NULL, listObj, 0, &base); /* - * There is only any value in doing this if the first object is - * of path type, otherwise we'll never actually get any - * efficiency benefit elsewhere in the code (from re-using the - * normalized representation of the base object). + * This is a special case where we can be much more + * efficient, where we are joining a single relative path + * onto an object that is already of path type. The + * 'TclNewFSPathObj' call below creates an object which + * can be normalized more efficiently. Currently we only + * use the special case when we have exactly two elements, + * but we could expand that in the future. */ - if (base->typePtr == &tclFsPathType - && !(base->bytes != NULL && base->bytes[0] == '\0')) { + if ((i == (elements-2)) && (i == 0) && (elt->typePtr == &tclFsPathType) + && !(elt->bytes != NULL && (elt->bytes[0] == '\0'))) { Tcl_Obj *tail; Tcl_PathType type; - Tcl_ListObjIndex(NULL, listObj, 1, &tail); + Tcl_ListObjIndex(NULL, listObj, i+1, &tail); type = GetPathType(tail, NULL, NULL, NULL); if (type == TCL_PATH_RELATIVE) { CONST char *str; @@ -4536,10 +4705,22 @@ * '/'. There's no need to return a special path * object, when the base itself is just fine! */ - return base; + Tcl_DecrRefCount(res); + return elt; } - if (str[0] != '.') { - return TclNewFSPathObj(base, str, len); + /* + * If it doesn't begin with '.' and is a mac or unix + * path or it a windows path without backslashes, then we + * can be very efficient here. (In fact even a windows + * path with backslashes can be joined efficiently, but + * the path object would not have forward slashes only, + * and this would therefore contradict our 'file join' + * documentation). + */ + if (str[0] != '.' && ((tclPlatform != TCL_PLATFORM_WINDOWS) + || (strchr(str, '\\') == NULL))) { + Tcl_DecrRefCount(res); + return TclNewFSPathObj(elt, str, len); } /* * Otherwise we don't have an easy join, and @@ -4547,24 +4728,27 @@ * things */ } else { - return tail; + if (tclPlatform == TCL_PLATFORM_UNIX) { + Tcl_DecrRefCount(res); + return tail; + } else { + CONST char *str; + int len; + str = Tcl_GetStringFromObj(tail,&len); + if (tclPlatform == TCL_PLATFORM_WINDOWS) { + if (strchr(str, '\\') == NULL) { + Tcl_DecrRefCount(res); + return tail; + } + } else if (tclPlatform == TCL_PLATFORM_MAC) { + if (strchr(str, '/') == NULL) { + Tcl_DecrRefCount(res); + return tail; + } + } + } } } - } - - res = Tcl_NewObj(); - - for (i = 0; i < elements; i++) { - Tcl_Obj *elt; - int driveNameLength; - Tcl_PathType type; - char *strElt; - int strEltLen; - int length; - char *ptr; - Tcl_Obj *driveName = NULL; - - Tcl_ListObjIndex(NULL, listObj, i, &elt); strElt = Tcl_GetStringFromObj(elt, &strEltLen); type = GetPathType(elt, &fsPtr, &driveNameLength, &driveName); if (type != TCL_PATH_RELATIVE) { @@ -5093,6 +5277,7 @@ retObj = srcFsPathPtr->translatedPathPtr; } + Tcl_IncrRefCount(retObj); return retObj; } @@ -5123,7 +5308,13 @@ Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(interp, pathPtr); if (transPtr != NULL) { - return Tcl_GetString(transPtr); + int len; + CONST char *result, *orig; + orig = Tcl_GetStringFromObj(transPtr, &len); + result = (char*) ckalloc((unsigned)(len+1)); + memcpy((VOID*) result, (VOID*) orig, (size_t) (len+1)); + Tcl_DecrRefCount(transPtr); + return result; } return NULL; @@ -5330,17 +5521,76 @@ * that call can actually result in a lot of other filesystem * action, which might loop back through here. */ - if ((path[0] != '\0') && - (Tcl_FSGetPathType(pathObjPtr) == TCL_PATH_RELATIVE)) { - useThisCwd = Tcl_FSGetCwd(interp); + if (path[0] != '\0') { + Tcl_PathType type = Tcl_FSGetPathType(pathObjPtr); + if (type == TCL_PATH_RELATIVE) { + useThisCwd = Tcl_FSGetCwd(interp); - if (useThisCwd == NULL) { - return NULL; - } + if (useThisCwd == NULL) return NULL; - absolutePath = Tcl_FSJoinToPath(useThisCwd, 1, &absolutePath); - Tcl_IncrRefCount(absolutePath); - /* We have a refCount on the cwd */ + absolutePath = Tcl_FSJoinToPath(useThisCwd, 1, &absolutePath); + Tcl_IncrRefCount(absolutePath); + /* We have a refCount on the cwd */ +#ifdef __WIN32__ + } else if (type == TCL_PATH_VOLUME_RELATIVE) { + /* + * Only Windows has volume-relative paths. These + * paths are rather rare, but is is nice if Tcl can + * handle them. It is much better if we can + * handle them here, rather than in the native fs code, + * because we really need to have a real absolute path + * just below. + * + * We do not let this block compile on non-Windows + * platforms because the test suite's manual forcing + * of tclPlatform can otherwise cause this code path + * to be executed, causing various errors because + * volume-relative paths really do not exist. + */ + useThisCwd = Tcl_FSGetCwd(interp); + if (useThisCwd == NULL) return NULL; + + if (path[0] == '/') { + /* + * Path of form /foo/bar which is a path in the + * root directory of the current volume. + */ + CONST char *drive = Tcl_GetString(useThisCwd); + absolutePath = Tcl_NewStringObj(drive,2); + Tcl_AppendToObj(absolutePath, path, -1); + Tcl_IncrRefCount(absolutePath); + /* We have a refCount on the cwd */ + } else { + /* + * Path of form C:foo/bar, but this only makes + * sense if the cwd is also on drive C. + */ + CONST char *drive = Tcl_GetString(useThisCwd); + char drive_c = path[0]; + if (drive_c >= 'a') { + drive_c -= ('a' - 'A'); + } + if (drive[0] == drive_c) { + absolutePath = Tcl_DuplicateObj(useThisCwd); + /* We have a refCount on the cwd */ + } else { + Tcl_DecrRefCount(useThisCwd); + useThisCwd = NULL; + /* + * The path is not in the current drive, but + * is volume-relative. The way Tcl 8.3 handles + * this is that it treats such a path as + * relative to the root of the drive. We + * therefore behave the same here. + */ + absolutePath = Tcl_NewStringObj(path, 2); + } + Tcl_IncrRefCount(absolutePath); + Tcl_AppendToObj(absolutePath, "/", 1); + Tcl_AppendToObj(absolutePath, path+2, -1); + } +#endif /* __WIN32__ */ + } } /* Already has refCount incremented */ fsPathPtr->normPathPtr = TclFSNormalizeAbsolutePath(interp, absolutePath, Index: pTk/mTk/tclGeneric/tclTest.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclTest.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclTest.c 2003-12-19 11:54:59.000000000 +0000 @@ -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: tclTest.c,v 1.62.2.1 2003/04/16 23:31:46 dgp Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.62.2.5 2003/11/17 18:12:08 dgp Exp $ */ #define TCL_TEST @@ -420,6 +420,9 @@ static int SimplePathInFilesystem _ANSI_ARGS_ (( Tcl_Obj *pathPtr, ClientData *clientDataPtr)); static Tcl_Obj* SimpleCopy _ANSI_ARGS_ ((Tcl_Obj *pathPtr)); +static int TestNumUtfCharsCmd _ANSI_ARGS_((ClientData clientData, + Tcl_Interp *interp, int objc, + Tcl_Obj *CONST objv[])); static Tcl_Filesystem testReportingFilesystem = { "reporting", @@ -654,6 +657,9 @@ Tcl_CreateObjCommand(interp, "testsetobjerrorcode", TestsetobjerrorcodeCmd, (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); + Tcl_CreateObjCommand(interp, "testnumutfchars", + TestNumUtfCharsCmd, (ClientData) 0, + (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand(interp, "testsetplatform", TestsetplatformCmd, (ClientData) 0, (Tcl_CmdDeleteProc *) NULL); Tcl_CreateCommand(interp, "teststaticpkg", TeststaticpkgCmd, @@ -3333,12 +3339,26 @@ char *varName; CONST char *value; int start, end; - char info[TCL_INTEGER_SPACE * 2]; + char resinfo[TCL_INTEGER_SPACE * 2]; varName = Tcl_GetString(objv[2]); TclRegExpRangeUniChar(regExpr, -1, &start, &end); - sprintf(info, "%d %d", start, end-1); - value = Tcl_SetVar(interp, varName, info, 0); + sprintf(resinfo, "%d %d", start, end-1); + value = Tcl_SetVar(interp, varName, resinfo, 0); + if (value == NULL) { + Tcl_AppendResult(interp, "couldn't set variable \"", + varName, "\"", (char *) NULL); + return TCL_ERROR; + } + } else if (cflags & TCL_REG_CANMATCH) { + char *varName; + CONST char *value; + char resinfo[TCL_INTEGER_SPACE * 2]; + + Tcl_RegExpGetInfo(regExpr, &info); + varName = Tcl_GetString(objv[2]); + sprintf(resinfo, "%d", info.extendStart); + value = Tcl_SetVar(interp, varName, resinfo, 0); if (value == NULL) { Tcl_AppendResult(interp, "couldn't set variable \"", varName, "\"", (char *) NULL); @@ -3457,6 +3477,10 @@ cflags &= ~REG_ADVANCED; break; } + case 'c': { + cflags |= TCL_REG_CANMATCH; + break; + } case 'e': { cflags &= ~REG_ADVANCED; cflags |= REG_EXTENDED; @@ -4008,7 +4032,7 @@ } for (j = i; j < argc; j++) { - if (Tcl_FSGetTranslatedPath(interp, argv[j]) == NULL) { + if (Tcl_FSGetNormalizedPath(interp, argv[j]) == NULL) { return TCL_ERROR; } } @@ -6085,16 +6109,21 @@ static int TestReportMatchInDirectory(interp, resultPtr, dirPtr, pattern, types) Tcl_Interp *interp; /* Interpreter to receive results. */ - Tcl_Obj *resultPtr; /* Directory separators to pass to TclDoGlob. */ + Tcl_Obj *resultPtr; /* Object to lappend results. */ Tcl_Obj *dirPtr; /* Contains path to directory to search. */ CONST char *pattern; /* Pattern to match against. */ Tcl_GlobTypeData *types; /* Object containing list of acceptable types. * May be NULL. */ { - TestReport("matchindirectory",dirPtr, NULL); - return Tcl_FSMatchInDirectory(interp, resultPtr, - TestReportGetNativePath(dirPtr), pattern, - types); + if (types != NULL && types->type & TCL_GLOB_TYPE_MOUNT) { + TestReport("matchmounts",dirPtr, NULL); + return TCL_OK; + } else { + TestReport("matchindirectory",dirPtr, NULL); + return Tcl_FSMatchInDirectory(interp, resultPtr, + TestReportGetNativePath(dirPtr), pattern, + types); + } } static int TestReportChdir(dirName) @@ -6424,3 +6453,23 @@ return retVal; } +/* + * Used to check correct string-length determining in Tcl_NumUtfChars + */ +static int +TestNumUtfCharsCmd(clientData, interp, objc, objv) + ClientData clientData; + Tcl_Interp *interp; + int objc; + Tcl_Obj *CONST objv[]; +{ + if (objc > 1) { + int len = -1; + if (objc > 2) { + (void) Tcl_GetStringFromObj(objv[1], &len); + } + len = Tcl_NumUtfChars(Tcl_GetString(objv[1]), len); + Tcl_SetObjResult(interp, Tcl_NewIntObj(len)); + } + return TCL_OK; +} Index: pTk/mTk/tclGeneric/tclUtf.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclUtf.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclUtf.c 2003-12-19 11:54:59.000000000 +0000 @@ -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: tclUtf.c,v 1.30.2.1 2003/03/06 23:24:17 dgp Exp $ + * RCS: @(#) $Id: tclUtf.c,v 1.30.2.2 2003/10/08 14:21:20 dkf Exp $ */ #include "tclInt.h" @@ -501,11 +501,8 @@ i = 0; if (len < 0) { - while (1) { + while (*str != '\0') { str += TclUtfToUniChar(str, chPtr); - if (ch == '\0') { - break; - } i++; } } else { Index: pTk/mTk/tclGeneric/tclUtil.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclUtil.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclUtil.c 2003-12-19 11:54:59.000000000 +0000 @@ -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: tclUtil.c,v 1.36.2.2 2003/07/16 21:25:07 hobbs Exp $ + * RCS: @(#) $Id: tclUtil.c,v 1.36.2.4 2003/08/27 21:31:53 dgp Exp $ */ #include "tkPort.h" @@ -2001,42 +2001,64 @@ CONST char *end; /* End of string (place where space will * be added, if appropriate). */ { - Tcl_UniChar ch; - /* * A space is needed unless either * (a) we're at the start of the string, or - * (b) the trailing characters of the string consist of one or more - * open curly braces preceded by a space or extending back to - * the beginning of the string. - * (c) the trailing characters of the string consist of a space - * preceded by a character other than backslash. */ - if (end == start) { return 0; } + + /* + * (b) we're at the start of a nested list-element, quoted with an + * open curly brace; we can be nested arbitrarily deep, so long + * as the first curly brace starts an element, so backtrack over + * open curly braces that are trailing characters of the string; and + */ + end = Tcl_UtfPrev(end, start); - if (*end != '{') { - Tcl_UtfToUniChar(end, &ch); - /* - * Direct char comparison on next line is safe as it is with - * a character in the ASCII subset, and so single-byte in UTF8. - */ - if (Tcl_UniCharIsSpace(ch) && ((end == start) || (end[-1] != '\\'))) { - return 0; - } - return 1; - } - do { + while (*end == '{') { if (end == start) { return 0; } end = Tcl_UtfPrev(end, start); - } while (*end == '{'); - Tcl_UtfToUniChar(end, &ch); - if (Tcl_UniCharIsSpace(ch)) { - return 0; + } + + /* + * (c) the trailing character of the string is already a list-element + * separator (according to TclFindElement); that is, one of these + * characters: + * \u0009 \t TAB + * \u000A \n NEWLINE + * \u000B \v VERTICAL TAB + * \u000C \f FORM FEED + * \u000D \r CARRIAGE RETURN + * \u0020 SPACE + * with the condition that the penultimate character is not a + * backslash. + */ + + if (*end > 0x20) { + /* + * Performance tweak. All ASCII spaces are <= 0x20. So get + * a quick answer for most characters before comparing against + * all spaces in the switch below. + * + * NOTE: Remove this if other Unicode spaces ever get accepted + * as list-element separators. + */ + return 1; + } + switch (*end) { + case ' ': + case '\t': + case '\n': + case '\r': + case '\v': + case '\f': + if ((end == start) || (end[-1] != '\\')) { + return 0; + } } return 1; } Index: pTk/mTk/tclGeneric/tclVar.c --- Tk-804.025_beta10/pTk/mTk/tclGeneric/tclVar.c 2003-07-27 17:39:28.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclGeneric/tclVar.c 2003-12-19 11:55:00.000000000 +0000 @@ -15,7 +15,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.69.2.3 2003/05/12 17:31:51 msofer Exp $ + * RCS: @(#) $Id: tclVar.c,v 1.69.2.4 2003/11/20 19:19:03 msofer Exp $ */ #include "tclInt.h" @@ -616,7 +616,7 @@ * namespace; never follow the second (global) resolution path * - Bug #631741 - do not use special namespace or interp resolvers */ -#define LOOKUP_FOR_UPVAR 0x400 +#define LOOKUP_FOR_UPVAR 0x40000 /* *---------------------------------------------------------------------- Index: pTk/mTk/tclUnix/Makefile.in --- Tk-804.025_beta10/pTk/mTk/tclUnix/Makefile.in 2003-07-24 20:37:30.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/Makefile.in 2003-12-19 11:55:00.000000000 +0000 @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.121.2.2 2003/07/15 01:15:51 das Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.121.2.4 2003/07/23 15:40:39 das Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ @@ -1294,6 +1294,7 @@ $(DISTDIR)/macosx mkdir $(DISTDIR)/macosx/Tcl.pbproj cp -p $(TOP_DIR)/macosx/Tcl.pbproj/*.pbx* $(DISTDIR)/macosx/Tcl.pbproj + cp -p $(TOP_DIR)/macosx/README $(DISTDIR)/macosx mkdir $(DISTDIR)/unix/dltest cp -p $(UNIX_DIR)/dltest/*.c $(UNIX_DIR)/dltest/Makefile.in \ $(UNIX_DIR)/dltest/README \ @@ -1343,12 +1344,16 @@ # TOOL_DIR. # -html-tcl: EXTRA_HTML_ARGS=--tcl -html-tk: EXTRA_HTML_ARGS=--tk +html: + $(BUILD_HTML) +html-tcl: + $(BUILD_HTML) --tcl +html-tk: + $(BUILD_HTML) --tk -html html-tcl html-tk: +BUILD_HTML = \ $(TCL_EXE) $(TOOL_DIR)/tcltk-man2html.tcl --htmldir=$(DISTDIR)/html \ - --srcdir=$(TOP_DIR)/.. $(EXTRA_HTML_ARGS) + --srcdir=$(TOP_DIR)/.. # # Target to create a Macintosh version of the distribution. This will Index: pTk/mTk/tclUnix/configure --- Tk-804.025_beta10/pTk/mTk/tclUnix/configure 2003-07-24 20:37:30.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/configure 2003-12-19 11:55:00.000000000 +0000 @@ -32,7 +32,7 @@ ac_help="$ac_help --enable-symbols build with debugging symbols [--disable-symbols]" ac_help="$ac_help - --enable-framework package shared libraries in frameworks [--disable-framework]" + --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -548,7 +548,7 @@ TCL_VERSION=8.4 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=4 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ @@ -5621,30 +5621,10 @@ LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' - fi - # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LDFLAGS="" @@ -5664,6 +5644,26 @@ SHLIB_LD_FLAGS="-b64" fi fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then @@ -5675,7 +5675,6 @@ fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -5693,6 +5692,21 @@ DL_LIBS="-lld" fi + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 + else + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to @@ -5706,7 +5720,7 @@ # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:5710: checking for gettimeofday in -lbsd" >&5 +echo "configure:5724: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -5714,7 +5728,7 @@ ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:5743: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -5753,20 +5767,6 @@ EOF fi - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 - else - do64bit_ok=yes - EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" Index: pTk/mTk/tclUnix/configure.in --- Tk-804.025_beta10/pTk/mTk/tclUnix/configure.in 2003-07-24 20:37:31.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/configure.in 2003-12-19 11:55:00.000000000 +0000 @@ -3,7 +3,7 @@ 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.106.2.2 2003/07/15 22:25:33 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.106.2.3 2003/10/02 23:07:34 dgp Exp $ AC_INIT(../generic/tcl.h) AC_PREREQ(2.13) @@ -11,7 +11,7 @@ TCL_VERSION=8.4 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=4 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VERSION=${TCL_VERSION} #------------------------------------------------------------------------ Index: pTk/mTk/tclUnix/tcl.m4 --- Tk-804.025_beta10/pTk/mTk/tclUnix/tcl.m4 2003-07-24 20:37:31.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tcl.m4 2003-12-19 11:55:00.000000000 +0000 @@ -44,10 +44,16 @@ if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` @@ -74,6 +80,8 @@ if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` @@ -140,10 +148,16 @@ if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` @@ -168,6 +182,8 @@ if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` @@ -354,7 +370,7 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, - [ --enable-framework package shared libraries in frameworks [--disable-framework]], + [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]], [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_framework+set}" = set; then @@ -816,30 +832,10 @@ LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' - fi - # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LDFLAGS="" @@ -859,6 +855,26 @@ SHLIB_LD_FLAGS="-b64" fi fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then @@ -870,7 +886,6 @@ fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -888,6 +903,21 @@ DL_LIBS="-lld" fi + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN("64bit mode not supported with GCC on $system") + else + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to @@ -905,20 +935,6 @@ MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ) fi - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN("64bit mode not supported with GCC on $system") - else - do64bit_ok=yes - EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" Index: pTk/mTk/tclUnix/tcl.spec --- Tk-804.025_beta10/pTk/mTk/tclUnix/tcl.spec 2003-07-24 20:37:31.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tcl.spec 2003-12-19 11:55:00.000000000 +0000 @@ -1,7 +1,7 @@ -# $Id: tcl.spec,v 1.16.2.2 2003/07/15 22:25:33 dgp Exp $ +# $Id: tcl.spec,v 1.16.2.3 2003/10/02 23:07:34 dgp Exp $ # This file is the basis for a binary Tcl RPM for Linux. -%define version 8.4.4 +%define version 8.4.5 %define directory /usr/local Summary: Tcl scripting language development environment Index: pTk/mTk/tclUnix/tclUnixChan.c --- Tk-804.025_beta10/pTk/mTk/tclUnix/tclUnixChan.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tclUnixChan.c 2003-12-19 11:55:00.000000000 +0000 @@ -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: tclUnixChan.c,v 1.42 2003/02/21 02:36:27 hobbs Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.42.2.1 2003/10/23 17:49:06 andreas_kupries Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -1889,8 +1889,8 @@ #ifdef DEPRECATED ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); #endif /* DEPRECATED */ - int socketType = 0; - socklen_t argLength = sizeof(int); + struct sockaddr sockaddr; + socklen_t sockaddrLen = sizeof(sockaddr); if (mode == 0) { return NULL; @@ -1911,6 +1911,8 @@ } #endif /* DEPRECATED */ + sockaddr.sa_family = AF_UNSPEC; + #ifdef SUPPORTS_TTY if (isatty(fd)) { fsPtr = TtyInit(fd, 0); @@ -1918,13 +1920,14 @@ sprintf(channelName, "serial%d", fd); } else #endif /* SUPPORTS_TTY */ - if (getsockopt(fd, SOL_SOCKET, SO_TYPE, (VOID *)&socketType, - &argLength) == 0 && socketType == SOCK_STREAM) { - return MakeTcpClientChannelMode((ClientData) fd, mode); + if (getsockname(fd, (struct sockaddr *)&sockaddr, &sockaddrLen) == 0 + && sockaddrLen > 0 + && sockaddr.sa_family == AF_INET) { + return MakeTcpClientChannelMode((ClientData) fd, mode); } else { - channelTypePtr = &fileChannelType; - fsPtr = (FileState *) ckalloc((unsigned) sizeof(FileState)); - sprintf(channelName, "file%d", fd); + channelTypePtr = &fileChannelType; + fsPtr = (FileState *) ckalloc((unsigned) sizeof(FileState)); + sprintf(channelName, "file%d", fd); } #ifdef DEPRECATED Index: pTk/mTk/tclUnix/tclUnixFCmd.c --- Tk-804.025_beta10/pTk/mTk/tclUnix/tclUnixFCmd.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tclUnixFCmd.c 2003-12-19 11:55:00.000000000 +0000 @@ -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: tclUnixFCmd.c,v 1.28.2.1 2003/07/16 15:28:30 dgp Exp $ + * RCS: @(#) $Id: tclUnixFCmd.c,v 1.28.2.2 2003/10/03 17:45:37 vincentdarley Exp $ * * Portions of this code were derived from NetBSD source code which has * the following copyright notice: @@ -624,13 +624,22 @@ Tcl_DString ds; Tcl_DString srcString, dstString; int ret; + Tcl_Obj *transPtr; + transPtr = Tcl_FSGetTranslatedPath(NULL,srcPathPtr); Tcl_UtfToExternalDString(NULL, - Tcl_FSGetTranslatedStringPath(NULL,srcPathPtr), + (transPtr != NULL ? Tcl_GetString(transPtr) : NULL), -1, &srcString); + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } + transPtr = Tcl_FSGetTranslatedPath(NULL,destPathPtr); Tcl_UtfToExternalDString(NULL, - Tcl_FSGetTranslatedStringPath(NULL,destPathPtr), + (transPtr != NULL ? Tcl_GetString(transPtr) : NULL), -1, &dstString); + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } ret = TraverseUnixTree(TraversalCopy, &srcString, &dstString, &ds); @@ -681,9 +690,14 @@ Tcl_DString ds; Tcl_DString pathString; int ret; + Tcl_Obj *transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); - Tcl_UtfToExternalDString(NULL, Tcl_FSGetTranslatedStringPath(NULL, pathPtr), + Tcl_UtfToExternalDString(NULL, + (transPtr != NULL ? Tcl_GetString(transPtr) : NULL), -1, &pathString); + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } ret = DoRemoveDirectory(&pathString, recursive, &ds); Tcl_DStringFree(&pathString); Index: pTk/mTk/tclUnix/tclUnixFile.c --- Tk-804.025_beta10/pTk/mTk/tclUnix/tclUnixFile.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tclUnixFile.c 2003-12-19 11:55:00.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixFile.c,v 1.32 2003/02/12 18:57:52 vincentdarley Exp $ + * RCS: @(#) $Id: tclUnixFile.c,v 1.32.2.2 2003/10/31 08:46:41 vincentdarley Exp $ */ #include "tclInt.h" @@ -221,6 +221,7 @@ if (NativeMatchType(native, types)) { Tcl_ListObjAppendElement(interp, resultPtr, pathPtr); } + Tcl_DecrRefCount(fileNamePtr); return TCL_OK; } else { DIR *d; @@ -255,6 +256,7 @@ dirLength++; } } + Tcl_DecrRefCount(fileNamePtr); /* * Now open the directory for reading and iterate over the contents. @@ -745,10 +747,14 @@ char link[MAXPATHLEN]; int length; Tcl_DString ds; + Tcl_Obj *transPtr; - if (Tcl_FSGetTranslatedPath(NULL, pathPtr) == NULL) { + transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); + if (transPtr == NULL) { return NULL; } + Tcl_DecrRefCount(transPtr); + length = readlink(Tcl_FSGetNativePath(pathPtr), link, sizeof(link)); if (length < 0) { return NULL; Index: pTk/mTk/tclUnix/tclUnixInit.c --- Tk-804.025_beta10/pTk/mTk/tclUnix/tclUnixInit.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tclUnixInit.c 2003-12-19 11:55:00.000000000 +0000 @@ -7,7 +7,7 @@ * Copyright (c) 1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclUnixInit.c,v 1.34.2.1 2003/05/13 08:41:26 das Exp $ + * RCS: @(#) $Id: tclUnixInit.c,v 1.34.2.2 2003/11/10 20:32:34 dgp Exp $ */ #if defined(HAVE_CFBUNDLE) @@ -342,7 +342,25 @@ */ if (path != NULL) { - Tcl_SplitPath(path, &pathc, &pathv); + int i, origc; + CONST char **origv; + + Tcl_SplitPath(path, &origc, &origv); + pathc = 0; + pathv = (CONST char **) ckalloc((unsigned int)(origc * sizeof(char *))); + for (i=0; i< origc; i++) { + if (origv[i][0] == '.') { + if (strcmp(origv[i], ".") == 0) { + /* do nothing */ + } else if (strcmp(origv[i], "..") == 0) { + pathc--; + } else { + pathv[pathc++] = origv[i]; + } + } else { + pathv[pathc++] = origv[i]; + } + } if (pathc > 2) { str = pathv[pathc - 2]; pathv[pathc - 2] = installLib; @@ -397,6 +415,7 @@ Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); Tcl_DStringFree(&ds); } + ckfree((char *) origv); ckfree((char *) pathv); } Index: pTk/mTk/tclUnix/tclUnixTest.c --- Tk-804.025_beta10/pTk/mTk/tclUnix/tclUnixTest.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclUnix/tclUnixTest.c 2003-12-19 11:55:00.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixTest.c,v 1.14 2003/02/15 22:30:29 kennykb Exp $ + * RCS: @(#) $Id: tclUnixTest.c,v 1.14.2.1 2003/10/13 01:00:38 hobbs Exp $ */ #include "tclInt.h" @@ -647,10 +647,7 @@ Tcl_AppendResult(interp, "sigaction: ", Tcl_PosixError(interp), NULL); return TCL_ERROR; } - if (alarm(sec) < 0) { - Tcl_AppendResult(interp, "alarm: ", Tcl_PosixError(interp), NULL); - return TCL_ERROR; - } + (void)alarm(sec); return TCL_OK; #else Tcl_AppendResult(interp, "warning: sigaction SA_RESTART not support on this platform", NULL); Index: pTk/mTk/tclWin/configure --- Tk-804.025_beta10/pTk/mTk/tclWin/configure 2003-07-24 20:37:34.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/configure 2003-12-19 11:55:01.000000000 +0000 @@ -534,19 +534,17 @@ TCL_VERSION=8.4 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=4 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.2 TCL_DDE_MAJOR_VERSION=1 TCL_DDE_MINOR_VERSION=2 -TCL_DDE_PATCH_LEVEL="" DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION TCL_REG_VERSION=1.1 TCL_REG_MAJOR_VERSION=1 TCL_REG_MINOR_VERSION=1 -TCL_REG_PATCH_LEVEL="" REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION #------------------------------------------------------------------------ @@ -575,7 +573,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:579: checking for $ac_word" >&5 +echo "configure:577: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -605,7 +603,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:609: checking for $ac_word" >&5 +echo "configure:607: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -656,7 +654,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:660: checking for $ac_word" >&5 +echo "configure:658: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -688,7 +686,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:692: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:690: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -699,12 +697,12 @@ cat > conftest.$ac_ext << EOF -#line 703 "configure" +#line 701 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:708: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:706: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -730,12 +728,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:734: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:732: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:739: checking whether we are using GNU C" >&5 +echo "configure:737: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -744,7 +742,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:748: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:746: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -763,7 +761,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:767: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:765: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -806,7 +804,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:810: checking for $ac_word" >&5 +echo "configure:808: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -835,7 +833,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:839: checking for $ac_word" >&5 +echo "configure:837: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -864,7 +862,7 @@ # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:868: checking for $ac_word" >&5 +echo "configure:866: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -907,7 +905,7 @@ #-------------------------------------------------------------------- echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:911: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:909: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -939,12 +937,12 @@ #-------------------------------------------------------------------- echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:943: checking for Cygwin environment" >&5 +echo "configure:941: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:957: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -980,7 +978,7 @@ echo $ac_n "checking for SEH support in compiler""... $ac_c" 1>&6 -echo "configure:984: checking for SEH support in compiler" >&5 +echo "configure:982: checking for SEH support in compiler" >&5 if eval "test \"`echo '$''{'tcl_cv_seh'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -988,7 +986,7 @@ tcl_cv_seh=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1009: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_seh=yes else @@ -1037,12 +1035,12 @@ # sufficient for getting the current code to work. # echo $ac_n "checking for EXCEPTION_DISPOSITION support in include files""... $ac_c" 1>&6 -echo "configure:1041: checking for EXCEPTION_DISPOSITION support in include files" >&5 +echo "configure:1039: checking for EXCEPTION_DISPOSITION support in include files" >&5 if eval "test \"`echo '$''{'tcl_cv_eh_disposition'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1057: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_eh_disposition=yes else @@ -1081,12 +1079,12 @@ # typedefs like LPFN_ACCEPT and friends. # echo $ac_n "checking for LPFN_ACCEPT support in winsock2.h""... $ac_c" 1>&6 -echo "configure:1085: checking for LPFN_ACCEPT support in winsock2.h" >&5 +echo "configure:1083: checking for LPFN_ACCEPT support in winsock2.h" >&5 if eval "test \"`echo '$''{'tcl_cv_lpfn_decls'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1102: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_lpfn_decls=yes else @@ -1126,12 +1124,12 @@ # used by mingw and cygwin is known to do this. echo $ac_n "checking for winnt.h that ignores VOID define""... $ac_c" 1>&6 -echo "configure:1130: checking for winnt.h that ignores VOID define" >&5 +echo "configure:1128: checking for winnt.h that ignores VOID define" >&5 if eval "test \"`echo '$''{'tcl_cv_winnt_ignore_void'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1149: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_winnt_ignore_void=yes else @@ -1179,12 +1177,12 @@ # call it from inline asm code. echo $ac_n "checking for alloca declaration in malloc.h""... $ac_c" 1>&6 -echo "configure:1183: checking for alloca declaration in malloc.h" >&5 +echo "configure:1181: checking for alloca declaration in malloc.h" >&5 if eval "test \"`echo '$''{'tcl_cv_malloc_decl_alloca'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < @@ -1198,7 +1196,7 @@ ; return 0; } EOF -if { (eval echo configure:1202: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_malloc_decl_alloca=yes else @@ -1225,12 +1223,12 @@ # warning when initializing a union member. echo $ac_n "checking for cast to union support""... $ac_c" 1>&6 -echo "configure:1229: checking for cast to union support" >&5 +echo "configure:1227: checking for cast to union support" >&5 if eval "test \"`echo '$''{'tcl_cv_cast_to_union'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1242: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_cast_to_union=yes else @@ -1267,13 +1265,13 @@ #-------------------------------------------------------------------- echo $ac_n "checking for object suffix""... $ac_c" 1>&6 -echo "configure:1271: checking for object suffix" >&5 +echo "configure:1269: checking for object suffix" >&5 if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else rm -f conftest* echo 'int i = 1;' > conftest.$ac_ext -if { (eval echo configure:1277: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then for ac_file in conftest.*; do case $ac_file in *.c) ;; @@ -1291,19 +1289,19 @@ ac_objext=$ac_cv_objext echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:1295: checking for mingw32 environment" >&5 +echo "configure:1293: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1305: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -1322,7 +1320,7 @@ echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:1326: checking for executable suffix" >&5 +echo "configure:1324: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1332,7 +1330,7 @@ rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:1336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:1334: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj) ;; @@ -1359,7 +1357,7 @@ echo $ac_n "checking for building with threads""... $ac_c" 1>&6 -echo "configure:1363: checking for building with threads" >&5 +echo "configure:1361: checking for building with threads" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" @@ -1396,7 +1394,7 @@ echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1400: checking how to build libraries" >&5 +echo "configure:1398: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1437,7 +1435,7 @@ # Step 0: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1441: checking if 64bit support is requested" >&5 +echo "configure:1439: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1454,7 +1452,7 @@ # Extract the first word of "cygpath", so it can be a program name with args. set dummy cygpath; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1458: checking for $ac_word" >&5 +echo "configure:1456: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CYGPATH'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1498,9 +1496,9 @@ echo "END" >> $conftest echo $ac_n "checking for Windows native path bug in windres""... $ac_c" 1>&6 -echo "configure:1502: checking for Windows native path bug in windres" >&5 +echo "configure:1500: checking for Windows native path bug in windres" >&5 cyg_conftest=`$CYGPATH $conftest` - if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1504: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then + if { ac_try='$RC -o conftest.res.o $cyg_conftest'; { (eval echo configure:1502: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } ; then echo "$ac_t""no" 1>&6 else echo "$ac_t""yes" 1>&6 @@ -1519,7 +1517,7 @@ # set various compiler flags depending on whether we are using gcc or cl echo $ac_n "checking compiler flags""... $ac_c" 1>&6 -echo "configure:1523: checking compiler flags" >&5 +echo "configure:1521: checking compiler flags" >&5 if test "${GCC}" = "yes" ; then if test "$do64bit" = "yes" ; then echo "configure: warning: "64bit mode not supported with GCC on Windows"" 1>&2 @@ -1739,7 +1737,7 @@ echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:1743: checking for build with symbols" >&5 +echo "configure:1741: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -1799,7 +1797,7 @@ #-------------------------------------------------------------------- echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:1803: checking how to run the C preprocessor" >&5 +echo "configure:1801: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -1814,13 +1812,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1822: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1831,13 +1829,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1841: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1839: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1848,13 +1846,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1858: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1856: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -1880,17 +1878,17 @@ ac_safe=`echo "errno.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for errno.h""... $ac_c" 1>&6 -echo "configure:1884: checking for errno.h" >&5 +echo "configure:1882: checking for errno.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1894: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1892: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2066,8 +2064,6 @@ - - trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -2285,11 +2281,9 @@ s%@TCL_DDE_VERSION@%$TCL_DDE_VERSION%g s%@TCL_DDE_MAJOR_VERSION@%$TCL_DDE_MAJOR_VERSION%g s%@TCL_DDE_MINOR_VERSION@%$TCL_DDE_MINOR_VERSION%g -s%@TCL_DDE_PATCH_LEVEL@%$TCL_DDE_PATCH_LEVEL%g s%@TCL_REG_VERSION@%$TCL_REG_VERSION%g s%@TCL_REG_MAJOR_VERSION@%$TCL_REG_MAJOR_VERSION%g s%@TCL_REG_MINOR_VERSION@%$TCL_REG_MINOR_VERSION%g -s%@TCL_REG_PATCH_LEVEL@%$TCL_REG_PATCH_LEVEL%g s%@RC_OUT@%$RC_OUT%g s%@RC_TYPE@%$RC_TYPE%g s%@RC_INCLUDE@%$RC_INCLUDE%g Index: pTk/mTk/tclWin/configure.in --- Tk-804.025_beta10/pTk/mTk/tclWin/configure.in 2003-07-24 20:37:34.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/configure.in 2003-12-19 11:55:01.000000000 +0000 @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tcl installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.68.2.3 2003/07/15 22:25:34 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.68.2.4 2003/10/02 23:07:35 dgp Exp $ AC_INIT(../generic/tcl.h) AC_PREREQ(2.13) @@ -11,19 +11,17 @@ TCL_VERSION=8.4 TCL_MAJOR_VERSION=8 TCL_MINOR_VERSION=4 -TCL_PATCH_LEVEL=".4" +TCL_PATCH_LEVEL=".5" VER=$TCL_MAJOR_VERSION$TCL_MINOR_VERSION TCL_DDE_VERSION=1.2 TCL_DDE_MAJOR_VERSION=1 TCL_DDE_MINOR_VERSION=2 -TCL_DDE_PATCH_LEVEL="" DDEVER=$TCL_DDE_MAJOR_VERSION$TCL_DDE_MINOR_VERSION TCL_REG_VERSION=1.1 TCL_REG_MAJOR_VERSION=1 TCL_REG_MINOR_VERSION=1 -TCL_REG_PATCH_LEVEL="" REGVER=$TCL_REG_MAJOR_VERSION$TCL_REG_MINOR_VERSION #------------------------------------------------------------------------ @@ -430,11 +428,9 @@ AC_SUBST(TCL_DDE_VERSION) AC_SUBST(TCL_DDE_MAJOR_VERSION) AC_SUBST(TCL_DDE_MINOR_VERSION) -AC_SUBST(TCL_DDE_PATCH_LEVEL) AC_SUBST(TCL_REG_VERSION) AC_SUBST(TCL_REG_MAJOR_VERSION) AC_SUBST(TCL_REG_MINOR_VERSION) -AC_SUBST(TCL_REG_PATCH_LEVEL) AC_SUBST(RC) AC_SUBST(RC_OUT) Index: pTk/mTk/tclWin/tclAppInit.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclAppInit.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclAppInit.c 2003-12-19 11:55:01.000000000 +0000 @@ -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: tclAppInit.c,v 1.11.2.1 2003/05/10 05:00:11 mistachkin Exp $ + * RCS: @(#) $Id: tclAppInit.c,v 1.11.2.2 2003/10/14 22:41:42 davygrvy Exp $ */ #include "tcl.h" @@ -426,6 +426,12 @@ sigHandler(DWORD fdwCtrlType) { HANDLE hStdIn; + + if (!exitToken) { + /* Async token must have been destroyed, punt gracefully. */ + return FALSE; + } + /* * If Tcl is currently executing some bytecode or in the eventloop, * this will cause Tcl to enter asyncExit at the next command Index: pTk/mTk/tclWin/tclWinDde.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinDde.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinDde.c 2003-12-19 11:55:01.000000000 +0000 @@ -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: tclWinDde.c,v 1.13 2003/03/03 17:12:48 dgp Exp $ + * RCS: @(#) $Id: tclWinDde.c,v 1.13.2.1 2003/11/10 22:42:07 dgp Exp $ */ #include "tclPort.h" @@ -69,7 +69,7 @@ * to us by DdeInitialize. */ static int ddeIsServer = 0; -#define TCL_DDE_VERSION "1.2.1" +#define TCL_DDE_VERSION "1.2.2" #define TCL_DDE_PACKAGE_NAME "dde" #define TCL_DDE_SERVICE_NAME "TclEval" Index: pTk/mTk/tclWin/tclWinFCmd.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinFCmd.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinFCmd.c 2003-12-19 11:55:01.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFCmd.c,v 1.35 2003/02/07 15:29:33 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFCmd.c,v 1.35.2.1 2003/10/03 17:45:37 vincentdarley Exp $ */ #include "tclWinInt.h" @@ -854,12 +854,13 @@ { Tcl_DString ds; Tcl_DString srcString, dstString; + Tcl_Obj *normSrcPtr, *normDestPtr; int ret; - Tcl_WinUtfToTChar(Tcl_FSGetTranslatedStringPath(NULL,srcPathPtr), - -1, &srcString); - Tcl_WinUtfToTChar(Tcl_FSGetTranslatedStringPath(NULL,destPathPtr), - -1, &dstString); + normSrcPtr = Tcl_FSGetNormalizedPath(NULL,srcPathPtr); + Tcl_WinUtfToTChar(Tcl_GetString(normSrcPtr), -1, &srcString); + normDestPtr = Tcl_FSGetNormalizedPath(NULL,destPathPtr); + Tcl_WinUtfToTChar(Tcl_GetString(normDestPtr), -1, &dstString); ret = TraverseWinTree(TraversalCopy, &srcString, &dstString, &ds); @@ -867,7 +868,13 @@ Tcl_DStringFree(&dstString); if (ret != TCL_OK) { - *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1); + if (!strcmp(Tcl_DStringValue(&ds), Tcl_GetString(normSrcPtr))) { + *errorPtr = srcPathPtr; + } else if (!strcmp(Tcl_DStringValue(&ds), Tcl_GetString(normDestPtr))) { + *errorPtr = destPathPtr; + } else { + *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1); + } Tcl_DStringFree(&ds); Tcl_IncrRefCount(*errorPtr); } @@ -910,6 +917,7 @@ Tcl_Obj **errorPtr; { Tcl_DString ds; + Tcl_Obj *normPtr = NULL; int ret; if (recursive) { /* @@ -918,8 +926,8 @@ * optimize this case easily. */ Tcl_DString native; - Tcl_WinUtfToTChar(Tcl_FSGetTranslatedStringPath(NULL, pathPtr), - -1, &native); + normPtr = Tcl_FSGetNormalizedPath(NULL, pathPtr); + Tcl_WinUtfToTChar(Tcl_GetString(normPtr), -1, &native); ret = DoRemoveDirectory(&native, recursive, &ds); Tcl_DStringFree(&native); } else { @@ -929,7 +937,12 @@ if (ret != TCL_OK) { int len = Tcl_DStringLength(&ds); if (len > 0) { - *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1); + if (normPtr != NULL + && !strcmp(Tcl_DStringValue(&ds), Tcl_GetString(normPtr))) { + *errorPtr = pathPtr; + } else { + *errorPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), -1); + } Tcl_IncrRefCount(*errorPtr); } Tcl_DStringFree(&ds); Index: pTk/mTk/tclWin/tclWinFile.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinFile.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinFile.c 2003-12-19 11:55:01.000000000 +0000 @@ -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: tclWinFile.c,v 1.44.2.5 2003/07/17 00:16:04 hobbs Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.44.2.6 2003/10/03 17:45:37 vincentdarley Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -818,6 +818,7 @@ } } dirName = Tcl_DStringValue(&dirString); + Tcl_DecrRefCount(fileNamePtr); /* * First verify that the specified path is actually a directory. @@ -1556,9 +1557,13 @@ transPtr = Tcl_FSGetTranslatedPath(NULL, pathPtr); if (transPtr == NULL || (strpbrk(Tcl_GetString(transPtr), "?*") != NULL)) { + if (transPtr != NULL) { + Tcl_DecrRefCount(transPtr); + } Tcl_SetErrno(ENOENT); return -1; } + Tcl_DecrRefCount(transPtr); #endif /* Index: pTk/mTk/tclWin/tclWinInit.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinInit.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinInit.c 2003-12-19 11:55:01.000000000 +0000 @@ -7,7 +7,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclWinInit.c,v 1.40 2003/02/27 03:47:09 chengyemao Exp $ + * RCS: @(#) $Id: tclWinInit.c,v 1.40.2.2 2003/11/10 20:32:34 dgp Exp $ */ #include "tclWinInt.h" @@ -58,6 +58,12 @@ #ifndef PROCESSOR_ARCHITECTURE_MSIL #define PROCESSOR_ARCHITECTURE_MSIL 8 #endif +#ifndef PROCESSOR_ARCHITECTURE_AMD64 +#define PROCESSOR_ARCHITECTURE_AMD64 9 +#endif +#ifndef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 +#define PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 10 +#endif #ifndef PROCESSOR_ARCHITECTURE_UNKNOWN #define PROCESSOR_ARCHITECTURE_UNKNOWN 0xFFFF #endif @@ -68,14 +74,15 @@ */ -#define NUMPLATFORMS 3 +#define NUMPLATFORMS 4 static char* platforms[NUMPLATFORMS] = { - "Win32s", "Windows 95", "Windows NT" + "Win32s", "Windows 95", "Windows NT", "Windows CE" }; -#define NUMPROCESSORS 9 +#define NUMPROCESSORS 11 static char* processors[NUMPROCESSORS] = { - "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil" + "intel", "mips", "alpha", "ppc", "shx", "arm", "ia64", "alpha64", "msil", + "amd64", "ia32_on_win64" }; /* Used to store the encoding used for binary files */ @@ -190,7 +197,7 @@ */ sprintf(installLib, "lib/tcl%s", TCL_VERSION); - sprintf(developLib, "../tcl%s/library", TCL_PATCH_LEVEL); + sprintf(developLib, "tcl%s/library", TCL_PATCH_LEVEL); /* * Look for the library relative to default encoding dir. @@ -245,7 +252,25 @@ */ if (path != NULL) { - Tcl_SplitPath(path, &pathc, &pathv); + int i, origc; + CONST char **origv; + + Tcl_SplitPath(path, &origc, &origv); + pathc = 0; + pathv = (CONST char **) ckalloc((unsigned int)(origc * sizeof(char *))); + for (i=0; i< origc; i++) { + if (origv[i][0] == '.') { + if (strcmp(origv[i], ".") == 0) { + /* do nothing */ + } else if (strcmp(origv[i], "..") == 0) { + pathc--; + } else { + pathv[pathc++] = origv[i]; + } + } else { + pathv[pathc++] = origv[i]; + } + } if (pathc > 2) { str = pathv[pathc - 2]; pathv[pathc - 2] = installLib; @@ -300,6 +325,7 @@ Tcl_ListObjAppendElement(NULL, pathPtr, objPtr); Tcl_DStringFree(&ds); } + ckfree((char *) origv); ckfree((char *) pathv); } Index: pTk/mTk/tclWin/tclWinPipe.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinPipe.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinPipe.c 2003-12-19 11:55:01.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.2 2003/07/16 19:34:14 mdejong Exp $ + * RCS: @(#) $Id: tclWinPipe.c,v 1.33.2.5 2003/10/21 22:57:18 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -1577,15 +1577,19 @@ arg = executable; } else { arg = argv[i]; - Tcl_DStringAppend(&ds, " ", 1); } + if(Tcl_DStringLength(&ds) > 0) Tcl_DStringAppend(&ds, " ", 1); + quote = 0; if (arg[0] == '\0') { quote = 1; } else { - for (start = arg; *start != '\0'; start++) { - if (isspace(*start)) { /* INTL: ISO space. */ + int count; + Tcl_UniChar ch; + for (start = arg; *start != '\0'; start += count) { + count = Tcl_UtfToUniChar(start, &ch); + if (Tcl_UniCharIsSpace(ch)) { /* INTL: ISO space. */ quote = 1; break; } @@ -2629,6 +2633,9 @@ DWORD id; /* Global process identifier */ { ProcInfo *procPtr = (ProcInfo *) ckalloc(sizeof(ProcInfo)); + + PipeInit(); + procPtr->hProcess = hProcess; procPtr->dwProcessId = id; Tcl_MutexLock(&pipeMutex); Index: pTk/mTk/tclWin/tclWinReg.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinReg.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinReg.c 2003-12-19 11:55:01.000000000 +0000 @@ -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: tclWinReg.c,v 1.21 2003/03/03 17:12:49 dgp Exp $ + * RCS: @(#) $Id: tclWinReg.c,v 1.21.2.3 2003/11/10 22:42:07 dgp Exp $ */ #include @@ -228,7 +228,7 @@ } Tcl_CreateObjCommand(interp, "registry", RegistryObjCmd, NULL, NULL); - return Tcl_PkgProvide(interp, "registry", "1.1.1"); + return Tcl_PkgProvide(interp, "registry", "1.1.3"); } /* @@ -982,7 +982,7 @@ keyName = (char *) Tcl_WinUtfToTChar(keyName, -1, &buf); if (flags & REG_CREATE) { DWORD create; - result = (*regWinProcs->regCreateKeyExProc)(rootKey, keyName, 0, "", + result = (*regWinProcs->regCreateKeyExProc)(rootKey, keyName, 0, NULL, REG_OPTION_NON_VOLATILE, mode, NULL, keyPtr, &create); } else { if (rootKey == HKEY_PERFORMANCE_DATA) { Index: pTk/mTk/tclWin/tclWinSock.c --- Tk-804.025_beta10/pTk/mTk/tclWin/tclWinSock.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/tclWin/tclWinSock.c 2003-12-19 11:55:01.000000000 +0000 @@ -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: tclWinSock.c,v 1.36 2003/01/16 19:02:00 mdejong Exp $ + * RCS: @(#) $Id: tclWinSock.c,v 1.36.2.1 2003/10/23 16:24:42 andreas_kupries Exp $ */ #include "tclWinInt.h" @@ -869,7 +869,7 @@ Tcl_Time blockTime = { 0, 0 }; Tcl_SetMaxBlockTime(&blockTime); - mask |= TCL_READABLE; + mask |= TCL_READABLE|TCL_WRITABLE; } else if (events & FD_READ) { fd_set readFds; struct timeval timeout; @@ -2258,7 +2258,7 @@ infoPtr->watchEvents |= (FD_READ|FD_CLOSE|FD_ACCEPT); } if (mask & TCL_WRITABLE) { - infoPtr->watchEvents |= (FD_WRITE|FD_CONNECT); + infoPtr->watchEvents |= (FD_WRITE|FD_CLOSE|FD_CONNECT); } /* Index: pTk/mTk/unix/Makefile.in --- Tk-804.025_beta10/pTk/mTk/unix/Makefile.in 2003-07-24 20:37:37.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/Makefile.in 2003-12-19 11:55:02.000000000 +0000 @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.87.2.1 2003/05/20 17:32:19 hobbs Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.87.2.2 2003/11/11 00:05:36 hobbs Exp $ # Current Tk version; used in various names. @@ -235,6 +235,7 @@ STLIB_LD = @STLIB_LD@ SHLIB_LD = @SHLIB_LD@ +SHLIB_LD_FLAGS = @SHLIB_LD_FLAGS@ SHLIB_LD_LIBS = @SHLIB_LD_LIBS@ TK_SHLIB_LD_EXTRAS = @TK_SHLIB_LD_EXTRAS@ Index: pTk/mTk/unix/configure --- Tk-804.025_beta10/pTk/mTk/unix/configure 2003-07-24 20:37:38.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/configure 2003-12-19 11:55:02.000000000 +0000 @@ -12,6 +12,8 @@ ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help + --with-tcl directory containing tcl configuration (tclConfig.sh)" +ac_help="$ac_help --enable-man-symlinks use symlinks for the manpages" ac_help="$ac_help --enable-man-compression=PROG @@ -19,8 +21,6 @@ ac_help="$ac_help --enable-threads build with threads" ac_help="$ac_help - --with-tcl directory containing tcl configuration (tclConfig.sh)" -ac_help="$ac_help --enable-shared build and link with shared libraries [--enable-shared]" ac_help="$ac_help --enable-64bit enable 64bit support (where applicable)" @@ -547,16 +547,173 @@ TK_VERSION=8.4 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=4 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VERSION=${TK_VERSION} LOCALES="cs de el en en_gb es fr it nl ru" +#-------------------------------------------------------------------- +# Find and load the tclConfig.sh file +#-------------------------------------------------------------------- + + + # + # Ok, lets find the tcl configuration + # First, look for one uninstalled. + # the alternative search directory is invoked by --with-tcl + # + + if test x"${no_tcl}" = x ; then + # we reset no_tcl in case something fails here + no_tcl=true + # Check whether --with-tcl or --without-tcl was given. +if test "${with_tcl+set}" = set; then + withval="$with_tcl" + with_tclconfig=${withval} +fi + + echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 +echo "configure:576: checking for Tcl configuration" >&5 + if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + + # First check to see if --with-tcl was specified. + if test x"${with_tclconfig}" != x ; then + if test -f "${with_tclconfig}/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` + else + { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; } + fi + fi + + # then check for a private Tcl installation + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ../tcl \ + `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../tcl \ + `ls -dr ../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ + ../../../tcl \ + `ls -dr ../../../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ../../../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + + # check in a few common install locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in `ls -d ${libdir} 2>/dev/null` \ + `ls -d /usr/local/lib 2>/dev/null` \ + `ls -d /usr/contrib/lib 2>/dev/null` \ + `ls -d /usr/lib 2>/dev/null` \ + ; do + if test -f "$i/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i; pwd)` + break + fi + done + fi + + # check in a few other private locations + if test x"${ac_cv_c_tclconfig}" = x ; then + for i in \ + ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9] 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do + if test -f "$i/unix/tclConfig.sh" ; then + ac_cv_c_tclconfig=`(cd $i/unix; pwd)` + break + fi + done + fi + +fi + + + if test x"${ac_cv_c_tclconfig}" = x ; then + TCL_BIN_DIR="# no Tcl configs found" + echo "configure: warning: Can't find Tcl configuration definitions" 1>&2 + exit 0 + else + no_tcl= + TCL_BIN_DIR=${ac_cv_c_tclconfig} + echo "$ac_t""found $TCL_BIN_DIR/tclConfig.sh" 1>&6 + fi + fi + + + echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 +echo "configure:657: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 + + if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then + echo "$ac_t""loading" 1>&6 + . $TCL_BIN_DIR/tclConfig.sh + else + echo "$ac_t""file not found" 1>&6 + fi + + # + # If the TCL_BIN_DIR is the build directory (not the install directory), + # then set the common variable name to the value of the build variables. + # For example, the variable TCL_LIB_SPEC will be set to the value + # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC + # instead of TCL_BUILD_LIB_SPEC since it will work with both an + # installed and uninstalled version of Tcl. + # + + if test -f $TCL_BIN_DIR/Makefile ; then + TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} + TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} + TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} + fi + + # + # eval is required to do the TCL_DBGX substitution + # + + eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" + eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" + eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" + + eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" + eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" + eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" + + + + + + + + + + + + + + +if test "${TCL_VERSION}" != "${TK_VERSION}"; then + { echo "configure: error: ${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}." 1>&2; exit 1; } +fi + #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then - prefix=/usr/local + prefix="$TCL_PREFIX" fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix @@ -573,7 +730,7 @@ echo $ac_n "checking whether to use symlinks for manpages""... $ac_c" 1>&6 -echo "configure:577: checking whether to use symlinks for manpages" >&5 +echo "configure:734: checking whether to use symlinks for manpages" >&5 # Check whether --enable-man-symlinks or --disable-man-symlinks was given. if test "${enable_man_symlinks+set}" = set; then enableval="$enable_man_symlinks" @@ -585,7 +742,7 @@ echo "$ac_t""$enableval" 1>&6 echo $ac_n "checking compression for manpages""... $ac_c" 1>&6 -echo "configure:589: checking compression for manpages" >&5 +echo "configure:746: checking compression for manpages" >&5 # Check whether --enable-man-compression or --disable-man-compression was given. if test "${enable_man_compression+set}" = set; then enableval="$enable_man_compression" @@ -613,7 +770,7 @@ # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:617: checking for $ac_word" >&5 +echo "configure:774: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -643,7 +800,7 @@ # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:647: checking for $ac_word" >&5 +echo "configure:804: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -694,7 +851,7 @@ # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:698: checking for $ac_word" >&5 +echo "configure:855: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -726,7 +883,7 @@ fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:730: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:887: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -737,12 +894,12 @@ cat > conftest.$ac_ext << EOF -#line 741 "configure" +#line 898 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -768,12 +925,12 @@ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:772: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:929: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:777: checking whether we are using GNU C" >&5 +echo "configure:934: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -782,7 +939,7 @@ yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:786: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:943: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -801,7 +958,7 @@ ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:805: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:962: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -838,7 +995,7 @@ #------------------------------------------------------------------------ echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:842: checking how to run the C preprocessor" >&5 +echo "configure:999: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -853,13 +1010,13 @@ # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:863: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1020: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -870,13 +1027,13 @@ rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:880: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1037: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -887,13 +1044,13 @@ rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:897: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1054: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -921,17 +1078,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:925: checking for $ac_hdr" >&5 +echo "configure:1082: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:935: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1092: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -964,7 +1121,7 @@ echo $ac_n "checking for building with threads""... $ac_c" 1>&6 -echo "configure:968: checking for building with threads" >&5 +echo "configure:1125: checking for building with threads" >&5 # Check whether --enable-threads or --disable-threads was given. if test "${enable_threads+set}" = set; then enableval="$enable_threads" @@ -996,7 +1153,7 @@ EOF echo $ac_n "checking for pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:1000: checking for pthread_mutex_init in -lpthread" >&5 +echo "configure:1157: checking for pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1004,7 +1161,7 @@ ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1176: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1043,7 +1200,7 @@ # pthread.h, but that will work with libpthread really doesn't # exist, like AIX 4.2. [Bug: 4359] echo $ac_n "checking for __pthread_mutex_init in -lpthread""... $ac_c" 1>&6 -echo "configure:1047: checking for __pthread_mutex_init in -lpthread" >&5 +echo "configure:1204: checking for __pthread_mutex_init in -lpthread" >&5 ac_lib_var=`echo pthread'_'__pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1051,7 +1208,7 @@ ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1223: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1090,7 +1247,7 @@ THREADS_LIBS=" -lpthread" else echo $ac_n "checking for pthread_mutex_init in -lpthreads""... $ac_c" 1>&6 -echo "configure:1094: checking for pthread_mutex_init in -lpthreads" >&5 +echo "configure:1251: checking for pthread_mutex_init in -lpthreads" >&5 ac_lib_var=`echo pthreads'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1098,7 +1255,7 @@ ac_save_LIBS="$LIBS" LIBS="-lpthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1135,7 +1292,7 @@ THREADS_LIBS=" -lpthreads" else echo $ac_n "checking for pthread_mutex_init in -lc""... $ac_c" 1>&6 -echo "configure:1139: checking for pthread_mutex_init in -lc" >&5 +echo "configure:1296: checking for pthread_mutex_init in -lc" >&5 ac_lib_var=`echo c'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1143,7 +1300,7 @@ ac_save_LIBS="$LIBS" LIBS="-lc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1315: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1177,7 +1334,7 @@ if test "$tcl_ok" = "no"; then echo $ac_n "checking for pthread_mutex_init in -lc_r""... $ac_c" 1>&6 -echo "configure:1181: checking for pthread_mutex_init in -lc_r" >&5 +echo "configure:1338: checking for pthread_mutex_init in -lc_r" >&5 ac_lib_var=`echo c_r'_'pthread_mutex_init | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1185,7 +1342,7 @@ ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1357: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1236,12 +1393,12 @@ for ac_func in pthread_attr_setstacksize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1240: checking for $ac_func" >&5 +echo "configure:1397: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1425: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1292,12 +1449,12 @@ for ac_func in readdir_r do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1296: checking for $ac_func" >&5 +echo "configure:1453: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1481: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1359,18 +1516,18 @@ if test -z "$no_pipe"; then if test -n "$GCC"; then echo $ac_n "checking if the compiler understands -pipe""... $ac_c" 1>&6 -echo "configure:1363: checking if the compiler understands -pipe" >&5 +echo "configure:1520: checking if the compiler understands -pipe" >&5 OLDCC="$CC" CC="$CC -pipe" cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1531: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -1390,21 +1547,21 @@ echo $ac_n "checking for required early compiler flags""... $ac_c" 1>&6 -echo "configure:1394: checking for required early compiler flags" >&5 +echo "configure:1551: checking for required early compiler flags" >&5 tcl_flags="" if eval "test \"`echo '$''{'tcl_cv_flag__isoc99_source'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:1408: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1565: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=no else @@ -1412,7 +1569,7 @@ cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -1420,7 +1577,7 @@ char *p = (char *)strtoll; char *q = (char *)strtoull; ; return 0; } EOF -if { (eval echo configure:1424: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1581: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__isoc99_source=yes else @@ -1446,14 +1603,14 @@ echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:1457: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1614: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=no else @@ -1461,7 +1618,7 @@ cat conftest.$ac_ext >&5 rm -rf conftest* cat > conftest.$ac_ext < @@ -1469,7 +1626,7 @@ struct stat64 buf; int i = stat64("/", &buf); ; return 0; } EOF -if { (eval echo configure:1473: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1630: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_flag__largefile64_source=yes else @@ -1498,7 +1655,7 @@ echo $ac_n "checking for 64-bit integer type""... $ac_c" 1>&6 -echo "configure:1502: checking for 64-bit integer type" >&5 +echo "configure:1659: checking for 64-bit integer type" >&5 if eval "test \"`echo '$''{'tcl_cv_type_64bit'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1506,14 +1663,14 @@ tcl_cv_type_64bit=none # See if the compiler knows natively about __int64 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1674: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_type_64bit=__int64 else @@ -1530,13 +1687,13 @@ : else cat > conftest.$ac_ext < int main() {exit(!(sizeof(${tcl_type_64bit}) > sizeof(long)));} EOF -if { (eval echo configure:1540: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1697: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_type_64bit=${tcl_type_64bit} else @@ -1565,13 +1722,13 @@ # Now check for auxiliary declarations echo $ac_n "checking for struct dirent64""... $ac_c" 1>&6 -echo "configure:1569: checking for struct dirent64" >&5 +echo "configure:1726: checking for struct dirent64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_dirent64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -1579,7 +1736,7 @@ struct dirent64 p; ; return 0; } EOF -if { (eval echo configure:1583: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1740: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_dirent64=yes else @@ -1600,13 +1757,13 @@ echo "$ac_t""${tcl_cv_struct_dirent64}" 1>&6 echo $ac_n "checking for struct stat64""... $ac_c" 1>&6 -echo "configure:1604: checking for struct stat64" >&5 +echo "configure:1761: checking for struct stat64" >&5 if eval "test \"`echo '$''{'tcl_cv_struct_stat64'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -1614,7 +1771,7 @@ ; return 0; } EOF -if { (eval echo configure:1618: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1775: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_struct_stat64=yes else @@ -1635,13 +1792,13 @@ echo "$ac_t""${tcl_cv_struct_stat64}" 1>&6 echo $ac_n "checking for off64_t""... $ac_c" 1>&6 -echo "configure:1639: checking for off64_t" >&5 +echo "configure:1796: checking for off64_t" >&5 if eval "test \"`echo '$''{'tcl_cv_type_off64_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < int main() { @@ -1649,7 +1806,7 @@ ; return 0; } EOF -if { (eval echo configure:1653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1810: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_cv_type_off64_t=yes else @@ -1671,155 +1828,12 @@ fi #-------------------------------------------------------------------- -# Find and load the tclConfig.sh file -#-------------------------------------------------------------------- - - - # - # Ok, lets find the tcl configuration - # First, look for one uninstalled. - # the alternative search directory is invoked by --with-tcl - # - - if test x"${no_tcl}" = x ; then - # we reset no_tcl in case something fails here - no_tcl=true - # Check whether --with-tcl or --without-tcl was given. -if test "${with_tcl+set}" = set; then - withval="$with_tcl" - with_tclconfig=${withval} -fi - - echo $ac_n "checking for Tcl configuration""... $ac_c" 1>&6 -echo "configure:1695: checking for Tcl configuration" >&5 - if eval "test \"`echo '$''{'ac_cv_c_tclconfig'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - - - # First check to see if --with-tcl was specified. - if test x"${with_tclconfig}" != x ; then - if test -f "${with_tclconfig}/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` - else - { echo "configure: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" 1>&2; exit 1; } - fi - fi - - # then check for a private Tcl installation - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ../tcl \ - `ls -dr ../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../tcl \ - `ls -dr ../../tcl[8-9].[0-9]* 2>/dev/null` \ - ../../../tcl \ - `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)` - break - fi - done - fi - - # check in a few common install locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in `ls -d ${libdir} 2>/dev/null` \ - `ls -d /usr/local/lib 2>/dev/null` \ - `ls -d /usr/contrib/lib 2>/dev/null` \ - `ls -d /usr/lib 2>/dev/null` \ - ; do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i; pwd)` - break - fi - done - fi - - # check in a few other private locations - if test x"${ac_cv_c_tclconfig}" = x ; then - for i in \ - ${srcdir}/../tcl \ - `ls -dr ${srcdir}/../tcl[8-9].[0-9]* 2>/dev/null` ; do - if test -f "$i/unix/tclConfig.sh" ; then - ac_cv_c_tclconfig=`(cd $i/unix; pwd)` - break - fi - done - fi - -fi - - - if test x"${ac_cv_c_tclconfig}" = x ; then - TCL_BIN_DIR="# no Tcl configs found" - echo "configure: warning: Can't find Tcl configuration definitions" 1>&2 - exit 0 - else - no_tcl= - TCL_BIN_DIR=${ac_cv_c_tclconfig} - echo "$ac_t""found $TCL_BIN_DIR/tclConfig.sh" 1>&6 - fi - fi - - - echo $ac_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh""... $ac_c" 1>&6 -echo "configure:1768: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 - - if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - echo "$ac_t""loading" 1>&6 - . $TCL_BIN_DIR/tclConfig.sh - else - echo "$ac_t""file not found" 1>&6 - fi - - # - # If the TCL_BIN_DIR is the build directory (not the install directory), - # then set the common variable name to the value of the build variables. - # For example, the variable TCL_LIB_SPEC will be set to the value - # of TCL_BUILD_LIB_SPEC. An extension should make use of TCL_LIB_SPEC - # instead of TCL_BUILD_LIB_SPEC since it will work with both an - # installed and uninstalled version of Tcl. - # - - if test -f $TCL_BIN_DIR/Makefile ; then - TCL_LIB_SPEC=${TCL_BUILD_LIB_SPEC} - TCL_STUB_LIB_SPEC=${TCL_BUILD_STUB_LIB_SPEC} - TCL_STUB_LIB_PATH=${TCL_BUILD_STUB_LIB_PATH} - fi - - # - # eval is required to do the TCL_DBGX substitution - # - - eval "TCL_LIB_FILE=\"${TCL_LIB_FILE}\"" - eval "TCL_LIB_FLAG=\"${TCL_LIB_FLAG}\"" - eval "TCL_LIB_SPEC=\"${TCL_LIB_SPEC}\"" - - eval "TCL_STUB_LIB_FILE=\"${TCL_STUB_LIB_FILE}\"" - eval "TCL_STUB_LIB_FLAG=\"${TCL_STUB_LIB_FLAG}\"" - eval "TCL_STUB_LIB_SPEC=\"${TCL_STUB_LIB_SPEC}\"" - - - - - - - - - - - - - - -#-------------------------------------------------------------------- # Recompute the necessary flags to run the compiler #-------------------------------------------------------------------- echo $ac_n "checking how to build libraries""... $ac_c" 1>&6 -echo "configure:1823: checking how to build libraries" >&5 +echo "configure:1837: checking how to build libraries" >&5 # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then enableval="$enable_shared" @@ -1852,7 +1866,7 @@ # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:1856: checking for $ac_word" >&5 +echo "configure:1870: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1884,7 +1898,7 @@ # Step 0.a: Enable 64 bit support? echo $ac_n "checking if 64bit support is requested""... $ac_c" 1>&6 -echo "configure:1888: checking if 64bit support is requested" >&5 +echo "configure:1902: checking if 64bit support is requested" >&5 # Check whether --enable-64bit or --disable-64bit was given. if test "${enable_64bit+set}" = set; then enableval="$enable_64bit" @@ -1904,7 +1918,7 @@ # Step 0.b: Enable Solaris 64 bit VIS support? echo $ac_n "checking if 64bit Sparc VIS support is requested""... $ac_c" 1>&6 -echo "configure:1908: checking if 64bit Sparc VIS support is requested" >&5 +echo "configure:1922: checking if 64bit Sparc VIS support is requested" >&5 # Check whether --enable-64bit-vis or --disable-64bit-vis was given. if test "${enable_64bit_vis+set}" = set; then enableval="$enable_64bit_vis" @@ -1928,7 +1942,7 @@ # there are a few systems, like Next, where this doesn't work. echo $ac_n "checking system version (for dynamic loading)""... $ac_c" 1>&6 -echo "configure:1932: checking system version (for dynamic loading)" >&5 +echo "configure:1946: checking system version (for dynamic loading)" >&5 if test -f /usr/lib/NextStep/software_version; then system=NEXTSTEP-`awk '/3/,/3/' /usr/lib/NextStep/software_version` else @@ -1954,7 +1968,7 @@ # Linux can use either -ldl or -ldld for dynamic loading. echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:1958: checking for dlopen in -ldl" >&5 +echo "configure:1972: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1962,7 +1976,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2021,7 +2035,7 @@ # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2025: checking for $ac_word" >&5 +echo "configure:2039: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2065,30 +2079,10 @@ LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' - fi - # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LDFLAGS="" @@ -2108,6 +2102,26 @@ SHLIB_LD_FLAGS="-b64" fi fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then @@ -2119,7 +2133,6 @@ fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -2137,6 +2150,21 @@ DL_LIBS="-lld" fi + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 + else + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to @@ -2150,7 +2178,7 @@ # known GMT value. echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:2154: checking for gettimeofday in -lbsd" >&5 +echo "configure:2182: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2158,7 +2186,7 @@ ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2201: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2197,20 +2225,6 @@ EOF fi - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - echo "configure: warning: "64bit mode not supported with GCC on $system"" 1>&2 - else - do64bit_ok=yes - EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" @@ -2259,7 +2273,7 @@ SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2263: checking for shl_load in -ldld" >&5 +echo "configure:2277: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2267,7 +2281,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2296: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2346,7 +2360,7 @@ HP-UX-*.08.*|HP-UX-*.09.*|HP-UX-*.10.*) SHLIB_SUFFIX=".sl" echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 -echo "configure:2350: checking for shl_load in -ldld" >&5 +echo "configure:2364: checking for shl_load in -ldld" >&5 ac_lib_var=`echo dld'_'shl_load | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2354,7 +2368,7 @@ ac_save_LIBS="$LIBS" LIBS="-ldld $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2492,17 +2506,17 @@ else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2496: checking for dld.h" >&5 +echo "configure:2510: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2506: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2520: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2567,17 +2581,17 @@ else ac_safe=`echo "dld.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dld.h""... $ac_c" 1>&6 -echo "configure:2571: checking for dld.h" >&5 +echo "configure:2585: checking for dld.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2581: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2595: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2635,17 +2649,17 @@ # Not available on all versions: check for include file. ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6 -echo "configure:2639: checking for dlfcn.h" >&5 +echo "configure:2653: checking for dlfcn.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2649: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2673,9 +2687,9 @@ CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' echo $ac_n "checking for ELF""... $ac_c" 1>&6 -echo "configure:2677: checking for ELF" >&5 +echo "configure:2691: checking for ELF" >&5 cat > conftest.$ac_ext <&6 -echo "configure:3037: checking for ld accepts -Bexport flag" >&5 +echo "configure:3053: checking for ld accepts -Bexport flag" >&5 LDFLAGS="${LDFLAGS} -Wl,-Bexport" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3063: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* found=yes else @@ -3090,9 +3106,9 @@ if test "x$DL_OBJS" = "xtclLoadAout.o" ; then echo $ac_n "checking sys/exec.h""... $ac_c" 1>&6 -echo "configure:3094: checking sys/exec.h" >&5 +echo "configure:3110: checking sys/exec.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3110,7 +3126,7 @@ ; return 0; } EOF -if { (eval echo configure:3114: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3130: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3128,9 +3144,9 @@ else echo $ac_n "checking a.out.h""... $ac_c" 1>&6 -echo "configure:3132: checking a.out.h" >&5 +echo "configure:3148: checking a.out.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3148,7 +3164,7 @@ ; return 0; } EOF -if { (eval echo configure:3152: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3168: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3166,9 +3182,9 @@ else echo $ac_n "checking sys/exec_aout.h""... $ac_c" 1>&6 -echo "configure:3170: checking sys/exec_aout.h" >&5 +echo "configure:3186: checking sys/exec_aout.h" >&5 cat > conftest.$ac_ext < int main() { @@ -3186,7 +3202,7 @@ ; return 0; } EOF -if { (eval echo configure:3190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3206: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tcl_ok=usable else @@ -3338,7 +3354,7 @@ echo $ac_n "checking for build with symbols""... $ac_c" 1>&6 -echo "configure:3342: checking for build with symbols" >&5 +echo "configure:3358: checking for build with symbols" >&5 # Check whether --enable-symbols or --disable-symbols was given. if test "${enable_symbols+set}" = set; then enableval="$enable_symbols" @@ -3404,6 +3420,12 @@ LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib" fi +if test "$TCL_PREFIX" != "$prefix"; then + echo "configure: warning: + Different --prefix selected for Tk and Tcl! + [package require Tk] may not work correctly in tclsh." 1>&2 +fi + #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. @@ -3412,12 +3434,12 @@ #-------------------------------------------------------------------- echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:3416: checking for sin" >&5 +echo "configure:3438: checking for sin" >&5 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -3461,7 +3483,7 @@ fi echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6 -echo "configure:3465: checking for main in -lieee" >&5 +echo "configure:3487: checking for main in -lieee" >&5 ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3469,14 +3491,14 @@ ac_save_LIBS="$LIBS" LIBS="-lieee $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3507,7 +3529,7 @@ libbsd=no if test "`uname -s`" = "AIX" ; then echo $ac_n "checking for gettimeofday in -lbsd""... $ac_c" 1>&6 -echo "configure:3511: checking for gettimeofday in -lbsd" >&5 +echo "configure:3533: checking for gettimeofday in -lbsd" >&5 ac_lib_var=`echo bsd'_'gettimeofday | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3515,7 +3537,7 @@ ac_save_LIBS="$LIBS" LIBS="-lbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3552: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3557,9 +3579,9 @@ #-------------------------------------------------------------------- echo $ac_n "checking stdlib.h""... $ac_c" 1>&6 -echo "configure:3561: checking stdlib.h" >&5 +echo "configure:3583: checking stdlib.h" >&5 cat > conftest.$ac_ext < EOF @@ -3574,7 +3596,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3588,7 +3610,7 @@ rm -f conftest* cat > conftest.$ac_ext < EOF @@ -3620,16 +3642,16 @@ #-------------------------------------------------------------------- echo $ac_n "checking fd_set and sys/select""... $ac_c" 1>&6 -echo "configure:3624: checking fd_set and sys/select" >&5 +echo "configure:3646: checking fd_set and sys/select" >&5 cat > conftest.$ac_ext < int main() { fd_set readMask, writeMask; ; return 0; } EOF -if { (eval echo configure:3633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3655: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tk_ok=yes else @@ -3641,7 +3663,7 @@ rm -f conftest* if test $tk_ok = no; then cat > conftest.$ac_ext < EOF @@ -3673,12 +3695,12 @@ #-------------------------------------------------------------------- echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3677: checking for ANSI C header files" >&5 +echo "configure:3699: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3686,7 +3708,7 @@ #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3690: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3712: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3703,7 +3725,7 @@ if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3721,7 +3743,7 @@ if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3742,7 +3764,7 @@ : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3753,7 +3775,7 @@ exit (0); } EOF -if { (eval echo configure:3757: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3779: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3777,12 +3799,12 @@ fi echo $ac_n "checking for mode_t""... $ac_c" 1>&6 -echo "configure:3781: checking for mode_t" >&5 +echo "configure:3803: checking for mode_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3810,12 +3832,12 @@ fi echo $ac_n "checking for pid_t""... $ac_c" 1>&6 -echo "configure:3814: checking for pid_t" >&5 +echo "configure:3836: checking for pid_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3843,12 +3865,12 @@ fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3847: checking for size_t" >&5 +echo "configure:3869: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3876,12 +3898,12 @@ fi echo $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3880: checking for uid_t in sys/types.h" >&5 +echo "configure:3902: checking for uid_t in sys/types.h" >&5 if eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF @@ -3918,17 +3940,17 @@ do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3922: checking for $ac_hdr" >&5 +echo "configure:3944: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3932: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3954: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3955,12 +3977,12 @@ done echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3959: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3981: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3969,7 +3991,7 @@ struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3973: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3995: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3995,16 +4017,16 @@ #------------------------------------------- echo $ac_n "checking pw_gecos in struct pwd""... $ac_c" 1>&6 -echo "configure:3999: checking pw_gecos in struct pwd" >&5 +echo "configure:4021: checking pw_gecos in struct pwd" >&5 cat > conftest.$ac_ext < int main() { struct passwd pwd; pwd.pw_gecos; ; return 0; } EOF -if { (eval echo configure:4008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:4030: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* tk_ok=yes else @@ -4037,7 +4059,7 @@ # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:4041: checking for X" >&5 +echo "configure:4063: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -4099,12 +4121,12 @@ # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4108: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4130: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4173,14 +4195,14 @@ ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4206: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -4270,12 +4292,12 @@ if test "$no_x" = ""; then if test "$x_includes" = ""; then cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4279: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -4295,15 +4317,15 @@ fi if test "$no_x" = "yes" -o "$not_really_there" = "yes"; then echo $ac_n "checking for X11 header files""... $ac_c" 1>&6 -echo "configure:4299: checking for X11 header files" >&5 +echo "configure:4321: checking for X11 header files" >&5 found_xincludes="no" cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:4307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:4329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -4339,7 +4361,7 @@ if test "$no_x" = yes; then echo $ac_n "checking for X11 libraries""... $ac_c" 1>&6 -echo "configure:4343: checking for X11 libraries" >&5 +echo "configure:4365: checking for X11 libraries" >&5 XLIBSW=nope dirs="/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/X11R6/lib /usr/X11R5/lib /usr/lib/X11R5 /usr/lib/X11R4 /usr/openwin/lib /usr/X11/lib /usr/sww/X11/lib" for i in $dirs ; do @@ -4359,7 +4381,7 @@ fi if test "$XLIBSW" = nope ; then echo $ac_n "checking for XCreateWindow in -lXwindow""... $ac_c" 1>&6 -echo "configure:4363: checking for XCreateWindow in -lXwindow" >&5 +echo "configure:4385: checking for XCreateWindow in -lXwindow" >&5 ac_lib_var=`echo Xwindow'_'XCreateWindow | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4367,7 +4389,7 @@ ac_save_LIBS="$LIBS" LIBS="-lXwindow $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4404: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4452,7 +4474,7 @@ #-------------------------------------------------------------------- echo $ac_n "checking for main in -lXbsd""... $ac_c" 1>&6 -echo "configure:4456: checking for main in -lXbsd" >&5 +echo "configure:4478: checking for main in -lXbsd" >&5 ac_lib_var=`echo Xbsd'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4460,14 +4482,14 @@ ac_save_LIBS="$LIBS" LIBS="-lXbsd $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4490,12 +4512,12 @@ tk_checkBoth=0 echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:4494: checking for connect" >&5 +echo "configure:4516: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4544: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -4540,7 +4562,7 @@ if test "$tk_checkSocket" = 1; then echo $ac_n "checking for main in -lsocket""... $ac_c" 1>&6 -echo "configure:4544: checking for main in -lsocket" >&5 +echo "configure:4566: checking for main in -lsocket" >&5 ac_lib_var=`echo socket'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4548,14 +4570,14 @@ ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4581,12 +4603,12 @@ tk_oldLibs=$LIBS LIBS="$LIBS -lsocket -lnsl" echo $ac_n "checking for accept""... $ac_c" 1>&6 -echo "configure:4585: checking for accept" >&5 +echo "configure:4607: checking for accept" >&5 if eval "test \"`echo '$''{'ac_cv_func_accept'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_accept=yes" else @@ -4631,12 +4653,12 @@ fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:4635: checking for gethostbyname" >&5 +echo "configure:4657: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4685: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -4677,7 +4699,7 @@ else echo "$ac_t""no" 1>&6 echo $ac_n "checking for main in -lnsl""... $ac_c" 1>&6 -echo "configure:4681: checking for main in -lnsl" >&5 +echo "configure:4703: checking for main in -lnsl" >&5 ac_lib_var=`echo nsl'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4685,14 +4707,14 @@ ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4732,13 +4754,13 @@ if test -d /usr/include/mit ; then echo $ac_n "checking MIT X libraries""... $ac_c" 1>&6 -echo "configure:4736: checking MIT X libraries" >&5 +echo "configure:4758: checking MIT X libraries" >&5 tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS -I/usr/include/mit" tk_oldLibs=$LIBS LIBS="$LIBS -lX11-mit" cat > conftest.$ac_ext < @@ -4749,7 +4771,7 @@ ; return 0; } EOF -if { (eval echo configure:4753: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -4776,12 +4798,12 @@ MATH_LIBS="" echo $ac_n "checking for sin""... $ac_c" 1>&6 -echo "configure:4780: checking for sin" >&5 +echo "configure:4802: checking for sin" >&5 if eval "test \"`echo '$''{'ac_cv_func_sin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_sin=yes" else @@ -4825,7 +4847,7 @@ fi echo $ac_n "checking for main in -lieee""... $ac_c" 1>&6 -echo "configure:4829: checking for main in -lieee" >&5 +echo "configure:4851: checking for main in -lieee" >&5 ac_lib_var=`echo ieee'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4833,14 +4855,14 @@ ac_save_LIBS="$LIBS" LIBS="-lieee $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4867,14 +4889,14 @@ #-------------------------------------------------------------------- echo $ac_n "checking whether char is unsigned""... $ac_c" 1>&6 -echo "configure:4871: checking whether char is unsigned" >&5 +echo "configure:4893: checking whether char is unsigned" >&5 if eval "test \"`echo '$''{'ac_cv_c_char_unsigned'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else if test "$GCC" = yes; then # GCC predefines this symbol on systems where it applies. cat > conftest.$ac_ext <&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:4932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_char_unsigned=yes else @@ -4939,12 +4961,12 @@ echo $ac_n "checking for strtod""... $ac_c" 1>&6 -echo "configure:4943: checking for strtod" >&5 +echo "configure:4965: checking for strtod" >&5 if eval "test \"`echo '$''{'ac_cv_func_strtod'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_strtod=yes" else @@ -4989,7 +5011,7 @@ if test "$tcl_strtod" = 1; then echo $ac_n "checking for Solaris2.4/Tru64 strtod bugs""... $ac_c" 1>&6 -echo "configure:4993: checking for Solaris2.4/Tru64 strtod bugs" >&5 +echo "configure:5015: checking for Solaris2.4/Tru64 strtod bugs" >&5 if eval "test \"`echo '$''{'tcl_cv_strtod_buggy'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4998,7 +5020,7 @@ tcl_cv_strtod_buggy=0 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:5047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then tcl_cv_strtod_buggy=1 else @@ -5296,10 +5318,6 @@ s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g -s%@MKLINKS_FLAGS@%$MKLINKS_FLAGS%g -s%@CC@%$CC%g -s%@CPP@%$CPP%g -s%@TCL_THREADS@%$TCL_THREADS%g s%@TCL_VERSION@%$TCL_VERSION%g s%@TCL_BIN_DIR@%$TCL_BIN_DIR%g s%@TCL_SRC_DIR@%$TCL_SRC_DIR%g @@ -5309,6 +5327,10 @@ s%@TCL_STUB_LIB_FILE@%$TCL_STUB_LIB_FILE%g s%@TCL_STUB_LIB_FLAG@%$TCL_STUB_LIB_FLAG%g s%@TCL_STUB_LIB_SPEC@%$TCL_STUB_LIB_SPEC%g +s%@MKLINKS_FLAGS@%$MKLINKS_FLAGS%g +s%@CC@%$CC%g +s%@CPP@%$CPP%g +s%@TCL_THREADS@%$TCL_THREADS%g s%@RANLIB@%$RANLIB%g s%@AR@%$AR%g s%@DL_LIBS@%$DL_LIBS%g Index: pTk/mTk/unix/configure.in --- Tk-804.025_beta10/pTk/mTk/unix/configure.in 2003-07-24 20:37:38.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/configure.in 2003-12-19 11:55:02.000000000 +0000 @@ -3,7 +3,7 @@ dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.83.2.2 2003/07/15 22:46:35 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.83.2.5 2003/10/06 16:59:25 dgp Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.13) @@ -11,16 +11,29 @@ TK_VERSION=8.4 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=4 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VERSION=${TK_VERSION} LOCALES="cs de el en en_gb es fr it nl ru" +#-------------------------------------------------------------------- +# Find and load the tclConfig.sh file +#-------------------------------------------------------------------- + +SC_PATH_TCLCONFIG +SC_LOAD_TCLCONFIG + +if test "${TCL_VERSION}" != "${TK_VERSION}"; then + AC_MSG_ERROR([${TCL_BIN_DIR}/tclConfig.sh is for Tcl ${TCL_VERSION}. +Tk ${TK_VERSION}${TK_PATCH_LEVEL} needs Tcl ${TK_VERSION}. +Use --with-tcl= option to indicate location of tclConfig.sh file for Tcl ${TK_VERSION}.]) +fi + #------------------------------------------------------------------------ # Handle the --prefix=... option #------------------------------------------------------------------------ if test "${prefix}" = "NONE"; then - prefix=/usr/local + prefix="$TCL_PREFIX" fi if test "${exec_prefix}" = "NONE"; then exec_prefix=$prefix @@ -86,13 +99,6 @@ SC_TCL_64BIT_FLAGS #-------------------------------------------------------------------- -# Find and load the tclConfig.sh file -#-------------------------------------------------------------------- - -SC_PATH_TCLCONFIG -SC_LOAD_TCLCONFIG - -#-------------------------------------------------------------------- # Recompute the necessary flags to run the compiler #-------------------------------------------------------------------- @@ -115,6 +121,12 @@ LIB_RUNTIME_DIR="${LIB_RUNTIME_DIR}:${TCL_EXEC_PREFIX}/lib" fi +if test "$TCL_PREFIX" != "$prefix"; then + AC_MSG_WARN([ + Different --prefix selected for Tk and Tcl! + [[package require Tk]] may not work correctly in tclsh.]) +fi + #-------------------------------------------------------------------- # On a few very rare systems, all of the libm.a stuff is # already in libc.a. Set compiler flags accordingly. Index: pTk/mTk/unix/mkLinks --- Tk-804.025_beta10/pTk/mTk/unix/mkLinks 2003-07-24 20:37:38.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/mkLinks 2003-12-19 11:55:03.000000000 +0000 @@ -174,12 +174,10 @@ rm -f ConfigWidg.3.* $ZIP ConfigWidg.3 rm -f Tk_ConfigureWidget.3 Tk_ConfigureWidget.3.* - rm -f Tk_Offset.3 Tk_Offset.3.* rm -f Tk_ConfigureInfo.3 Tk_ConfigureInfo.3.* rm -f Tk_ConfigureValue.3 Tk_ConfigureValue.3.* rm -f Tk_FreeOptions.3 Tk_FreeOptions.3.* ln $S ConfigWidg.3$Z Tk_ConfigureWidget.3$Z - ln $S ConfigWidg.3$Z Tk_Offset.3$Z ln $S ConfigWidg.3$Z Tk_ConfigureInfo.3$Z ln $S ConfigWidg.3$Z Tk_ConfigureValue.3$Z ln $S ConfigWidg.3$Z Tk_FreeOptions.3$Z @@ -478,7 +476,9 @@ rm -f GetHWND.3.* $ZIP GetHWND.3 rm -f Tk_GetHWND.3 Tk_GetHWND.3.* + rm -f Tk_AttachHWND.3 Tk_AttachHWND.3.* ln $S GetHWND.3$Z Tk_GetHWND.3$Z + ln $S GetHWND.3$Z Tk_AttachHWND.3$Z fi if test -r GetImage.3; then rm -f GetImage.3.* Index: pTk/mTk/unix/tcl.m4 --- Tk-804.025_beta10/pTk/mTk/unix/tcl.m4 2003-07-24 20:37:38.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/tcl.m4 2003-12-19 11:55:03.000000000 +0000 @@ -44,10 +44,16 @@ if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ + `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tcl \ + `ls -dr ../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tcl[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tcl \ + `ls -dr ../../../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` @@ -74,6 +80,8 @@ if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ${srcdir}/../tcl \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tcl[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd $i/unix; pwd)` @@ -140,10 +148,16 @@ if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ../tk \ + `ls -dr ../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../tk \ + `ls -dr ../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../tk[[8-9]].[[0-9]]* 2>/dev/null` \ ../../../tk \ + `ls -dr ../../../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ../../../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ../../../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` @@ -168,6 +182,8 @@ if test x"${ac_cv_c_tkconfig}" = x ; then for i in \ ${srcdir}/../tk \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ + `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]] 2>/dev/null` \ `ls -dr ${srcdir}/../tk[[8-9]].[[0-9]]* 2>/dev/null` ; do if test -f "$i/unix/tkConfig.sh" ; then ac_cv_c_tkconfig=`(cd $i/unix; pwd)` @@ -354,7 +370,7 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, - [ --enable-framework package shared libraries in frameworks [--disable-framework]], + [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]], [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_framework+set}" = set; then @@ -816,30 +832,10 @@ LIBS="$LIBS -lc" # AIX-5 uses ELF style dynamic libraries SHLIB_CFLAGS="" - SHLIB_LD_LIBS='${LIBS}' - SHLIB_SUFFIX=".so" - if test "`uname -m`" = "ia64" ; then - # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC - SHLIB_LD="/usr/ccs/bin/ld -G -z text" - # AIX-5 has dl* in libc.so - DL_LIBS="" - if test "$GCC" = "yes" ; then - CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' - else - CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' - fi - LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' - else - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" - DL_LIBS="-ldl" - CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' - LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} - TCL_NEEDS_EXP_FILE=1 - TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' - fi - # Note: need the LIBS below, otherwise Tk won't find Tcl's # symbols when dynamically loaded into tclsh. + SHLIB_LD_LIBS='${LIBS}' + SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" LDFLAGS="" @@ -859,6 +855,26 @@ SHLIB_LD_FLAGS="-b64" fi fi + + if test "`uname -m`" = "ia64" ; then + # AIX-5 uses ELF style dynamic libraries on IA-64, but not PPC + SHLIB_LD="/usr/ccs/bin/ld -G -z text" + # AIX-5 has dl* in libc.so + DL_LIBS="" + if test "$GCC" = "yes" ; then + CC_SEARCH_FLAGS='-Wl,-R,${LIB_RUNTIME_DIR}' + else + CC_SEARCH_FLAGS='-R${LIB_RUNTIME_DIR}' + fi + LD_SEARCH_FLAGS='-R ${LIB_RUNTIME_DIR}' + else + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + DL_LIBS="-ldl" + CC_SEARCH_FLAGS='-L${LIB_RUNTIME_DIR}' + LD_SEARCH_FLAGS=${CC_SEARCH_FLAGS} + TCL_NEEDS_EXP_FILE=1 + TCL_EXPORT_FILE_SUFFIX='${VERSION}\$\{DBGX\}.exp' + fi ;; AIX-*) if test "${TCL_THREADS}" = "1" -a "$GCC" != "yes" ; then @@ -870,7 +886,6 @@ fi LIBS="$LIBS -lc" SHLIB_CFLAGS="" - SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry" SHLIB_LD_LIBS='${LIBS}' SHLIB_SUFFIX=".so" DL_OBJS="tclLoadDl.o" @@ -888,6 +903,21 @@ DL_LIBS="-lld" fi + # Check to enable 64-bit flags for compiler/linker + if test "$do64bit" = "yes" ; then + if test "$GCC" = "yes" ; then + AC_MSG_WARN("64bit mode not supported with GCC on $system") + else + do64bit_ok=yes + EXTRA_CFLAGS="-q64" + LDFLAGS="-q64" + RANLIB="${RANLIB} -X64" + AR="${AR} -X64" + SHLIB_LD_FLAGS="-b64" + fi + fi + SHLIB_LD="${TCL_SRC_DIR}/unix/ldAix /bin/ld -bhalt:4 -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry ${SHLIB_LD_FLAGS}" + # On AIX <=v4 systems, libbsd.a has to be linked in to support # non-blocking file IO. This library has to be linked in after # the MATH_LIBS or it breaks the pow() function. The way to @@ -905,20 +935,6 @@ MATH_LIBS="$MATH_LIBS -lbsd" AC_DEFINE(USE_DELTA_FOR_TZ) fi - - # Check to enable 64-bit flags for compiler/linker - if test "$do64bit" = "yes" ; then - if test "$GCC" = "yes" ; then - AC_MSG_WARN("64bit mode not supported with GCC on $system") - else - do64bit_ok=yes - EXTRA_CFLAGS="-q64" - LDFLAGS="-q64" - RANLIB="${RANLIB} -X64" - AR="${AR} -X64" - SHLIB_LD_FLAGS="-b64" - fi - fi ;; BSD/OS-2.1*|BSD/OS-3*) SHLIB_CFLAGS="" @@ -1333,8 +1349,10 @@ LDFLAGS="" CC_SEARCH_FLAGS='-Wl,-rpath,${LIB_RUNTIME_DIR}' LD_SEARCH_FLAGS='-rpath ${LIB_RUNTIME_DIR}' - if test "$GCC" != "yes" ; then - EXTRA_CFLAGS="-DHAVE_TZSET -std1" + if test "$GCC" = "yes" ; then + EXTRA_CFLAGS="-mieee" + else + EXTRA_CFLAGS="-DHAVE_TZSET -std1 -ieee" fi # see pthread_intro(3) for pthread support on osf1, k.furukawa if test "${TCL_THREADS}" = "1" ; then Index: pTk/mTk/unix/tk.spec --- Tk-804.025_beta10/pTk/mTk/unix/tk.spec 2003-07-24 20:37:38.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/tk.spec 2003-12-19 11:55:03.000000000 +0000 @@ -1,7 +1,7 @@ -# $Id: tk.spec,v 1.15.2.2 2003/07/15 22:46:35 dgp Exp $ +# $Id: tk.spec,v 1.15.2.3 2003/10/03 16:32:39 dgp Exp $ # This file is the basis for a binary Tk Linux RPM. -%define version 8.4.4 +%define version 8.4.5 %define directory /usr/local Summary: Tk graphical toolkit for the Tcl scripting language. @@ -14,7 +14,7 @@ URL: http://www.tcl.tk/ Packager: Carina Buildroot: /var/tmp/%{name}%{version} -Requires: XFree86-libs >= 3.3.3, XFree86-devel >= 3.3.3, tcl = 8.4.4 +Requires: XFree86-libs >= 3.3.3, XFree86-devel >= 3.3.3, tcl = 8.4.5 %description The Tcl (Tool Command Language) provides a powerful platform for Index: pTk/mTk/unix/tkUnixButton.c --- Tk-804.025_beta10/pTk/mTk/unix/tkUnixButton.c 2003-07-27 17:30:56.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/unix/tkUnixButton.c 2003-12-19 11:55:03.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixButton.c,v 1.11.2.3 2003/04/26 02:58:17 hobbs Exp $ + * RCS: @(#) $Id: tkUnixButton.c,v 1.11.2.4 2003/10/10 20:20:47 hobbs Exp $ */ #include "tkButton.h" @@ -293,15 +293,15 @@ y += offset; } imageXOffset += x; - imageXOffset += y; + imageYOffset += y; if (butPtr->image != NULL) { if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { Tk_RedrawImage(butPtr->selectImage, 0, 0, width, - height, pixmap, x, y); + height, pixmap, imageXOffset, imageYOffset); } else { Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, - x, y); + imageXOffset, imageYOffset); } } else { XSetClipOrigin(butPtr->display, gc, x, y); Index: pTk/mTk/unix/tkUnixFont.c --- Tk-804.025_beta10/pTk/mTk/unix/tkUnixFont.c 2003-12-13 11:46:58.000000000 +0000 +++ Tk-804.025_beta11/pTk/mTk/unix/tkUnixFont.c 2003-12-19 11:55:03.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixFont.c,v 1.18.2.2 2003/07/19 01:45:42 hobbs Exp $ + * RCS: @(#) $Id: tkUnixFont.c,v 1.18.2.3 2003/10/29 01:07:46 hobbs Exp $ */ #include "tkUnixInt.h" @@ -2827,6 +2827,13 @@ } else { TkInitFontAttributes(&faPtr->fa); TkInitXLFDAttributes(&faPtr->xa); + } + /* + * Do last ditch check for family. It seems that some X servers can + * fail on the X font calls above, slipping through earlier checks. + * X-Win32 5.4 is one of these. + */ + if (faPtr->fa.family == NULL) { faPtr->fa.family = Tk_GetUid(""); faPtr->xa.foundry = Tk_GetUid(""); faPtr->xa.charset = Tk_GetUid(""); Index: pTk/mTk/win/configure --- Tk-804.025_beta10/pTk/mTk/win/configure 2003-07-24 20:37:41.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/win/configure 2003-12-19 11:55:04.000000000 +0000 @@ -536,7 +536,7 @@ TK_VERSION=8.4 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=4 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -1762,10 +1762,17 @@ eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. -# we also need to double check about including DBGX in lib names -# and spaces in file or directory names for the eval +# we also need to double check about spaces in path names +eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\"" +TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" +TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" -eval "TK_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TK_STUB_LIB_FLAG}\"" +TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" + +TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" eval "DLLSUFFIX=${DLLSUFFIX}" eval "LIBPREFIX=${LIBPREFIX}" @@ -1865,7 +1872,6 @@ -# undefined at this point for win @@ -1873,6 +1879,8 @@ +# undefined at this point for win + trap '' 1 2 15 @@ -2099,14 +2107,14 @@ s%@POST_MAKE_LIB@%$POST_MAKE_LIB%g s%@MAKE_DLL@%$MAKE_DLL%g s%@MAKE_EXE@%$MAKE_EXE%g -s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g -s%@TK_CC_SEARCH_FLAGS@%$TK_CC_SEARCH_FLAGS%g -s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g s%@TK_LIB_FLAG@%$TK_LIB_FLAG%g s%@TK_LIB_SPEC@%$TK_LIB_SPEC%g +s%@TK_BUILD_LIB_SPEC@%$TK_BUILD_LIB_SPEC%g s%@TK_STUB_LIB_SPEC@%$TK_STUB_LIB_SPEC%g -s%@TK_BUILD_STUB_LIB_PATH@%$TK_BUILD_STUB_LIB_PATH%g s%@TK_STUB_LIB_PATH@%$TK_STUB_LIB_PATH%g +s%@TK_BUILD_STUB_LIB_PATH@%$TK_BUILD_STUB_LIB_PATH%g +s%@TK_CC_SEARCH_FLAGS@%$TK_CC_SEARCH_FLAGS%g +s%@TK_LD_SEARCH_FLAGS@%$TK_LD_SEARCH_FLAGS%g CEOF EOF Index: pTk/mTk/win/configure.in --- Tk-804.025_beta10/pTk/mTk/win/configure.in 2003-07-24 20:37:41.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/win/configure.in 2003-12-19 11:55:04.000000000 +0000 @@ -3,7 +3,7 @@ # generate the file "configure", which is run during Tk installation # to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.49.2.4 2003/07/15 22:46:35 dgp Exp $ +# RCS: @(#) $Id: configure.in,v 1.49.2.6 2003/11/11 00:05:54 hobbs Exp $ AC_INIT(../generic/tk.h) AC_PREREQ(2.13) @@ -11,7 +11,7 @@ TK_VERSION=8.4 TK_MAJOR_VERSION=8 TK_MINOR_VERSION=4 -TK_PATCH_LEVEL=".4" +TK_PATCH_LEVEL=".5" VER=$TK_MAJOR_VERSION$TK_MINOR_VERSION #------------------------------------------------------------------------ @@ -153,10 +153,17 @@ eval "TK_STUB_LIB_FILE=${LIBPREFIX}tkstub${VER}${LIBSUFFIX}" # FIXME: All of this var junk needs to be done in tcl.m4 !!!! # I left out the other vars that also need to get defined here. -# we also need to double check about including DBGX in lib names -# and spaces in file or directory names for the eval +# we also need to double check about spaces in path names +eval "TK_LIB_FLAG=\"-ltk${VER}${LIBFLAGSUFFIX}\"" +TK_LIB_SPEC="-L${libdir} ${TK_LIB_FLAG}" +TK_BUILD_LIB_SPEC="-L`pwd` ${TK_LIB_FLAG}" + eval "TK_STUB_LIB_FLAG=\"-ltkstub${VER}${LIBFLAGSUFFIX}\"" -eval "TK_BUILD_STUB_LIB_SPEC=\"-L`pwd` ${TK_STUB_LIB_FLAG}\"" +TK_BUILD_STUB_LIB_SPEC="-L`pwd` ${TK_STUB_LIB_FLAG}" + +TK_STUB_LIB_SPEC="-L${libdir} ${TK_STUB_LIB_FLAG}" +TK_STUB_LIB_PATH="${libdir}/${TK_STUB_LIB_FILE}" +TK_BUILD_STUB_LIB_PATH="`pwd`/${TK_STUB_LIB_FILE}" eval "DLLSUFFIX=${DLLSUFFIX}" eval "LIBPREFIX=${LIBPREFIX}" @@ -256,14 +263,15 @@ AC_SUBST(MAKE_DLL) AC_SUBST(MAKE_EXE) -# undefined at this point for win -AC_SUBST(TK_BUILD_LIB_SPEC) -AC_SUBST(TK_CC_SEARCH_FLAGS) -AC_SUBST(TK_LD_SEARCH_FLAGS) AC_SUBST(TK_LIB_FLAG) AC_SUBST(TK_LIB_SPEC) +AC_SUBST(TK_BUILD_LIB_SPEC) AC_SUBST(TK_STUB_LIB_SPEC) -AC_SUBST(TK_BUILD_STUB_LIB_PATH) AC_SUBST(TK_STUB_LIB_PATH) +AC_SUBST(TK_BUILD_STUB_LIB_PATH) + +# undefined at this point for win +AC_SUBST(TK_CC_SEARCH_FLAGS) +AC_SUBST(TK_LD_SEARCH_FLAGS) AC_OUTPUT(Makefile tkConfig.sh) Index: pTk/mTk/win/makefile.vc --- Tk-804.025_beta10/pTk/mTk/win/makefile.vc 2003-12-10 08:26:30.000000000 +0000 +++ Tk-804.025_beta11/pTk/mTk/win/makefile.vc 2003-12-19 11:55:04.000000000 +0000 @@ -12,7 +12,7 @@ # Copyright (c) 2001-2002 David Gravereaux. # #------------------------------------------------------------------------------ -# RCS: @(#) $Id: makefile.vc,v 1.67.2.3 2003/03/23 02:25:21 kennykb Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.67.2.5 2003/11/17 02:20:20 dgp Exp $ #------------------------------------------------------------------------------ !if "$(MSVCDIR)" == "" Index: pTk/mTk/win/tkWinButton.c --- Tk-804.025_beta10/pTk/mTk/win/tkWinButton.c 2003-07-27 17:30:57.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/win/tkWinButton.c 2003-12-19 11:55:04.000000000 +0000 @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinButton.c,v 1.20.2.2 2003/04/26 02:53:47 hobbs Exp $ + * RCS: @(#) $Id: tkWinButton.c,v 1.20.2.3 2003/10/10 00:03:57 hobbs Exp $ */ #define OEMRESOURCE @@ -560,15 +560,15 @@ y += offset; } imageXOffset += x; - imageXOffset += y; + imageYOffset += y; if (butPtr->image != NULL) { if ((butPtr->selectImage != NULL) && (butPtr->flags & SELECTED)) { Tk_RedrawImage(butPtr->selectImage, 0, 0, width, height, - pixmap, x, y); + pixmap, imageXOffset, imageYOffset); } else { Tk_RedrawImage(butPtr->image, 0, 0, width, height, pixmap, - x, y); + imageXOffset, imageYOffset); } } else { XSetClipOrigin(butPtr->display, gc, x, y); Index: pTk/mTk/win/tkWinDraw.c --- Tk-804.025_beta10/pTk/mTk/win/tkWinDraw.c 2003-07-27 17:30:57.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/win/tkWinDraw.c 2003-12-19 11:55:04.000000000 +0000 @@ -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: tkWinDraw.c,v 1.12 2003/02/26 02:47:04 hobbs Exp $ + * RCS: @(#) $Id: tkWinDraw.c,v 1.12.2.1 2003/11/11 00:26:33 hobbs Exp $ */ #include "tkWinInt.h" @@ -630,7 +630,7 @@ int i; RECT rect; TkWinDCState state; - HBRUSH brush; + HBRUSH brush, oldBrush; if (d == None) { return; @@ -644,7 +644,7 @@ || gc->fill_style == FillOpaqueStippled) && gc->stipple != None) { TkWinDrawable *twdPtr = (TkWinDrawable *)gc->stipple; - HBRUSH oldBrush, stipple; + HBRUSH stipple; HBITMAP oldBitmap, bitmap; HDC dcMem; HBRUSH bgBrush = CreateSolidBrush(gc->background); @@ -694,9 +694,28 @@ DeleteObject(stipple); DeleteObject(bgBrush); } else { - for (i = 0; i < nrectangles; i++) { - TkWinFillRect(dc, rectangles[i].x, rectangles[i].y, - rectangles[i].width, rectangles[i].height, gc->foreground); + if (gc->function == GXcopy) { + for (i = 0; i < nrectangles; i++) { + rect.left = rectangles[i].x; + rect.right = rect.left + rectangles[i].width; + rect.top = rectangles[i].y; + rect.bottom = rect.top + rectangles[i].height; + FillRect(dc, &rect, brush); + } + } else { + HPEN newPen = CreatePen(PS_NULL, 0, gc->foreground); + HPEN oldPen = SelectObject(dc, newPen); + oldBrush = SelectObject(dc, brush); + + for (i = 0; i < nrectangles; i++) { + Rectangle(dc, rectangles[i].x, rectangles[i].y, + rectangles[i].x + rectangles[i].width + 1, + rectangles[i].y + rectangles[i].height + 1); + } + + SelectObject(dc, oldBrush); + SelectObject(dc, oldPen); + DeleteObject(newPen); } } DeleteObject(brush); Index: pTk/mTk/win/tkWinImage.c --- Tk-804.025_beta10/pTk/mTk/win/tkWinImage.c 2003-07-27 23:36:21.000000000 +0100 +++ Tk-804.025_beta11/pTk/mTk/win/tkWinImage.c 2003-12-19 11:55:04.000000000 +0000 @@ -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: tkWinImage.c,v 1.6.2.1 2003/07/17 01:02:47 hobbs Exp $ + * RCS: @(#) $Id: tkWinImage.c,v 1.6.2.2 2003/10/29 01:08:02 hobbs Exp $ */ #include "tkWinInt.h" @@ -438,6 +438,29 @@ for (i = 0; i < bmInfo->bmiHeader.biSizeImage; i++, p++) { *p = (unsigned char) palette[*p]; } + } else if (depth == 16) { + GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); + data = ckalloc(bmInfo->bmiHeader.biSizeImage); + if (!data) { + /* printf("Failed to allocate data area for XImage.\n"); */ + ret_image = NULL; + goto cleanup; + } + ret_image = XCreateImage(display, NULL, 16, ZPixmap, 0, data, + width, height, 16, 0 /* will be calc'ed from bitmap_pad */); + if (ret_image == NULL) { + ckfree((char *) data); + goto cleanup; + } + + /* Get the BITMAP info directly into the Image. */ + if (GetDIBits(hdcMem, hbmp, 0, height, ret_image->data, bmInfo, + DIB_RGB_COLORS) == 0) { + ckfree((char *) ret_image->data); + ckfree((char *) ret_image); + ret_image = NULL; + goto cleanup; + } } else { GetDIBits(hdcMem, hbmp, 0, height, NULL, bmInfo, DIB_RGB_COLORS); data = ckalloc(width * height * 4); @@ -454,6 +477,10 @@ } if (depth <= 24) { + /* + * This used to handle 16 and 24 bpp, but now just handles 24. + * It can likely be optimized for that. -- hobbs + */ unsigned char *smallBitData, *smallBitBase, *bigBitData; unsigned int byte_width, h, w; @@ -469,14 +496,13 @@ /* Get the BITMAP info into the Image. */ if (GetDIBits(hdcMem, hbmp, 0, height, smallBitData, bmInfo, - DIB_RGB_COLORS) == 0) { + DIB_RGB_COLORS) == 0) { ckfree((char *) ret_image->data); ckfree((char *) ret_image); ckfree((char *) smallBitBase); ret_image = NULL; goto cleanup; } - /* Copy the 24 Bit Pixmap to a 32-Bit one. */ for (h = 0; h < height; h++) { bigBitData = ret_image->data + h * ret_image->bytes_per_line; Index: pTk/tcl.h --- Tk-804.025_beta10/pTk/tcl.h 2003-10-26 17:04:25.000000000 +0000 +++ Tk-804.025_beta11/pTk/tcl.h 2003-12-19 11:55:05.000000000 +0000 @@ -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: tcl.h,v 1.153.2.6 2003/07/16 22:06:04 hobbs Exp $ + * RCS: @(#) $Id: tcl.h,v 1.153.2.8 2003/10/22 22:35:46 andreas_kupries Exp $ */ #ifndef _TCL #define _TCL @@ -57,10 +57,10 @@ #define TCL_MAJOR_VERSION 8 #define TCL_MINOR_VERSION 4 #define TCL_RELEASE_LEVEL TCL_FINAL_RELEASE -#define TCL_RELEASE_SERIAL 4 +#define TCL_RELEASE_SERIAL 5 #define TCL_VERSION "8.4" -#define TCL_PATCH_LEVEL "8.4.4" +#define TCL_PATCH_LEVEL "8.4.5" /* * The following definitions set up the proper options for Windows @@ -1670,6 +1670,7 @@ #define TCL_GLOB_TYPE_FILE (1<<4) #define TCL_GLOB_TYPE_LINK (1<<5) #define TCL_GLOB_TYPE_SOCK (1<<6) +#define TCL_GLOB_TYPE_MOUNT (1<<7) #define TCL_GLOB_PERM_RONLY (1<<0) #define TCL_GLOB_PERM_HIDDEN (1<<1) Index: pTk/tkIntDecls.m --- Tk-804.025_beta10/pTk/tkIntDecls.m 2003-12-10 09:37:05.000000000 +0000 +++ Tk-804.025_beta11/pTk/tkIntDecls.m 2003-12-19 11:56:13.000000000 +0000 @@ -198,6 +198,10 @@ # define TkGetMainInfoList (*TkintdeclsVptr->V_TkGetMainInfoList) #endif +#ifndef TkGetOptionSpec +# define TkGetOptionSpec (*TkintdeclsVptr->V_TkGetOptionSpec) +#endif + #ifndef TkGetPointerCoords # define TkGetPointerCoords (*TkintdeclsVptr->V_TkGetPointerCoords) #endif Index: pTk/tkIntDecls.t --- Tk-804.025_beta10/pTk/tkIntDecls.t 2003-12-10 09:37:05.000000000 +0000 +++ Tk-804.025_beta11/pTk/tkIntDecls.t 2003-12-19 11:56:13.000000000 +0000 @@ -267,6 +267,11 @@ VFUNC(TkMainInfo *,TkGetMainInfoList,V_TkGetMainInfoList,_ANSI_ARGS_((void))) #endif /* #ifndef TkGetMainInfoList */ +#ifndef TkGetOptionSpec +VFUNC(CONST Tk_OptionSpec *,TkGetOptionSpec,V_TkGetOptionSpec,_ANSI_ARGS_((CONST char * name, + Tk_OptionTable optionTable))) +#endif /* #ifndef TkGetOptionSpec */ + #ifndef TkGetPointerCoords VFUNC(void,TkGetPointerCoords,V_TkGetPointerCoords,_ANSI_ARGS_((Tk_Window tkwin, int * xPtr, int * yPtr))) Index: pod/UserGuide.pod --- Tk-804.025_beta10/pod/UserGuide.pod 2003-07-19 09:39:41.000000000 +0100 +++ Tk-804.025_beta11/pod/UserGuide.pod 2003-12-14 22:25:40.000000000 +0000 @@ -1,24 +1,27 @@ =head1 NAME -perl/Tk - Writing Tk applications in perl5. +Perl/Tk - Writing Tk applications in Perl 5 =for category Introduction =head1 DESCRIPTION -This manual page is for beginners. It assumes you know some perl, -and have got perl+Tk running. -Please run the 'widget' demo before reading this text; it will teach you -the various widget types supported by Tk. - -=head1 Some background - -Tk GUI programming is event-driven. (This may already be familiar to you.) -In event-driven programs, the main GUI loop is outside of the user program -and inside the GUI library. This loop will watch all events of interest, -and activate the correct handler procedures to handle these events. -Some of these handler procedures may be user-supplied; others will be part -of the library. +This document is for beginners. It assumes you know some Perl, and +have it and Tk running. If you are not currently reading this +document courtesy of the B demonstration program, please be +sure to run B, as it will teach you the various widget types +supported by Tk and how to use them. B should be installed in +your default path, so type I at a command prompt. + +=head1 Some Background + +Tk GUI programming is event-driven. (This may already be familiar to +you.) In event-driven programs, the main GUI loop is outside of the +user program and inside the GUI library. This loop - initiated by +calling B - watches all events of interest and activate +the correct handler procedures to handle these events. Some of these +handler procedures may be user-supplied; others will be part of the +library. For a programmer, this means that you're not watching what is happening; instead, you are requested by the toolkit to perform actions whenever @@ -27,7 +30,7 @@ requests, but you tell the toolkit which routine will handle such cases, and the toolkit will call the procedures when required. -=head1 First requirements +=head1 First Requirements Any perl program that uses Tk needs to include C. A program should also use C and the B<-w> switch to ensure Index: t/create.t --- Tk-804.025_beta10/t/create.t 2003-09-28 18:29:18.000000000 +0100 +++ Tk-804.025_beta11/t/create.t 2003-12-19 12:05:04.000000000 +0000 @@ -127,13 +127,16 @@ eval { $w->pack; }; ok ($@, "", "Can't pack a $class widget") } + print "# $class update\n"; eval { $mw->update; }; ok ($@, "", "Error during 'update' for $class widget"); my @dummy; + print "# $class configure list\n"; eval { @dummy = $w->configure; }; ok ($@, "", "Error: configure list for $class"); my $dummy; + print "# $class configure scalar\n"; eval { $dummy = $w->configure; }; ok ($@, "", "Error: configure scalar for $class"); ok (scalar(@dummy),scalar(@$dummy), "Error: scalar config != list config"); @@ -159,9 +162,11 @@ } ok($@,"","Cannot re-configure $class"); + print "# $class update post-configure\n"; eval { $mw->update; }; ok ($@, "", "Error: 'update' after configure for $class widget"); + print "# $class destroy\n"; eval { $w->destroy; }; ok($@, "", "can't destroy $class widget"); ok(!Tk::Exists($w), 1, "$class: widget not really destroyed"); Index: tkGlue.c --- Tk-804.025_beta10/tkGlue.c 2003-12-09 22:05:54.000000000 +0000 +++ Tk-804.025_beta11/tkGlue.c 2003-12-19 12:49:04.000000000 +0000 @@ -3463,32 +3463,35 @@ Tcl_GetCommandInfo (Tcl_Interp *interp, CONST char *cmdName, Tcl_CmdInfo *infoPtr) { dTHX; - if (*cmdName == '.') + HV *hv = InterpHv(interp,1); + SV **svp = hv_fetch(hv,cmdName,strlen(cmdName),0); + /* Widgets, images and named fonts get put in main hash */ + if (svp && *svp) { - HV *hv = InterpHv(interp,1); - SV **svp = hv_fetch(hv,cmdName,strlen(cmdName),0); - if (svp && *svp) - { - Lang_CmdInfo *info = WindowCommand(*svp,NULL,0); - *infoPtr = info->Tk; - return 1; - } + Lang_CmdInfo *info = WindowCommand(*svp,NULL,0); + *infoPtr = info->Tk; + return 1; } - else + /* widgets are special cased elsewhere */ + else if (*cmdName != '.') { - CV *cv = TkXSUB(cmdName,NULL,NULL); - if (!cv) + HV *cm = FindHv(aTHX_ interp, "Tcl_GetCommandInfo", 1, CMD_KEY); + SV **svp = hv_fetch(cm,cmdName,strlen(cmdName),0); + if (svp && *svp) { - return EXPIRE((interp,"Cannot find %s", cmdName)); + memcpy(infoPtr,SvPVX(*svp),sizeof(Tcl_CmdInfo)); + return 1; } - else + else if (0) { - HV *cm = FindHv(aTHX_ interp, "Tcl_GetCommandInfo", 1, CMD_KEY); - SV **svp = hv_fetch(cm,cmdName,strlen(cmdName),0); - if (svp && *svp) + /* If we didn't find the info but this is supposed to + be a known Tk builtin then something may have gone wrong + but "after" seems to occur regularly + */ + CV *cv = TkXSUB(cmdName,NULL,NULL); + if (cv) { - memcpy(infoPtr,SvPVX(*svp),sizeof(Tcl_CmdInfo)); - return 1; + LangDebug("No Tcl_GetCommandInfo for %s\n",cmdName); } } } __END_OF_PATCH__