This is the mail archive of the insight@sourceware.cygnus.com 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]

PATCH: Get Insight to start up if it is a link


Hi, all...

The following little patch will get Insight to start up even if the
executable is a link to the original gdb.  Note, if you move the
original gdb executable OUT of the install tree, then it will NOT
work.  But at least with this you can make a link to the executable,
and it will still find all the tcl library code.

Enjoy.

Jim

Index: gdb/gdbtk/library/util.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/util.tcl,v
retrieving revision 1.2
diff -p -r1.2 util.tcl
*** util.tcl	2000/03/10 23:39:10	1.2
--- util.tcl	2000/04/03 19:29:22
*************** proc find_iwidgets_library {} {
*** 244,249 ****
--- 244,256 ----
  
      set exec_name [info nameofexecutable]
      set curdir [pwd] 
+     if {[string compare [file type $exec_name] "link"] == 0} {
+       set exec_name [file readlink $exec_name]
+       if {[string compare [file pathtype $exec_name] "relative"] == 0} {
+ 	set exec_name [file join [pwd] $exec_name]
+       }
+     }
+     
      cd [file dirname $exec_name]
      set exec_name [pwd]
      cd $curdir
Index: libgui/src/paths.c
===================================================================
RCS file: /cvs/src/src/libgui/src/paths.c,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 paths.c
*** paths.c	2000/02/07 00:19:47	1.1.1.1
--- paths.c	2000/04/03 19:29:22
*************** proc initialize_paths {} {\n\
*** 59,65 ****
      lappend guidirs $env(CYGNUS_GUI_LIBRARY)\n\
    }\n\
    set here [pwd]\n\
!   cd [file dirname [info nameofexecutable]]\n\
    # Handle build with --exec-prefix and build without.\n\
    set d [file join [file dirname [pwd]] share]\n\
    lappend prefdirs $d\n\
--- 59,72 ----
      lappend guidirs $env(CYGNUS_GUI_LIBRARY)\n\
    }\n\
    set here [pwd]\n\
!   set exec_name [info nameofexecutable]\n\
!   if {[string compare [file type $exec_name] \"link\"] == 0} {\n\
!     set exec_name [file readlink $exec_name]\n\
!     if {[string compare [file pathtype $exec_name] \"relative\"] == 0} {\n\
!         set exec_name [file join [pwd] $exec_name]\n\
!     }\n\
!   }\n\
!   cd [file dirname $exec_name]\n\
    # Handle build with --exec-prefix and build without.\n\
    set d [file join [file dirname [pwd]] share]\n\
    lappend prefdirs $d\n\
*************** proc initialize_paths {} {\n\
*** 165,171 ****
    rename initialize_paths {}\n\
    set guidirs {}\n\
    set here [pwd]\n\
!   cd [file dirname [info nameofexecutable]]\n\
    set d [file join [file dirname [pwd]] share]\n\
    lappend guidirs [file join $d cygnus gui]\n\
    set d [file join [file dirname [file dirname [pwd]]] share]\n\
--- 172,185 ----
    rename initialize_paths {}\n\
    set guidirs {}\n\
    set here [pwd]\n\
!   set exec_name [info nameofexecutable]\n\
!   if {[string compare [file type $exec_name] \"link\"] == 0} {\n\
!     set exec_name [file readlink $exec_name]\n\
!     if {[string compare [file pathtype $exec_name] \"relative\"] == 0} {\n\
!       set execName [file join [pwd] $exec_name]\n\
!     }\n\
!   }\n\
!   cd [file dirname $exe_name]\n\
    set d [file join [file dirname [pwd]] share]\n\
    lappend guidirs [file join $d cygnus gui]\n\
    set d [file join [file dirname [file dirname [pwd]]] share]\n\
Index: tcl/generic/tclInitScript.h
===================================================================
RCS file: /cvs/src/src/tcl/generic/tclInitScript.h,v
retrieving revision 1.1.1.1
diff -p -r1.1.1.1 tclInitScript.h
*** tclInitScript.h	1999/11/09 01:28:43	1.1.1.1
--- tclInitScript.h	2000/04/03 19:29:22
*************** static char initScript[] = "if {[info pr
*** 76,85 ****
  	if {[info exists env(TCL_LIBRARY)]} {\n\
  	    lappend dirs $env(TCL_LIBRARY)\n\
  	}\n\
!         # CYGNUS LOCAL: I've changed this alot.  Basically we only care about two cases,\n\
          # if we are installed, and if we are in the devo tree...\n\
          # The next few are for if we are installed:\n\
! 	set parentDir [file dirname [file dirname [info nameofexecutable]]]\n\
          lappend dirs [file join $parentDir share tcl$tcl_version]\n\
  	lappend dirs [file join [file dirname $parentDir] share tcl$tcl_version]\n\
          # NOW, let's try to find it in the build tree...\n\
--- 76,96 ----
  	if {[info exists env(TCL_LIBRARY)]} {\n\
  	    lappend dirs $env(TCL_LIBRARY)\n\
  	}\n\
!         # CYGNUS LOCAL: I've changed this alot.  \n\
!         # Basically we only care about two cases,\n\
          # if we are installed, and if we are in the devo tree...\n\
          # The next few are for if we are installed:\n\
!         # NB. We also want this to work if the user is actually\n\
!         # running a link and not the actual program.  So look for a\n\
!         # link and chase it down to its source.\n\
!         set execName [info nameofexecutable]\n\
!         if {[string compare [file type $execName] \"link\"] == 0} {\n\
!             set execName [file readlink $execName]\n\
!             if {[string compare [file pathtype $execName] \"relative\"] == 0} {\n\
!               set execName [file join [pwd] $execName]\n\
!             }\n\
!         }\n\
! 	set parentDir [file dirname [file dirname $execName]]\n\
          lappend dirs [file join $parentDir share tcl$tcl_version]\n\
  	lappend dirs [file join [file dirname $parentDir] share tcl$tcl_version]\n\
          # NOW, let's try to find it in the build tree...\n\
*************** static char initScript[] = "if {[info pr
*** 92,98 ****
          lappend configDirs [file join [file dirname $parentDir] tcl$tcl_version $tcl_platform(platform)]\n\
          lappend configDirs [file join [file dirname $parentDir] tcl             $tcl_platform(platform)]\n\
          # This one gets tclsh...\n\
!         lappend configDirs [info nameofexecutable]\n\
          # This one is for gdb, and any other app which has its executible in the top directory.\n\
          lappend configDirs [file join $parentDir tcl$tcl_version $tcl_platform(platform)]\n\
          lappend configDirs [file join $parentDir tcl             $tcl_platform(platform)]\n\
--- 103,109 ----
          lappend configDirs [file join [file dirname $parentDir] tcl$tcl_version $tcl_platform(platform)]\n\
          lappend configDirs [file join [file dirname $parentDir] tcl             $tcl_platform(platform)]\n\
          # This one gets tclsh...\n\
!         lappend configDirs $execName \n\
          # This one is for gdb, and any other app which has its executible in the top directory.\n\
          lappend configDirs [file join $parentDir tcl$tcl_version $tcl_platform(platform)]\n\
          lappend configDirs [file join $parentDir tcl             $tcl_platform(platform)]\n\

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