Blame config/ax_prog_javah.m4

Packit c04fcb
# ===========================================================================
Packit c04fcb
#       http://www.gnu.org/software/autoconf-archive/ax_prog_javah.html
Packit c04fcb
# ===========================================================================
Packit c04fcb
#
Packit c04fcb
# SYNOPSIS
Packit c04fcb
#
Packit c04fcb
#   AX_PROG_JAVAH
Packit c04fcb
#
Packit c04fcb
# DESCRIPTION
Packit c04fcb
#
Packit c04fcb
#   AX_PROG_JAVAH tests the availability of the javah header generator and
Packit c04fcb
#   looks for the jni.h header file. If available, JAVAH is set to the full
Packit c04fcb
#   path of javah and CPPFLAGS is updated accordingly.
Packit c04fcb
#
Packit c04fcb
# LICENSE
Packit c04fcb
#
Packit c04fcb
#   Copyright (c) 2008 Luc Maisonobe <luc@spaceroots.org>
Packit c04fcb
#
Packit c04fcb
#   Copying and distribution of this file, with or without modification, are
Packit c04fcb
#   permitted in any medium without royalty provided the copyright notice
Packit c04fcb
#   and this notice are preserved. This file is offered as-is, without any
Packit c04fcb
#   warranty.
Packit c04fcb
Packit c04fcb
#serial 7
Packit c04fcb
Packit c04fcb
AU_ALIAS([AC_PROG_JAVAH], [AX_PROG_JAVAH])
Packit c04fcb
AC_DEFUN([AX_PROG_JAVAH],[
Packit c04fcb
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
Packit c04fcb
AC_REQUIRE([AC_PROG_CPP])dnl
Packit c04fcb
AC_PATH_PROG(JAVAH,javah)
Packit c04fcb
AS_IF([test -n "$ac_cv_path_JAVAH"],
Packit c04fcb
      [
Packit c04fcb
        AC_TRY_CPP([#include <jni.h>],,[
Packit c04fcb
        ac_save_CPPFLAGS="$CPPFLAGS"
Packit c04fcb
        ax_prog_javah_bin_dir=`AS_DIRNAME([$ac_cv_path_JAVAH])`
Packit c04fcb
        ac_dir="`AS_DIRNAME([$ax_prog_javah_bin])`/include"
Packit c04fcb
        AS_CASE([$build_os],
Packit c04fcb
                [cygwin*],
Packit c04fcb
                [ac_machdep=win32],
Packit c04fcb
                [ac_machdep=`AS_ECHO($build_os) | sed 's,[[-0-9]].*,,'`])
Packit c04fcb
        CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep"
Packit c04fcb
        AC_TRY_CPP([#include <jni.h>],
Packit c04fcb
                   ac_save_CPPFLAGS="$CPPFLAGS",
Packit c04fcb
                   AC_MSG_WARN([unable to include <jni.h>]))
Packit c04fcb
        CPPFLAGS="$ac_save_CPPFLAGS"])
Packit c04fcb
      ])
Packit c04fcb
])