This is the mail archive of the insight@sourceware.org mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH/libgui] Update for installed Tcl/Tk and Itcl 3.3


Hi,

I've committed the following mega-patch which does two things. First, trivially, it updates the sources for use with Itcl 3.3. Second, and more important, I've added machinery to use the system-supplied versions of Tcl and Tk.

I'm on my way to eradicating our need for having our own versions of tcl, tk, and itcl et al.

If there are any problems, please send a note to this list.

New itcl3.3 and updates to insight coming shortly.

Keith

2008-07-22 Keith Seitz <keiths@redhat.com>

        * tcl.m4: New file.
        * acinclude.m4: Include tcl.m4 instead of ../config/acinclude.m4
        * aclocal.m4: Regenerated.
        * configure.ac: Do not check for ITCL_SH.
        Use SC_PATH_TCLCONFIG, SC_PATH_TKCONFIG, SC_LOAD_TCLCONFIG, and
        SC_LOAD_TKCONFIG to find Tcl and Tk.
        Add some logic for when using in-tree Tcl/Tk.
        Change substitutes for TCL_BUILD_LIB_SPEC, TK_BUILD_LIB_SPEC, and
        TCLHDIR to accommodate using system-supplied Tcl and Tk.
        * configure: Regenerated.
        * Makefile.in: Regenerated.
        * library/Makefile.am: Replace ITCL_SH with TCLSH.
        Remove TCL_SHARED rules.
        (tclIndex): Update build rules.
        * library/Makefile.in: Regenerate.
        * library/balloon.tcl: Update for Itcl 3.2/3.3.
        * library/cframe.tcl: Likewise.
        * library/lframe.tcl: Likewise.
        * library/multibox.tcl: Likewise.
        * library/sendpr.tcl: Likewise.
        * library/ventry.tcl: Likewise.
        * library/wframe.tcl: Likewise.
        * src/Makefile.am (INCLUDES): Update.
        * src/Makefile.in: Regenerate.
        * src/paths.c (init_script): Accommodate builddir != srcdir.
Index: acinclude.m4
===================================================================
RCS file: /cvs/src/src/libgui/acinclude.m4,v
retrieving revision 1.2
diff -u -p -r1.2 acinclude.m4
--- acinclude.m4	8 Sep 2001 22:34:45 -0000	1.2
+++ acinclude.m4	22 Jul 2008 20:10:15 -0000
@@ -1 +1 @@
-"sinclude(../config/acinclude.m4)"
+"sinclude(tcl.m4)"
Index: configure.ac
===================================================================
RCS file: /cvs/src/src/libgui/configure.ac,v
retrieving revision 1.2
diff -u -p -r1.2 configure.ac
--- configure.ac	23 Mar 2005 17:53:14 -0000	1.2
+++ configure.ac	22 Jul 2008 20:10:15 -0000
@@ -14,8 +14,6 @@ AM_CONDITIONAL(CROSS_COMPILING, test x$c
 AM_CONDITIONAL(INSTALL_LIBGUI, test x$enable_install_libgui = xyes)
 AC_CHECK_TOOL(RANLIB, ranlib, :)
 AC_CHECK_TOOL(AR, ar, :)
-AC_CHECK_PROG(ITCL_SH, itcl_sh, itcl_sh,
-	[\$\$here/\$(top_builddir)/../itcl/itcl/unix/itcl_sh\$(EXEEXT)])
 
 AC_FUNC_ALLOCA
 AC_HAVE_HEADERS(stddef.h stdlib.h getopt.h unistd.h fcntl.h sys/file.h sys/wait.h string.h strings.h)
@@ -81,44 +79,39 @@ else
 fi
 AC_SUBST(LIBGUI_LIBRARY_DIR)
 
-# Find the init.tcl file.
-
-AC_MSG_CHECKING(for init.tcl)
-AC_CACHE_VAL(ac_cv_c_tcl_libdir,[
-dnl currently, only check the source tree
-if test -f $srcdir/../tcl/library/init.tcl ; then
-  ac_cv_c_tcl_libdir=`cd $srcdir/../tcl/library; pwd`
-elif test -f $srcdir/../tcl8.1/library/init.tcl; then
-  ac_cv_c_tcl_libdir=`cd $srcdir/../tcl8.1/library; pwd`
-fi
-])
-AC_MSG_RESULT(${ac_cv_c_tcl_libdir})
-
-if test x"$ac_cv_prog_CC" = xcl; then
-  tmp2="`cygpath --windows $ac_cv_c_tcl_libdir`"
-  TCL_LIBRARY="`echo $tmp2 | sed -e s#\\\\\\\\#/#g`"
+# Check for Tcl and Tk.
+SC_PATH_TCLCONFIG
+SC_LOAD_TCLCONFIG
+SC_PATH_TKCONFIG
+SC_LOAD_TKCONFIG
+
+here=`pwd`
+cd ${srcdir}/..
+topdir=`pwd`
+cd ${here}
+
+if test "${TCL_SRC_DIR}" = "${topdir}/tcl"; then
+  # Using in-tree Tcl/Tk
+  TCL_INCLUDES="-I${TCL_SRC_DIR}/generic"
+  TCL_LIBRARY=${TCL_BUILD_LIB_SPEC}
+  TK_INCLUDES="-I${TK_SRC_DIR}/generic"
+  TK_LIBRARY=${TK_BUILD_LIB_SPEC}
 else
-  TCL_LIBRARY=$ac_cv_c_tcl_libdir
+  # Using installed Tcl/Tk
+  TCL_INCLUDES=${TCL_INCLUDE_SPEC}
+  TCL_LIBRARY=${TCL_LIB_SPEC}
+  TK_INCLUDES=${TK_INCLUDE_SPEC}
+  TK_LIBRARY=${TK_LIB_SPEC}
 fi
-AC_SUBST(TCL_LIBRARY)
-
-# Check for Tcl and Tk.
-CYG_AC_PATH_TCLCONFIG
-CYG_AC_LOAD_TCLCONFIG
-CYG_AC_PATH_TKCONFIG
-CYG_AC_LOAD_TKCONFIG
-CYG_AC_PATH_TCLH
-# FIXME: consider only doing this if --with-x given.
-CYG_AC_PATH_TKH
 
 AC_SUBST(TCL_DEFS)
+AC_SUBST(TCL_INCLUDES)
 AC_SUBST(TK_DEFS)
-AC_SUBST(TCLHDIR)
-AC_SUBST(TKHDIR)
+AC_SUBST(TK_INCLUDES)
 AC_SUBST(TK_XINCLUDES)
 AC_SUBST(TCL_LIBS)
-AC_SUBST(TK_BUILD_LIB_SPEC)
-AC_SUBST(TCL_BUILD_LIB_SPEC)
+AC_SUBST(TK_LIBRARY)
+AC_SUBST(TCL_LIBRARY)
 AC_SUBST(TK_LIBS)
 
 AM_CONDITIONAL(TCL_SHARED, test x$TCL_SHARED_BUILD = x1)
Index: library/Makefile.am
===================================================================
RCS file: /cvs/src/src/libgui/library/Makefile.am,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile.am
--- library/Makefile.am	5 Feb 2002 23:16:14 -0000	1.6
+++ library/Makefile.am	22 Jul 2008 20:10:15 -0000
@@ -17,38 +17,18 @@ PACKAGES = combobox.tcl
 guidir = $(datadir)/redhat/gui
 gui_DATA = tclIndex pkgIndex.tcl $(TCL) $(PACKAGES)
 
-if TCL_SHARED
-SET_LIB_PATH = 	$(RPATH_ENVVAR)=$$here/../../tcl/unix:$$here/../../itcl/itcl/unix:$$$(RPATH_ENVVAR); export $(RPATH_ENVVAR);
-else
-SET_LIB_PATH = 
-endif
-
-WISH = wish
 
 if CROSS_COMPILING
-ITCL_SH = itclsh3.0
+TCLSH = tclsh8.4
 else
-ITCL_SH = @ITCL_SH@
+TCLSH = @TCLSH@
 endif
 
 if MAINTAINER_MODE
 tclIndex: $(TCL)
-	TCL_LIBRARY=$(srcdir)/../../tcl/library; export TCL_LIBRARY; \
-	here=`pwd`; \
-	$(SET_LIB_PATH) \
-	cd $(srcdir) && \
-	  echo "auto_mkindex $(LIBGUI_LIBRARY_DIR) $(TCL)" | $(ITCL_SH)
-
-pkgIndex.tcl: @MAINT@ $(PACKAGES)
-	here=`pwd`;	 \
-	$(SET_LIB_PATH) \
-	cd $(srcdir) && \
-	echo "pkg_mkIndex . $(PACKAGES); exit" | $(ITCL_SH)
+	 echo "package require Itcl; auto_mkindex $(LIBGUI_LIBRARY_DIR) $(TCL)" | $(TCLSH)
 else
 tclIndex:
-
-pkgIndex.tcl:
-
 endif
 
 ETAGS_ARGS = --lang=none --regex='/[ \t]*\(proc\|method\|itcl_class\)[ \t]+\([^ \t]+\)/\1/' $(TCL) --lang=auto
Index: library/balloon.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/balloon.tcl,v
retrieving revision 1.5
diff -u -p -r1.5 balloon.tcl
--- library/balloon.tcl	10 Feb 2003 09:21:40 -0000	1.5
+++ library/balloon.tcl	22 Jul 2008 20:10:16 -0000
@@ -1,5 +1,5 @@
 # balloon.tcl - Balloon help.
-# Copyright (C) 1997, 1998, 2000 Cygnus Solutions.
+# Copyright (C) 1997, 1998, 2000, 2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
 # KNOWN BUGS:
@@ -7,36 +7,36 @@
 #   presently they are hard-coded.
 # * Likewise, balloon positioning on Windows is a hack.
 
-itcl_class Balloon {
+itcl::class Balloon {
   # Name of associated global variable which should be set whenever
   # the help is shown.
-  public variable {}
+  public variable varname {}
 
   # Name of associated toplevel.  Private variable.
-  protected _top {}
+  protected variable _top {}
 
   # This is non-empty if there is an after script pending.  Private
   # method.
-  protected _after_id {}
+  protected variable _after_id {}
 
   # This is an array mapping window name to help text.
-  protected _help_text
+  protected variable _help_text
 
   # This is an array mapping window name to notification proc.
-  protected _notifiers
+  protected variable _notifiers
 
   # This is set to the name of the parent widget whenever the mouse is
   # in a widget with balloon help.
-  protected _active {}
+  protected variable _active {}
 
   # This is true when we're already calling a notification proc.
   # Private variable.
-  protected _in_notifier 0
+  protected variable _in_notifier 0
 
   # This holds the parent of the most recently entered widget.  It is
   # used to determine when the user is moving through a toolbar.
   # Private variable.
-  protected _recent_parent {}
+  protected variable _recent_parent {}
 
   constructor {top} {
     global tcl_platform
@@ -92,7 +92,7 @@ itcl_class Balloon {
     # Clean up when the label is destroyed.  This has the hidden
     # assumption that the balloon widget is a child of the toplevel to
     # which it is connected.
-    bind [namespace tail $this].label <Destroy> [list $this delete]
+    bind [namespace tail $this].label <Destroy> [itcl::code itcl::delete object $this]
   }
 
   destructor {
@@ -101,8 +101,6 @@ itcl_class Balloon {
     catch {destroy $this}
   }
 
-  method configure {config} {}
-
   # Register a notifier for a window.
   method notify {command window {tag {}}} {
     if {$tag == ""} then {
@@ -256,16 +254,16 @@ itcl_class Balloon {
     if {$index == ""} then {
       set value ""
     } elseif {[info exists _notifiers($index)] && ! $_in_notifier} then {
-      if {$variable != ""} {
-	upvar $variable var
+      if {$varname != ""} {
+	upvar $varname var
 	set var $_help_text($index)
       }
       set _in_notifier 1
       uplevel \#0 $_notifiers($index)
       set _in_notifier 0
       # Get value afterwards to give notifier a chance to change it.
-      if {$variable != ""} {
-	upvar $variable var
+      if {$varname != ""} {
+	upvar $varname var
 	set _help_text($index) $var
       } 
       set value $_help_text($index)
@@ -273,8 +271,8 @@ itcl_class Balloon {
       set value $_help_text($index)
     }
 
-    if {$variable != ""} then {
-      upvar $variable var
+    if {$varname != ""} then {
+      upvar $varname var
       set var $value
     }
   }
@@ -401,7 +399,7 @@ itcl_class Balloon {
     # Decode window name.
     regsub -all -- ! $name . name
 
-    if {$variable == ""} then {
+    if {$varname == ""} then {
       # There's no point to doing anything.
       return
     }
@@ -493,12 +491,12 @@ proc BALLOON_command_variable {window ar
   if {[llength $args] == 0} then {
     # Fetch.
     set b [BALLOON_find_balloon $window]
-    return [$b cget -variable]
+    return [$b cget -varname]
   } else {
     # FIXME: no arg checking here.
     # Set.
     set b [BALLOON_find_balloon $window]
-    $b configure -variable [lindex $args 0]
+    $b configure -varname [lindex $args 0]
   }
 }
 
Index: library/cframe.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/cframe.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 cframe.tcl
--- library/cframe.tcl	8 Sep 2001 22:34:46 -0000	1.2
+++ library/cframe.tcl	22 Jul 2008 20:10:17 -0000
@@ -1,19 +1,19 @@
 # cframe.tcl - Frame controlled by checkbutton.
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc
 # Written by Tom Tromey <tromey@cygnus.com>.
 
-itcl_class Checkframe {
+itcl::class Checkframe {
   inherit Widgetframe
 
   # The checkbutton text.
-  public text {} {
+  public variable text {} {
     _set_option -text $text 0
   }
 
   # This holds the last value of -variable.  We use it to unset our
   # trace when the variable changes (or is deleted).  Private
   # variable.
-  protected _saved_variable {}
+  protected variable _saved_variable {}
 
   # The checkbutton variable.
   public variable {} {
@@ -21,22 +21,22 @@ itcl_class Checkframe {
   }
 
   # The checkbutton -onvalue.
-  public onvalue 1 {
+  public variable onvalue 1 {
     _set_option -onvalue $onvalue
   }
 
   # The checkbutton -offvalue.
-  public offvalue 0 {
+  public variable offvalue 0 {
     _set_option -offvalue $offvalue
   }
 
   # The checkbutton -command.
-  public command {} {
+  public variable command {} {
     _set_option -command $command 0
   }
 
   # This holds balloon help for the checkbutton.
-  public help {} {
+  public variable help {} {
     if {[winfo exists [namespace tail $this].check]} then {
       balloon register [namespace tail $this].check $help
     }
@@ -44,9 +44,9 @@ itcl_class Checkframe {
 
   # This holds a list of all widgets which should be immune to
   # enabling/disabling.  Private variable.
-  protected _avoid {}
+  protected variable _avoid {}
 
-  constructor {config} {
+  constructor {} {
     checkbutton [namespace tail $this].check -text $text -variable $variable -padx 2 \
       -command $command -onvalue $onvalue -offvalue $offvalue
     balloon register [namespace tail $this].check $help
Index: library/lframe.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/lframe.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 lframe.tcl
--- library/lframe.tcl	8 Sep 2001 22:34:46 -0000	1.2
+++ library/lframe.tcl	22 Jul 2008 20:10:17 -0000
@@ -1,18 +1,18 @@
 # lframe.tcl - Labelled frame widget.
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
-itcl_class Labelledframe {
+itcl::class Labelledframe {
   inherit Widgetframe
 
   # The label text.
-  public text {} {
+  public variable text {} {
     if {[winfo exists [namespace tail $this].label]} then {
       [namespace tail $this].label configure -text $text
     }
   }
 
-  constructor {config} {
+  constructor {} {
     label [namespace tail $this].label -text $text -padx 2
     _add [namespace tail $this].label
   }
Index: library/multibox.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/multibox.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 multibox.tcl
--- library/multibox.tcl	8 Sep 2001 22:34:46 -0000	1.2
+++ library/multibox.tcl	22 Jul 2008 20:10:17 -0000
@@ -1,25 +1,25 @@
 # multibox.tcl - Multi-column listbox.
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
 # FIXME:
 # * Should support sashes so user can repartition widget sizes.
 # * Should support itemcget, itemconfigure.
 
-itcl_class Multibox {
+itcl::class Multibox {
   # The selection mode.
-  public selectmode browse {
+  public variable selectmode browse {
     _apply_all configure [list -selectmode $selectmode]
   }
 
   # The height.
-  public height 10 {
+  public variable height 10 {
     _apply_all configure [list -height $height]
   }
 
   # This is a list of all the listbox widgets we've created.  Private
   # variable.
-  protected _listboxen {}
+  protected variable _listboxen {}
 
   # Tricky: take the class bindings for the Listbox widget and turn
   # them into Multibox bindings that directly run our bindings.  That
@@ -32,7 +32,7 @@ itcl_class Multibox {
     bind Multibox $seq $sub
   }
 
-  constructor {config} {
+  constructor {} {
     # The standard widget-making trick.
     set class [$this info class]
     set hull [namespace tail $this]
@@ -43,7 +43,8 @@ itcl_class Multibox {
     ::rename $this $old_name
 
     scrollbar [namespace tail $this].vs -orient vertical
-    bind [namespace tail $this].vs <Destroy> [list $this delete]
+    bind [namespace tail $this].vs <Destroy> \
+	[itcl::code itcl::delete object $this]
 
     grid rowconfigure  [namespace tail $this] 0 -weight 0
     grid rowconfigure  [namespace tail $this] 1 -weight 1
@@ -95,8 +96,6 @@ itcl_class Multibox {
     grid columnconfigure  [namespace tail $this] $num -weight 0
   }
 
-  method configure {config} {}
-
   # FIXME: should handle automatically.
   method cget {option} {
     switch -- $option {
Index: library/sendpr.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/sendpr.tcl,v
retrieving revision 1.3
diff -u -p -r1.3 sendpr.tcl
--- library/sendpr.tcl	5 Feb 2002 23:16:14 -0000	1.3
+++ library/sendpr.tcl	22 Jul 2008 20:10:18 -0000
@@ -1,5 +1,5 @@
 # sendpr.tcl - GUI to send-pr.
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
 # FIXME:
@@ -13,7 +13,7 @@
 # FIXME: shouldn't have global variable.
 defarray SENDPR_state
 
-itcl_class Sendpr {
+itcl::class Sendpr {
   inherit Ide_window
 
   # This array holds information about this site.  It is a private
@@ -198,7 +198,8 @@ itcl_class Sendpr {
     grid rowconfigure  [namespace tail $this] 3 -weight 1
     grid columnconfigure  [namespace tail $this] 0 -weight 1
 
-    bind [namespace tail $this].buttons <Destroy> [list $this delete]
+    bind [namespace tail $this].buttons <Destroy> \
+	[itcl::code itcl::delete object $this]
 
     wm deiconify  [namespace tail $this]
   }
Index: library/ventry.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/ventry.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 ventry.tcl
--- library/ventry.tcl	8 Sep 2001 22:34:46 -0000	1.2
+++ library/ventry.tcl	22 Jul 2008 20:10:18 -0000
@@ -1,14 +1,14 @@
 # ventry.tcl - Entry with validation
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
-itcl_class Validated_entry {
+itcl::class Validated_entry {
   # The validation command.  It is passed the contents of the entry.
   # It should throw an error if there is a problem; the error text
   # will be displayed to the user.
-  public command {}
+  public variable command {}
 
-  constructor {config} {
+  constructor {} {
     upvar \#0 $this state
 
     # The standard widget-making trick.
@@ -26,7 +26,8 @@ itcl_class Validated_entry {
 
     bind [namespace tail $this].entry <Map> [list $this _map]
     bind [namespace tail $this].entry <Unmap> [list $this _unmap]
-    bind [namespace tail $this].entry <Destroy> [list $this delete]
+    bind [namespace tail $this].entry <Destroy> \
+	[itcl::code itcl::delete object $this]
     # We never want the focus on the frame.
     bind [namespace tail $this] <FocusIn> [list focus [namespace tail $this].entry]
 
@@ -56,8 +57,6 @@ itcl_class Validated_entry {
     unset state
   }
 
-  method configure {config} {}
-
   # Return 1 if we're in the error state, 0 otherwise.
   method is_error {} {
     upvar \#0 $this state
Index: library/wframe.tcl
===================================================================
RCS file: /cvs/src/src/libgui/library/wframe.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 wframe.tcl
--- library/wframe.tcl	8 Sep 2001 22:34:46 -0000	1.2
+++ library/wframe.tcl	22 Jul 2008 20:10:18 -0000
@@ -1,11 +1,11 @@
 # wframe.tcl - Frame with a widget on its border.
-# Copyright (C) 1997 Cygnus Solutions.
+# Copyright (C) 1997,2008 Red Hat, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 
-itcl_class Widgetframe {
+itcl::class Widgetframe {
   # Where to put the widget.  For now, we don't support many anchors.
   # Augment as you like.
-  public anchor nw {
+  public variable anchor nw {
     if {$anchor != "nw" && $anchor != "n"} then {
       error "anchors nw and n are the only ones supported"
     }
@@ -14,9 +14,9 @@ itcl_class Widgetframe {
 
   # The name of the widget to put on the frame.  This is set by some
   # subclass calling the _add method.  Private variable.
-  protected _widget {}
+  protected variable _widget {}
 
-  constructor {config} {
+  constructor {} {
     # The standard widget-making trick.
     set class [$this info class]
     set hull [namespace tail $this]
@@ -39,7 +39,8 @@ itcl_class Widgetframe {
     grid rowconfigure [namespace tail $this].iframe 1 -weight 1
     grid columnconfigure [namespace tail $this].iframe 0 -weight 1
 
-    bind [namespace tail $this].iframe <Destroy> [list $this delete]
+    bind [namespace tail $this].iframe <Destroy> \
+	[itcl::code itcl::delete object $this]
   }
 
   destructor {
Index: src/Makefile.am
===================================================================
RCS file: /cvs/src/src/libgui/src/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- src/Makefile.am	12 Feb 2003 04:18:53 -0000	1.8
+++ src/Makefile.am	22 Jul 2008 20:10:18 -0000
@@ -41,10 +41,8 @@ LIBGUI_CFLAGS=@LIBGUI_CFLAGS@
 
 ## Some of the files in this directory want to see Tk internals.
 ## Nasty.
-INCLUDES = $(LIBGUI_CFLAGS) $(TCLHDIR) \
-$(TKHDIR) \
-$(TK_XINCLUDES) $(TCL_DEFS) $(TK_DEFS) \
-$(TKHDIR)/../unix $(TKHDIR)/../win \
+INCLUDES = $(LIBGUI_CFLAGS) $(TCL_INCLUDES) \
+$(TK_INCLUDES) $(TK_XINCLUDES) $(TCL_DEFS) $(TK_DEFS) \
 -DTBL_VERSION=\"$(TBL_VERSION)\"\
 -DTBL_COMMAND=\"$(TBL_COMMAND)\"\
 -DTBL_RUNTIME=\"tkTable.tcl\" -DTBL_RUNTIME_DIR=\"$(guidir)\"\
Index: src/paths.c
===================================================================
RCS file: /cvs/src/src/libgui/src/paths.c,v
retrieving revision 1.6
diff -u -p -r1.6 paths.c
--- src/paths.c	5 Feb 2002 23:16:16 -0000	1.6
+++ src/paths.c	22 Jul 2008 20:10:18 -0000
@@ -1,5 +1,5 @@
 /* paths.c - Find IDE and application Tcl libraries.
-   Copyright (C) 1997 Cygnus Solutions.
+   Copyright (C) 1997, 2008 Red Hat, Inc.
    Written by Tom Tromey <tromey@cygnus.com>.  */
 
 #include <tk.h>
@@ -50,7 +50,6 @@
 static char init_script[] = "\
 proc initialize_paths {} {\n\
   global ide_application_name auto_path env Paths\n\
-  global tcl_library\n\
   rename initialize_paths {}\n\
   # First find the GUI library.\n\
   set guidirs {}\n\
@@ -93,7 +92,11 @@ proc initialize_paths {} {\n\
   set Paths(exec_prefix) [file dirname [pwd]]\n\
   cd $here\n\
   # Try to handle running from the build tree:\n\
-  lappend guidirs [file join [file dirname [file dirname $tcl_library]] libgui library]\n\
+  # We check for the two most common installations:\n\
+  # exec_dir/../ (if built in the source tree)\n\
+  # exec_dir/../../src (if using builddir & CVS)\n\
+  lappend guidirs [file join [file dirname $Paths(exec_prefix)] libgui library]\n\
+  lappend guidirs [file join [file dirname $Paths(exec_prefix)] src libgui library]\n\
   foreach sd $guidirs {\n\
     if {[file exists [file join $sd tclIndex]]} {\n\
       lappend auto_path $sd\n\
@@ -110,7 +113,7 @@ proc initialize_paths {} {\n\
     lappend idedirs [file join $d redhat ide]\n\
   }\n\
   # Try to handle running from the build tree:\n\
-  lappend idedirs [file join [file dirname [file dirname $tcl_library]] libide library]\n\
+  lappend idedirs [file join [file dirname [file dirname $::tcl_library]] libide library]\n\
   foreach sd $idedirs {\n\
     if {[file exists [file join $sd tclIndex]]} {\n\
       lappend auto_path $sd\n\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]