public inbox for sourcenav@sourceware.org
 help / color / mirror / Atom feed
From: Ian Roxborough <irox@redhat.com>
To: freddyrojas@costarricense.com
Cc: sourcenav@sources.redhat.com
Subject: Re: source navigator patch for javac
Date: Wed, 17 Jan 2001 00:20:00 -0000	[thread overview]
Message-ID: <3A6555A4.7C0EB2C1@redhat.com> (raw)
In-Reply-To: <1245asd5asd78sajs>

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

Hi,

This isn't the "real way" to add tool chains (but given that 4.5.2
tool chains support is a bit hacky to say the least....).

You could create a tool chain in toolchain.tcl which would only
have JAVA support (i.e. only a Java toolchain)

This example is close to what you want:

# Sun Java compiler toolchain.

set sunjava [snToolChain SunJavaTarget]
$sunjava SetIsEmbedded 0
$sunjava SetShortName sunjava
$sunjava SetDebuggerName gdb
$sunjava AddRule JAVA .class.o javacc "-c $<"
$sunjava AddRuleInfo JAVA "Java" "Compile a Java file"

# does suns compiler need an entry point.
# $sunjava AddExeLinkerEntryPointFlag JAVA "--main="

$sunjava AddRuleSuffix JAVA .class

#DEBUG FLAGS
$sunjava AddRuleFlagSet JAVA Debug "" DBG_DEFAULT

#OPRIMIZATION FLAGS
$sunjava AddRuleFlagSet JAVA Optimize "" OPT_DEFAULT

#CODE GENERATION FLAGS
$sunjava AddRuleFlagSet JAVA CodeGen "" CG_DEFAULT

#WARNING FLAGS
$sunjava AddRuleFlagSet JAVA Warning "" WN_DEFAULT



You need to find all the hard coded bits for selecting
a tool chain (5.0 will handle this much better).

Another alternative would be to just modify the GNU java
compiler support to use the Sun Java compiler.

Anyway, hope this is of some use to you.
Thanks,
    Ian.


Jose Freddy Rojas Chavarria wrote:
> 
> 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
> 
>   ------------------------------------------------------------------------
>              Name: JAVACC
>    JAVACC    Type: Application/Octect-stream
>          Encoding: Base64
> 
>                             Name: PATCH-FOR-JAVAC.PATCH
>    PATCH-FOR-JAVAC.PATCH    Type: Application/Octect-stream
>                         Encoding: Base64

      reply	other threads:[~2001-01-17  0:20 UTC|newest]

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

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=3A6555A4.7C0EB2C1@redhat.com \
    --to=irox@redhat.com \
    --cc=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).