From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30070 invoked by alias); 23 Apr 2002 21:36:54 -0000 Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org Received: (qmail 30045 invoked from network); 23 Apr 2002 21:36:52 -0000 Received: from unknown (HELO gash2.peakpeak.com) (207.174.178.17) by sources.redhat.com with SMTP; 23 Apr 2002 21:36:52 -0000 Received: from creche.cygnus.com (ta0193.peakpeak.com [204.144.244.193] (may be forged)) by gash2.peakpeak.com (8.9.3/8.9.3) with ESMTP id PAA30500; Tue, 23 Apr 2002 15:36:48 -0600 Received: (from tromey@localhost) by creche.cygnus.com (8.9.3/8.9.3) id PAA23958; Tue, 23 Apr 2002 15:42:48 -0600 To: akos.szalay@sophos.com Cc: java@gcc.gnu.org Subject: Re: -D ? References: From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom X-Zippy: Now I need a suntan, a tennis lesson, Annette Funicello and two dozen Day-Glo orange paper jumpsuits!! Date: Tue, 23 Apr 2002 14:39:00 -0000 In-Reply-To: akos.szalay@sophos.com's message of "Tue, 23 Apr 2002 15:25:34 +0100" Message-ID: <873cxmf5wn.fsf@creche.redhat.com> X-SW-Source: 2002-04/txt/msg00325.txt.bz2 >>>>> "Akos" == akos szalay 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 Define a 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