forked from ceph/ceph
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configure.ac: check for org.junit.rules.ExternalResource
Check for org.junit.rules.ExternalResource if build with --enable-cephfs-java and --with-debug. Checking for junit4 isn't enough since junit4 has this class not before 4.7. Added some m4 files to get some JAVA related macros. Changed autogen.sh to work with local m4 files/macros. Signed-off-by: Danny Al-Gaaf <[email protected]>
- Loading branch information
Showing
14 changed files
with
615 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
dnl @synopsis AC_CHECK_CLASS | ||
dnl | ||
dnl AC_CHECK_CLASS tests the existence of a given Java class, either in | ||
dnl a jar or in a '.class' file. | ||
dnl | ||
dnl *Warning*: its success or failure can depend on a proper setting of | ||
dnl the CLASSPATH env. variable. | ||
dnl | ||
dnl Note: This is part of the set of autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download the whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. The general documentation, as well as the sample | ||
dnl configure.in, is included in the AC_PROG_JAVA macro. | ||
dnl | ||
dnl @category Java | ||
dnl @author Stephane Bortzmeyer <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license GPLWithACException | ||
|
||
AC_DEFUN([AC_CHECK_CLASS],[ | ||
AC_REQUIRE([AC_PROG_JAVA]) | ||
ac_var_name=`echo $1 | sed 's/\./_/g'` | ||
dnl Normaly I'd use a AC_CACHE_CHECK here but since the variable name is | ||
dnl dynamic I need an extra level of extraction | ||
AC_MSG_CHECKING([for $1 class]) | ||
AC_CACHE_VAL(ac_cv_class_$ac_var_name, [ | ||
if test x$ac_cv_prog_uudecode_base64 = xyes; then | ||
dnl /** | ||
dnl * Test.java: used to test dynamicaly if a class exists. | ||
dnl */ | ||
dnl public class Test | ||
dnl { | ||
dnl | ||
dnl public static void | ||
dnl main( String[] argv ) | ||
dnl { | ||
dnl Class lib; | ||
dnl if (argv.length < 1) | ||
dnl { | ||
dnl System.err.println ("Missing argument"); | ||
dnl System.exit (77); | ||
dnl } | ||
dnl try | ||
dnl { | ||
dnl lib = Class.forName (argv[0]); | ||
dnl } | ||
dnl catch (ClassNotFoundException e) | ||
dnl { | ||
dnl System.exit (1); | ||
dnl } | ||
dnl lib = null; | ||
dnl System.exit (0); | ||
dnl } | ||
dnl | ||
dnl } | ||
cat << \EOF > Test.uue | ||
begin-base64 644 Test.class | ||
yv66vgADAC0AKQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE | ||
bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51 | ||
bWJlclRhYmxlDAAKAAsBAANlcnIBABVMamF2YS9pby9QcmludFN0cmVhbTsJ | ||
AA0ACQcADgEAEGphdmEvbGFuZy9TeXN0ZW0IABABABBNaXNzaW5nIGFyZ3Vt | ||
ZW50DAASABMBAAdwcmludGxuAQAVKExqYXZhL2xhbmcvU3RyaW5nOylWCgAV | ||
ABEHABYBABNqYXZhL2lvL1ByaW50U3RyZWFtDAAYABkBAARleGl0AQAEKEkp | ||
VgoADQAXDAAcAB0BAAdmb3JOYW1lAQAlKExqYXZhL2xhbmcvU3RyaW5nOylM | ||
amF2YS9sYW5nL0NsYXNzOwoAHwAbBwAgAQAPamF2YS9sYW5nL0NsYXNzBwAi | ||
AQAgamF2YS9sYW5nL0NsYXNzTm90Rm91bmRFeGNlcHRpb24BAAY8aW5pdD4B | ||
AAMoKVYMACMAJAoAAwAlAQAKU291cmNlRmlsZQEACVRlc3QuamF2YQAhAAEA | ||
AwAAAAAAAgAJAAUABgABAAcAAABtAAMAAwAAACkqvgSiABCyAAwSD7YAFBBN | ||
uAAaKgMyuAAeTKcACE0EuAAaAUwDuAAasQABABMAGgAdACEAAQAIAAAAKgAK | ||
AAAACgAAAAsABgANAA4ADgATABAAEwASAB4AFgAiABgAJAAZACgAGgABACMA | ||
JAABAAcAAAAhAAEAAQAAAAUqtwAmsQAAAAEACAAAAAoAAgAAAAQABAAEAAEA | ||
JwAAAAIAKA== | ||
==== | ||
EOF | ||
if uudecode$EXEEXT Test.uue; then | ||
: | ||
else | ||
echo "configure: __oline__: uudecode had trouble decoding base 64 file 'Test.uue'" >&AC_FD_CC | ||
echo "configure: failed file was:" >&AC_FD_CC | ||
cat Test.uue >&AC_FD_CC | ||
ac_cv_prog_uudecode_base64=no | ||
fi | ||
rm -f Test.uue | ||
if AC_TRY_COMMAND($JAVA $JAVAFLAGS Test $1) >/dev/null 2>&1; then | ||
eval "ac_cv_class_$ac_var_name=yes" | ||
else | ||
eval "ac_cv_class_$ac_var_name=no" | ||
fi | ||
rm -f Test.class | ||
else | ||
AC_TRY_COMPILE_JAVA([$1], , [eval "ac_cv_class_$ac_var_name=yes"], | ||
[eval "ac_cv_class_$ac_var_name=no"]) | ||
fi | ||
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" | ||
eval "HAVE_$ac_var_name=$`echo ac_cv_class_$ac_var_val`" | ||
HAVE_LAST_CLASS=$ac_var_val | ||
if test x$ac_var_val = xyes; then | ||
ifelse([$2], , :, [$2]) | ||
else | ||
ifelse([$3], , :, [$3]) | ||
fi | ||
]) | ||
dnl for some reason the above statment didn't fall though here? | ||
dnl do scripts have variable scoping? | ||
eval "ac_var_val=$`eval echo ac_cv_class_$ac_var_name`" | ||
AC_MSG_RESULT($ac_var_val) | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
dnl @synopsis AC_CHECK_CLASSPATH | ||
dnl | ||
dnl AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification | ||
dnl of the user. | ||
dnl | ||
dnl Note: This is part of the set of autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download the whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. The general documentation, as well as the sample | ||
dnl configure.in, is included in the AC_PROG_JAVA macro. | ||
dnl | ||
dnl @category Java | ||
dnl @author Stephane Bortzmeyer <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license GPLWithACException | ||
|
||
AC_DEFUN([AC_CHECK_CLASSPATH],[ | ||
if test "x$CLASSPATH" = x; then | ||
echo "You have no CLASSPATH, I hope it is good" | ||
else | ||
echo "You have CLASSPATH $CLASSPATH, hope it is correct" | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
dnl @synopsis AC_CHECK_RQRD_CLASS | ||
dnl | ||
dnl AC_CHECK_RQRD_CLASS tests the existence of a given Java class, | ||
dnl either in a jar or in a '.class' file and fails if it doesn't | ||
dnl exist. Its success or failure can depend on a proper setting of the | ||
dnl CLASSPATH env. variable. | ||
dnl | ||
dnl Note: This is part of the set of autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download the whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. The general documentation, as well as the sample | ||
dnl configure.in, is included in the AC_PROG_JAVA macro. | ||
dnl | ||
dnl @category Java | ||
dnl @author Stephane Bortzmeyer <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license GPLWithACException | ||
|
||
AC_DEFUN([AC_CHECK_RQRD_CLASS],[ | ||
CLASS=`echo $1|sed 's/\./_/g'` | ||
AC_CHECK_CLASS($1) | ||
if test "$HAVE_LAST_CLASS" = "no"; then | ||
AC_MSG_ERROR([Required class $1 missing, exiting.]) | ||
fi | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
dnl @synopsis AC_JAVA_OPTIONS | ||
dnl | ||
dnl AC_JAVA_OPTIONS adds configure command line options used for Java | ||
dnl m4 macros. This Macro is optional. | ||
dnl | ||
dnl Note: This is part of the set of autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download the whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. The general documentation, as well as the sample | ||
dnl configure.in, is included in the AC_PROG_JAVA macro. | ||
dnl | ||
dnl @category Java | ||
dnl @author Devin Weaver <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license AllPermissive | ||
|
||
AC_DEFUN([AC_JAVA_OPTIONS],[ | ||
AC_ARG_WITH(java-prefix, | ||
[ --with-java-prefix=PFX prefix where Java runtime is installed (optional)]) | ||
AC_ARG_WITH(javac-flags, | ||
[ --with-javac-flags=FLAGS flags to pass to the Java compiler (optional)]) | ||
AC_ARG_WITH(java-flags, | ||
[ --with-java-flags=FLAGS flags to pass to the Java VM (optional)]) | ||
JAVAPREFIX=$with_java_prefix | ||
JAVACFLAGS=$with_javac_flags | ||
JAVAFLAGS=$with_java_flags | ||
AC_SUBST(JAVAPREFIX)dnl | ||
AC_SUBST(JAVACFLAGS)dnl | ||
AC_SUBST(JAVAFLAGS)dnl | ||
AC_SUBST(JAVA)dnl | ||
AC_SUBST(JAVAC)dnl | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
dnl @synopsis AC_PROG_JAR | ||
dnl | ||
dnl AC_PROG_JAR tests for an existing jar program. It uses the | ||
dnl environment variable JAR then tests in sequence various common jar | ||
dnl programs. | ||
dnl | ||
dnl If you want to force a specific compiler: | ||
dnl | ||
dnl - at the configure.in level, set JAR=yourcompiler before calling | ||
dnl AC_PROG_JAR | ||
dnl | ||
dnl - at the configure level, setenv JAR | ||
dnl | ||
dnl You can use the JAR variable in your Makefile.in, with @JAR@. | ||
dnl | ||
dnl Note: This macro depends on the autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download that whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. | ||
dnl | ||
dnl The general documentation of those macros, as well as the sample | ||
dnl configure.in, is included in the AC_PROG_JAVA macro. | ||
dnl | ||
dnl @category Java | ||
dnl @author Egon Willighagen <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license AllPermissive | ||
|
||
AC_DEFUN([AC_PROG_JAR],[ | ||
AC_REQUIRE([AC_EXEEXT])dnl | ||
if test "x$JAVAPREFIX" = x; then | ||
test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar$EXEEXT) | ||
else | ||
test "x$JAR" = x && AC_CHECK_PROGS(JAR, jar, $JAVAPREFIX) | ||
fi | ||
test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH]) | ||
AC_PROVIDE([$0])dnl | ||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
dnl @synopsis AC_PROG_JAVA | ||
dnl | ||
dnl Here is a summary of the main macros: | ||
dnl | ||
dnl AC_PROG_JAVAC: finds a Java compiler. | ||
dnl | ||
dnl AC_PROG_JAVA: finds a Java virtual machine. | ||
dnl | ||
dnl AC_CHECK_CLASS: finds if we have the given class (beware of | ||
dnl CLASSPATH!). | ||
dnl | ||
dnl AC_CHECK_RQRD_CLASS: finds if we have the given class and stops | ||
dnl otherwise. | ||
dnl | ||
dnl AC_TRY_COMPILE_JAVA: attempt to compile user given source. | ||
dnl | ||
dnl AC_TRY_RUN_JAVA: attempt to compile and run user given source. | ||
dnl | ||
dnl AC_JAVA_OPTIONS: adds Java configure options. | ||
dnl | ||
dnl AC_PROG_JAVA tests an existing Java virtual machine. It uses the | ||
dnl environment variable JAVA then tests in sequence various common | ||
dnl Java virtual machines. For political reasons, it starts with the | ||
dnl free ones. You *must* call [AC_PROG_JAVAC] before. | ||
dnl | ||
dnl If you want to force a specific VM: | ||
dnl | ||
dnl - at the configure.in level, set JAVA=yourvm before calling | ||
dnl AC_PROG_JAVA | ||
dnl | ||
dnl (but after AC_INIT) | ||
dnl | ||
dnl - at the configure level, setenv JAVA | ||
dnl | ||
dnl You can use the JAVA variable in your Makefile.in, with @JAVA@. | ||
dnl | ||
dnl *Warning*: its success or failure can depend on a proper setting of | ||
dnl the CLASSPATH env. variable. | ||
dnl | ||
dnl TODO: allow to exclude virtual machines (rationale: most Java | ||
dnl programs cannot run with some VM like kaffe). | ||
dnl | ||
dnl Note: This is part of the set of autoconf M4 macros for Java | ||
dnl programs. It is VERY IMPORTANT that you download the whole set, | ||
dnl some macros depend on other. Unfortunately, the autoconf archive | ||
dnl does not support the concept of set of macros, so I had to break it | ||
dnl for submission. | ||
dnl | ||
dnl A Web page, with a link to the latest CVS snapshot is at | ||
dnl <http://www.internatif.org/bortzmeyer/autoconf-Java/>. | ||
dnl | ||
dnl This is a sample configure.in Process this file with autoconf to | ||
dnl produce a configure script. | ||
dnl | ||
dnl AC_INIT(UnTag.java) | ||
dnl | ||
dnl dnl Checks for programs. | ||
dnl AC_CHECK_CLASSPATH | ||
dnl AC_PROG_JAVAC | ||
dnl AC_PROG_JAVA | ||
dnl | ||
dnl dnl Checks for classes | ||
dnl AC_CHECK_RQRD_CLASS(org.xml.sax.Parser) | ||
dnl AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver) | ||
dnl | ||
dnl AC_OUTPUT(Makefile) | ||
dnl | ||
dnl @category Java | ||
dnl @author Stephane Bortzmeyer <[email protected]> | ||
dnl @version 2000-07-19 | ||
dnl @license GPLWithACException | ||
|
||
AC_DEFUN([AC_PROG_JAVA],[ | ||
AC_REQUIRE([AC_EXEEXT])dnl | ||
if test x$JAVAPREFIX = x; then | ||
test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT) | ||
else | ||
test x$JAVA = x && AC_CHECK_PROGS(JAVA, kaffe$EXEEXT java$EXEEXT, $JAVAPREFIX) | ||
fi | ||
test x$JAVA = x && AC_MSG_ERROR([no acceptable Java virtual machine found in \$PATH]) | ||
AC_PROG_JAVA_WORKS | ||
AC_PROVIDE([$0])dnl | ||
]) |
Oops, something went wrong.