1 |
dnl Available from the GNU Autoconf Macro Archive at: |
dnl Available from the GNU Autoconf Macro Archive at: |
2 |
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_jar.html |
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_jar.html |
3 |
dnl |
dnl |
4 |
dnl Changes for gjdoc: check for "fastjar, jar", not only "jar"; |
dnl Changes for gjdoc: |
5 |
dnl output warning if detected jar is kaffe jar. |
dnl - check for "fastjar, jar", not only "jar"; |
6 |
|
dnl - output warning if detected jar is kaffe jar. |
7 |
dnl |
dnl |
8 |
AC_DEFUN([AC_PROG_JAR],[ |
AC_DEFUN([AC_PROG_JAR],[ |
9 |
AC_REQUIRE([AC_EXEEXT])dnl |
AC_REQUIRE([AC_EXEEXT])dnl |
12 |
else |
else |
13 |
test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar$EXEEXT jar$EXEEXT, $JAVAPREFIX) |
test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar$EXEEXT jar$EXEEXT, $JAVAPREFIX) |
14 |
fi |
fi |
15 |
test "x$JAR" = x && AC_MSG_ERROR([no acceptable jar program found in \$PATH]) |
|
16 |
grep kaffe\.tools\.jar\.Jar $JAR >/dev/null || \ |
dnl Complain if not found |
17 |
AC_MSG_WARN([The build seems to be using the Jar tool that comes with |
test "x$JAR" = "x" && AC_MSG_ERROR([no acceptable jar program found in \$PATH]) |
18 |
Kaffe. Note that there are known issues in some versions of this tool. |
|
19 |
|
dnl Strip any parameters |
20 |
|
sed_expr_param=['s/[ ][^"]*$//'] |
21 |
|
jarabs=`echo $JAR | sed -e "$sed_expr_param"` |
22 |
|
|
23 |
|
dnl Convert ~/ to $HOME/ |
24 |
|
sed_expr_home="s|^~/|$HOME/|" |
25 |
|
jarabs=`echo $jarabs | sed -e "$sed_expr_home"` |
26 |
|
|
27 |
|
dnl If not already absolute filename, find on PATH |
28 |
|
sed_expr_abspath=['s/^~?\/.*$//'] |
29 |
|
if (test `echo $jarabs | sed -e "$sed_expr_abspath"`); then |
30 |
|
dnl Stolen from libtool.m4: |
31 |
|
lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR |
32 |
|
for dir in $PATH; do |
33 |
|
IFS="$lt_save_ifs" |
34 |
|
if (test -f $dir/$jarabs || test -f $dir/$jarabs$ac_exeext); then |
35 |
|
jarabs="$dir/$jarabs" |
36 |
|
break |
37 |
|
fi |
38 |
|
done |
39 |
|
fi |
40 |
|
|
41 |
|
dnl Warn if it's the kaffe jar |
42 |
|
grep 'kaffe\.tools\.jar\.Jar' "$jarabs" >/dev/null |
43 |
|
test "$?" != "0" || \ |
44 |
|
AC_MSG_WARN([ |
45 |
|
The build seems to be using the Jar tool that comes with Kaffe. Note |
46 |
|
that there are known issues in some versions of this tool. |
47 |
|
Unfortunately it does not support any --version option, so I can't |
48 |
|
detect whether your version works. |
49 |
|
|
50 |
If you see error messages from the Jar tool, or the build hangs, |
If you see error messages from the Jar tool, or the build hangs, |
51 |
please set environment variable JAR to a working Jar tool.]) |
please set environment variable JAR to a working Jar tool. |
52 |
|
]) |
53 |
AC_PROVIDE([$0])dnl |
AC_PROVIDE([$0])dnl |
54 |
]) |
]) |