public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: akos.szalay@sophos.com
Cc: java@gcc.gnu.org
Subject: Re: -D ?
Date: Tue, 23 Apr 2002 14:39:00 -0000	[thread overview]
Message-ID: <873cxmf5wn.fsf@creche.redhat.com> (raw)
In-Reply-To: akos.szalay@sophos.com's message of "Tue, 23 Apr 2002 15:25:34 +0100"

>>>>> "Akos" == akos szalay <akos.szalay@sophos.com> writes:

Akos> What does the -D switch do ?

From the manual:

    @item -D@var{name}[=@var{value}]
    This option can only be used with @code{--main}.  It defines a system
    property named @var{name} with value @var{value}.  If @var{value} is not
    specified then it defaults to the empty string.  These system properties
    are initialized at the program's startup and can be retrieved at runtime
    using the @code{java.lang.System.getProperty} method.

The manual ought to be online somewhere, but to be honest I've never
checked.

Akos> In the help it says "-D<macro> Define a <macro> with string '1'
Akos> as its value", which is what I need, but when using it, I get an
Akos> error "can't specify '-D' without '--main'.

Yes.  You're reading the definition for C/C++, which is different.
Java doesn't have macros, so that definition of -D makes no sense for gcj.

Akos> I try to compile together java and c code by using JNI (which
Akos> works just fine in the version from 17/12/2001 - in 3.0.4 it
Akos> seems to be broken).  So what does the -D switch do, and what
Akos> should I use instead to define a macro ?

If you're compiling C code you should invoke `gcc'.  If you're
compiling C++ you should invoke `g++'.  Both of these will accept -D
in the way you expect.  gcj should only be used for compiling Java
code (either .java, .class, or resource files with --resource).

Akos> BTW, any estimation on the release of 3.1 ?

Soon, as soon as the critical bugs are fixed.  A prerelease came out
today.

Tom

  reply	other threads:[~2002-04-23 21:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23  9:38 akos.szalay
2002-04-23 14:39 ` Tom Tromey [this message]
2002-04-23 16:59   ` Bryce McKinlay
2002-04-23 18:57     ` Tom Tromey

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=873cxmf5wn.fsf@creche.redhat.com \
    --to=tromey@redhat.com \
    --cc=akos.szalay@sophos.com \
    --cc=java@gcc.gnu.org \
    /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).