summaryrefslogtreecommitdiffstats
path: root/m4
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-08-26 15:14:56 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2009-08-26 15:14:56 +0000
commit6e33ada682bd0aa9f746e1407afbda93af9b2d25 (patch)
tree567f5be90e5223a179f0efdb9043bf2daabca5b5 /m4
parent366e4433610e8846b9ceb82952eb2f42fd7284f6 (diff)
downloadlasso-6e33ada682bd0aa9f746e1407afbda93af9b2d25.tar.gz
lasso-6e33ada682bd0aa9f746e1407afbda93af9b2d25.tar.xz
lasso-6e33ada682bd0aa9f746e1407afbda93af9b2d25.zip
Core: Use automake-1.11 when possible
* Makefile.am: use new automake-1.11 silent rules if possible move macros to m4 directory * m4/gtk-doc.m4: add gtk-doc macros. * lasso/Makefile.am: add missing -f flag to rm, to unbreak make distcheck * docs/references/Makefile.am: fix problem between libtool and gtk-doc * autogen.sh: update to autogen.sh from gtk-doc, add support for automake-1.11
Diffstat (limited to 'm4')
-rw-r--r--m4/ac_check_class.m4147
-rw-r--r--m4/ac_check_classpath.m463
-rw-r--r--m4/ac_check_java_home.m462
-rw-r--r--m4/ac_check_junit.m469
-rw-r--r--m4/ac_check_rqrd_class.m465
-rw-r--r--m4/ac_java_options.m446
-rw-r--r--m4/ac_prog_jar.m452
-rw-r--r--m4/ac_prog_java.m4122
-rw-r--r--m4/ac_prog_java_cc.m4107
-rw-r--r--m4/ac_prog_java_works.m4137
-rw-r--r--m4/ac_prog_javac.m484
-rw-r--r--m4/ac_prog_javac_works.m475
-rw-r--r--m4/ac_prog_javadoc.m453
-rw-r--r--m4/ac_prog_javah.m443
-rw-r--r--m4/ac_try_compile_java.m453
-rw-r--r--m4/ac_try_run_javac.m454
-rw-r--r--m4/as-compiler-flag.m462
-rw-r--r--m4/check.m4133
-rw-r--r--m4/dps_java_check_class.m489
-rw-r--r--m4/dps_libgcj_jar.m486
-rw-r--r--m4/dps_xtra_classpath.m471
-rw-r--r--m4/gtk-doc.m439
22 files changed, 1712 insertions, 0 deletions
diff --git a/m4/ac_check_class.m4 b/m4/ac_check_class.m4
new file mode 100644
index 00000000..264ba4d9
--- /dev/null
+++ b/m4/ac_check_class.m4
@@ -0,0 +1,147 @@
+##### http://autoconf-archive.cryp.to/ac_check_class.html
+#
+# SYNOPSIS
+#
+# AC_CHECK_CLASS
+#
+# DESCRIPTION
+#
+# AC_CHECK_CLASS tests the existence of a given Java class, either in
+# a jar or in a '.class' file.
+#
+# *Warning*: its success or failure can depend on a proper setting of
+# the CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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 00000000..bfbdda4a
--- /dev/null
+++ b/m4/ac_check_classpath.m4
@@ -0,0 +1,63 @@
+##### http://autoconf-archive.cryp.to/ac_check_classpath.html
+#
+# SYNOPSIS
+#
+# AC_CHECK_CLASSPATH
+#
+# DESCRIPTION
+#
+# AC_CHECK_CLASSPATH just displays the CLASSPATH, for the edification
+# of the user.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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_java_home.m4 b/m4/ac_check_java_home.m4
new file mode 100644
index 00000000..88bfbd18
--- /dev/null
+++ b/m4/ac_check_java_home.m4
@@ -0,0 +1,62 @@
+##### http://autoconf-archive.cryp.to/ac_check_java_home.html
+#
+# SYNOPSIS
+#
+# AC_CHECK_JAVA_HOME
+#
+# DESCRIPTION
+#
+# Check for Sun Java (JDK / JRE) installation, where the 'java' VM is
+# in. If found, set environment variable JAVA_HOME = Java
+# installation home, else left JAVA_HOME untouch, which in most case
+# means JAVA_HOME is empty.
+#
+# LAST MODIFICATION
+#
+# 2002-10-10
+#
+# COPYLEFT
+#
+# Copyright (c) 2002 Gleen Salmon <gleensalmon@yahoo.com>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([AC_CHECK_JAVA_HOME],[
+AC_REQUIRE([AC_EXEEXT])dnl
+TRY_JAVA_HOME=`ls -dr /usr/java/* 2> /dev/null | head -n 1`
+if test x$TRY_JAVA_HOME != x; then
+ PATH=$PATH:$TRY_JAVA_HOME/bin
+fi
+AC_PATH_PROG(JAVA_PATH_NAME, java$EXEEXT)
+if test x$JAVA_PATH_NAME != x; then
+ JAVA_HOME=`echo $JAVA_PATH_NAME | sed "s/\(.*\)[[/]]bin[[/]]java$EXEEXT$/\1/"`
+fi;dnl
+])
diff --git a/m4/ac_check_junit.m4 b/m4/ac_check_junit.m4
new file mode 100644
index 00000000..3214335d
--- /dev/null
+++ b/m4/ac_check_junit.m4
@@ -0,0 +1,69 @@
+##### http://autoconf-archive.cryp.to/ac_check_junit.html
+#
+# SYNOPSIS
+#
+# AC_CHECK_JUNIT
+#
+# DESCRIPTION
+#
+# AC_CHECK_JUNIT tests the availability of the Junit testing
+# framework, and set some variables for conditional compilation of
+# the test suite by automake.
+#
+# If available, JUNIT is set to a command launching the text based
+# user interface of Junit, @JAVA_JUNIT@ is set to $JAVA_JUNIT and
+# @TESTS_JUNIT@ is set to $TESTS_JUNIT, otherwise they are set to
+# empty values.
+#
+# You can use these variables in your Makefile.am file like this :
+#
+# # Some of the following classes are built only if junit is available
+# JAVA_JUNIT = Class1Test.java Class2Test.java AllJunitTests.java
+#
+# noinst_JAVA = Example1.java Example2.java @JAVA_JUNIT@
+#
+# EXTRA_JAVA = $(JAVA_JUNIT)
+#
+# TESTS_JUNIT = AllJunitTests
+#
+# TESTS = StandaloneTest1 StandaloneTest2 @TESTS_JUNIT@
+#
+# EXTRA_TESTS = $(TESTS_JUNIT)
+#
+# AllJunitTests :
+# echo "#! /bin/sh" > $@
+# echo "exec @JUNIT@ my.package.name.AllJunitTests" >> $@
+# chmod +x $@
+#
+# LAST MODIFICATION
+#
+# 2001-03-02
+#
+# COPYLEFT
+#
+# Copyright (c) 2001 Luc Maisonobe <luc@spaceroots.org>
+#
+# 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.
+
+AC_DEFUN([AC_CHECK_JUNIT],[
+AC_CACHE_VAL(ac_cv_prog_JUNIT,[
+AC_CHECK_CLASS(junit.textui.TestRunner)
+if test x"`eval 'echo $ac_cv_class_junit_textui_TestRunner'`" != xno ; then
+ ac_cv_prog_JUNIT='$(CLASSPATH_ENV) $(JAVA) $(JAVAFLAGS) junit.textui.TestRunner'
+fi])
+AC_MSG_CHECKING([for junit])
+if test x"`eval 'echo $ac_cv_prog_JUNIT'`" != x ; then
+ JUNIT="$ac_cv_prog_JUNIT"
+ JAVA_JUNIT='$(JAVA_JUNIT)'
+ TESTS_JUNIT='$(TESTS_JUNIT)'
+else
+ JUNIT=
+ JAVA_JUNIT=
+ TESTS_JUNIT=
+fi
+AC_MSG_RESULT($JUNIT)
+AC_SUBST(JUNIT)
+AC_SUBST(JAVA_JUNIT)
+AC_SUBST(TESTS_JUNIT)])
diff --git a/m4/ac_check_rqrd_class.m4 b/m4/ac_check_rqrd_class.m4
new file mode 100644
index 00000000..fb13fff1
--- /dev/null
+++ b/m4/ac_check_rqrd_class.m4
@@ -0,0 +1,65 @@
+##### http://autoconf-archive.cryp.to/ac_check_rqrd_class.html
+#
+# SYNOPSIS
+#
+# AC_CHECK_RQRD_CLASS
+#
+# DESCRIPTION
+#
+# AC_CHECK_RQRD_CLASS tests the existence of a given Java class,
+# either in a jar or in a '.class' file and fails if it doesn't
+# exist. Its success or failure can depend on a proper setting of the
+# CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([AC_CHECK_RQRD_CLASS],[
+CLASS=`echo $1|sed 's/\./_/g'`
+AC_CHECK_CLASS($1)
+if test "$HAVE_LAST_CLASS" = "no"; then
+true
+fi
+])
diff --git a/m4/ac_java_options.m4 b/m4/ac_java_options.m4
new file mode 100644
index 00000000..290406e8
--- /dev/null
+++ b/m4/ac_java_options.m4
@@ -0,0 +1,46 @@
+##### http://autoconf-archive.cryp.to/ac_java_options.html
+#
+# SYNOPSIS
+#
+# AC_JAVA_OPTIONS
+#
+# DESCRIPTION
+#
+# AC_JAVA_OPTIONS adds configure command line options used for Java
+# m4 macros. This Macro is optional.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Devin Weaver <ktohg@tritarget.com>
+#
+# 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.
+
+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 00000000..266d310c
--- /dev/null
+++ b/m4/ac_prog_jar.m4
@@ -0,0 +1,52 @@
+##### http://autoconf-archive.cryp.to/ac_prog_jar.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAR
+#
+# DESCRIPTION
+#
+# AC_PROG_JAR tests for an existing jar program. It uses the
+# environment variable JAR then tests in sequence various common jar
+# programs.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAR=yourcompiler before calling
+# AC_PROG_JAR
+#
+# - at the configure level, setenv JAR
+#
+# You can use the JAR variable in your Makefile.in, with @JAR@.
+#
+# Note: This macro depends on the autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download that whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission.
+#
+# The general documentation of those macros, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Egon Willighagen <e.willighagen@science.ru.nl>
+#
+# 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.
+
+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
+true
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_java.m4 b/m4/ac_prog_java.m4
new file mode 100644
index 00000000..af2b6cbd
--- /dev/null
+++ b/m4/ac_prog_java.m4
@@ -0,0 +1,122 @@
+##### http://autoconf-archive.cryp.to/ac_prog_java.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA
+#
+# DESCRIPTION
+#
+# Here is a summary of the main macros:
+#
+# AC_PROG_JAVAC: finds a Java compiler.
+#
+# AC_PROG_JAVA: finds a Java virtual machine.
+#
+# AC_CHECK_CLASS: finds if we have the given class (beware of
+# CLASSPATH!).
+#
+# AC_CHECK_RQRD_CLASS: finds if we have the given class and stops
+# otherwise.
+#
+# AC_TRY_COMPILE_JAVA: attempt to compile user given source.
+#
+# AC_TRY_RUN_JAVA: attempt to compile and run user given source.
+#
+# AC_JAVA_OPTIONS: adds Java configure options.
+#
+# AC_PROG_JAVA tests an existing Java virtual machine. It uses the
+# environment variable JAVA then tests in sequence various common
+# Java virtual machines. For political reasons, it starts with the
+# free ones. You *must* call [AC_PROG_JAVAC] before.
+#
+# If you want to force a specific VM:
+#
+# - at the configure.in level, set JAVA=yourvm before calling
+# AC_PROG_JAVA
+#
+# (but after AC_INIT)
+#
+# - at the configure level, setenv JAVA
+#
+# You can use the JAVA variable in your Makefile.in, with @JAVA@.
+#
+# *Warning*: its success or failure can depend on a proper setting of
+# the CLASSPATH env. variable.
+#
+# TODO: allow to exclude virtual machines (rationale: most Java
+# programs cannot run with some VM like kaffe).
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission.
+#
+# A Web page, with a link to the latest CVS snapshot is at
+# <http://www.internatif.org/bortzmeyer/autoconf-Java/>.
+#
+# This is a sample configure.in Process this file with autoconf to
+# produce a configure script.
+#
+# AC_INIT(UnTag.java)
+#
+# dnl Checks for programs.
+# AC_CHECK_CLASSPATH
+# AC_PROG_JAVAC
+# AC_PROG_JAVA
+#
+# dnl Checks for classes
+# AC_CHECK_RQRD_CLASS(org.xml.sax.Parser)
+# AC_CHECK_RQRD_CLASS(com.jclark.xml.sax.Driver)
+#
+# AC_OUTPUT(Makefile)
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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
+true
+AC_PROG_JAVA_WORKS
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_java_cc.m4 b/m4/ac_prog_java_cc.m4
new file mode 100644
index 00000000..df127856
--- /dev/null
+++ b/m4/ac_prog_java_cc.m4
@@ -0,0 +1,107 @@
+##### http://autoconf-archive.cryp.to/ac_prog_java_cc.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA_CC
+#
+# DESCRIPTION
+#
+# Finds the appropriate java compiler on your path. By preference the
+# java compiler is gcj, then jikes then javac.
+#
+# The macro can take one argument specifying a space separated list
+# of java compiler names.
+#
+# For example:
+#
+# AC_PROG_JAVA_CC(javac, gcj)
+#
+# The macro also sets the compiler options variable: JAVA_CC_OPTS to
+# something sensible:
+#
+# - for GCJ it sets it to: @GCJ_OPTS@
+# (if GCJ_OPTS is not yet defined then it is set to "-C")
+#
+# - no other compiler has applicable options yet
+#
+# Here's an example configure.in:
+#
+# AC_INIT(Makefile.in)
+# AC_PROG_JAVA_CC()
+# AC_OUTPUT(Makefile)
+# dnl End.
+#
+# And here's the start of the Makefile.in:
+#
+# PROJECT_ROOT := @srcdir@
+# # Tool definitions.
+# JAVAC := @JAVA_CC@
+# JAVAC_OPTS := @JAVA_CC_OPTS@
+# JAR_TOOL := @jar_tool@
+#
+# LAST MODIFICATION
+#
+# 2002-03-04
+#
+# COPYLEFT
+#
+# Copyright (c) 2002 Nic Ferrier <nferrier@tapsellferrier.co.uk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+# AC_PROG_JAVA_CC([COMPILER ...])
+# --------------------------
+# COMPILER ... is a space separated list of java compilers to search for.
+# This just gives the user an opportunity to specify an alternative
+# search list for the java compiler.
+AC_DEFUN([AC_PROG_JAVA_CC],
+[AC_ARG_VAR([JAVA_CC], [java compiler command])dnl
+AC_ARG_VAR([JAVA_CC_FLAGS], [java compiler flags])dnl
+m4_ifval([$1],
+ [AC_CHECK_TOOLS(JAVA_CC, [$1])],
+[AC_CHECK_TOOL(JAVA_CC, gcj)
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, javac)
+fi
+if test -z "$JAVA_CC"; then
+ AC_CHECK_TOOL(JAVA_CC, jikes)
+fi
+])
+
+if test "$JAVA_CC" = "gcj"; then
+ if test "$GCJ_OPTS" = ""; then
+ AC_SUBST(GCJ_OPTS,-C)
+ fi
+ AC_SUBST(JAVA_CC_OPTS, @GCJ_OPTS@,
+ [Define the compilation options for GCJ])
+fi
+true
+])# AC_PROG_JAVA_CC
diff --git a/m4/ac_prog_java_works.m4 b/m4/ac_prog_java_works.m4
new file mode 100644
index 00000000..e450c6c8
--- /dev/null
+++ b/m4/ac_prog_java_works.m4
@@ -0,0 +1,137 @@
+##### http://autoconf-archive.cryp.to/ac_prog_java_works.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVA_WORKS
+#
+# DESCRIPTION
+#
+# Internal use ONLY.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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
+true
+ 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
+true
+ 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
+true
+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 00000000..630c3cfe
--- /dev/null
+++ b/m4/ac_prog_javac.m4
@@ -0,0 +1,84 @@
+##### http://autoconf-archive.cryp.to/ac_prog_javac.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAC
+#
+# DESCRIPTION
+#
+# AC_PROG_JAVAC tests an existing Java compiler. It uses the
+# environment variable JAVAC then tests in sequence various common
+# Java compilers. For political reasons, it starts with the free
+# ones.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAVAC=yourcompiler before calling
+# AC_PROG_JAVAC
+#
+# - at the configure level, setenv JAVAC
+#
+# You can use the JAVAC variable in your Makefile.in, with @JAVAC@.
+#
+# *Warning*: its success or failure can depend on a proper setting of
+# the CLASSPATH env. variable.
+#
+# TODO: allow to exclude compilers (rationale: most Java programs
+# cannot compile with some compilers like guavac).
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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" jikes$EXEEXT guavac$EXEEXT javac$EXEEXT)
+else
+ test "x$JAVAC" = x && AC_CHECK_PROGS(JAVAC, "gcj$EXEEXT -C" jikes$EXEEXT guavac$EXEEXT javac$EXEEXT, $JAVAPREFIX)
+fi
+true
+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 00000000..d3ceb5cc
--- /dev/null
+++ b/m4/ac_prog_javac_works.m4
@@ -0,0 +1,75 @@
+##### http://autoconf-archive.cryp.to/ac_prog_javac_works.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAC_WORKS
+#
+# DESCRIPTION
+#
+# Internal use ONLY.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+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
+true
+ 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_javadoc.m4 b/m4/ac_prog_javadoc.m4
new file mode 100644
index 00000000..0920c559
--- /dev/null
+++ b/m4/ac_prog_javadoc.m4
@@ -0,0 +1,53 @@
+##### http://autoconf-archive.cryp.to/ac_prog_javadoc.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVADOC
+#
+# DESCRIPTION
+#
+# AC_PROG_JAVADOC tests for an existing javadoc generator. It uses
+# the environment variable JAVADOC then tests in sequence various
+# common javadoc generator.
+#
+# If you want to force a specific compiler:
+#
+# - at the configure.in level, set JAVADOC=yourgenerator before
+# calling AC_PROG_JAVADOC
+#
+# - at the configure level, setenv JAVADOC
+#
+# You can use the JAVADOC variable in your Makefile.in, with
+# @JAVADOC@.
+#
+# Note: This macro depends on the autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download that whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission.
+#
+# The general documentation of those macros, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Egon Willighagen <e.willighagen@science.ru.nl>
+#
+# 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.
+
+AC_DEFUN([AC_PROG_JAVADOC],[
+AC_REQUIRE([AC_EXEEXT])dnl
+if test "x$JAVAPREFIX" = x; then
+ test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc$EXEEXT)
+else
+ test "x$JAVADOC" = x && AC_CHECK_PROGS(JAVADOC, javadoc, $JAVAPREFIX)
+fi
+true
+AC_PROVIDE([$0])dnl
+])
diff --git a/m4/ac_prog_javah.m4 b/m4/ac_prog_javah.m4
new file mode 100644
index 00000000..6da77847
--- /dev/null
+++ b/m4/ac_prog_javah.m4
@@ -0,0 +1,43 @@
+##### http://autoconf-archive.cryp.to/ac_prog_javah.html
+#
+# SYNOPSIS
+#
+# AC_PROG_JAVAH
+#
+# DESCRIPTION
+#
+# AC_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.
+#
+# LAST MODIFICATION
+#
+# 2002-03-25
+#
+# COPYLEFT
+#
+# Copyright (c) 2002 Luc Maisonobe <luc@spaceroots.org>
+#
+# 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.
+
+AC_DEFUN([AC_PROG_JAVAH],[
+AC_REQUIRE([AC_CANONICAL_SYSTEM])dnl
+AC_REQUIRE([AC_PROG_CPP])dnl
+test "x$JAVAH" = x && AC_CHECK_PROGS(JAVAH,gjavah gcjh javah)
+if test "x$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"])
+else
+true
+fi])
diff --git a/m4/ac_try_compile_java.m4 b/m4/ac_try_compile_java.m4
new file mode 100644
index 00000000..ab49aae5
--- /dev/null
+++ b/m4/ac_try_compile_java.m4
@@ -0,0 +1,53 @@
+##### http://autoconf-archive.cryp.to/ac_try_compile_java.html
+#
+# SYNOPSIS
+#
+# AC_TRY_COMPILE_JAVA
+#
+# DESCRIPTION
+#
+# AC_TRY_COMPILE_JAVA attempt to compile user given source.
+#
+# *Warning*: its success or failure can depend on a proper setting of
+# the CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Devin Weaver <ktohg@tritarget.com>
+#
+# 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.
+
+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 00000000..188c414a
--- /dev/null
+++ b/m4/ac_try_run_javac.m4
@@ -0,0 +1,54 @@
+##### http://autoconf-archive.cryp.to/ac_try_run_javac.html
+#
+# SYNOPSIS
+#
+# AC_TRY_RUN_JAVA
+#
+# DESCRIPTION
+#
+# AC_TRY_RUN_JAVA attempt to compile and run user given source.
+#
+# *Warning*: its success or failure can depend on a proper setting of
+# the CLASSPATH env. variable.
+#
+# Note: This is part of the set of autoconf M4 macros for Java
+# programs. It is VERY IMPORTANT that you download the whole set,
+# some macros depend on other. Unfortunately, the autoconf archive
+# does not support the concept of set of macros, so I had to break it
+# for submission. The general documentation, as well as the sample
+# configure.in, is included in the AC_PROG_JAVA macro.
+#
+# LAST MODIFICATION
+#
+# 2000-07-19
+#
+# COPYLEFT
+#
+# Copyright (c) 2000 Devin Weaver <ktohg@tritarget.com>
+#
+# 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.
+
+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*])
diff --git a/m4/as-compiler-flag.m4 b/m4/as-compiler-flag.m4
new file mode 100644
index 00000000..0f660cf0
--- /dev/null
+++ b/m4/as-compiler-flag.m4
@@ -0,0 +1,62 @@
+dnl as-compiler-flag.m4 0.1.0
+
+dnl autostars m4 macro for detection of compiler flags
+
+dnl David Schleef <ds@schleef.org>
+
+dnl $Id: as-compiler-flag.m4,v 1.1 2005/12/15 23:35:19 ds Exp $
+
+dnl AS_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
+dnl Tries to compile with the given CFLAGS.
+dnl Runs ACTION-IF-ACCEPTED if the compiler can compile with the flags,
+dnl and ACTION-IF-NOT-ACCEPTED otherwise.
+
+AC_DEFUN([AS_COMPILER_FLAG],
+[
+ AC_MSG_CHECKING([to see if compiler understands $1])
+
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+
+ AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
+ CFLAGS="$save_CFLAGS"
+
+ if test "X$flag_ok" = Xyes ; then
+ m4_ifvaln([$2],[$2])
+ true
+ else
+ m4_ifvaln([$3],[$3])
+ true
+ fi
+ AC_MSG_RESULT([$flag_ok])
+])
+
+dnl AS_COMPILER_FLAGS(VAR, FLAGS)
+dnl Tries to compile with the given CFLAGS.
+
+AC_DEFUN([AS_COMPILER_FLAGS],
+[
+ list=$2
+ flags_supported=""
+ flags_unsupported=""
+ AC_MSG_CHECKING([for supported compiler flags])
+ for each in $list
+ do
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $each"
+ AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
+ CFLAGS="$save_CFLAGS"
+
+ if test "X$flag_ok" = Xyes ; then
+ flags_supported="$flags_supported $each"
+ else
+ flags_unsupported="$flags_unsupported $each"
+ fi
+ done
+ AC_MSG_RESULT([$flags_supported])
+ if test "X$flags_unsupported" != X ; then
+ AC_MSG_WARN([unsupported compiler flags: $flags_unsupported])
+ fi
+ $1="$$1 $flags_supported"
+])
+
diff --git a/m4/check.m4 b/m4/check.m4
new file mode 100644
index 00000000..a2e0812d
--- /dev/null
+++ b/m4/check.m4
@@ -0,0 +1,133 @@
+dnl AM_PATH_CHECK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+dnl Test for check, and define CHECK_CFLAGS and CHECK_LIBS
+dnl
+
+AC_DEFUN([AM_PATH_CHECK],
+[
+ AC_ARG_WITH(check,
+ [ --with-check=PATH prefix where check is installed [default=auto]])
+
+ min_check_version=ifelse([$1], ,0.8.2,$1)
+
+ AC_MSG_CHECKING(for check - version >= $min_check_version)
+
+ if test x$with_check = xno; then
+ AC_MSG_RESULT(disabled)
+ ifelse([$3], , AC_MSG_ERROR([disabling check is not supported]), [$3])
+ else
+ if test "x$with_check" != x; then
+ CHECK_CFLAGS="-I$with_check/include"
+ CHECK_LIBS="-L$with_check/lib -lcheck"
+ else
+ CHECK_CFLAGS=""
+ CHECK_LIBS="-lcheck"
+ fi
+
+ ac_save_CFLAGS="$CFLAGS"
+ ac_save_LIBS="$LIBS"
+
+ CFLAGS="$CFLAGS $CHECK_CFLAGS"
+ LIBS="$CHECK_LIBS $LIBS"
+
+ rm -f conf.check-test
+ AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <check.h>
+
+int main ()
+{
+ int major, minor, micro;
+ char *tmp_version;
+
+ system ("touch conf.check-test");
+
+ /* HP/UX 9 (%@#!) writes to sscanf strings */
+ tmp_version = strdup("$min_check_version");
+ if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
+ printf("%s, bad version string\n", "$min_check_version");
+ return 1;
+ }
+
+ if ((CHECK_MAJOR_VERSION != check_major_version) ||
+ (CHECK_MINOR_VERSION != check_minor_version) ||
+ (CHECK_MICRO_VERSION != check_micro_version))
+ {
+ printf("\n*** The check header file (version %d.%d.%d) does not match\n",
+ CHECK_MAJOR_VERSION, CHECK_MINOR_VERSION, CHECK_MICRO_VERSION);
+ printf("*** the check library (version %d.%d.%d).\n",
+ check_major_version, check_minor_version, check_micro_version);
+ return 1;
+ }
+
+ if ((check_major_version > major) ||
+ ((check_major_version == major) && (check_minor_version > minor)) ||
+ ((check_major_version == major) && (check_minor_version == minor) && (check_micro_version >= micro)))
+ {
+ return 0;
+ }
+ else
+ {
+ printf("\n*** An old version of check (%d.%d.%d) was found.\n",
+ check_major_version, check_minor_version, check_micro_version);
+ printf("*** You need a version of check being at least %d.%d.%d.\n", major, minor, micro);
+ printf("***\n");
+ printf("*** If you have already installed a sufficiently new version, this error\n");
+ printf("*** probably means that the wrong copy of the check library and header\n");
+ printf("*** file is being found. Rerun configure with the --with-check=PATH option\n");
+ printf("*** to specify the prefix where the correct version was installed.\n");
+ }
+
+ return 1;
+}
+],, no_check=yes, [echo $ac_n "cross compiling; assumed OK... $ac_c"])
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+
+ if test "x$no_check" = x ; then
+ AC_MSG_RESULT(yes)
+ ifelse([$2], , :, [$2])
+ else
+ AC_MSG_RESULT(no)
+ if test -f conf.check-test ; then
+ :
+ else
+ echo "*** Could not run check test program, checking why..."
+ CFLAGS="$CFLAGS $CHECK_CFLAGS"
+ LIBS="$CHECK_LIBS $LIBS"
+ AC_TRY_LINK([
+#include <stdio.h>
+#include <stdlib.h>
+
+#include <check.h>
+], , [ echo "*** The test program compiled, but did not run. This usually means"
+ echo "*** that the run-time linker is not finding check. You'll need to set your"
+ echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
+ echo "*** to the installed location Also, make sure you have run ldconfig if that"
+ echo "*** is required on your system"
+ echo "***"
+ echo "*** If you have an old version installed, it is best to remove it, although"
+ echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
+ [ echo "*** The test program failed to compile or link. See the file config.log for"
+ echo "*** the exact error that occured." ])
+
+ CFLAGS="$ac_save_CFLAGS"
+ LIBS="$ac_save_LIBS"
+ fi
+
+ CHECK_CFLAGS=""
+ CHECK_LIBS=""
+
+ rm -f conf.check-test
+ ifelse([$3], , AC_MSG_ERROR([check not found]), [$3])
+ fi
+
+ AC_SUBST(CHECK_CFLAGS)
+ AC_SUBST(CHECK_LIBS)
+
+ rm -f conf.check-test
+
+ fi
+])
diff --git a/m4/dps_java_check_class.m4 b/m4/dps_java_check_class.m4
new file mode 100644
index 00000000..a86d6416
--- /dev/null
+++ b/m4/dps_java_check_class.m4
@@ -0,0 +1,89 @@
+##### http://autoconf-archive.cryp.to/dps_java_check_class.html
+#
+# SYNOPSIS
+#
+# DPS_JAVA_CHECK_CLASS(<class>,<action-if-found>,<action-if-not-found>)
+#
+# DESCRIPTION
+#
+# Test if a Java class is available. Based on AC_PROG_JAVAC_WORKS.
+# This version uses a cache variable which is both compiler, options
+# and classpath dependent (so if you switch from javac to gcj it
+# correctly notices and redoes the test).
+#
+# The macro tries to compile a minimal program importing <class>.
+# Some newer compilers moan about the failure to use this but fail or
+# produce a class file anyway. All moaing is sunk to /dev/null since
+# I only wanted to know if the class could be imported. This is a
+# recommended followup to DPS_CHECK_JAVA_PLUGIN with classpath
+# appropriately adjusted.
+#
+# LAST MODIFICATION
+#
+# 2008-01-28
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([DPS_JAVA_CHECK_CLASS],[
+m4_define([cache_val],[m4_translit(dps_cv_have_java_class_$1, " ." ,"__")])
+if test "x$CLASSPATH" != "x"; then
+xtra=" with classpath ${CLASSPATH}"
+xopts=`echo ${CLASSPATH} | ${SED} 's/^ *://'`
+xopts="-classpath $xopts"
+else xtra=""; xopts=""; fi
+cache_var="cache_val"AS_TR_SH([_Jc_${JAVAC}_Cp_${CLASSPATH}])
+AC_CACHE_CHECK([if the $1 class is available$xtra], [$cache_var], [
+JAVA_TEST=Testing.java
+CLASS_TEST=Testing.class
+cat << \EOF > $JAVA_TEST
+/* [#]xline __oline__ "configure" */
+import $1;
+public class Testing {
+}
+EOF
+if AC_TRY_COMMAND($JAVAC $JAVACFLAGS $xopts $JAVA_TEST) >/dev/null 2>&1; then
+ eval "${cache_var}=yes"
+else
+ eval "${cache_var}=no"
+ echo "configure: failed program was:" >&AC_FD_CC
+ cat $JAVA_TEST >&AC_FD_CC
+fi
+rm -f $JAVA_TEST $CLASS_TEST
+])
+if eval 'test "x$'${cache_var}'" = "xyes"'; then
+$2
+true; else
+$3
+false; fi])
diff --git a/m4/dps_libgcj_jar.m4 b/m4/dps_libgcj_jar.m4
new file mode 100644
index 00000000..777cd5c6
--- /dev/null
+++ b/m4/dps_libgcj_jar.m4
@@ -0,0 +1,86 @@
+##### http://autoconf-archive.cryp.to/dps_libgcj_jar.html
+#
+# SYNOPSIS
+#
+# DPS_LIBGCJ_JAR
+#
+# DESCRIPTION
+#
+# Locate libgcj.jar so you can place it before everything else when
+# using gcj.
+#
+# LAST MODIFICATION
+#
+# 2008-01-28
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([DPS_LIBGCJ_JAR],
+[
+AC_REQUIRE([AC_EXEEXT])
+AC_REQUIRE([AC_PROG_JAVAC])
+AC_REQUIRE([AC_PROG_FGREP])
+AC_CHECK_PROG(SED, sed)
+if test "x$SED" = "x"; then
+AC_MSG_WARN([sed not avaiable, so libgcj.jar test skipped])
+else
+AC_MSG_CHECKING([if $JAVAC is gcj]);
+jc=`eval "[echo x$JAVAC | $SED 's/^x.*\\/\\([^/]*\\)\$/x\\1/;s/^ *\\([^ ]*\\) .*$/\\1/;s/"$EXEEXT"$//']"`
+if test "x$jc" != "xxgcj"; then
+AC_MSG_RESULT(no)
+else
+AC_MSG_RESULT(yes)
+AC_MSG_CHECKING([libgcj.jar location])
+save_cp="$CLASSPATH";
+unset CLASSPATH;
+AC_MSG_CHECKING([gcj default classpath])
+cat << \EOF > Test.java
+/* [#]line __oline__ "configure" */
+public class Test {
+}
+EOF
+lgcj=`eval "[$JAVAC -v -C Test.java 2>&1 | $FGREP \\(system\\) | $SED 's/^ *\\([^ ]*\\) .*$/\\1/;s/\\.jar\\//.jar/']"`;
+if test -f Test.class && test "x$lgcj" != "x"; then
+AC_MSG_RESULT($lgcj)
+$1="$lgcj:"
+else
+AC_MSG_RESULT(failed)
+$1=""
+fi
+if test "x$save_cp" != "x"; then CLASSPATH="$save_cp"; fi
+rm -f Test.java Test.class
+fi
+fi
+])
diff --git a/m4/dps_xtra_classpath.m4 b/m4/dps_xtra_classpath.m4
new file mode 100644
index 00000000..83cc37e8
--- /dev/null
+++ b/m4/dps_xtra_classpath.m4
@@ -0,0 +1,71 @@
+##### http://autoconf-archive.cryp.to/dps_xtra_classpath.html
+#
+# SYNOPSIS
+#
+# DPS_XTRA_CLASSPATH(<classpath>,<class>,<jarfile>,<action-if-found>,<action-if-not-found>)
+#
+# DESCRIPTION
+#
+# Set $1 to extra classpath components required for class $2 found in
+# a jar file in $3. If the class is found do $4 and otherwise do $5.
+# Uses DPS_JAVA_CHECK_CLASS for testing whether a class is avialable
+#
+# LAST MODIFICATION
+#
+# 2008-01-28
+#
+# COPYLEFT
+#
+# Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of the
+# License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the respective Autoconf Macro's copyright
+# owner gives unlimited permission to copy, distribute and modify the
+# configure scripts that are the output of Autoconf when processing
+# the Macro. You need not follow the terms of the GNU General Public
+# License when using or distributing such scripts, even though
+# portions of the text of the Macro appear in them. The GNU General
+# Public License (GPL) does govern all other use of the material that
+# constitutes the Autoconf Macro.
+#
+# This special exception to the GPL applies to versions of the
+# Autoconf Macro released by the Autoconf Macro Archive. When you
+# make and distribute a modified version of the Autoconf Macro, you
+# may extend this special exception to the GPL to apply to your
+# modified version as well.
+
+AC_DEFUN([DPS_XTRA_CLASSPATH],[
+AC_CHECK_PROG(SED, sed)
+DPS_JAVA_CHECK_CLASS([$2],[got="yes"],[got="no"])
+cpxtra=""; saved_cp="${CLASSPATH}";
+for jhome in `ls -dr /usr/share/java /usr/java/* /usr/local/java/* 2> /dev/null`; do
+for jdir in lib jre/lib . ; do
+for jfile in $3; do
+if test "x$got" != "xyes" && test -f "$jhome/$jdir/$jfile"; then
+CLASSPATH="${saved_cp}:$jhome/$jdir/$jfile"
+DPS_JAVA_CHECK_CLASS([$2],[got="yes"; cpxtra="$jhome/$jdir/$jfile:"],[got="no"])
+fi; done; done; done
+if test "x${saved_cp}" != "x"; then
+CLASSPATH="${saved_cp}"
+else unset CLASSPATH; fi
+if test "x$got" = "xyes"; then
+$1="$cpxtra"
+$4
+true; else
+$5
+false; fi
+])
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
new file mode 100644
index 00000000..bfdfa1da
--- /dev/null
+++ b/m4/gtk-doc.m4
@@ -0,0 +1,39 @@
+dnl -*- mode: autoconf -*-
+
+# serial 1
+
+dnl Usage:
+dnl GTK_DOC_CHECK([minimum-gtk-doc-version])
+AC_DEFUN([GTK_DOC_CHECK],
+[
+ AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+ AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+ dnl for overriding the documentation installation directory
+ AC_ARG_WITH([html-dir],
+ AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+ [with_html_dir='${datadir}/gtk-doc/html'])
+ HTML_DIR="$with_html_dir"
+ AC_SUBST([HTML_DIR])
+
+ dnl enable/disable documentation building
+ AC_ARG_ENABLE([gtk-doc],
+ AS_HELP_STRING([--enable-gtk-doc],
+ [use gtk-doc to build documentation [[default=no]]]),,
+ [enable_gtk_doc=no])
+
+ if test x$enable_gtk_doc = xyes; then
+ ifelse([$1],[],
+ [PKG_CHECK_EXISTS([gtk-doc],,
+ AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
+ [PKG_CHECK_EXISTS([gtk-doc >= $1],,
+ AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
+ fi
+
+ AC_MSG_CHECKING([whether to build gtk-doc documentation])
+ AC_MSG_RESULT($enable_gtk_doc)
+
+ AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
+
+ AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
+ AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
+])