* configure.ac: New switch for disabling -O2 (--disable-optimizations).
[cacao.git] / m4 / ac_prog_jar.m4
1 dnl taken from http://ac-archive.sourceforge.net/
2
3 dnl @synopsis AC_PROG_JAR
4 dnl
5 dnl AC_PROG_JAR tests for an existing jar program. It uses the
6 dnl environment variable JAR then tests in sequence various common jar
7 dnl programs.
8 dnl
9 dnl If you want to force a specific compiler:
10 dnl
11 dnl - at the configure.in level, set JAR=yourcompiler before calling
12 dnl AC_PROG_JAR
13 dnl
14 dnl - at the configure level, setenv JAR
15 dnl
16 dnl You can use the JAR variable in your Makefile.in, with @JAR@.
17 dnl
18 dnl Note: This macro depends on the autoconf M4 macros for Java
19 dnl programs. It is VERY IMPORTANT that you download that whole set,
20 dnl some macros depend on other. Unfortunately, the autoconf archive
21 dnl does not support the concept of set of macros, so I had to break it
22 dnl for submission.
23 dnl
24 dnl The general documentation of those macros, as well as the sample
25 dnl configure.in, is included in the AC_PROG_JAVA macro.
26 dnl
27 dnl @category Java
28 dnl @author Egon Willighagen <e.willighagen@science.ru.nl>
29 dnl @version 2000-07-19
30 dnl @license AllPermissive
31
32 AC_DEFUN([AC_PROG_JAR],[
33 AC_REQUIRE([AC_EXEEXT])dnl
34 if test "x$JAVAPREFIX" = x; then
35         test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar$EXEEXT zip$EXEEXT jar$EXEEXT)
36 else
37         test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar zip jar, $JAVAPREFIX)
38 fi
39 test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH])
40 AC_PROVIDE([$0])dnl
41 ])