public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: "Jose Freddy Rojas Chavarria" <freddyrojas@costarricense.com>
To: sourcenav@sources.redhat.com
Subject: source navigator patch for javac
Date: Tue, 16 Jan 2001 19:57:00 -0000	[thread overview]
Message-ID: <1245asd5asd78sajs> (raw)

[-- 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"

             reply	other threads:[~2001-01-16 19:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-16 19:57 Jose Freddy Rojas Chavarria [this message]
2001-01-17  0:20 ` Ian Roxborough

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245asd5asd78sajs \
    --to=freddyrojas@costarricense.com \
    --cc=sourcenav@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).