[BRLTTY] Error compiling from svn on mac: jni.h

Dave Mielke dave at mielke.cc
Sun Nov 26 21:34:09 EST 2006


[quoted lines by Samuel Thibault on 2006/11/26 at 20:10 +0100]

>Dave, when javac is found in /some/path/bin/javac, /some/path/include
>should be added in the include path.  

That'd only cover one of the (I think) five typical ways Java tends to be
installed:

1): gcj puts javac in /usr/bin and you simply trust that the C compiler puts
jni.h into the include path.

2): Java is installed somewhere (like /usr/java or /usr/java/jdk1.5.0) and you
just need to know that that's where it is. This is the typical setup people
have after installing, say, Sun Java.

3): Like 2, but symlinks are placed in /usr/bin/ which point to "/some/where". 
This is actually how Sun does it.

4): Like 2, but $JAVA_HOME is predefined to point to ".some.where".

5): Like 2, but /some/where/bin is added to $PATH by the system login profile.

>Or maybe we should just disable java by default since the jni.h path seems far
>from being standard.

I think the right solution is to make configure smart enough to know when it
fcan't find Java for real. My current thoughts are as follows:

If JAVA_HOME is set then assume that javac and friends (javadoc, jar, ...) are
in $JAVA_HOME/bin/ and that jni.h is in $JAva_HOME/include/.

If JAVA_HOME isn't set then test to see if JAVAC is in the current command
search order. If it is then check for jni.h via both AC_CHECK_HEADERS() and
$(JAVAC:/bin/javac=/include). If javac can't be found, or if it can be found
but jni.h can't be found, then don't build the Java bindings.

Can anyone think of any improvements to these huristics?

-- 
Dave Mielke           | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario   | Word of God. Please contact me
EMail: dave at mielke.cc | Canada  K2A 1H7   | if you're concerned about Hell.
http://FamilyRadio.com/                   | http://Mielke.cc/bible/


More information about the BRLTTY mailing list