Compare commits

..

1 Commits

Author SHA1 Message Date
Benjamin Dauvergne 0a5b4e7da7 Release 2.8.1
gitea/lasso/pipeline/head This commit looks good Details
-·Major·overhaul·of·OpenSSL·API·usage·by·using·only·the·EVP·API·as·the·low¶
··level·API·(RSA*,·HMAC*)·is·deprecated.¶
-·Fix·wrong·parsing·of·Count·attribute·on·saml:ProxyRestriction,·thanks·to¶
··Maxime·Besson·from·Worteks.¶
-·Perl:·pass·LDFLAGS·to·Makefile.PL¶
-·Replace·use·of·deprecated·xmlSecBase64Decode·by·xmlSecBase64Decode_ex¶
-·Fix·overwrite·of·profile.signature_status·in·lasso_saml20_login_process_response_status_and_assertion¶
-·Fix·lot·of·GCC·warnings¶
2023-02-28 10:52:45 +01:00
22 changed files with 1673 additions and 20 deletions

View File

@ -15,13 +15,13 @@ dnl - Second number is the number of supported API versions where API version >
dnl first number.
dnl - Third number is the current API version implementation version number.
dnl See libtool explanations about current, age and release, later in this file.
AC_INIT([lasso],[m4_esyscmd(tools/git-version-gen .tarball-version)],[lasso-devel@lists.labs.libre-entreprise.org])
AC_INIT([lasso], m4_esyscmd([tools/git-version-gen .tarball-version]), lasso-devel@lists.labs.libre-entreprise.org)
dnl Check if autoconf ver > 2.53
AC_PREREQ([2.53])
AC_PREREQ(2.53)
AC_CONFIG_MACRO_DIR([m4])
dnl Perform only subset commands and variable relevant to the host type.
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CANONICAL_SYSTEM
dnl Check existence of a relative pathed source file.
AC_CONFIG_SRCDIR(lasso/lasso.c)
dnl Copy stamp REVISIO-INFO in the configure script.
@ -34,7 +34,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
m4_ifdef([AM_SILENT_RULES],[HAVE_AM_SILENT_RULES=yes])
AM_CONDITIONAL(HAVE_AM_SILENT_RULES, test x$HAVE_AM_SILENT_RULES != x)
dnl Create rules to automaticaly regenerate the config header.
AC_CONFIG_HEADERS([config.h lasso/lasso_config.h])
AM_CONFIG_HEADER([config.h lasso/lasso_config.h])
dnl Add --enable-maintainer-mode option to configure.
AM_MAINTAINER_MODE([enable])
@ -92,31 +92,31 @@ dnl Check for programs
dnl
AC_PROG_CC
AM_CFLAGS=""
AC_PROG_EGREP
LT_PROG_RC
AC_HEADER_STDC
LT_AC_PROG_RC
AC_EXEEXT
AC_PROG_CC_C_O
AM_SANITY_CHECK
AC_PROG_AWK
AC_PROG_LN_S
LT_INIT
AC_LIBTOOL_WIN32_DLL
AM_PROG_LIBTOOL
AC_SUBST(LIBTOOL_DEPS)
AS_COMPILER_FLAGS(WARNING_FLAGS, "-Wall -Wextra -Wno-missing-field-initializers -Wno-unused-parameter -Wold-style-definition -Wdeclaration-after-statement -Wmissing-declarations -Wredundant-decls -Wmissing-noreturn -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Winline -Wformat-nonliteral -Wformat-security -Wswitch-enum -Wswitch-default -Winit-self -Wmissing-include-dirs -Wundef -Waggregate-return -Wmissing-format-attribute -Wnested-externs")
dnl Find tar command for make dist
AC_CHECK_PROGS(TAR, gnutar gtar tar)
dnl Check existence of binding programs
AX_CHECK_CLASSPATH
AX_PROG_JAVAC
AX_PROG_JAVA
AX_PROG_JAVAH
AX_PROG_JAR
AX_XTRA_CLASSPATH([CLASSPATH_JUNIT],[junit.framework.Test],[junit.jar])
AC_CHECK_CLASSPATH
AC_PROG_JAVAC
AC_PROG_JAVA
AC_PROG_JAVAH
AC_PROG_JAR
DPS_XTRA_CLASSPATH(CLASSPATH_JUNIT, junit.framework.Test, junit.jar)
old_cp=$CLASSPATH
export CLASSPATH=${CLASSPATH}:${CLASSPATH_JUNIT}
AX_CHECK_JUNIT
AC_CHECK_JUNIT
if test "x$old_cp" = "x"; then
unset CLASSPATH
else
@ -142,8 +142,12 @@ test "z$U" != "z" && AC_MSG_ERROR(Compiler not ANSI compliant)
dnl Check for variadic macros
AC_CACHE_CHECK([for variadic cpp macros],
[ac_cv_cpp_variadic_macros],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
#define a(b,c...) printf(b,##c)]], [[a("foo");a("%s","bar");a("%s%s","baz","quux");]])],[ac_cv_cpp_variadic_macros=yes],[ac_cv_cpp_variadic_macros=no])])
[AC_TRY_COMPILE(
[#include <stdio.h>
#define a(b,c...) printf(b,##c)],
[a("foo");a("%s","bar");a("%s%s","baz","quux");],
ac_cv_cpp_variadic_macros=yes,
ac_cv_cpp_variadic_macros=no)])
if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
fi
@ -888,7 +892,8 @@ dnl ==========================================================================
dnl Writing result files
dnl ==========================================================================
AC_CONFIG_FILES([lasso-src-config], [chmod +x lasso-src-config])
AC_CONFIG_FILES([Makefile
AC_OUTPUT(
[Makefile
docs/Makefile
docs/lasso-book/Makefile
docs/lasso-book/figures/Makefile
@ -918,7 +923,6 @@ bindings/php7/examples/Makefile
bindings/php7/tests/Makefile
bindings/perl/Makefile
])
AC_OUTPUT
languages_available=`echo $languages_available | sed -e "s/^ //" `
AC_MSG_RESULT(

145
m4/ac_check_class.m4 Normal file
View File

@ -0,0 +1,145 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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)
])

61
m4/ac_check_classpath.m4 Normal file
View File

@ -0,0 +1,61 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

60
m4/ac_check_java_home.m4 Normal file
View File

@ -0,0 +1,60 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

69
m4/ac_check_junit.m4 Normal file
View File

@ -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)])

63
m4/ac_check_rqrd_class.m4 Normal file
View File

@ -0,0 +1,63 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

46
m4/ac_java_options.m4 Normal file
View File

@ -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
])

52
m4/ac_prog_jar.m4 Normal file
View File

@ -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
])

120
m4/ac_prog_java.m4 Normal file
View File

@ -0,0 +1,120 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

105
m4/ac_prog_java_cc.m4 Normal file
View File

@ -0,0 +1,105 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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

135
m4/ac_prog_java_works.m4 Normal file
View File

@ -0,0 +1,135 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
]
)

82
m4/ac_prog_javac.m4 Normal file
View File

@ -0,0 +1,82 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

73
m4/ac_prog_javac_works.m4 Normal file
View File

@ -0,0 +1,73 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

53
m4/ac_prog_javadoc.m4 Normal file
View File

@ -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
])

43
m4/ac_prog_javah.m4 Normal file
View File

@ -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])

53
m4/ac_try_compile_java.m4 Normal file
View File

@ -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*])

54
m4/ac_try_run_javac.m4 Normal file
View File

@ -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*])

62
m4/as-compiler-flag.m4 Normal file
View File

@ -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"
])

133
m4/check.m4 Normal file
View File

@ -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
])

View File

@ -0,0 +1,87 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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])

84
m4/dps_libgcj_jar.m4 Normal file
View File

@ -0,0 +1,84 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])

69
m4/dps_xtra_classpath.m4 Normal file
View File

@ -0,0 +1,69 @@
##### 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, see <http://www.gnu.org/licenses/>.
#
# 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
])