]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Create Java executables if gcj is found.
authorBruno Haible <bruno@clisp.org>
Wed, 17 Jul 2002 10:29:58 +0000 (10:29 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:38 +0000 (12:08 +0200)
17 files changed:
ChangeLog
configure.in
lib/ChangeLog
lib/Makefile.am
lib/javacomp.sh.in
lib/javaexec.c
lib/javaexec.h
m4/ChangeLog
m4/Makefile.am
m4/gcj.m4 [new file with mode: 0644]
m4/javacomp.m4
src/ChangeLog
src/Makefile.am
src/read-java.c
src/urlget.c
tests/ChangeLog
tests/msgunfmt-2

index cb1759391fb96249b125be407d7719843602527a..d48d42a18f4a2ec40ac6fdb6954c431f0e3643da 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2002-07-16  Bruno Haible  <bruno@clisp.org>
+
+       * configure.in: Call gt_GCJ and set BUILDJAVAEXE.
+
 2002-07-16  Bruno Haible  <haible@clisp.cons.org>
 
        * config.guess, config.sub: Update to GNU version 2002-07-09.
index d47322bcbc0465a9a69b2cc61db840a3df387f0d..90e11543ad70c5525775234260c87be7b61f2225 100644 (file)
@@ -2,8 +2,8 @@ dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
 AC_INIT
 AC_CONFIG_SRCDIR(src/msgfmt.c)
-AM_INIT_AUTOMAKE(gettext, 0.11.3-pre2)
-RELEASE_DATE=2002-04-24      dnl in "date +%Y-%m-%d" format
+AM_INIT_AUTOMAKE(gettext, 0.11.3)
+RELEASE_DATE=2002-07-17      dnl in "date +%Y-%m-%d" format
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
@@ -12,6 +12,14 @@ AC_PROG_INSTALL
 AC_PROG_YACC
 gt_PROG_LEX
 
+gt_GCJ
+if test -n "$HAVE_GCJ"; then
+  BUILDJAVAEXE=yes
+else
+  BUILDJAVAEXE=no
+fi
+AC_SUBST(BUILDJAVAEXE)
+
 gt_JAVACOMP
 AC_CHECK_PROG(JAR, jar, jar)
 if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then
index 7454ccc964180276537507ba6b5d47e60c068e0a..cca7ac55cd8ef43b48f6e33058bb2a93460cfe16 100644 (file)
@@ -1,3 +1,11 @@
+2002-07-16  Bruno Haible  <bruno@clisp.org>
+
+       * javaexec.h (execute_java_class): Add argument exe_dir.
+       * javaexec.c (execute_java_class): Add argument exe_dir. If given,
+       attempt to run a native executable.
+       * Makefile.am (DEFS): Define EXEEXT.
+       * javacomp.sh.in: Use HAVE_GCJ_C instead of HAVE_GCJ.
+
 2002-06-15  Bruno Haible  <bruno@clisp.org>
 
        * javacomp.c (compile_java_class): Ignore gcj versions that start with
index 2c4b89323268321644432cf0ef0d30b5f07d96ad..3f89a1351422a3f03c1ebfac0bec8908520528e4 100644 (file)
@@ -116,7 +116,7 @@ $(LIBADD_SOURCE) $(UNUSED_SOURCE) \
 stdbool.h.in \
 gen-lbrkprop.c 3level.h Combining.txt
 
-DEFS = -DLIBDIR=\"$(libdir)\" @DEFS@
+DEFS = -DLIBDIR=\"$(libdir)\" -DEXEEXT=\"$(EXEEXT)\" @DEFS@
 INCLUDES = -I. -I$(srcdir) -I.. -I../intl -I$(top_srcdir)/intl
 
 
index f1d07dc4828de15883c08d5a2235f730f29a54bf..e21a1af3ad2433f864ba8a042ec19e5e10523633 100644 (file)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # Compile a Java program.
 
-# Copyright (C) 2001 Free Software Foundation, Inc.
+# Copyright (C) 2001-2002 Free Software Foundation, Inc.
 # Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -42,7 +42,7 @@ if test -n "$CONF_JAVAC"; then
   exec $CONF_JAVAC "$@"
 else
   unset JAVA_HOME
-  if test -n "@HAVE_GCJ@"; then
+  if test -n "@HAVE_GCJ_C@"; then
     CLASSPATH="$CLASSPATH"
     export CLASSPATH
     test -z "$JAVA_VERBOSE" || echo gcj -C "$@"
index fd11f5c9385fe2da0ad934c37c08c38c99b72d92..092396c6e56fad20c230ccc5570d7d3d067ce686 100644 (file)
@@ -1,5 +1,5 @@
 /* Execute a Java program.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,7 @@
 #include "execute.h"
 #include "xsetenv.h"
 #include "sh-quote.h"
+#include "pathname.h"
 #include "xmalloc.h"
 #include "error.h"
 #include "gettext.h"
@@ -75,6 +76,7 @@
 bool
 execute_java_class (class_name,
                    classpaths, classpaths_count, use_minimal_classpath,
+                   exe_dir,
                    args,
                    verbose, quiet,
                    executer, private_data)
@@ -82,6 +84,7 @@ execute_java_class (class_name,
      const char * const *classpaths;
      unsigned int classpaths_count;
      bool use_minimal_classpath;
+     const char *exe_dir;
      const char * const *args;
      bool verbose;
      bool quiet;
@@ -92,6 +95,46 @@ execute_java_class (class_name,
   unsigned int nargs;
   char *old_JAVA_HOME;
 
+  /* Count args.  */
+  {
+    const char * const *arg;
+
+    for (nargs = 0, arg = args; *arg != NULL; nargs++, arg++)
+     ;
+  }
+
+  /* First, try a class compiled to a native code executable.  */
+  if (exe_dir != NULL)
+    {
+      char *exe_pathname = concatenated_pathname (exe_dir, class_name, EXEEXT);
+      char *old_classpath;
+      char **argv = (char **) alloca ((1 + nargs + 1) * sizeof (char *));
+      unsigned int i;
+
+      /* Set CLASSPATH.  */
+      old_classpath =
+       set_classpath (classpaths, classpaths_count, use_minimal_classpath,
+                      verbose);
+
+      argv[0] = exe_pathname;
+      for (i = 0; i <= nargs; i++)
+       argv[1 + i] = (char *) args[i];
+
+      if (verbose)
+       {
+         char *command = shell_quote_argv (argv);
+         printf ("%s\n", command);
+         free (command);
+       }
+
+      err = executer (class_name, exe_pathname, argv, private_data);
+
+      /* Reset CLASSPATH.  */
+      reset_classpath (old_classpath);
+
+      goto done1;
+    }
+
   {
     const char *java = getenv ("JAVA");
     if (java != NULL && java[0] != '\0')
@@ -152,14 +195,6 @@ execute_java_class (class_name,
       }
   }
 
-  /* Count args.  */
-  {
-    const char * const *arg;
-
-    for (nargs = 0, arg = args; *arg != NULL; nargs++, arg++)
-     ;
-  }
-
   /* Unset the JAVA_HOME environment variable.  */
   old_JAVA_HOME = getenv ("JAVA_HOME");
   if (old_JAVA_HOME != NULL)
index 8c4a167697277bf913a79c4eb29c046971740b5a..9f33aacfe80b305fb3b7516f70a7356e3cef3d84 100644 (file)
@@ -1,5 +1,5 @@
 /* Execute a Java program.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -32,6 +32,7 @@ typedef bool execute_fn PARAMS ((const char *progname,
    use a minimal one. This is likely to reduce possible problems if the
    user's CLASSPATH contains garbage or a classes.zip file of the wrong
    Java version.
+   exe_dir is a directory that may contain a native executable for the class.
    args is a NULL terminated list of arguments to be passed to the program.
    If verbose, the command to be executed will be printed.
    Then the command is passed to the execute function together with the
@@ -42,6 +43,7 @@ extern bool execute_java_class PARAMS ((const char *class_name,
                                        const char * const *classpaths,
                                        unsigned int classpaths_count,
                                        bool use_minimal_classpath,
+                                       const char *exe_dir,
                                        const char * const *args,
                                        bool verbose, bool quiet,
                                        execute_fn *executer,
index 7b905ac6920682b94d2f56b2098e0e46c46d141c..739f17d0f3b620d2a7188b2ee2eedcec8e5bd504 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-16  Bruno Haible  <bruno@clisp.org>
+
+       * gcj.m4: New file.
+       * Makefile.am (EXTRA_DIST): Add it.
+       * javacomp.m4 (gt_JAVACOMP): Set HAVE_GCJ_C instead of HAVE_GCJ.
+
 2002-07-14  Bruno Haible  <bruno@clisp.org>
 
        * libtool.m4 (_LT_AC_LTCONFIG_HACK): Add support for GNU/FreeBSD.
index 7ebe8b8ce4612a3be9da2eac808433dd1db6c7f4..53203cab4feae4832a44b99202d19fff80351808 100644 (file)
@@ -7,10 +7,10 @@ aclocal_DATA = codeset.m4 gettext.m4 glibc21.m4 iconv.m4 intdiv0.m4 isc-posix.m4
 # find . -type f -name '*.m4' -printf '%f\n'|sort |fmt |tr '\012' @ \
 #   |sed 's/@$/%/;s/@/ \\@/g' |tr @% '\012\012'
 EXTRA_DIST = README \
-backupfile.m4 c-bs-a.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 getline.m4 \
-gettext.m4 glibc21.m4 hostname.m4 iconv.m4 intdiv0.m4 inttypes_h.m4 \
-isc-posix.m4 javacomp.m4 javaexec.m4 lcmessage.m4 lib-ld.m4 lib-link.m4 \
-lib-prefix.m4 libtool.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 mkdtemp.m4 \
-progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 signed.m4 \
-ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 ulonglong.m4 \
-unionwait.m4
+backupfile.m4 c-bs-a.m4 codeset.m4 error.m4 flex.m4 fnmatch.m4 gcj.m4 \
+getline.m4 gettext.m4 glibc21.m4 hostname.m4 iconv.m4 intdiv0.m4 \
+inttypes_h.m4 isc-posix.m4 javacomp.m4 javaexec.m4 lcmessage.m4 lib-ld.m4 \
+lib-link.m4 lib-prefix.m4 libtool.m4 mbrtowc.m4 mbstate_t.m4 mbswidth.m4 \
+mkdtemp.m4 progtest.m4 setenv.m4 setlocale.m4 siginfo.m4 signalblocking.m4 \
+signed.m4 ssize_t.m4 stdbool.m4 stdint_h.m4 tmpdir.m4 uintmax_t.m4 \
+ulonglong.m4 unionwait.m4
diff --git a/m4/gcj.m4 b/m4/gcj.m4
new file mode 100644 (file)
index 0000000..af16707
--- /dev/null
+++ b/m4/gcj.m4
@@ -0,0 +1,76 @@
+# gcj.m4 serial 1 (gettext-0.11.3)
+dnl Copyright (C) 2002 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Check for a Java compiler that creates executables.
+# Assigns the variables GCJ and GCJFLAGS, and set HAVE_GCJ to nonempty,
+# if found. Otherwise sets HAVE_GCJ to empty.
+
+AC_DEFUN([gt_GCJ],
+[
+  AC_ARG_VAR([GCJ], [Java native code compiler command])
+  AC_ARG_VAR([GCJFLAGS], [Java native code compiler flags])
+
+  AC_MSG_CHECKING([for Java to native code compiler])
+  # Search for the gcj command or use the one provided by the user.
+  if test -z "$GCJ"; then
+    pushdef([AC_MSG_CHECKING],[:])dnl
+    pushdef([AC_CHECKING],[:])dnl
+    pushdef([AC_MSG_RESULT],[:])dnl
+    AC_CHECK_PROGS(GCJ, [gcj], [none])
+    popdef([AC_MSG_RESULT])dnl
+    popdef([AC_CHECKING])dnl
+    popdef([AC_MSG_CHECKING])dnl
+  fi
+  # Choose GCJFLAGS or use the one provided by the user.
+  if test "$GCJ" != none; then
+    test "${GCJFLAGS+set}" != set || GCJFLAGS="-O2 -g"
+  fi
+  # Check whether the version is ok and it can create executables.
+  ac_gcj_link="$GCJ $GCJFLAGS conftest.java --main=conftest -o conftest$ac_exeext"
+changequote(,)dnl
+  if test "$GCJ" != none \
+     && $GCJ --version 2>/dev/null | sed -e 's,^[^0-9]*,,' -e 1q | grep '^[3-9]' >/dev/null \
+     && (
+      # See if libgcj.so is well installed and if exception handling works.
+      cat > conftest.java <<EOF
+public class conftest {
+  public static void main (String[] args) {
+    try {
+      java.util.ResourceBundle.getBundle("foobar");
+    } catch (Exception e) {
+    }
+    System.exit(0);
+  }
+}
+EOF
+changequote([,])dnl
+      AC_TRY_EVAL([ac_gcj_link])
+      error=$?
+      if test $error = 0 && test "$cross_compiling" != yes; then
+        # Run conftest and catch its exit status, but silently.
+        error=`./conftest >/dev/null 2>&1; echo $?`
+        test $error = 0 || error=1
+        rm -f core conftest.core
+      fi
+      rm -f conftest.java conftest$ac_exeext
+      exit $error
+     ); then
+    :
+  else
+    GCJ=none
+  fi
+  AC_MSG_RESULT($GCJ)
+  if test "$GCJ" != none; then
+    HAVE_GCJ=1
+  else
+    HAVE_GCJ=
+  fi
+  AC_SUBST(GCJ)
+  AC_SUBST(GCJFLAGS)
+  AC_SUBST(HAVE_GCJ)
+])
index 2286540bbfd10af90511687f32a11d9cc6bc3780..3a74a2bec3ea16ccb1849af09388606ea4ab8d50 100644 (file)
@@ -46,7 +46,7 @@ EOF
         rm -f conftest.java conftest.class
         exit $error
        ); then
-      HAVE_GCJ=1
+      HAVE_GCJ_C=1
       ac_result="gcj -C"
     else
       if test -n "$HAVE_JAVAC_IN_PATH" \
@@ -85,7 +85,7 @@ changequote([,])dnl
   AC_SUBST(JAVAC)
   AC_SUBST(CLASSPATH)
   AC_SUBST(CLASSPATH_SEPARATOR)
-  AC_SUBST(HAVE_GCJ)
+  AC_SUBST(HAVE_GCJ_C)
   AC_SUBST(HAVE_JAVAC)
   AC_SUBST(HAVE_JIKES)
 ])
index 9653d8cef62821e05dcba9ea2bf351156cd044fb..9e8c0ad07a7ee9010c8c24fc2e1ba0d7c4b4a99e 100644 (file)
@@ -1,3 +1,18 @@
+2002-07-16  Bruno Haible  <bruno@clisp.org>
+
+       * read-java.c (msgdomain_read_java): Pass $GETTEXTJEXEDIR to
+       execute_java_class.
+       * urlget.c (fetch): Likewise.
+       * Makefile.am (DEFS): Define USEJEXE and GETTEXTJEXEDIR.
+       (GCJ, GCJFLAGS, USEJEXE): New variables.
+       (all-java*): Renamed to take into account BUILDJAVAEXE.
+       (install-data-java*): Likewise.
+       (installdirs-java*): Likewise.
+       (uninstall-java*): Likewise.
+       (install-exec-*): New rules.
+       (gnu.gettext.DumpResource, gnu.gettext.GetURL): New rules.
+       (CLEANFILES): Add them.
+
 2002-07-16  Bruno Haible  <bruno@clisp.org>
 
        * project-id: Make it work when the configure file was generated by
index a4fc1ad2f4d9d8c3b161997b9f005244965389f9..613b5865f48fbb59b0331e718756aaf24087c690 100644 (file)
@@ -46,13 +46,16 @@ projectsdir = $(pkgdatadir)/projects
 
 INCLUDES = -I. -I$(srcdir) -I.. -I$(top_srcdir)/libuniname \
 -I../lib -I$(top_srcdir)/lib -I../intl -I$(top_srcdir)/intl
-DEFS = -DLOCALEDIR=\"$(localedir)\" -DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
+DEFS = -DLOCALEDIR=\"$(localedir)\" -DUSEJEXE=$(USEJEXE) \
+-DGETTEXTJEXEDIR=\"$(pkglibdir)\" -DGETTEXTJAR=\"$(jardir)/gettext.jar\" \
 -DLIBDIR=\"$(libdir)\" -DGETTEXTDATADIR=\"$(pkgdatadir)\" \
 -DPROJECTSDIR=\"$(projectsdir)\" @DEFS@
 LDADD = ../lib/libgettextlib.la @LTLIBINTL@
 
 SED = sed
 YACC = @YACC@ -d
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
 JAR = @JAR@
 JAVACOMP = $(SHELL) ../lib/javacomp.sh
 
@@ -178,9 +181,21 @@ uninstall-local:
 
 # Special rules for Java compilation.
 
-all-local: all-java-@BUILDJAVA@
-all-java-no:
-all-java-yes: gettext.jar
+USEJEXE = $(USEJEXE_@BUILDJAVAEXE@)
+USEJEXE_yes = 1
+USEJEXE_no = 0
+
+all-local: all-java-@BUILDJAVAEXE@
+all-java-yes: gnu.gettext.DumpResource$(EXEEXT) gnu.gettext.GetURL$(EXEEXT)
+all-java-no: all-java-no-@BUILDJAVA@
+all-java-no-yes: gettext.jar
+all-java-no-no:
+
+gnu.gettext.DumpResource$(EXEEXT): $(srcdir)/gnu/gettext/DumpResource.java
+       $(GCJ) $(GCJFLAGS) $(srcdir)/gnu/gettext/DumpResource.java --main=gnu.gettext.DumpResource -o $@
+
+gnu.gettext.GetURL$(EXEEXT): $(srcdir)/gnu/gettext/GetURL.java
+       $(GCJ) $(GCJFLAGS) $(srcdir)/gnu/gettext/GetURL.java --main=gnu.gettext.GetURL -o $@
 
 gnu/gettext/DumpResource.class: $(srcdir)/gnu/gettext/DumpResource.java
        $(JAVACOMP) -d . $(srcdir)/gnu/gettext/DumpResource.java
@@ -191,22 +206,39 @@ gnu/gettext/GetURL.class: $(srcdir)/gnu/gettext/GetURL.java
 gettext.jar: gnu/gettext/DumpResource.class gnu/gettext/GetURL.class
        $(JAR) cf $@ gnu/gettext/DumpResource*.class gnu/gettext/GetURL*.class
 
-CLEANFILES = gettext.jar gnu/gettext/*.class
+CLEANFILES = gnu.gettext.DumpResource$(EXEEXT) gnu.gettext.GetURL$(EXEEXT) \
+             gettext.jar gnu/gettext/*.class
 
-install-data-local: install-java-@BUILDJAVA@
-install-java-no:
-install-java-yes: all-java-yes
+install-exec-local: install-exec-java-@BUILDJAVAEXE@
+install-exec-java-yes: all-java-yes
+       $(mkinstalldirs) $(DESTDIR)$(libdir)/$(PACKAGE)
+       $(INSTALL_PROGRAM) gnu.gettext.DumpResource$(EXEEXT) $(DESTDIR)$(libdir)/$(PACKAGE)/gnu.gettext.DumpResource$(EXEEXT)
+       $(INSTALL_PROGRAM) gnu.gettext.GetURL$(EXEEXT) $(DESTDIR)$(libdir)/$(PACKAGE)/gnu.gettext.GetURL$(EXEEXT)
+install-exec-java-no:
+
+install-data-local: install-data-java-@BUILDJAVAEXE@
+install-data-java-yes:
+install-data-java-no: install-data-java-no-@BUILDJAVA@
+install-data-java-no-yes: all-java-no-yes
        $(INSTALL_DATA) gettext.jar $(DESTDIR)$(jardir)/gettext.jar
+install-data-java-no-no:
 
-installdirs-local: installdirs-java-@BUILDJAVA@
-installdirs-java-no:
+installdirs-local: installdirs-java-@BUILDJAVAEXE@
 installdirs-java-yes:
+       $(mkinstalldirs) $(DESTDIR)$(libdir)/$(PACKAGE)
+installdirs-java-no: installdirs-java-no-@BUILDJAVA@
+installdirs-java-no-yes:
        $(mkinstalldirs) $(DESTDIR)$(jardir)
+installdirs-java-no-no:
 
-uninstall-local: uninstall-java-@BUILDJAVA@
-uninstall-java-no:
+uninstall-local: uninstall-java-@BUILDJAVAEXE@
 uninstall-java-yes:
+       $(RM) $(DESTDIR)$(libdir)/$(PACKAGE)/gnu.gettext.DumpResource$(EXEEXT)
+       $(RM) $(DESTDIR)$(libdir)/$(PACKAGE)/gnu.gettext.GetURL$(EXEEXT)
+uninstall-java-no: uninstall-java-no-@BUILDJAVA@
+uninstall-java-no-yes:
        $(RM) $(DESTDIR)$(jardir)/gettext.jar
+uninstall-java-no-no:
 
 
 # Special rules for Tcl auxiliary program.
index 6ca86a698c81c3cd1846a99c0d792a68018ea81b..3528bec60bdf37ba591982067586236c23d34619 100644 (file)
@@ -1,5 +1,5 @@
 /* Reading Java ResourceBundles.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -100,10 +100,21 @@ msgdomain_read_java (resource_name, locale_name)
      const char *locale_name;
 {
   const char *class_name = "gnu.gettext.DumpResource";
+  const char *gettextjexedir;
   const char *gettextjar;
   const char *args[3];
   struct locals locals;
 
+#if USEJEXE
+  /* Make it possible to override the executable's location.  This is
+     necessary for running the testsuite before "make install".  */
+  gettextjexedir = getenv ("GETTEXTJEXEDIR");
+  if (gettextjexedir == NULL || gettextjexedir[0] == '\0')
+    gettextjexedir = GETTEXTJEXEDIR;
+#else
+  gettextjexedir = NULL;
+#endif
+
   /* Make it possible to override the gettext.jar location.  This is
      necessary for running the testsuite before "make install".  */
   gettextjar = getenv ("GETTEXTJAR");
@@ -127,7 +138,7 @@ msgdomain_read_java (resource_name, locale_name)
   /* Dump the resource and retrieve the resulting output.
      Here we use the user's CLASSPATH, not a minimal one, so that the
      resource can be found.  */
-  if (execute_java_class (class_name, &gettextjar, 1, false,
+  if (execute_java_class (class_name, &gettextjar, 1, false, gettextjexedir,
                          args,
                          verbose, false,
                          execute_and_read_po_output, &locals))
index 356410bce422924c61b41bbe981526ea093b0d46..51d3d5c7f3983dbd89671279b1ee792d242ad402 100644 (file)
@@ -1,5 +1,5 @@
 /* Get the contents of an URL.
-   Copyright (C) 2001 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -248,9 +248,20 @@ fetch (url, file)
   /* First try: using Java.  */
   {
     const char *class_name = "gnu.gettext.GetURL";
+    const char *gettextjexedir;
     const char *gettextjar;
     const char *args[2];
 
+#if USEJEXE
+    /* Make it possible to override the executable's location.  This is
+       necessary for running the testsuite before "make install".  */
+    gettextjexedir = getenv ("GETTEXTJEXEDIR");
+    if (gettextjexedir == NULL || gettextjexedir[0] == '\0')
+      gettextjexedir = GETTEXTJEXEDIR;
+#else
+    gettextjexedir = NULL;
+#endif
+
     /* Make it possible to override the gettext.jar location.  This is
        necessary for running the testsuite before "make install".  */
     gettextjar = getenv ("GETTEXTJAR");
@@ -262,7 +273,7 @@ fetch (url, file)
     args[1] = NULL;
 
     /* Fetch the URL's contents.  */
-    if (execute_java_class (class_name, &gettextjar, 1, true,
+    if (execute_java_class (class_name, &gettextjar, 1, true, gettextjexedir,
                            args,
                            false, true,
                            execute_it, NULL) == 0)
index 001402f767b7f1cea9bf241adcacaeb432165bb9..2c847d63c0a5f57581b216c77f45a612657e3869 100644 (file)
@@ -1,3 +1,7 @@
+2002-07-16  Bruno Haible  <bruno@clisp.org>
+
+       * msgunfmt-2: Set GETTEXTJEXEDIR.
+
 2002-06-14  Bruno Haible  <bruno@clisp.org>
 
        * msgfmt-11: New file.
index 3a5814daddcb94ae98d19e0ca9f1417ebb1f1e35..a27cf4550bf70bd899cdea352c40bf9153a46231 100755 (executable)
@@ -37,7 +37,7 @@ ${MSGFMT} -j -d . -r prog -l fr fr.po || exit 1
 
 tmpfiles="$tmpfiles prog.out"
 : ${MSGUNFMT=msgunfmt}
-GETTEXTJAR=../src/gettext.jar \
+GETTEXTJEXEDIR=../src GETTEXTJAR=../src/gettext.jar \
 ${MSGUNFMT} --java -d . -r prog -l fr -o prog.out || exit 1
 
 tmpfiles="$tmpfiles prog.sort"