+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.
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.
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
+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
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
#!/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
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 "$@"
/* 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
#include "execute.h"
#include "xsetenv.h"
#include "sh-quote.h"
+#include "pathname.h"
#include "xmalloc.h"
#include "error.h"
#include "gettext.h"
bool
execute_java_class (class_name,
classpaths, classpaths_count, use_minimal_classpath,
+ exe_dir,
args,
verbose, quiet,
executer, private_data)
const char * const *classpaths;
unsigned int classpaths_count;
bool use_minimal_classpath;
+ const char *exe_dir;
const char * const *args;
bool verbose;
bool quiet;
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')
}
}
- /* 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)
/* 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
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
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,
+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.
# 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
--- /dev/null
+# 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)
+])
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" \
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)
])
+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
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
# 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
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.
/* 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
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");
/* 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))
/* 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
/* 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");
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)
+2002-07-16 Bruno Haible <bruno@clisp.org>
+
+ * msgunfmt-2: Set GETTEXTJEXEDIR.
+
2002-06-14 Bruno Haible <bruno@clisp.org>
* msgfmt-11: New file.
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"