This avoid annoying dialogs on macOS when Java has not been installed so far.
Reported by Iain Sandoe <idsandoe@googlemail.com> in
<https://gcc.gnu.org/pipermail/gcc/2022-June/238929.html>.
* gettext-runtime/configure.ac: When JAVA_CHOICE is 'no', bypass the gt_JAVACOMP
and JAR tests.
* gettext-tools/configure.ac: When JAVA_CHOICE is 'no', bypass the gt_JAVAEXEC,
gt_JAVACOMP, and JAR tests.
AC_PROG_INSTALL
gt_JAVA_CHOICE
-
-gt_JAVACOMP([1.5], [1.6])
-AC_CHECK_PROG([JAR], [jar], [jar])
-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
- BUILDJAVA=yes
-else
+AS_IF([test "$JAVA_CHOICE" != no], [
+ gt_JAVACOMP([1.5], [1.6])
+ AC_CHECK_PROG([JAR], [jar], [jar])
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
+ BUILDJAVA=yes
+ else
+ BUILDJAVA=no
+ fi
+], [
+ gt_JAVACOMP_DISABLED
+ JAR=
BUILDJAVA=no
-fi
+])
AC_SUBST([BUILDJAVA])
gt_CSHARPCOMP
AC_PROG_INSTALL
gt_JAVA_CHOICE
-
-gt_JAVAEXEC
-gt_JAVACOMP([1.5])
-AC_CHECK_PROG([JAR], [jar], [jar])
-if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
- BUILDJAVA=yes
-else
+AS_IF([test "$JAVA_CHOICE" != no], [
+ gt_JAVAEXEC
+ gt_JAVACOMP([1.5])
+ AC_CHECK_PROG([JAR], [jar], [jar])
+ if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then
+ BUILDJAVA=yes
+ else
+ BUILDJAVA=no
+ fi
+], [
+ gt_JAVAEXEC_DISABLED
+ gt_JAVACOMP_DISABLED
+ JAR=
BUILDJAVA=no
-fi
+])
AC_SUBST([BUILDJAVA])
if test -n "$HAVE_JAVAEXEC" && test $BUILDJAVA = yes; then
TESTJAVA=yes