public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
* source navigator patch for javac
@ 2001-01-16 19:57 Jose Freddy Rojas Chavarria
  2001-01-17  0:20 ` Ian Roxborough
  0 siblings, 1 reply; 2+ messages in thread
From: Jose Freddy Rojas Chavarria @ 2001-01-16 19:57 UTC (permalink / raw)
  To: sourcenav

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3146 bytes --]

Hello.
I am using source navigator. And I have an option to use it with 
javac compiler of SUN in linux with the minimal of changes.

To be compatible with the gcc and gjc format I write a simple javacc script. 
It receive the gnu format and call javac in this way.


++++++++++++++++++javacc+++++++++++++++++++++++++++++
#!/bin/sh

case "$1" in
    "-c")
	javac "$2"
    ;;
    "-o")
    ;;
esac
++++++++++++++++++++++++ EOF ++++++++++++++++++++++++++++++++

Then I modify the file mkfilegen.tcl in order to check the name javacc as
the compiler and allow to work it ok in the same way that gjc.
The patch is



+++++++++++++++++++++++++++++mkfilegendiff.patch+++++++++++++++++++++++

*** mkfilegen.tcl	Thu Jan  4 06:56:02 2001
--- mkfilegen.tcl.origin	Mon Sep 11 12:48:34 2000
*************** itcl_class MakefileGen {
*** 33,39 ****
      # private date members
      protected b_target ""     ; # Build target object
      protected toolchain ""    ; # Use this toolchain
!     protected tooljava  ""    ;
  
      method constructor { target_name {tool_chain ""} {args "" }} {
  
--- 33,39 ----
      # private date members
      protected b_target ""     ; # Build target object
      protected toolchain ""    ; # Use this toolchain
! 
  
      method constructor { target_name {tool_chain ""} {args "" }} {
  
*************** itcl_class MakefileGen {
*** 283,291 ****
      method WriteMacroLINKER { file_d } {
          set linker [$b_target GetLinkerLocation]
          puts $file_d "LINKER = $linker"
- 	if { $linker == "javacc" } {
- 	      set tooljava "true"
-         }
  	
          set linkerflags [$b_target GetUserLinkFlags]
          puts $file_d "LINKER_FLAGS = $linkerflags"
--- 283,288 ----
*************** itcl_class MakefileGen {
*** 343,353 ****
          # Make the rule
  	puts $file_d "\nclean:"
  	foreach objext $objexts {
! 	    if { $tooljava == "true"} {
! 	      puts $file_d "\trm -f *.class"    
! 	    } else {
!               puts $file_d "\trm -f *$objext"
! 	    }
          }
  	     
          puts $file_d "\trm -f $outputfile"
--- 340,346 ----
          # Make the rule
  	puts $file_d "\nclean:"
  	foreach objext $objexts {
!             puts $file_d "\trm -f *$objext"
          }
  	     
          puts $file_d "\trm -f $outputfile"


++++++++++++++++++++++ EOF ++++++++++++++++++++++++++++++++

With this two changes I can select javacc as my java compiler and I add
in the project file (makefile) the main java file or the list of files and
sourcenavigator works as gcj compiler.

This is my simple way to do that. Please if you think it patch should be 
practical for you. Tell me please. It is preliminary, and it was my easy way
to avoid to compile gjc for now.

Tank you
Freddy Rojas





++++++++++++++++++++++++++++++++++++++++++
Eng. José Freddy Rojas Chavarría,MSC.
Research and Development Department
Instituto Costarricense de Electricidad
San Jose, Costa Rica.
(Utility company of Costa Rica)
freddy@ns.dgct.ice.go.cr
freddyrojas@costarricense.com
+++++++++++++++++++++++++++++++++++++++++++


_______________________________________
Yo me registré en www.costarricense.com


[-- Attachment #2: JAVACC --]
[-- Type: text/x-shellscript, Size: 75 bytes --]

#!/bin/sh

case "$1" in
    "-c")
	javac "$2"
    ;;
    "-o")
    ;;
esac

[-- Attachment #3: PATCH-FOR-JAVAC.PATCH --]
[-- Type: text/x-diff, Size: 1595 bytes --]

*** mkfilegen.tcl	Thu Jan  4 06:56:02 2001
--- mkfilegen.tcl.origin	Mon Sep 11 12:48:34 2000
*************** itcl_class MakefileGen {
*** 33,39 ****
      # private date members
      protected b_target ""     ; # Build target object
      protected toolchain ""    ; # Use this toolchain
!     protected tooljava  ""    ;
  
      method constructor { target_name {tool_chain ""} {args "" }} {
  
--- 33,39 ----
      # private date members
      protected b_target ""     ; # Build target object
      protected toolchain ""    ; # Use this toolchain
! 
  
      method constructor { target_name {tool_chain ""} {args "" }} {
  
*************** itcl_class MakefileGen {
*** 283,291 ****
      method WriteMacroLINKER { file_d } {
          set linker [$b_target GetLinkerLocation]
          puts $file_d "LINKER = $linker"
- 	if { $linker == "javacc" } {
- 	      set tooljava "true"
-         }
  	
          set linkerflags [$b_target GetUserLinkFlags]
          puts $file_d "LINKER_FLAGS = $linkerflags"
--- 283,288 ----
*************** itcl_class MakefileGen {
*** 343,353 ****
          # Make the rule
  	puts $file_d "\nclean:"
  	foreach objext $objexts {
! 	    if { $tooljava == "true"} {
! 	      puts $file_d "\trm -f *.class"    
! 	    } else {
!               puts $file_d "\trm -f *$objext"
! 	    }
          }
  	     
          puts $file_d "\trm -f $outputfile"
--- 340,346 ----
          # Make the rule
  	puts $file_d "\nclean:"
  	foreach objext $objexts {
!             puts $file_d "\trm -f *$objext"
          }
  	     
          puts $file_d "\trm -f $outputfile"

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2001-01-17  0:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-16 19:57 source navigator patch for javac Jose Freddy Rojas Chavarria
2001-01-17  0:20 ` Ian Roxborough

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).