1 dnl @synopsis AC_PROG_JAVAH
3 dnl AC_PROG_JAVAH tests the availability of the javah header generator
4 dnl and looks for the jni.h header file. If available, JAVAH is set to
5 dnl the full path of javah and CPPFLAGS is updated accordingly.
8 dnl @author Luc Maisonobe <luc@spaceroots.org>
9 dnl @version 2002-03-25
10 dnl @license AllPermissive
12 AC_DEFUN([AC_PROG_JAVAH],[
13 AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
14 AC_REQUIRE([AC_PROG_CPP])dnl
15 AC_PATH_PROG(JAVAH,javah)
16 if test x"`eval 'echo $ac_cv_path_JAVAH'`" != x ; then
17 AC_TRY_CPP([#include <jni.h>],,[
18 ac_save_CPPFLAGS="$CPPFLAGS"
20 ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'`
21 ac_machdep=`echo $build_os | sed 's,[-0-9].*,,' | sed 's,cygwin,win32,'`
23 CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep"
24 AC_TRY_CPP([#include <jni.h>],
25 ac_save_CPPFLAGS="$CPPFLAGS",
26 AC_MSG_WARN([unable to include <jni.h>]))
27 CPPFLAGS="$ac_save_CPPFLAGS"])