Don't forget that you can use wildcards in the for loop. For eg.
for i in $CLASSPATH \
/usr/local/* \
/*/*
do
if test -r jni.h
then
fi
done
It can still add up to a lot of directories, at least there is a bound on the
number of levels down it will go. As for which directories....start with the
ones that _you_ need. It's pretty easy to add directories once the logic to
search is in there. Personally, I don't care. As long as it gives up within a
reasonable amount of time, and compiles without java, because it ain't going to
find it on any of my systems in the forseeable future.
On 07-Dec-99 at 22:01, David Thompson ([EMAIL PROTECTED]) wrote:
> I will try to work on this tomorrow. Any suggestions as to a list of paths
> to try? Every path I have is completely random (/scratch/J.1.1.5,
> /usr/local/JDK1.2.2, /usr/java1.2, /usr/local/J1.1.8?)
>
> I will use some of Pete's code to do a search but if the compiler found is
> not "javac", I will have it skip--ie the others don't handle -verbose.
>
> Typically for java, you set a CLASSPATH environment variable to
> distinguish where your directories, jar and zip files are; this is gcj
> uses in order to find the classes.zip. Anybody want to suggest an
> environment variable for the JNI search stuff? It will require two
> directories and the final string we need will look like "-I/path2jni.h
> -I/path2jni_md.h".
>
> David
>
> On Tue, 7 Dec 1999 [EMAIL PROTECTED] wrote:
>
> > It seems to me that it there's an appropriate environment variable, then
> > it ought to be tried. If not, then maybe use Pete's approach. If that
> > fails, then fall back on the AC_PATH_X approach - simply a built in list
> > of places to look that gets extended as needed. AC_PATH_X lists 25 places
> > to look.
> > Greg
> >
> > David Thompson <[EMAIL PROTECTED]>@opendx.watson.ibm.com on 12/07/99
> > 02:15:35 PM
> >
> > Please respond to [email protected]
> >
> > Sent by: [EMAIL PROTECTED]
> >
> >
>
> --------------------------------------------------------------------
> David L. Thompson e-mail:[EMAIL PROTECTED]
> University of Montana/CS Department
> Missoula, MT 59812
> Work Phone : (406)243-4793