]> git.sesse.net Git - vlc/blob - m4/ac_prog_javah.m4
* m4: added libtool macro files. Na.
[vlc] / m4 / ac_prog_javah.m4
1 dnl @synopsis AC_PROG_JAVAH
2 dnl
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.
6 dnl
7 dnl @category Java
8 dnl @author Luc Maisonobe <luc@spaceroots.org>
9 dnl @version 2002-03-25
10 dnl @license AllPermissive
11
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"
19 changequote(, )dnl
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,'`
22 changequote([, ])dnl
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"])
28 fi])