annotate m4/javacomp.m4 @ 17363:5a51fb7777a9

sys_select, sys_time: port 2013-01-30 Solaris 2.6 fix to Cygwin Problem reported by Marco Atzeri in <http://lists.gnu.org/archive/html/bug-gnulib/2013-03/msg00000.html>. * lib/sys_select.in.h [HAVE_SYS_SELECT_H && _CYGWIN_SYS_TIME_H]: Simply delegate to the system <sys/select.h> in this case too. Also, pay attention to _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H only if OSF/1, since otherwise Cygwin breaks, and it doesn't seem to be needed on Solaris either. * lib/sys_time.in.h [_CYGWIN_SYS_TIME_H]: Simply delgate to the system <sys/time.h> in this case.
author Paul Eggert <eggert@cs.ucla.edu>
date Tue, 19 Mar 2013 09:08:47 -0700
parents e542fd46ad6f
children 344018b6e5d7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12509
aa547f8201c1 javacomp: Portability fix.
Bruno Haible <bruno@clisp.org>
parents: 11007
diff changeset
1 # javacomp.m4 serial 12
17249
e542fd46ad6f maint: update all copyright year number ranges
Eric Blake <eblake@redhat.com>
parents: 16201
diff changeset
2 dnl Copyright (C) 2001-2003, 2006-2007, 2009-2013 Free Software Foundation,
12559
c2cbabec01dd update nearly all FSF copyright year lists to include 2010
Jim Meyering <meyering@redhat.com>
parents: 12509
diff changeset
3 dnl Inc.
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 dnl This file is free software; the Free Software Foundation
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 dnl gives unlimited permission to copy and/or distribute it,
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 dnl with or without modifications, as long as this notice is preserved.
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8 # Prerequisites of javacomp.sh.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
9 # gt_JAVACOMP([source-version], [target-version])
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
10 # Sets HAVE_JAVACOMP to nonempty if javacomp.sh will allow Java source code
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
11 # according to source-version to be compiled to Java bytecode classes in the
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
12 # target-version format.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
13 #
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
14 # source-version can be: support for
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
15 # 1.3 inner classes
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
16 # 1.4 assert keyword
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
17 # 1.5 generic classes and methods
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
18 # 1.6 (not yet supported)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
19 #
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
20 # target-version can be: classfile version:
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
21 # 1.1 45.3
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
22 # 1.2 46.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
23 # 1.3 47.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
24 # 1.4 48.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
25 # 1.5 49.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
26 # 1.6 50.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
27 # The classfile version of a .class file can be determined through the "file"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
28 # command. More portably, the classfile major version can be determined through
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
29 # "od -A n -t d1 -j 7 -N 1 classfile".
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
30 # target-version can also be omitted. In this case, the required target-version
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
31 # is determined from the found JVM (see macro gt_JAVAEXEC):
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
32 # target-version for JVM
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
33 # 1.1 JDK 1.1, jview
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
34 # 1.2 JDK/JRE 1.2
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
35 # 1.3 JDK/JRE 1.3, gij 3.3, 3.4
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
36 # 1.4 JDK/JRE 1.4, gij 4.0, 4.1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
37 # 1.5 JDK/JRE 1.5
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
38 # 1.6 JDK/JRE 1.6
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
39 # Note: gij >= 3.3 can in some cases handle classes compiled with -target 1.4,
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
40 # and gij >= 4.1 can in some cases partially handle classes compiled with
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
41 # -target 1.5, but I have no idea how complete this support is.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
42 #
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
43 # Specifying target-version is useful when building a library (.jar) that is
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
44 # useful outside the given package. Omitting target-version is useful when
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
45 # building an application.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
46 #
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
47 # It is unreasonable to ask for:
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
48 # - target-version < 1.4 with source-version >= 1.4, or
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
49 # - target-version < 1.5 with source-version >= 1.5, or
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
50 # - target-version < 1.6 with source-version >= 1.6,
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
51 # because even Sun's javac doesn't support these combinations.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
52 #
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
53 # It is redundant to ask for a target-version > source-version, since the
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
54 # smaller target-version = source-version will also always work and newer JVMs
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
55 # support the older target-versions too. Except for the case
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
56 # target-version = 1.4, source-version = 1.3, which allows gcj versions 3.0
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
57 # to 3.2 to be used.
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 AC_DEFUN([gt_JAVACOMP],
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60 [
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
61 ifelse([$2], [], [AC_REQUIRE([gt_JAVAEXEC])], [])
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
62 AC_EGREP_CPP([yes], [
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
63 #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 yes
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65 #endif
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66 ], CLASSPATH_SEPARATOR=';', CLASSPATH_SEPARATOR=':')
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
67 source_version=$1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
68 test -n "$source_version" || {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
69 AC_MSG_ERROR([missing source-version argument to gt_@&t@JAVACOMP])
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
70 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
71 ifelse([$2], [],
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
72 [if test -n "$HAVE_JAVAEXEC"; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
73 dnl Use $CONF_JAVA to determine the JVM's version.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
74 changequote(,)dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
75 cat > conftestver.java <<EOF
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
76 public class conftestver {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
77 public static void main (String[] args) {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
78 System.out.println(System.getProperty("java.specification.version"));
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
79 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
80 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
81 EOF
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
82 changequote([,])dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
83 dnl A precompiled version of conftestver.java, compiled with
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
84 dnl "javac -target 1.1". This avoids having to compile conftestver.java
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
85 dnl during each test for a suitable Java compiler.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
86 dnl For the conversion from binary to this ASCII encapsulation, avoiding
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
87 dnl to assume the presence of uudecode, use the command
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
88 dnl $ od -A n -t o1 < conftestver.class | tr ' ' '\012'| sort | uniq | sed -e '/^$/d' -e 's,^,\\,' | tr -d '\012'
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
89 dnl and the long tr command in opposite direction.
8117
29ffd490ca54 Work around a coreutils-5.x bug.
Bruno Haible <bruno@clisp.org>
parents: 8078
diff changeset
90 dnl Finally move the position corresponding to \055 to the last position,
29ffd490ca54 Work around a coreutils-5.x bug.
Bruno Haible <bruno@clisp.org>
parents: 8078
diff changeset
91 dnl to work around a coreutils-5.x bug.
12509
aa547f8201c1 javacomp: Portability fix.
Bruno Haible <bruno@clisp.org>
parents: 11007
diff changeset
92 echo 'yzwx!$!I!D,!)!3+!4!5*!6,!4!7,!8!9)!:)!;"!(MeienN"!$FGW"!%Ojab"!2QeibRohZblVYZgb"!%hYei"!9FXQfYpYKgYidKUnleidLGW"!,Ujol_bPegb"!3_jicnbmnpblJfYpY/!*!+)!</!=!>"!=fYpYJmkb_ece_YnejiJpblmeji/!?!@)!A/!B!C"!._jicnbmnpbl"!3fYpYKgYidKSZfb_n"!3fYpYKgYidKUqmnbh"!$jon"!8QfYpYKejKTleinUnlbYhL"!.dbnTljkblnq"!EFQfYpYKgYidKUnleidLGQfYpYKgYidKUnleidL"!6fYpYKejKTleinUnlbYh"!)kleingi"!8FQfYpYKgYidKUnleidLGW!D!(!)!!!!!#!"!*!+!"!,!!!@!"!"!!!&Hu!"r!!!"!.!!!(!"!!!"!+!/!0!"!,!!!F!#!"!!!/s!#5$v!%t!&r!!!"!.!!!,!#!!!$!.!%!"!1!!!#!2' \
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
93 | tr -d '\012\015' \
12509
aa547f8201c1 javacomp: Portability fix.
Bruno Haible <bruno@clisp.org>
parents: 11007
diff changeset
94 | tr '!"#$%&()*+,./0123456789:;<=>?@ABCDEFGHJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyzI' '\000\001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037\040\041\046\050\051\052\056\057\073\074\076\103\106\114\116\117\120\123\124\126\133\141\142\143\144\145\146\147\151\152\154\155\156\157\160\162\163\164\165\166\171\261\262\266\267\270\272\276\312\376\055' \
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
95 > conftestver.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
96 target_version=`{
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
97 unset JAVA_HOME
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
98 echo "$as_me:__oline__: CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
99 CLASSPATH=.${CLASSPATH:+$CLASSPATH_SEPARATOR$CLASSPATH} $CONF_JAVA conftestver 2>&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
100 }`
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
101 case "$target_version" in
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
102 1.1 | 1.2 | 1.3 | 1.4 | 1.5 | 1.6) ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
103 null)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
104 dnl JDK 1.1.X returns null.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
105 target_version=1.1 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
106 *) AC_MSG_WARN([unknown target-version $target_version, please update gt_@&t@JAVACOMP macro])
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
107 target_version=1.1 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
108 esac
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
109 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
110 target_version="1.1"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
111 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
112 ],
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
113 [target_version=$2])
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
114 case "$source_version" in
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
115 1.3) goodcode='class conftest {}'
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
116 failcode='class conftestfail { static { assert(true); } }' ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
117 1.4) goodcode='class conftest { static { assert(true); } }'
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
118 failcode='class conftestfail<T> { T foo() { return null; } }' ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
119 1.5) goodcode='class conftest<T> { T foo() { return null; } }'
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
120 failcode='class conftestfail syntax error' ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
121 *) AC_MSG_ERROR([invalid source-version argument to gt_@&t@JAVACOMP: $source_version]) ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
122 esac
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
123 case "$target_version" in
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
124 1.1) cfversion=45 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
125 1.2) cfversion=46 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
126 1.3) cfversion=47 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
127 1.4) cfversion=48 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
128 1.5) cfversion=49 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
129 1.6) cfversion=50 ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
130 *) AC_MSG_ERROR([invalid target-version argument to gt_@&t@JAVACOMP: $target_version]) ;;
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
131 esac
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
132 # Function to output the classfile version of a file (8th byte) in decimal.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
133 if od -A x < /dev/null >/dev/null 2>/dev/null; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
134 # Use POSIX od.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
135 func_classfile_version ()
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
136 {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
137 od -A n -t d1 -j 7 -N 1 "[$]1"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
138 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
139 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
140 # Use BSD hexdump.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
141 func_classfile_version ()
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
142 {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
143 dd if="[$]1" bs=1 count=1 skip=7 2>/dev/null | hexdump -e '1/1 "%3d "'
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
144 echo
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
145 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
146 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
147 AC_MSG_CHECKING([for Java compiler])
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
148 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
149 dnl The support of GNU gcj for target-version and source-version:
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
150 dnl
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
151 dnl gcj 3.0.4 to 4.2 does not have a way to specify the target-version.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
152 dnl It always assumes target-version=1.4 but labels the class files as 1.1.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
153 dnl One consequence of this is that gcj compiles GetURL.java to invalid
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
154 dnl bytecode, which crashes with a VerifyError when executed by Sun Java
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
155 dnl 1.3.1. The bug is registered as java/7066, see
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
156 dnl http://gcc.gnu.org/bugzilla/show_bug.cgi?id=7066
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
157 dnl gcj 4.3 and newer has an option -ftarget=1.X.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
158 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
159 dnl For gcj < 3.3, the source-version always is 1.3.
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
160 dnl For 3.3 <= gcj < 4.3, the source-version defaults to 1.4; option
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
161 dnl "-fno-assert" switches to source-version 1.3.
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
162 dnl gcj >= 4.3 has an option -fsource=1.X.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
163 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
164 dnl The support of Sun javac for target-version and source-version:
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
165 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
166 dnl javac 1.3: -target 1.1 1.2 1.3 default: 1.1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
167 dnl source always: 1.3
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
168 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
169 dnl javac 1.4: -target 1.1 1.2 1.3 1.4 default: 1.2
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
170 dnl -source 1.3 1.4 default: 1.3
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
171 dnl -target 1.1/1.2/1.3 only possible with -source 1.3 or no -source
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
172 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
173 dnl javac 1.5: -target 1.1 1.2 1.3 1.4 1.5 default: 1.5
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
174 dnl -source 1.3 1.4 1.5 default: 1.5
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
175 dnl -target 1.1/1.2/1.3 only possible with -source 1.3
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
176 dnl -target 1.4 only possible with -source 1.3/1.4
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
177 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
178 dnl javac 1.6: -target 1.1 1.2 1.3 1.4 1.5 1.6 default: 1.6
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
179 dnl -source 1.3 1.4 1.5 1.6 default: 1.5
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
180 dnl -target 1.1/1.2/1.3 only possible with -source 1.3
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
181 dnl -target 1.4 only possible with -source 1.3/1.4
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
182 dnl -target 1.5 only possible with -source 1.3/1.4/1.5 or no -source
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
183 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
184 dnl The support of jikes for target-version and source-version:
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
185 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
186 dnl jikes 1.14 does not have a way to specify the target-version. It
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
187 dnl always assumes target-version=1.1.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
188 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
189 dnl For jikes 1.14, the source-version always is 1.3.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
190 dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
191 CONF_JAVAC=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
192 HAVE_JAVAC_ENVVAR=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
193 HAVE_GCJ_C=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
194 HAVE_JAVAC=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
195 HAVE_JIKES=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
196 HAVE_JAVACOMP=
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
197 changequote(,)dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
198 cat > conftestlib.java <<EOF
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
199 public class conftestlib {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
200 public static void main (String[] args) {
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
201 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
202 }
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
203 EOF
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
204 changequote([,])dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
205 echo "$goodcode" > conftest.java
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
206 echo "$failcode" > conftestfail.java
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
207 dnl If the user has set the JAVAC environment variable, use that, if it
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
208 dnl satisfies the constraints (possibly after adding -target and -source
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
209 dnl options).
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
210 if test -n "$JAVAC"; then
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
211 dnl Try the original $JAVAC.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
212 if $JAVAC --version 2>/dev/null | sed -e 1q | grep gcj > /dev/null; then
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
213 dnl It's a version of gcj.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
214 changequote(,)dnl
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
215 if $JAVAC --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
216 changequote([,])dnl
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
217 dnl It's a version of gcj >= 4.3. Assume the classfile versions are correct.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
218 dnl Try $JAVAC.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
219 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
220 if { echo "$as_me:__oline__: $JAVAC -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
221 $JAVAC -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
222 } \
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
223 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
224 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
225 dnl Try adding -fsource option if it is useful.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
226 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
227 rm -f conftestfail.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
228 if { echo "$as_me:__oline__: $JAVAC -fsource=$source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
229 $JAVAC -fsource="$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
230 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
231 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
232 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
233 && { echo "$as_me:__oline__: $JAVAC -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
234 $JAVAC -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
235 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
236 && test -f conftestfail.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
237 && ! { echo "$as_me:__oline__: $JAVAC -fsource=$source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
238 $JAVAC -fsource="$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
239 }; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
240 CONF_JAVAC="$JAVAC -fsource=$source_version"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
241 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
242 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
243 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
244 CONF_JAVAC="$JAVAC"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
245 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
246 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
247 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
248 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
249 dnl Try with -fsource and -ftarget options.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
250 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
251 rm -f conftestfail.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
252 if { echo "$as_me:__oline__: $JAVAC -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
253 $JAVAC -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
254 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
255 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
256 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
257 CONF_JAVAC="$JAVAC -fsource=$source_version -ftarget=$target_version"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
258 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
259 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
260 fi
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
261 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
262 else
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
263 dnl It's a version of gcj < 4.3. Ignore the version of conftest.class.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
264 if test "$target_version" = 1.4 && test "$source_version" = 1.4; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
265 dnl Try $JAVAC.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
266 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
267 if { echo "$as_me:__oline__: $JAVAC -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
268 $JAVAC -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
269 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
270 && test -f conftest.class; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
271 CONF_JAVAC="$JAVAC"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
272 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
273 HAVE_JAVACOMP=1
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
274 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
275 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
276 if test "$target_version" = 1.4 && test "$source_version" = 1.3; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
277 dnl Try $JAVAC and "$JAVAC -fno-assert". But add -fno-assert only if
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
278 dnl it makes a difference. (It could already be part of $JAVAC.)
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
279 javac_works=
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
280 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
281 if { echo "$as_me:__oline__: $JAVAC -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
282 $JAVAC -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
283 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
284 && test -f conftest.class; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
285 javac_works=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
286 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
287 javac_noassert_works=
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
288 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
289 if { echo "$as_me:__oline__: $JAVAC -fno-assert -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
290 $JAVAC -fno-assert -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
291 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
292 && test -f conftest.class; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
293 javac_noassert_works=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
294 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
295 if test -n "$javac_works" && test -n "$javac_noassert_works"; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
296 rm -f conftestfail.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
297 if { echo "$as_me:__oline__: $JAVAC -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
298 $JAVAC -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
299 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
300 && test -f conftestfail.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
301 && ! { echo "$as_me:__oline__: $JAVAC -fno-assert -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
302 $JAVAC -fno-assert -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
303 }; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
304 dnl "$JAVAC -fno-assert" works better than $JAVAC.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
305 javac_works=
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
306 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
307 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
308 if test -n "$javac_works"; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
309 CONF_JAVAC="$JAVAC"
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
310 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
311 HAVE_JAVACOMP=1
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
312 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
313 if test -n "$javac_noassert_works"; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
314 CONF_JAVAC="$JAVAC -fno-assert"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
315 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
316 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
317 fi
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
318 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
319 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
320 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
321 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
322 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
323 dnl It's not gcj. Assume the classfile versions are correct.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
324 dnl Try $JAVAC.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
325 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
326 if { echo "$as_me:__oline__: $JAVAC -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
327 $JAVAC -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
328 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
329 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
330 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
331 dnl Try adding -source option if it is useful.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
332 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
333 rm -f conftestfail.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
334 if { echo "$as_me:__oline__: $JAVAC -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
335 $JAVAC -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
336 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
337 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
338 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
339 && { echo "$as_me:__oline__: $JAVAC -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
340 $JAVAC -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
341 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
342 && test -f conftestfail.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
343 && ! { echo "$as_me:__oline__: $JAVAC -source $source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
344 $JAVAC -source "$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
345 }; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
346 CONF_JAVAC="$JAVAC -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
347 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
348 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
349 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
350 CONF_JAVAC="$JAVAC"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
351 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
352 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
353 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
354 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
355 dnl Try with -target option alone. (Sun javac 1.3.1 has the -target
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
356 dnl option but no -source option.)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
357 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
358 if { echo "$as_me:__oline__: $JAVAC -target $target_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
359 $JAVAC -target "$target_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
360 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
361 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
362 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
363 dnl Try adding -source option if it is useful.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
364 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
365 rm -f conftestfail.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
366 if { echo "$as_me:__oline__: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
367 $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
368 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
369 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
370 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
371 && { echo "$as_me:__oline__: $JAVAC -target $target_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
372 $JAVAC -target "$target_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
373 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
374 && test -f conftestfail.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
375 && ! { echo "$as_me:__oline__: $JAVAC -target $target_version -source $source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
376 $JAVAC -target "$target_version" -source "$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
377 }; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
378 CONF_JAVAC="$JAVAC -target $target_version -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
379 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
380 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
381 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
382 CONF_JAVAC="$JAVAC -target $target_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
383 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
384 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
385 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
386 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
387 dnl Maybe this -target option requires a -source option? Try with
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
388 dnl -target and -source options. (Supported by Sun javac 1.4 and
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
389 dnl higher.)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
390 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
391 if { echo "$as_me:__oline__: $JAVAC -target $target_version -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
392 $JAVAC -target "$target_version" -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
393 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
394 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
395 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
396 CONF_JAVAC="$JAVAC -target $target_version -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
397 HAVE_JAVAC_ENVVAR=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
398 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
399 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
400 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
401 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
402 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
403 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
404 if test -z "$HAVE_JAVACOMP"; then
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
405 pushdef([AC_MSG_CHECKING],[:])dnl
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
406 pushdef([AC_CHECKING],[:])dnl
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
407 pushdef([AC_MSG_RESULT],[:])dnl
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
408 AC_CHECK_PROG([HAVE_GCJ_IN_PATH], [gcj], [yes])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
409 AC_CHECK_PROG([HAVE_JAVAC_IN_PATH], [javac], [yes])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
410 AC_CHECK_PROG([HAVE_JIKES_IN_PATH], [jikes], [yes])
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
411 popdef([AC_MSG_RESULT])dnl
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
412 popdef([AC_CHECKING])dnl
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
413 popdef([AC_MSG_CHECKING])dnl
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
414 if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_GCJ_IN_PATH"; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
415 dnl Test for a good gcj version (>= 3.0).
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
416 changequote(,)dnl
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
417 if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^3\.[01]/d' | grep '^[3-9]' >/dev/null; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
418 changequote([,])dnl
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
419 dnl See if libgcj.jar is well installed.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
420 if { echo "$as_me:__oline__: gcj -C -d . conftestlib.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
421 gcj -C -d . conftestlib.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
422 }; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
423 dnl OK, gcj works.
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
424 changequote(,)dnl
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
425 if gcj --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | sed -e '/^4\.[012]/d' | grep '^[4-9]' >/dev/null; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
426 changequote([,])dnl
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
427 dnl It's a version of gcj >= 4.3. Assume the classfile versions are correct.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
428 dnl Try gcj.
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
429 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
430 if { echo "$as_me:__oline__: gcj -C -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
431 gcj -C -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
432 } \
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
433 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
434 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
435 dnl Try adding -fsource option if it is useful.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
436 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
437 rm -f conftestfail.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
438 if { echo "$as_me:__oline__: gcj -C -fsource=$source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
439 gcj -C -fsource="$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
440 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
441 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
442 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
443 && { echo "$as_me:__oline__: gcj -C -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
444 gcj -C -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
445 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
446 && test -f conftestfail.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
447 && ! { echo "$as_me:__oline__: gcj -C -fsource=$source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
448 gcj -C -fsource="$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
449 }; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
450 CONF_JAVAC="gcj -C -fsource=$source_version"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
451 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
452 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
453 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
454 CONF_JAVAC="gcj -C"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
455 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
456 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
457 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
458 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
459 dnl Try with -fsource and -ftarget options.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
460 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
461 rm -f conftestfail.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
462 if { echo "$as_me:__oline__: gcj -C -fsource=$source_version -ftarget=$target_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
463 gcj -C -fsource="$source_version" -ftarget="$target_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
464 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
465 && test -f conftest.class \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
466 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
467 CONF_JAVAC="gcj -C -fsource=$source_version -ftarget=$target_version"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
468 HAVE_JAVAC_ENVVAR=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
469 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
470 fi
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
471 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
472 else
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
473 dnl It's a version of gcj < 4.3. Ignore the version of conftest.class.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
474 dnl Now test whether it supports the desired target-version and
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
475 dnl source-version.
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
476 if test "$target_version" = 1.4 && test "$source_version" = 1.4; then
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
477 rm -f conftest.class
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
478 if { echo "$as_me:__oline__: gcj -C -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
479 gcj -C -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
480 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
481 && test -f conftest.class; then
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
482 CONF_JAVAC="gcj -C"
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
483 HAVE_GCJ_C=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
484 HAVE_JAVACOMP=1
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
485 fi
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
486 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
487 if test "$target_version" = 1.4 && test "$source_version" = 1.3; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
488 dnl Try gcj and "gcj -fno-assert". But add -fno-assert only if
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
489 dnl it works (not gcj < 3.3).
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
490 rm -f conftest.class
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
491 if { echo "$as_me:__oline__: gcj -C -fno-assert -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
492 gcj -C -fno-assert -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
493 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
494 && test -f conftest.class; then
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
495 CONF_JAVAC="gcj -C -fno-assert"
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
496 HAVE_GCJ_C=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
497 HAVE_JAVACOMP=1
8078
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
498 else
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
499 rm -f conftest.class
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
500 if { echo "$as_me:__oline__: gcj -C -d . conftest.java" >&AS_MESSAGE_LOG_FD
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
501 gcj -C -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
502 } \
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
503 && test -f conftest.class; then
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
504 CONF_JAVAC="gcj -C"
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
505 HAVE_GCJ_C=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
506 HAVE_JAVACOMP=1
0a080a2d054b Make use of gcj-4.3's -fsource and -ftarget option.
Bruno Haible <bruno@clisp.org>
parents: 7022
diff changeset
507 fi
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
508 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
509 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
510 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
511 fi
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
512 fi
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
513 fi
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
514 fi
7022
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
515 if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_JAVAC_IN_PATH"; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
516 dnl Test whether javac is usable.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
517 if { javac -version >/dev/null 2>/dev/null || test $? -le 2; } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
518 && ( if javac -help 2>&1 >/dev/null | grep at.dms.kjc.Main >/dev/null && javac -help 2>/dev/null | grep 'released.*2000' >/dev/null ; then exit 1; else exit 0; fi ); then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
519 dnl OK, javac works.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
520 dnl Now test whether it supports the desired target-version and
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
521 dnl source-version.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
522 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
523 if { echo "$as_me:__oline__: javac -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
524 javac -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
525 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
526 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
527 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
528 dnl Try adding -source option if it is useful.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
529 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
530 rm -f conftestfail.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
531 if { echo "$as_me:__oline__: javac -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
532 javac -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
533 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
534 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
535 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
536 && { echo "$as_me:__oline__: javac -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
537 javac -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
538 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
539 && test -f conftestfail.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
540 && ! { echo "$as_me:__oline__: javac -source $source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
541 javac -source "$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
542 }; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
543 CONF_JAVAC="javac -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
544 HAVE_JAVAC=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
545 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
546 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
547 CONF_JAVAC="javac"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
548 HAVE_JAVAC=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
549 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
550 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
551 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
552 dnl Try with -target option alone. (Sun javac 1.3.1 has the -target
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
553 dnl option but no -source option.)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
554 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
555 if { echo "$as_me:__oline__: javac -target $target_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
556 javac -target "$target_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
557 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
558 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
559 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
560 dnl Try adding -source option if it is useful.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
561 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
562 rm -f conftestfail.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
563 if { echo "$as_me:__oline__: javac -target $target_version -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
564 javac -target "$target_version" -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
565 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
566 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
567 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
568 && { echo "$as_me:__oline__: javac -target $target_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
569 javac -target "$target_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
570 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
571 && test -f conftestfail.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
572 && ! { echo "$as_me:__oline__: javac -target $target_version -source $source_version -d . conftestfail.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
573 javac -target "$target_version" -source "$source_version" -d . conftestfail.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
574 }; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
575 CONF_JAVAC="javac -target $target_version -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
576 HAVE_JAVAC=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
577 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
578 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
579 CONF_JAVAC="javac -target $target_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
580 HAVE_JAVAC=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
581 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
582 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
583 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
584 dnl Maybe this -target option requires a -source option? Try with
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
585 dnl -target and -source options. (Supported by Sun javac 1.4 and
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
586 dnl higher.)
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
587 rm -f conftest.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
588 if { echo "$as_me:__oline__: javac -target $target_version -source $source_version -d . conftest.java" >&AS_MESSAGE_LOG_FD
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
589 javac -target "$target_version" -source "$source_version" -d . conftest.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
590 } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
591 && test -f conftest.class \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
592 && expr `func_classfile_version conftest.class` '<=' $cfversion >/dev/null 2>&AS_MESSAGE_LOG_FD; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
593 CONF_JAVAC="javac -target $target_version -source $source_version"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
594 HAVE_JAVAC=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
595 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
596 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
597 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
598 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
599 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
600 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
601 if test -z "$HAVE_JAVACOMP" && test -n "$HAVE_JIKES_IN_PATH"; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
602 dnl Test whether jikes is usable.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
603 if { jikes >/dev/null 2>/dev/null || test $? = 1; } \
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
604 && (
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
605 # See if the existing CLASSPATH is sufficient to make jikes work.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
606 unset JAVA_HOME
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
607 jikes conftestlib.java >&AS_MESSAGE_LOG_FD 2>&1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
608 error=$?
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
609 rm -f conftestlib.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
610 exit $error
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
611 ); then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
612 dnl OK, jikes works.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
613 dnl Now test whether it supports the desired target-version and
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
614 dnl source-version.
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
615 if test "$source_version" = 1.3; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
616 CONF_JAVAC="jikes"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
617 HAVE_JIKES=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
618 HAVE_JAVACOMP=1
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
619 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
620 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
621 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
622 fi
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
623 rm -f conftest*.java conftest*.class
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
624 if test -n "$HAVE_JAVACOMP"; then
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
625 ac_result="$CONF_JAVAC"
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
626 else
987fd3cc122a Update from GNU gettext 0.15. Accept source and target versions.
Bruno Haible <bruno@clisp.org>
parents: 5628
diff changeset
627 ac_result="no"
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
628 fi
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
629 AC_MSG_RESULT([$ac_result])
11007
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
630 AC_SUBST([CONF_JAVAC])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
631 AC_SUBST([CLASSPATH])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
632 AC_SUBST([CLASSPATH_SEPARATOR])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
633 AC_SUBST([HAVE_JAVAC_ENVVAR])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
634 AC_SUBST([HAVE_GCJ_C])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
635 AC_SUBST([HAVE_JAVAC])
f6cba5a556ce many *.m4 files: improve m4 quoting
Jim Meyering <meyering@redhat.com>
parents: 9457
diff changeset
636 AC_SUBST([HAVE_JIKES])
5628
0ceadee93518 New module 'javacomp'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
637 ])