1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_libgcj_jar.html
3 # ===========================================================================
11 # Locate libgcj.jar so you can place it before everything else when using
16 # Copyright (c) 2008 Duncan Simpson <dps@simpson.demon.co.uk>
18 # This program is free software; you can redistribute it and/or modify it
19 # under the terms of the GNU General Public License as published by the
20 # Free Software Foundation; either version 2 of the License, or (at your
21 # option) any later version.
23 # This program is distributed in the hope that it will be useful, but
24 # WITHOUT ANY WARRANTY; without even the implied warranty of
25 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
26 # Public License for more details.
28 # You should have received a copy of the GNU General Public License along
29 # with this program. If not, see <http://www.gnu.org/licenses/>.
31 # As a special exception, the respective Autoconf Macro's copyright owner
32 # gives unlimited permission to copy, distribute and modify the configure
33 # scripts that are the output of Autoconf when processing the Macro. You
34 # need not follow the terms of the GNU General Public License when using
35 # or distributing such scripts, even though portions of the text of the
36 # Macro appear in them. The GNU General Public License (GPL) does govern
37 # all other use of the material that constitutes the Autoconf Macro.
39 # This special exception to the GPL applies to versions of the Autoconf
40 # Macro released by the Autoconf Archive. When you make and distribute a
41 # modified version of the Autoconf Macro, you may extend this special
42 # exception to the GPL to apply to your modified version as well.
46 AU_ALIAS([DPS_LIBGCJ_JAR], [AX_LIBGCJ_JAR])
47 AC_DEFUN([AX_LIBGCJ_JAR],
49 AC_REQUIRE([AC_EXEEXT])
50 AC_REQUIRE([AX_PROG_JAVAC])
51 AC_REQUIRE([AC_PROG_FGREP])
53 if test "x$SED" = "x"; then
54 AC_MSG_WARN([sed not avaiable, so libgcj.jar test skipped])
56 AC_MSG_CHECKING([if $JAVAC is gcj]);
57 jc=`eval "[echo x$JAVAC | $SED 's/^x.*\\/\\([^/]*\\)\$/x\\1/;s/^ *\\([^ ]*\\) .*$/\\1/;s/"$EXEEXT"$//']"`
58 if test "x$jc" != "xxgcj"; then
62 AC_MSG_CHECKING([libgcj.jar location])
65 AC_MSG_CHECKING([gcj default classpath])
66 cat << \EOF > Test.java
67 /* [#]line __oline__ "configure" */
71 lgcj=`eval "[$JAVAC -v -C Test.java 2>&1 | $FGREP \\(system\\) | $SED 's/^ *\\([^ ]*\\) .*$/\\1/;s/\\.jar\\//.jar/']"`;
72 if test -f Test.class && test "x$lgcj" != "x"; then
79 if test "x$save_cp" != "x"; then CLASSPATH="$save_cp"; fi
80 rm -f Test.java Test.class