X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=config%2Fax_prog_javah.m4;fp=config%2Fax_prog_javah.m4;h=2809f29cf879a293de7cae7d17893c53a08bd87c;hb=5c5aae82106abbb720b82bd8f10f22b69d738711;hp=0000000000000000000000000000000000000000;hpb=28ed962891cb7d32463aa9e8ced9d37a97eaea22;p=lttng-ust.git diff --git a/config/ax_prog_javah.m4 b/config/ax_prog_javah.m4 new file mode 100644 index 00000000..2809f29c --- /dev/null +++ b/config/ax_prog_javah.m4 @@ -0,0 +1,47 @@ +# =========================================================================== +# http://www.gnu.org/software/autoconf-archive/ax_prog_javah.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_PROG_JAVAH +# +# DESCRIPTION +# +# AX_PROG_JAVAH tests the availability of the javah header generator and +# looks for the jni.h header file. If available, JAVAH is set to the full +# path of javah and CPPFLAGS is updated accordingly. +# +# LICENSE +# +# Copyright (c) 2008 Luc Maisonobe +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +AU_ALIAS([AC_PROG_JAVAH], [AX_PROG_JAVAH]) +AC_DEFUN([AX_PROG_JAVAH],[ +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_CPP])dnl +AC_PATH_PROG(JAVAH,javah) +AS_IF([test -n "$ac_cv_path_JAVAH"], + [ + AC_TRY_CPP([#include ],,[ + ac_save_CPPFLAGS="$CPPFLAGS" + ax_prog_javah_bin_dir=`AS_DIRNAME([$ac_cv_path_JAVAH])` + ac_dir="`AS_DIRNAME([$ax_prog_javah_bin])`/include" + AS_CASE([$build_os], + [cygwin*], + [ac_machdep=win32], + [ac_machdep=`AS_ECHO($build_os) | sed 's,[[-0-9]].*,,'`]) + CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep" + AC_TRY_CPP([#include ], + ac_save_CPPFLAGS="$CPPFLAGS", + AC_MSG_WARN([unable to include ])) + CPPFLAGS="$ac_save_CPPFLAGS"]) + ]) +])