All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] configure.ac: check for org.junit.rules.ExternalResource
@ 2013-01-09 21:35 Danny Al-Gaaf
  2013-01-09 21:35 ` Danny Al-Gaaf
  2013-01-09 21:54 ` Noah Watkins
  0 siblings, 2 replies; 13+ messages in thread
From: Danny Al-Gaaf @ 2013-01-09 21:35 UTC (permalink / raw)
  To: ceph-devel; +Cc: Danny Al-Gaaf, Sage Weil

The attached patch depends on the set of 6 patches I send some days ago.
See: http://thread.gmane.org/gmane.comp.file-systems.ceph.devel/11793

Danny Al-Gaaf (1):
  configure.ac: check for org.junit.rules.ExternalResource

 autogen.sh                |   2 +-
 configure.ac              |  29 ++++++-------
 m4/ac_check_class.m4      | 108 ++++++++++++++++++++++++++++++++++++++++++++++
 m4/ac_check_classpath.m4  |  24 +++++++++++
 m4/ac_check_rqrd_class.m4 |  26 +++++++++++
 m4/ac_java_options.m4     |  33 ++++++++++++++
 m4/ac_prog_jar.m4         |  39 +++++++++++++++++
 m4/ac_prog_java.m4        |  83 +++++++++++++++++++++++++++++++++++
 m4/ac_prog_java_works.m4  |  98 +++++++++++++++++++++++++++++++++++++++++
 m4/ac_prog_javac.m4       |  45 +++++++++++++++++++
 m4/ac_prog_javac_works.m4 |  36 ++++++++++++++++
 m4/ac_prog_javah.m4       |  28 ++++++++++++
 m4/ac_try_compile_java.m4 |  40 +++++++++++++++++
 m4/ac_try_run_javac.m4    |  41 ++++++++++++++++++
 14 files changed, 615 insertions(+), 17 deletions(-)
 create mode 100644 m4/ac_check_class.m4
 create mode 100644 m4/ac_check_classpath.m4
 create mode 100644 m4/ac_check_rqrd_class.m4
 create mode 100644 m4/ac_java_options.m4
 create mode 100644 m4/ac_prog_jar.m4
 create mode 100644 m4/ac_prog_java.m4
 create mode 100644 m4/ac_prog_java_works.m4
 create mode 100644 m4/ac_prog_javac.m4
 create mode 100644 m4/ac_prog_javac_works.m4
 create mode 100644 m4/ac_prog_javah.m4
 create mode 100644 m4/ac_try_compile_java.m4
 create mode 100644 m4/ac_try_run_javac.m4

-- 
1.8.1


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-09 21:35 [PATCH] configure.ac: check for org.junit.rules.ExternalResource Danny Al-Gaaf
@ 2013-01-09 21:35 ` Danny Al-Gaaf
  2013-01-09 21:54 ` Noah Watkins
  1 sibling, 0 replies; 13+ messages in thread
From: Danny Al-Gaaf @ 2013-01-09 21:35 UTC (permalink / raw)
  To: ceph-devel; +Cc: Danny Al-Gaaf, Sage Weil

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 <danny.al-gaaf@bisect.de>
---
 autogen.sh                |   2 +-
 configure.ac              |  29 ++++++-------
 m4/ac_check_class.m4      | 108 ++++++++++++++++++++++++++++++++++++++++++++++
 m4/ac_check_classpath.m4  |  24 +++++++++++
 m4/ac_check_rqrd_class.m4 |  26 +++++++++++
 m4/ac_java_options.m4     |  33 ++++++++++++++
 m4/ac_prog_jar.m4         |  39 +++++++++++++++++
 m4/ac_prog_java.m4        |  83 +++++++++++++++++++++++++++++++++++
 m4/ac_prog_java_works.m4  |  98 +++++++++++++++++++++++++++++++++++++++++
 m4/ac_prog_javac.m4       |  45 +++++++++++++++++++
 m4/ac_prog_javac_works.m4 |  36 ++++++++++++++++
 m4/ac_prog_javah.m4       |  28 ++++++++++++
 m4/ac_try_compile_java.m4 |  40 +++++++++++++++++
 m4/ac_try_run_javac.m4    |  41 ++++++++++++++++++
 14 files changed, 615 insertions(+), 17 deletions(-)
 create mode 100644 m4/ac_check_class.m4
 create mode 100644 m4/ac_check_classpath.m4
 create mode 100644 m4/ac_check_rqrd_class.m4
 create mode 100644 m4/ac_java_options.m4
 create mode 100644 m4/ac_prog_jar.m4
 create mode 100644 m4/ac_prog_java.m4
 create mode 100644 m4/ac_prog_java_works.m4
 create mode 100644 m4/ac_prog_javac.m4
 create mode 100644 m4/ac_prog_javac_works.m4
 create mode 100644 m4/ac_prog_javah.m4
 create mode 100644 m4/ac_try_compile_java.m4
 create mode 100644 m4/ac_try_run_javac.m4

diff --git a/autogen.sh b/autogen.sh
index 08e435b..9d6a77b 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -12,7 +12,7 @@ check_for_pkg_config() {
 }
 
 rm -f config.cache
-aclocal #-I m4
+aclocal -I m4 --install
 check_for_pkg_config
 libtoolize --force --copy
 autoconf
diff --git a/configure.ac b/configure.ac
index 832054b..32814b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -271,9 +271,6 @@ AM_CONDITIONAL(ENABLE_CEPHFS_JAVA, test "x$enable_cephfs_java" = "xyes")
 AC_ARG_WITH(jdk-dir,
     AC_HELP_STRING([--with-jdk-dir(=DIR)], [Path to JDK directory]))
 
-AC_DEFUN([JAVA_DNE],
-	AC_MSG_ERROR([Cannot find $1 '$2'. Try setting --with-jdk-dir]))
-
 AS_IF([test "x$enable_cephfs_java" = "xyes"], [
 
 	# setup bin/include dirs from --with-jdk-dir (search for jni.h, javac)
@@ -314,20 +311,20 @@ AS_IF([test "x$enable_cephfs_java" = "xyes"], [
       AC_MSG_NOTICE([Cannot find junit4.jar (apt-get install junit4)])
       [have_junit4=0]])])
 
-	# Check for Java programs: javac, javah, jar
-    PATH_save=$PATH
-	PATH="$PATH:$EXTRA_JDK_BIN_DIR"
-	AC_PATH_PROG(JAVAC, javac)
-    AC_PATH_PROG(JAVAH, javah)
-    AC_PATH_PROG(JAR, jar)
-    PATH=$PATH_save
+      AC_CHECK_CLASSPATH
+      AC_PROG_JAVAC
+      AC_PROG_JAVAH
+      AC_PROG_JAR
 
-    # Ensure we have them...
-    AS_IF([test -z "$JAVAC"], JAVA_DNE(program, javac))
-    AS_IF([test -z "$JAVAH"], JAVA_DNE(program, javah))
-    AS_IF([test -z "$JAR"], JAVA_DNE(program, jar))
+      CLASSPATH=$CLASSPATH:$EXTRA_CLASSPATH_JAR
+      export CLASSPATH
+      AC_MSG_NOTICE([classpath - $CLASSPATH])
+      AS_IF([test "$have_junit4" = "1"], [
+	    AC_CHECK_CLASS([org.junit.rules.ExternalResource], [], [
+	    AC_MSG_NOTICE(Could not find org.junit.rules.ExternalResource)
+	    have_junit4=0])])
 
-    # Check for jni.h
+        # Check for jni.h
 	CPPFLAGS_save=$CPPFLAGS
 
 	AS_IF([test -n "$EXTRA_JDK_INC_DIR"],
@@ -336,7 +333,7 @@ AS_IF([test "x$enable_cephfs_java" = "xyes"], [
 				 [JDK_CPPFLAGS="$JDK_CPPFLAGS -I$EXTRA_JDK_INC_DIR/linux"])
 		   CPPFLAGS="$CPPFLAGS $JDK_CPPFLAGS"])
 
-	AC_CHECK_HEADER([jni.h], [], JAVA_DNE(header, jni.h))
+	AC_CHECK_HEADER([jni.h], [], AC_MSG_ERROR([Cannot find header 'jni.h'. Try setting --with-jdk-dir]))
 
 	CPPFLAGS=$CPPFLAGS_save
 
diff --git a/m4/ac_check_class.m4 b/m4/ac_check_class.m4
new file mode 100644
index 0000000..17932c5
--- /dev/null
+++ b/m4/ac_check_class.m4
@@ -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 <bortzmeyer@pasteur.fr>
+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)
+])
diff --git a/m4/ac_check_classpath.m4 b/m4/ac_check_classpath.m4
new file mode 100644
index 0000000..1782b5d
--- /dev/null
+++ b/m4/ac_check_classpath.m4
@@ -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 <bortzmeyer@pasteur.fr>
+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
+])
diff --git a/m4/ac_check_rqrd_class.m4 b/m4/ac_check_rqrd_class.m4
new file mode 100644
index 0000000..24b3d37
--- /dev/null
+++ b/m4/ac_check_rqrd_class.m4
@@ -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 <bortzmeyer@pasteur.fr>
+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
+])
diff --git a/m4/ac_java_options.m4 b/m4/ac_java_options.m4
new file mode 100644
index 0000000..aee3844
--- /dev/null
+++ b/m4/ac_java_options.m4
@@ -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 <ktohg@tritarget.com>
+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
+])
diff --git a/m4/ac_prog_jar.m4 b/m4/ac_prog_jar.m4
new file mode 100644
index 0000000..e5bf57c
--- /dev/null
+++ b/m4/ac_prog_jar.m4
@@ -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 <e.willighagen@science.ru.nl>
+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
+])
diff --git a/m4/ac_prog_java.m4 b/m4/ac_prog_java.m4
new file mode 100644
index 0000000..d16c2d6
--- /dev/null
+++ b/m4/ac_prog_java.m4
@@ -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 <bortzmeyer@pasteur.fr>
+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
+])
diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
new file mode 100644
index 0000000..bb14a88
--- /dev/null
+++ b/m4/ac_prog_java_works.m4
@@ -0,0 +1,98 @@
+dnl @synopsis AC_PROG_JAVA_WORKS
+dnl
+dnl Internal use ONLY.
+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 <bortzmeyer@pasteur.fr>
+dnl @version 2000-07-19
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_JAVA_WORKS], [
+AC_CHECK_PROG(uudecode, uudecode$EXEEXT, yes)
+if test x$uudecode = xyes; then
+AC_CACHE_CHECK([if uudecode can decode base 64 file], ac_cv_prog_uudecode_base64, [
+dnl /**
+dnl  * Test.java: used to test if java compiler works.
+dnl  */
+dnl public class Test
+dnl {
+dnl
+dnl public static void
+dnl main( String[] argv )
+dnl {
+dnl     System.exit (0);
+dnl }
+dnl
+dnl }
+cat << \EOF > Test.uue
+begin-base64 644 Test.class
+yv66vgADAC0AFQcAAgEABFRlc3QHAAQBABBqYXZhL2xhbmcvT2JqZWN0AQAE
+bWFpbgEAFihbTGphdmEvbGFuZy9TdHJpbmc7KVYBAARDb2RlAQAPTGluZU51
+bWJlclRhYmxlDAAKAAsBAARleGl0AQAEKEkpVgoADQAJBwAOAQAQamF2YS9s
+YW5nL1N5c3RlbQEABjxpbml0PgEAAygpVgwADwAQCgADABEBAApTb3VyY2VG
+aWxlAQAJVGVzdC5qYXZhACEAAQADAAAAAAACAAkABQAGAAEABwAAACEAAQAB
+AAAABQO4AAyxAAAAAQAIAAAACgACAAAACgAEAAsAAQAPABAAAQAHAAAAIQAB
+AAEAAAAFKrcAErEAAAABAAgAAAAKAAIAAAAEAAQABAABABMAAAACABQ=
+====
+EOF
+if uudecode$EXEEXT Test.uue; then
+        ac_cv_prog_uudecode_base64=yes
+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])
+fi
+if test x$ac_cv_prog_uudecode_base64 != xyes; then
+        rm -f Test.class
+        AC_MSG_WARN([I have to compile Test.class from scratch])
+        if test x$ac_cv_prog_javac_works = xno; then
+                AC_MSG_ERROR([Cannot compile java source. $JAVAC does not work properly])
+        fi
+        if test x$ac_cv_prog_javac_works = x; then
+                AC_PROG_JAVAC
+        fi
+fi
+AC_CACHE_CHECK(if $JAVA works, ac_cv_prog_java_works, [
+JAVA_TEST=Test.java
+CLASS_TEST=Test.class
+TEST=Test
+changequote(, )dnl
+cat << \EOF > $JAVA_TEST
+/* [#]line __oline__ "configure" */
+public class Test {
+public static void main (String args[]) {
+        System.exit (0);
+} }
+EOF
+changequote([, ])dnl
+if test x$ac_cv_prog_uudecode_base64 != xyes; then
+        if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) && test -s $CLASS_TEST; then
+                :
+        else
+          echo "configure: failed program was:" >&AC_FD_CC
+          cat $JAVA_TEST >&AC_FD_CC
+          AC_MSG_ERROR(The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?))
+        fi
+fi
+if AC_TRY_COMMAND($JAVA $JAVAFLAGS $TEST) >/dev/null 2>&1; then
+  ac_cv_prog_java_works=yes
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat $JAVA_TEST >&AC_FD_CC
+  AC_MSG_ERROR(The Java VM $JAVA failed (see config.log, check the CLASSPATH?))
+fi
+rm -fr $JAVA_TEST $CLASS_TEST Test.uue
+])
+AC_PROVIDE([$0])dnl
+]
+)
diff --git a/m4/ac_prog_javac.m4 b/m4/ac_prog_javac.m4
new file mode 100644
index 0000000..91463e8
--- /dev/null
+++ b/m4/ac_prog_javac.m4
@@ -0,0 +1,45 @@
+dnl @synopsis AC_PROG_JAVAC
+dnl
+dnl AC_PROG_JAVAC tests an existing Java compiler. It uses the
+dnl environment variable JAVAC then tests in sequence various common
+dnl Java compilers. For political reasons, it starts with the free
+dnl ones.
+dnl
+dnl If you want to force a specific compiler:
+dnl
+dnl - at the configure.in level, set JAVAC=yourcompiler before calling
+dnl AC_PROG_JAVAC
+dnl
+dnl - at the configure level, setenv JAVAC
+dnl
+dnl You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
+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 compilers (rationale: most Java programs
+dnl cannot compile with some compilers like guavac).
+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 <bortzmeyer@pasteur.fr>
+dnl @version 2000-07-19
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_JAVAC],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+        test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT)
+else
+        test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" guavac$EXEEXT jikes$EXEEXT javac$EXEEXT, $JAVAPREFIX)
+fi
+test "x$JAVAC" = x && AC_MSG_ERROR([no acceptable Java compiler found in \$PATH])
+AC_PROG_JAVAC_WORKS
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javac_works.m4 b/m4/ac_prog_javac_works.m4
new file mode 100644
index 0000000..8727e7f
--- /dev/null
+++ b/m4/ac_prog_javac_works.m4
@@ -0,0 +1,36 @@
+dnl @synopsis AC_PROG_JAVAC_WORKS
+dnl
+dnl Internal use ONLY.
+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 <bortzmeyer@pasteur.fr>
+dnl @version 2000-07-19
+dnl @license GPLWithACException
+
+AC_DEFUN([AC_PROG_JAVAC_WORKS],[
+AC_CACHE_CHECK([if $JAVAC works], ac_cv_prog_javac_works, [
+JAVA_TEST=Test.java
+CLASS_TEST=Test.class
+cat << \EOF > $JAVA_TEST
+/* [#]line __oline__ "configure" */
+public class Test {
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $JAVA_TEST) >/dev/null 2>&1; then
+  ac_cv_prog_javac_works=yes
+else
+  AC_MSG_ERROR([The Java compiler $JAVAC failed (see config.log, check the CLASSPATH?)])
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat $JAVA_TEST >&AC_FD_CC
+fi
+rm -f $JAVA_TEST $CLASS_TEST
+])
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javah.m4 b/m4/ac_prog_javah.m4
new file mode 100644
index 0000000..0cc93f9
--- /dev/null
+++ b/m4/ac_prog_javah.m4
@@ -0,0 +1,28 @@
+dnl @synopsis AC_PROG_JAVAH
+dnl
+dnl AC_PROG_JAVAH tests the availability of the javah header generator
+dnl and looks for the jni.h header file. If available, JAVAH is set to
+dnl the full path of javah and CPPFLAGS is updated accordingly.
+dnl
+dnl @category Java
+dnl @author Luc Maisonobe <luc@spaceroots.org>
+dnl @version 2002-03-25
+dnl @license AllPermissive
+
+AC_DEFUN([AC_PROG_JAVAH],[
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_PATH_PROG(JAVAH,javah)
+if test x"`eval 'echo $ac_cv_path_JAVAH'`" != x ; then
+  AC_TRY_CPP([#include <jni.h>],,[
+    ac_save_CPPFLAGS="$CPPFLAGS"
+changequote(, )dnl
+    ac_dir=`echo $ac_cv_path_JAVAH | sed 's,\(.*\)/[^/]*/[^/]*$,\1/include,'`
+    ac_machdep=`echo $build_os | sed 's,[-0-9].*,,' | sed 's,cygwin,win32,'`
+changequote([, ])dnl
+    CPPFLAGS="$ac_save_CPPFLAGS -I$ac_dir -I$ac_dir/$ac_machdep"
+    AC_TRY_CPP([#include <jni.h>],
+               ac_save_CPPFLAGS="$CPPFLAGS",
+               AC_MSG_WARN([unable to include <jni.h>]))
+    CPPFLAGS="$ac_save_CPPFLAGS"])
+fi])
diff --git a/m4/ac_try_compile_java.m4 b/m4/ac_try_compile_java.m4
new file mode 100644
index 0000000..102a04c
--- /dev/null
+++ b/m4/ac_try_compile_java.m4
@@ -0,0 +1,40 @@
+dnl @synopsis AC_TRY_COMPILE_JAVA
+dnl
+dnl AC_TRY_COMPILE_JAVA attempt to compile user given source.
+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 Devin Weaver <ktohg@tritarget.com>
+dnl @version 2000-07-19
+dnl @license AllPermissive
+
+AC_DEFUN([AC_TRY_COMPILE_JAVA],[
+AC_REQUIRE([AC_PROG_JAVAC])dnl
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+ifelse([$1], , , [import $1;])
+public class Test {
+[$2]
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class
+then
+dnl Don't remove the temporary files here, so they can be examined.
+  ifelse([$3], , :, [$3])
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat Test.java >&AC_FD_CC
+ifelse([$4], , , [  rm -fr Test*
+  $4
+])dnl
+fi
+rm -fr Test*])
diff --git a/m4/ac_try_run_javac.m4 b/m4/ac_try_run_javac.m4
new file mode 100644
index 0000000..e8e975c
--- /dev/null
+++ b/m4/ac_try_run_javac.m4
@@ -0,0 +1,41 @@
+dnl @synopsis AC_TRY_RUN_JAVA
+dnl
+dnl AC_TRY_RUN_JAVA attempt to compile and run user given source.
+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 Devin Weaver <ktohg@tritarget.com>
+dnl @version 2000-07-19
+dnl @license AllPermissive
+
+AC_DEFUN([AC_TRY_RUN_JAVA],[
+AC_REQUIRE([AC_PROG_JAVAC])dnl
+AC_REQUIRE([AC_PROG_JAVA])dnl
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+ifelse([$1], , , [include $1;])
+public class Test {
+[$2]
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS Test.java) && test -s Test.class && ($JAVA $JAVAFLAGS Test; exit) 2>/dev/null
+then
+dnl Don't remove the temporary files here, so they can be examined.
+  ifelse([$3], , :, [$3])
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat Test.java >&AC_FD_CC
+ifelse([$4], , , [  rm -fr Test*
+  $4
+])dnl
+fi
+rm -fr Test*])
-- 
1.8.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-09 21:35 [PATCH] configure.ac: check for org.junit.rules.ExternalResource Danny Al-Gaaf
  2013-01-09 21:35 ` Danny Al-Gaaf
@ 2013-01-09 21:54 ` Noah Watkins
  2013-01-10  4:32   ` Gary Lowell
  1 sibling, 1 reply; 13+ messages in thread
From: Noah Watkins @ 2013-01-09 21:54 UTC (permalink / raw)
  To: Danny Al-Gaaf; +Cc: ceph-devel, Danny Al-Gaaf, Sage Weil

I haven't tested this yet, but I like it. I think several of these
macros can be used to simplify a bit more of the Java config bit. I
also just saw the ax_jni_include_dir macro in the autoconf archive and
it looks like that can help clean-up too.

On Wed, Jan 9, 2013 at 1:35 PM, Danny Al-Gaaf <danny.al-gaaf@bisect.de> wrote:
> The attached patch depends on the set of 6 patches I send some days ago.
> See: http://thread.gmane.org/gmane.comp.file-systems.ceph.devel/11793
>
> Danny Al-Gaaf (1):
>   configure.ac: check for org.junit.rules.ExternalResource
>
>  autogen.sh                |   2 +-
>  configure.ac              |  29 ++++++-------
>  m4/ac_check_class.m4      | 108 ++++++++++++++++++++++++++++++++++++++++++++++
>  m4/ac_check_classpath.m4  |  24 +++++++++++
>  m4/ac_check_rqrd_class.m4 |  26 +++++++++++
>  m4/ac_java_options.m4     |  33 ++++++++++++++
>  m4/ac_prog_jar.m4         |  39 +++++++++++++++++
>  m4/ac_prog_java.m4        |  83 +++++++++++++++++++++++++++++++++++
>  m4/ac_prog_java_works.m4  |  98 +++++++++++++++++++++++++++++++++++++++++
>  m4/ac_prog_javac.m4       |  45 +++++++++++++++++++
>  m4/ac_prog_javac_works.m4 |  36 ++++++++++++++++
>  m4/ac_prog_javah.m4       |  28 ++++++++++++
>  m4/ac_try_compile_java.m4 |  40 +++++++++++++++++
>  m4/ac_try_run_javac.m4    |  41 ++++++++++++++++++
>  14 files changed, 615 insertions(+), 17 deletions(-)
>  create mode 100644 m4/ac_check_class.m4
>  create mode 100644 m4/ac_check_classpath.m4
>  create mode 100644 m4/ac_check_rqrd_class.m4
>  create mode 100644 m4/ac_java_options.m4
>  create mode 100644 m4/ac_prog_jar.m4
>  create mode 100644 m4/ac_prog_java.m4
>  create mode 100644 m4/ac_prog_java_works.m4
>  create mode 100644 m4/ac_prog_javac.m4
>  create mode 100644 m4/ac_prog_javac_works.m4
>  create mode 100644 m4/ac_prog_javah.m4
>  create mode 100644 m4/ac_try_compile_java.m4
>  create mode 100644 m4/ac_try_run_javac.m4
>
> --
> 1.8.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-09 21:54 ` Noah Watkins
@ 2013-01-10  4:32   ` Gary Lowell
  2013-01-10  7:55     ` Danny Al-Gaaf
  0 siblings, 1 reply; 13+ messages in thread
From: Gary Lowell @ 2013-01-10  4:32 UTC (permalink / raw)
  To: Noah Watkins; +Cc: Danny Al-Gaaf, ceph-devel, Danny Al-Gaaf, Sage Weil

I have this patch, and the ones from Friday in the wip-rpm-update branch.  Everything looks good except that we have the following new warning from configure:

….
checking for kaffe... no
checking for java... java
checking for uudecode... no
WARNING: configure: I have to compile Test.class from scratch
checking for gcj... no
checking for guavac... no
checking for jikes… no
….

This may have to do with something in our build environment.

Cheers,
Gary

On Jan 9, 2013, at 1:54 PM, Noah Watkins wrote:

> I haven't tested this yet, but I like it. I think several of these
> macros can be used to simplify a bit more of the Java config bit. I
> also just saw the ax_jni_include_dir macro in the autoconf archive and
> it looks like that can help clean-up too.
> 
> On Wed, Jan 9, 2013 at 1:35 PM, Danny Al-Gaaf <danny.al-gaaf@bisect.de> wrote:
>> The attached patch depends on the set of 6 patches I send some days ago.
>> See: http://thread.gmane.org/gmane.comp.file-systems.ceph.devel/11793
>> 
>> Danny Al-Gaaf (1):
>>  configure.ac: check for org.junit.rules.ExternalResource
>> 
>> autogen.sh                |   2 +-
>> configure.ac              |  29 ++++++-------
>> m4/ac_check_class.m4      | 108 ++++++++++++++++++++++++++++++++++++++++++++++
>> m4/ac_check_classpath.m4  |  24 +++++++++++
>> m4/ac_check_rqrd_class.m4 |  26 +++++++++++
>> m4/ac_java_options.m4     |  33 ++++++++++++++
>> m4/ac_prog_jar.m4         |  39 +++++++++++++++++
>> m4/ac_prog_java.m4        |  83 +++++++++++++++++++++++++++++++++++
>> m4/ac_prog_java_works.m4  |  98 +++++++++++++++++++++++++++++++++++++++++
>> m4/ac_prog_javac.m4       |  45 +++++++++++++++++++
>> m4/ac_prog_javac_works.m4 |  36 ++++++++++++++++
>> m4/ac_prog_javah.m4       |  28 ++++++++++++
>> m4/ac_try_compile_java.m4 |  40 +++++++++++++++++
>> m4/ac_try_run_javac.m4    |  41 ++++++++++++++++++
>> 14 files changed, 615 insertions(+), 17 deletions(-)
>> create mode 100644 m4/ac_check_class.m4
>> create mode 100644 m4/ac_check_classpath.m4
>> create mode 100644 m4/ac_check_rqrd_class.m4
>> create mode 100644 m4/ac_java_options.m4
>> create mode 100644 m4/ac_prog_jar.m4
>> create mode 100644 m4/ac_prog_java.m4
>> create mode 100644 m4/ac_prog_java_works.m4
>> create mode 100644 m4/ac_prog_javac.m4
>> create mode 100644 m4/ac_prog_javac_works.m4
>> create mode 100644 m4/ac_prog_javah.m4
>> create mode 100644 m4/ac_try_compile_java.m4
>> create mode 100644 m4/ac_try_run_javac.m4
>> 
>> --
>> 1.8.1
>> 
>> --
>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-10  4:32   ` Gary Lowell
@ 2013-01-10  7:55     ` Danny Al-Gaaf
  2013-01-11  5:13       ` Gary Lowell
  0 siblings, 1 reply; 13+ messages in thread
From: Danny Al-Gaaf @ 2013-01-10  7:55 UTC (permalink / raw)
  To: ceph-devel; +Cc: Gary Lowell, Noah Watkins, Sage Weil

Am 10.01.2013 05:32, schrieb Gary Lowell:
> I have this patch, and the ones from Friday in the wip-rpm-update branch.  Everything looks good except that we have the following new warning from configure:
> 
> ….
> checking for kaffe... no
> checking for java... java
> checking for uudecode... no
> WARNING: configure: I have to compile Test.class from scratch
> checking for gcj... no
> checking for guavac... no
> checking for jikes… no
> ….
> 
> This may have to do with something in our build environment.

I assume you have no uudecode installed. It should be part of sharutils
(http://www.gnu.org/software/sharutils/)

Regards,

Danny
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-10  7:55     ` Danny Al-Gaaf
@ 2013-01-11  5:13       ` Gary Lowell
  2013-01-12 16:36         ` Noah Watkins
  2013-01-12 21:59         ` Danny Al-Gaaf
  0 siblings, 2 replies; 13+ messages in thread
From: Gary Lowell @ 2013-01-11  5:13 UTC (permalink / raw)
  To: Danny Al-Gaaf; +Cc: ceph-devel, Noah Watkins, Sage Weil


On Jan 9, 2013, at 11:55 PM, Danny Al-Gaaf wrote:

> Am 10.01.2013 05:32, schrieb Gary Lowell:
>> I have this patch, and the ones from Friday in the wip-rpm-update branch.  Everything looks good except that we have the following new warning from configure:
>> 
>> ….
>> checking for kaffe... no
>> checking for java... java
>> checking for uudecode... no
>> WARNING: configure: I have to compile Test.class from scratch
>> checking for gcj... no
>> checking for guavac... no
>> checking for jikes… no
>> ….
>> 
>> This may have to do with something in our build environment.
> 
> I assume you have no uudecode installed. It should be part of sharutils
> (http://www.gnu.org/software/sharutils/)

Thanks Danny.  Installing sharutils solved that minor issue.  We now get though the build just fine on opensuse 12, but sles 11sp2 gives more warnings (pasted below).  Should we be using a newer version of autoconf  on sles?  I've tried moving AC_CANONICAL_TARGET earlier in the file, but that causes some other issues with the new java macros.

Thanks,
Gary

+ ./autogen.sh
warning: configure.ac:274: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1795: AC_CANONICAL_TARGET is expanded from...
../../lib/autoconf/general.m4:1819: AC_CANONICAL_SYSTEM is expanded from...
m4/ac_prog_javah.m4:12: AC_PROG_JAVAH is expanded from...
../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from...
configure.ac:274: the top level
aclocal: installing `m4/libtool.m4' from `/usr/share/aclocal/libtool.m4'
aclocal: installing `m4/ltoptions.m4' from `/usr/share/aclocal/ltoptions.m4'
aclocal: installing `m4/ltsugar.m4' from `/usr/share/aclocal/ltsugar.m4'
aclocal: installing `m4/ltversion.m4' from `/usr/share/aclocal/ltversion.m4'
aclocal: installing `m4/lt~obsolete.m4' from `/usr/share/aclocal/lt~obsolete.m4'
aclocal: installing `m4/pkg.m4' from `/usr/share/aclocal/pkg.m4'
warning: configure.ac:274: AC_ARG_PROGRAM was called before AC_CANONICAL_TARGET
../../lib/autoconf/general.m4:1795: AC_CANONICAL_TARGET is expanded from...
../../lib/autoconf/general.m4:1819: AC_CANONICAL_SYSTEM is expanded from...
m4/ac_prog_javah.m4:12: AC_PROG_JAVAH is expanded from...
../../lib/m4sugar/m4sh.m4:505: AS_IF is expanded from...
configure.ac:274: the top level




--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-11  5:13       ` Gary Lowell
@ 2013-01-12 16:36         ` Noah Watkins
  2013-01-15  9:04           ` James Page
  2013-01-12 21:59         ` Danny Al-Gaaf
  1 sibling, 1 reply; 13+ messages in thread
From: Noah Watkins @ 2013-01-12 16:36 UTC (permalink / raw)
  To: Gary Lowell; +Cc: Danny Al-Gaaf, ceph-devel, Sage Weil

On Thu, Jan 10, 2013 at 9:13 PM, Gary Lowell <gary.lowell@inktank.com> wrote:
>
> Thanks Danny.  Installing sharutils solved that minor issue.  We now get though the build just fine on opensuse 12, but sles 11sp2 gives more warnings (pasted below).  Should we be using a newer version of autoconf  on sles?  I've tried moving AC_CANONICAL_TARGET earlier in the file, but that causes some other issues with the new java macros.

We could also move away from using autoconf/automake for Java, and use
a packaging/dependency system designed for Java, like Maven.

- Noah

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-11  5:13       ` Gary Lowell
  2013-01-12 16:36         ` Noah Watkins
@ 2013-01-12 21:59         ` Danny Al-Gaaf
  2013-01-14 20:41           ` Gary Lowell
  1 sibling, 1 reply; 13+ messages in thread
From: Danny Al-Gaaf @ 2013-01-12 21:59 UTC (permalink / raw)
  To: ceph-devel; +Cc: Gary Lowell, Noah Watkins, Sage Weil

Am 11.01.2013 06:13, schrieb Gary Lowell:
[...]
> Thanks Danny.  Installing sharutils solved that minor issue.  We now
> get though the build just fine on opensuse 12, but sles 11sp2 gives
> more warnings (pasted below).  Should we be using a newer version of
> autoconf  on sles?  I've tried moving AC_CANONICAL_TARGET earlier in
> the file, but that causes some other issues with the new java
> macros.
> 
> Thanks, Gary

I'll take a look at it, I guess it's a problem in configure.ac.

I see the same warnings in our build system at SUSE for SLES (see: e.g.
logs at
https://build.opensuse.org/project/monitor?project=home%3Adalgaaf%3Abranches%3Afilesystems),
but the package builds just fine for openSUSE, SLES, Fedora, RHEL and
CentOS there.

Danny

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-12 21:59         ` Danny Al-Gaaf
@ 2013-01-14 20:41           ` Gary Lowell
  0 siblings, 0 replies; 13+ messages in thread
From: Gary Lowell @ 2013-01-14 20:41 UTC (permalink / raw)
  To: Danny Al-Gaaf; +Cc: ceph-devel, Noah Watkins, Sage Weil


On Jan 12, 2013, at 1:59 PM, Danny Al-Gaaf wrote:

> Am 11.01.2013 06:13, schrieb Gary Lowell:
> [...]
>> Thanks Danny.  Installing sharutils solved that minor issue.  We now
>> get though the build just fine on opensuse 12, but sles 11sp2 gives
>> more warnings (pasted below).  Should we be using a newer version of
>> autoconf  on sles?  I've tried moving AC_CANONICAL_TARGET earlier in
>> the file, but that causes some other issues with the new java
>> macros.
>> 
>> Thanks, Gary
> 
> I'll take a look at it, I guess it's a problem in configure.ac.
> 
> I see the same warnings in our build system at SUSE for SLES (see: e.g.
> logs at
> https://build.opensuse.org/project/monitor?project=home%3Adalgaaf%3Abranches%3Afilesystems),
> but the package builds just fine for openSUSE, SLES, Fedora, RHEL and
> CentOS there

Looks like it is the usage of AC_CANONICAL_SYSTEM in ac_prog_javah.m4 that cause the warning on centos and sles.  Using AC_CANONICAL_HOST fixed the warning.  I'm not sure if that's the real solution, or if something should be changed in the configure.ac file.
The diff of the change I tried is below.

Thanks,
Gary

diff --git a/m4/ac_prog_javah.m4 b/m4/ac_prog_javah.m4
index 0cc93f9..118e02f 100644
--- a/m4/ac_prog_javah.m4
+++ b/m4/ac_prog_javah.m4
@@ -10,7 +10,7 @@ dnl @version 2002-03-25
 dnl @license AllPermissive
 
 AC_DEFUN([AC_PROG_JAVAH],[
-AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
 AC_REQUIRE([AC_PROG_CPP])dnl
 AC_PATH_PROG(JAVAH,javah)
 if test x"`eval 'echo $ac_cv_path_JAVAH'`" != x ; then



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-12 16:36         ` Noah Watkins
@ 2013-01-15  9:04           ` James Page
  2013-01-15  9:32             ` Danny Al-Gaaf
  0 siblings, 1 reply; 13+ messages in thread
From: James Page @ 2013-01-15  9:04 UTC (permalink / raw)
  To: Noah Watkins; +Cc: Gary Lowell, Danny Al-Gaaf, ceph-devel, Sage Weil

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 12/01/13 16:36, Noah Watkins wrote:
> On Thu, Jan 10, 2013 at 9:13 PM, Gary Lowell
> <gary.lowell@inktank.com> wrote:
>>> 
>>> Thanks Danny.  Installing sharutils solved that minor issue.
>>> We now get though the build just fine on opensuse 12, but sles
>>> 11sp2 gives more warnings (pasted below).  Should we be using a
>>> newer version of autoconf  on sles?  I've tried moving
>>> AC_CANONICAL_TARGET earlier in the file, but that causes some
>>> other issues with the new java macros.
> We could also move away from using autoconf/automake for Java, and
> use a packaging/dependency system designed for Java, like Maven.

If this route it taken please bear in mind that use of Maven will
create some challenges in Ubuntu; specifically with regards to the
fact that ceph is in main and supported by Canonical and Maven +
associated toolchain is *huge* in terms of packages and is not in main.

Ant however is in main and fully supported.

- -- 
James Page
Technical Lead
Ubuntu Server Team
james.page@canonical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iQIcBAEBCAAGBQJQ9RufAAoJEL/srsug59jDYwoQAJbE3nEhxi0qiEQmyQpvkNlO
VhY2CA2Mu5z+WDkPuF2YqiisM1+v+10RUK077ZOv1K8QIcEffHGWJtuXxRarHGDY
+PHWTinNvNm56BDC6mxAOJPU1hPv0hOgho9E8jW9LJDNTajVGskr03BxMHDLu/OQ
W3X9CqrhD97WAXv95fhPGKQoWxyHUNLMxvusZvbRqMEr23+ccgkMfulOdjETe8LG
BwBCV8FPiFAYxJPaVxm9UvbRXHo3PXvOU8CIpEP0Wk87f3FDQbCTVzJIdSyp30xJ
762U+cXgN6zMkTpvZYHX6vN29vWGSNmkRcsSrGoIlbxZCTkYt13S8iBvSMDeCbVa
SX/YZQNPYEcnkcEDrgHoG0y4xQNcSwIjkji+dKf2A5lxOHU6qDEIcXMp7XMvx3ha
PVh+d2MkRiIPSw48n3d4TZch8VkbJBFFW1klLlC1yKHRsOPee8Ck+tyBAqnW6nCQ
2goiXsH73CASzznfjI3qo9kkIza4eL7k15AjeyMfXh3b88ssuALgDV1Bk9JI0G1b
LyzY7JMqCDqlvmGTJQwm14qKcP3HRGXl8WaNV8gGUo84BV3a2VmqjJw0WWekyk+z
3wSbPgFpQE31N7SmsYBhjROMngOrMdWc4ccEs/EiukDrvC+LnMrhuUmYQfa01iaS
zm59v1Ys83hx+2vapx0M
=Mjh1
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-15  9:04           ` James Page
@ 2013-01-15  9:32             ` Danny Al-Gaaf
  2013-01-15 14:55               ` Noah Watkins
  0 siblings, 1 reply; 13+ messages in thread
From: Danny Al-Gaaf @ 2013-01-15  9:32 UTC (permalink / raw)
  To: ceph-devel; +Cc: James Page, Noah Watkins, Gary Lowell, Sage Weil

Am 15.01.2013 10:04, schrieb James Page:
> On 12/01/13 16:36, Noah Watkins wrote:
>> On Thu, Jan 10, 2013 at 9:13 PM, Gary Lowell
>> <gary.lowell@inktank.com> wrote:
>>>>
>>>> Thanks Danny.  Installing sharutils solved that minor issue.
>>>> We now get though the build just fine on opensuse 12, but sles
>>>> 11sp2 gives more warnings (pasted below).  Should we be using a
>>>> newer version of autoconf  on sles?  I've tried moving
>>>> AC_CANONICAL_TARGET earlier in the file, but that causes some
>>>> other issues with the new java macros.
>> We could also move away from using autoconf/automake for Java, and
>> use a packaging/dependency system designed for Java, like Maven.
> 
> If this route it taken please bear in mind that use of Maven will
> create some challenges in Ubuntu; specifically with regards to the
> fact that ceph is in main and supported by Canonical and Maven +
> associated toolchain is *huge* in terms of packages and is not in main.
> 
> Ant however is in main and fully supported.

I would also prefer to not add another huge build dependency to ceph,
especially since it's e.g. not supported by SLES11 and since ceph
currently builds fine (even with these small warnings from autotools).

Danny

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-15  9:32             ` Danny Al-Gaaf
@ 2013-01-15 14:55               ` Noah Watkins
  2013-01-15 17:36                 ` Gregory Farnum
  0 siblings, 1 reply; 13+ messages in thread
From: Noah Watkins @ 2013-01-15 14:55 UTC (permalink / raw)
  To: Danny Al-Gaaf; +Cc: ceph-devel, James Page, Gary Lowell, Sage Weil

On Tue, Jan 15, 2013 at 1:32 AM, Danny Al-Gaaf <danny.al-gaaf@bisect.de> wrote:
> Am 15.01.2013 10:04, schrieb James Page:
>> On 12/01/13 16:36, Noah Watkins wrote:
>>> On Thu, Jan 10, 2013 at 9:13 PM, Gary Lowell
>>> <gary.lowell@inktank.com> wrote:
>
> I would also prefer to not add another huge build dependency to ceph,
> especially since it's e.g. not supported by SLES11 and since ceph
> currently builds fine (even with these small warnings from autotools).

Ahh, I had in my head a separate repository for Java bindings managed
by maven (or ant). Either way, I have no strong opinion -- we only
have one junit dependency :)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PATCH] configure.ac: check for org.junit.rules.ExternalResource
  2013-01-15 14:55               ` Noah Watkins
@ 2013-01-15 17:36                 ` Gregory Farnum
  0 siblings, 0 replies; 13+ messages in thread
From: Gregory Farnum @ 2013-01-15 17:36 UTC (permalink / raw)
  To: Noah Watkins
  Cc: Danny Al-Gaaf, ceph-devel@vger.kernel.org, James Page,
	Gary Lowell, Sage Weil

On Tue, Jan 15, 2013 at 6:55 AM, Noah Watkins <jayhawk@cs.ucsc.edu> wrote:
> On Tue, Jan 15, 2013 at 1:32 AM, Danny Al-Gaaf <danny.al-gaaf@bisect.de> wrote:
>> Am 15.01.2013 10:04, schrieb James Page:
>>> On 12/01/13 16:36, Noah Watkins wrote:
>>>> On Thu, Jan 10, 2013 at 9:13 PM, Gary Lowell
>>>> <gary.lowell@inktank.com> wrote:
>>
>> I would also prefer to not add another huge build dependency to ceph,
>> especially since it's e.g. not supported by SLES11 and since ceph
>> currently builds fine (even with these small warnings from autotools).
>
> Ahh, I had in my head a separate repository for Java bindings managed
> by maven (or ant). Either way, I have no strong opinion -- we only
> have one junit dependency :)

I don't believe Ceph currently requires any Java to build, and it's
going to remain that way if I have anything to say about it. ;) Hadoop
bindings can be packaged in about a billion different ways that don't
require core Ceph to depend on a Java toolchain.
-Greg

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2013-01-15 17:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-09 21:35 [PATCH] configure.ac: check for org.junit.rules.ExternalResource Danny Al-Gaaf
2013-01-09 21:35 ` Danny Al-Gaaf
2013-01-09 21:54 ` Noah Watkins
2013-01-10  4:32   ` Gary Lowell
2013-01-10  7:55     ` Danny Al-Gaaf
2013-01-11  5:13       ` Gary Lowell
2013-01-12 16:36         ` Noah Watkins
2013-01-15  9:04           ` James Page
2013-01-15  9:32             ` Danny Al-Gaaf
2013-01-15 14:55               ` Noah Watkins
2013-01-15 17:36                 ` Gregory Farnum
2013-01-12 21:59         ` Danny Al-Gaaf
2013-01-14 20:41           ` Gary Lowell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.