File: ac_prog_jar.m4

package info (click to toggle)
libgnuinet-java 1.1.1-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 1,648 kB
  • ctags: 1,882
  • sloc: java: 14,444; sh: 8,326; makefile: 236; xml: 127
file content (54 lines) | stat: -rw-r--r-- 1,719 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
dnl Available from the GNU Autoconf Macro Archive at:
dnl http://www.gnu.org/software/ac-archive/htmldoc/ac_prog_jar.html
dnl
dnl Changes for gjdoc: 
dnl - check for "fastjar, jar", not only "jar";
dnl - output warning if detected jar is kaffe jar.
dnl
AC_DEFUN([AC_PROG_JAR],[
AC_REQUIRE([AC_EXEEXT])dnl
if test "x$JAVAPREFIX" = x; then
        test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar$EXEEXT jar$EXEEXT)
else
        test "x$JAR" = x && AC_CHECK_PROGS(JAR, fastjar$EXEEXT jar$EXEEXT, $JAVAPREFIX)
fi

dnl Complain if not found
test "x$JAR" = "x" && AC_MSG_ERROR([no acceptable jar program found in \$PATH])

dnl Strip any parameters
sed_expr_param=['s/[ ][^"]*$//']
jarabs=`echo $JAR | sed -e "$sed_expr_param"`

dnl Convert ~/ to $HOME/
sed_expr_home="s|^~/|$HOME/|"
jarabs=`echo $jarabs | sed -e "$sed_expr_home"`

dnl If not already absolute filename, find on PATH
sed_expr_abspath=['s/^~?\/.*$//']
if (test `echo $jarabs | sed -e "$sed_expr_abspath"`); then
  dnl Stolen from libtool.m4:
  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
  for dir in $PATH; do
    IFS="$lt_save_ifs"
    if (test -f $dir/$jarabs || test -f $dir/$jarabs$ac_exeext); then
      jarabs="$dir/$jarabs"
      break
    fi
  done
fi

dnl Warn if it's the kaffe jar
grep 'kaffe\.tools\.jar\.Jar' "$jarabs" >/dev/null
test "$?" != "0" || \
  AC_MSG_WARN([
The build seems to be using the Jar tool that comes with Kaffe.  Note
that there are known issues in some versions of this tool.
Unfortunately it does not support any --version option, so I can't
detect whether your version works.

If you see error messages from the Jar tool, or the build hangs,
please set environment variable JAR to a working Jar tool.
])
AC_PROVIDE([$0])dnl
])