Merge pull request #5001 from ggouaillardet/topic/javah
configury: use javac vs javah whenever possible.
Этот коммит содержится в:
Коммит
5e12e0f2e5
@ -15,7 +15,7 @@ dnl reserved.
|
|||||||
dnl Copyright (c) 2007-2012 Oracle and/or its affiliates. All rights reserved.
|
dnl Copyright (c) 2007-2012 Oracle and/or its affiliates. All rights reserved.
|
||||||
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
|
dnl Copyright (c) 2008-2013 Cisco Systems, Inc. All rights reserved.
|
||||||
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
|
dnl Copyright (c) 2013 Intel, Inc. All rights reserved.
|
||||||
dnl Copyright (c) 2015 Research Organization for Information Science
|
dnl Copyright (c) 2015-2018 Research Organization for Information Science
|
||||||
dnl and Technology (RIST). All rights reserved.
|
dnl and Technology (RIST). All rights reserved.
|
||||||
dnl Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
dnl Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
||||||
dnl $COPYRIGHT$
|
dnl $COPYRIGHT$
|
||||||
@ -37,7 +37,7 @@ AC_DEFUN([OPAL_SETUP_JAVA_BANNER],[
|
|||||||
AC_DEFUN([OPAL_SETUP_JAVA],[
|
AC_DEFUN([OPAL_SETUP_JAVA],[
|
||||||
AC_REQUIRE([OPAL_SETUP_JAVA_BANNER])
|
AC_REQUIRE([OPAL_SETUP_JAVA_BANNER])
|
||||||
|
|
||||||
OPAL_VAR_SCOPE_PUSH([opal_java_bad opal_java_found opal_java_dir opal_java_jnih opal_java_PATH_save opal_java_CPPFLAGS_save])
|
OPAL_VAR_SCOPE_PUSH([opal_java_bad opal_javah_happy opal_java_found opal_java_dir opal_java_jnih opal_java_PATH_save opal_java_CPPFLAGS_save])
|
||||||
AC_ARG_ENABLE(java,
|
AC_ARG_ENABLE(java,
|
||||||
AC_HELP_STRING([--enable-java],
|
AC_HELP_STRING([--enable-java],
|
||||||
[Enable Java-based support in the system - use this option to disable all Java-based compiler tests (default: enabled)]))
|
[Enable Java-based support in the system - use this option to disable all Java-based compiler tests (default: enabled)]))
|
||||||
@ -161,13 +161,13 @@ AC_DEFUN([OPAL_SETUP_JAVA],[
|
|||||||
AS_IF([test -n "$with_jdk_bindir" && test "$with_jdk_bindir" != "yes" && test "$with_jdk_bindir" != "no"],
|
AS_IF([test -n "$with_jdk_bindir" && test "$with_jdk_bindir" != "yes" && test "$with_jdk_bindir" != "no"],
|
||||||
[PATH="$with_jdk_bindir:$PATH"])
|
[PATH="$with_jdk_bindir:$PATH"])
|
||||||
AC_PATH_PROG(JAVAC, javac)
|
AC_PATH_PROG(JAVAC, javac)
|
||||||
AC_PATH_PROG(JAVAH, javah)
|
|
||||||
AC_PATH_PROG(JAR, jar)
|
AC_PATH_PROG(JAR, jar)
|
||||||
AC_PATH_PROG(JAVADOC, javadoc)
|
AC_PATH_PROG(JAVADOC, javadoc)
|
||||||
|
AC_PATH_PROG(JAVAH, javah)
|
||||||
PATH=$opal_java_PATH_save
|
PATH=$opal_java_PATH_save
|
||||||
|
|
||||||
# Check to see if we have all 4 programs.
|
# Check to see if we have all 3 programs.
|
||||||
AS_IF([test -z "$JAVAC" || test -z "$JAVAH" || test -z "$JAR" || test -z "$JAVADOC"],
|
AS_IF([test -z "$JAVAC" || test -z "$JAR" || test -z "$JAVADOC"],
|
||||||
[opal_java_happy=no
|
[opal_java_happy=no
|
||||||
HAVE_JAVA_SUPPORT=0],
|
HAVE_JAVA_SUPPORT=0],
|
||||||
[opal_java_happy=yes
|
[opal_java_happy=yes
|
||||||
@ -178,6 +178,21 @@ AC_DEFUN([OPAL_SETUP_JAVA],[
|
|||||||
[opal_java_CPPFLAGS_save=$CPPFLAGS
|
[opal_java_CPPFLAGS_save=$CPPFLAGS
|
||||||
# silence a stupid Mac warning
|
# silence a stupid Mac warning
|
||||||
CPPFLAGS="$CPPFLAGS -DTARGET_RT_MAC_CFM=0"
|
CPPFLAGS="$CPPFLAGS -DTARGET_RT_MAC_CFM=0"
|
||||||
|
AC_MSG_CHECKING([javac -h])
|
||||||
|
cat > Conftest.java << EOF
|
||||||
|
public final class Conftest {
|
||||||
|
public native void conftest();
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
AS_IF([$JAVAC -d . -h . Conftest.java > /dev/null 2>&1],
|
||||||
|
[AC_MSG_RESULT([yes])],
|
||||||
|
[AC_MSG_RESULT([no])
|
||||||
|
AS_IF([test -n "$JAVAH"],
|
||||||
|
[opal_javah_happy=yes],
|
||||||
|
[opal_java_happy=no])])
|
||||||
|
rm -f Conftest.java Conftest.class Conftest.h
|
||||||
|
|
||||||
|
|
||||||
AS_IF([test -n "$with_jdk_headers" && test "$with_jdk_headers" != "yes" && test "$with_jdk_headers" != "no"],
|
AS_IF([test -n "$with_jdk_headers" && test "$with_jdk_headers" != "yes" && test "$with_jdk_headers" != "no"],
|
||||||
[OPAL_JDK_CPPFLAGS="-I$with_jdk_headers"
|
[OPAL_JDK_CPPFLAGS="-I$with_jdk_headers"
|
||||||
# Some flavors of JDK also require -I<blah>/linux.
|
# Some flavors of JDK also require -I<blah>/linux.
|
||||||
@ -216,5 +231,6 @@ AC_DEFUN([OPAL_SETUP_JAVA],[
|
|||||||
|
|
||||||
AC_DEFINE_UNQUOTED([OPAL_HAVE_JAVA_SUPPORT], [$HAVE_JAVA_SUPPORT], [do we have Java support])
|
AC_DEFINE_UNQUOTED([OPAL_HAVE_JAVA_SUPPORT], [$HAVE_JAVA_SUPPORT], [do we have Java support])
|
||||||
AM_CONDITIONAL(OPAL_HAVE_JAVA_SUPPORT, test "$opal_java_happy" = "yes")
|
AM_CONDITIONAL(OPAL_HAVE_JAVA_SUPPORT, test "$opal_java_happy" = "yes")
|
||||||
|
AM_CONDITIONAL(OPAL_HAVE_JAVAH_SUPPORT, test "$opal_javah_happy" = "yes")
|
||||||
OPAL_VAR_SCOPE_POP
|
OPAL_VAR_SCOPE_POP
|
||||||
])
|
])
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
# Copyright (c) 2015 Los Alamos National Security, LLC. All rights
|
||||||
# reserved.
|
# reserved.
|
||||||
# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
# Copyright (c) 2017 FUJITSU LIMITED. All rights reserved.
|
||||||
|
# Copyright (c) 2018 Research Organization for Information Science
|
||||||
|
# and Technology (RIST). All rights reserved.
|
||||||
# $COPYRIGHT$
|
# $COPYRIGHT$
|
||||||
#
|
#
|
||||||
# Additional copyrights may follow
|
# Additional copyrights may follow
|
||||||
@ -74,7 +76,6 @@ if OMPI_WANT_JAVA_BINDINGS
|
|||||||
# from JAVA_SRC_FILES.
|
# from JAVA_SRC_FILES.
|
||||||
JAVA_H = \
|
JAVA_H = \
|
||||||
mpi_MPI.h \
|
mpi_MPI.h \
|
||||||
mpi_CartParms.h \
|
|
||||||
mpi_CartComm.h \
|
mpi_CartComm.h \
|
||||||
mpi_Comm.h \
|
mpi_Comm.h \
|
||||||
mpi_Constant.h \
|
mpi_Constant.h \
|
||||||
@ -82,7 +83,6 @@ JAVA_H = \
|
|||||||
mpi_Datatype.h \
|
mpi_Datatype.h \
|
||||||
mpi_Errhandler.h \
|
mpi_Errhandler.h \
|
||||||
mpi_File.h \
|
mpi_File.h \
|
||||||
mpi_GraphParms.h \
|
|
||||||
mpi_GraphComm.h \
|
mpi_GraphComm.h \
|
||||||
mpi_Group.h \
|
mpi_Group.h \
|
||||||
mpi_Info.h \
|
mpi_Info.h \
|
||||||
@ -92,9 +92,7 @@ JAVA_H = \
|
|||||||
mpi_Op.h \
|
mpi_Op.h \
|
||||||
mpi_Prequest.h \
|
mpi_Prequest.h \
|
||||||
mpi_Request.h \
|
mpi_Request.h \
|
||||||
mpi_ShiftParms.h \
|
|
||||||
mpi_Status.h \
|
mpi_Status.h \
|
||||||
mpi_Version.h \
|
|
||||||
mpi_Win.h
|
mpi_Win.h
|
||||||
|
|
||||||
# A little verbosity magic; see Makefile.ompi-rules for an explanation.
|
# A little verbosity magic; see Makefile.ompi-rules for an explanation.
|
||||||
@ -140,6 +138,7 @@ ompi__v_JAVADOC_QUIET_0 = -quiet
|
|||||||
# in. This, along with the fact that the .java files seem to have
|
# in. This, along with the fact that the .java files seem to have
|
||||||
# circular references, prevents us from using a .foo.bar: generic
|
# circular references, prevents us from using a .foo.bar: generic
|
||||||
# Makefile rule. :-(
|
# Makefile rule. :-(
|
||||||
|
if OPAL_HAVE_JAVAH_SUPPORT
|
||||||
mpi/MPI.class: $(JAVA_SRC_FILES)
|
mpi/MPI.class: $(JAVA_SRC_FILES)
|
||||||
$(OMPI_V_JAVAC) CLASSPATH=. ; \
|
$(OMPI_V_JAVAC) CLASSPATH=. ; \
|
||||||
export CLASSPATH ; \
|
export CLASSPATH ; \
|
||||||
@ -148,11 +147,18 @@ mpi/MPI.class: $(JAVA_SRC_FILES)
|
|||||||
# Similar to above, all the generated .h files are dependent upon the
|
# Similar to above, all the generated .h files are dependent upon the
|
||||||
# token mpi/MPI.class file. Hence, all the classes will be generated
|
# token mpi/MPI.class file. Hence, all the classes will be generated
|
||||||
# first, then we'll individually generate each of the .h files.
|
# first, then we'll individually generate each of the .h files.
|
||||||
|
|
||||||
$(JAVA_H): mpi/MPI.class
|
$(JAVA_H): mpi/MPI.class
|
||||||
$(OMPI_V_JAVAH) sourcename=mpi.`echo $@ | sed -e s/^mpi_// -e s/.h$$//`; \
|
$(OMPI_V_JAVAH) sourcename=mpi.`echo $@ | sed -e s/^mpi_// -e s/.h$$//`; \
|
||||||
CLASSPATH=. ; \
|
CLASSPATH=. ; \
|
||||||
export CLASSPATH ; \
|
export CLASSPATH ; \
|
||||||
$(JAVAH) -d . -jni $$sourcename
|
$(JAVAH) -d . -jni $$sourcename
|
||||||
|
else
|
||||||
|
mpi/MPI.class: $(JAVA_SRC_FILES)
|
||||||
|
$(OMPI_V_JAVAC) CLASSPATH=. ; \
|
||||||
|
export CLASSPATH ; \
|
||||||
|
$(JAVAC) -h . -d . $(top_srcdir)/ompi/mpi/java/java/*.java
|
||||||
|
endif # OPAL_HAVE_JAVAH_SUPPORT
|
||||||
|
|
||||||
# Generate the .jar file from all the class files. List mpi/MPI.class
|
# Generate the .jar file from all the class files. List mpi/MPI.class
|
||||||
# as a dependency so that it fires the rule above that will generate
|
# as a dependency so that it fires the rule above that will generate
|
||||||
@ -171,7 +177,11 @@ java_DATA = mpi.jar
|
|||||||
# List all the header files in BUILT_SOURCES so that Automake's "all"
|
# List all the header files in BUILT_SOURCES so that Automake's "all"
|
||||||
# target will build them. This will also force the building of the
|
# target will build them. This will also force the building of the
|
||||||
# mpi/*.class files (for the jar file).
|
# mpi/*.class files (for the jar file).
|
||||||
|
if OPAL_HAVE_JAVAH_SUPPORT
|
||||||
BUILT_SOURCES = $(JAVA_H) doc
|
BUILT_SOURCES = $(JAVA_H) doc
|
||||||
|
else
|
||||||
|
BUILT_SOURCES = mpi/MPI.class doc
|
||||||
|
endif
|
||||||
|
|
||||||
# Convenience for building Javadoc docs
|
# Convenience for building Javadoc docs
|
||||||
jdoc: doc
|
jdoc: doc
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user