automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditionally compiling Java


From: Alexandre Duret-Lutz
Subject: Re: Conditionally compiling Java
Date: Tue, 11 Jun 2002 10:04:49 +0200
User-agent: Gnus/5.090006 (Oort Gnus v0.06) Emacs/21.2 (i386-debian-linux-gnu)

>>> "Braden" == Braden McDaniel <address@hidden> writes:

 Braden> I'm trying to conditionally compile some Java sources
 Braden> (with javac) using an Automake conditional:

 Braden> JAVAROOT = $(top_builddir)/java
    
 Braden> JAVA_FILES = MyClass1.java MyClass2.java
    
 Braden> if WITH_JDK
 Braden> noinst_JAVA = $(JAVA_FILES)
 Braden> endif
    
 Braden> EXTRA_DIST = $(JAVA_FILES)

 Braden> I am having trouble when the condition is false. If
 Braden> JAVAROOT is defined outside the conditional (as above),
 Braden> I get this error:

 Braden> 
CLASSPATH=../../../java:../../../../java/vrml/field/../../../java:$CLASSPATH  
-d ../../../java \        
 Braden> /bin/sh: -d: command not found

I can't reproduce this.  Have you overridden $(JAVAC) somewhere?  
Here is the test case I've used:

#! /bin/sh

# Make sure conditional Java works.
# Report from Braden McDaniel.

required=gcj
. $srcdir/defs || exit 1

set -e

cat >> configure.in << 'END'
AM_PROG_GCJ
AM_CONDITIONAL(WITH_JDK, true)
AC_OUTPUT
END

cat > Makefile.am << 'END'
JAVAROOT = $(top_builddir)/java

JAVA_FILES = MyClass1.java

if WITH_JDK
noinst_JAVA = $(JAVA_FILES)
endif

EXTRA_DIST = $(JAVA_FILES)
END

cat >MyClass1.java <<'EOF'
public class MyClass1
{
}
EOF

mkdir java

$ACLOCAL
$AUTOCONF
$AUTOMAKE
./configure GCJ=gcj
$MAKE

    
 Braden> If the JAVAROOT definition is moved inside the
 Braden> conditional, I get this error:

This error is ok.  Simply don't define JAVAROOT conditionally.

-- 
Alexandre Duret-Lutz




reply via email to

[Prev in Thread] Current Thread [Next in Thread]