From: Bruno Haible Date: Thu, 3 Jun 2010 22:38:04 +0000 (+0200) Subject: urlget: Don't attempt to run the Java program if we don't install it. X-Git-Tag: v0.18.1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dd44af3ec19bfd8456ed0de9bfa88274b3a78f24;p=thirdparty%2Fgettext.git urlget: Don't attempt to run the Java program if we don't install it. --- diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 18575d3c8..f3a5e0d2f 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,10 @@ +2010-06-03 Bruno Haible + + urlget: Don't attempt to run the Java program if we don't install it. + * Makefile.am (USEJAVA): New variable. + (DEFS): Define USEJAVA. + * urlget.c (fetch): Don't try to use Java is USEJAVA is 0. + 2010-05-19 Bruno Haible Link with libunistring, if it exists. diff --git a/gettext-tools/src/Makefile.am b/gettext-tools/src/Makefile.am index 31d3c573c..d9e76464e 100644 --- a/gettext-tools/src/Makefile.am +++ b/gettext-tools/src/Makefile.am @@ -70,6 +70,7 @@ AM_CPPFLAGS = \ DEFS = \ -DLOCALEDIR=\"$(localedir)\" -DBISON_LOCALEDIR=\"$(BISON_LOCALEDIR)\" \ -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \ + -DUSEJAVA=$(USEJAVA) \ -DUSEJEXE=$(USEJEXE) \ -DGETTEXTJEXEDIR=\"$(pkglibdir)\" \ -DGETTEXTJAR=\"$(jardir)/gettext.jar\" \ @@ -446,6 +447,12 @@ DISTCLEANFILES += user-email # Special rules for Java compilation. +USEJAVA = $(USEJAVA_@BUILDJAVAEXE@) +USEJAVA_yes = 1 +USEJAVA_no = $(USEJAVA_no_@BUILDJAVA@) +USEJAVA_no_yes = 1 +USEJAVA_no_no = 0 + USEJEXE = $(USEJEXE_@BUILDJAVAEXE@) USEJEXE_yes = 1 USEJEXE_no = 0 diff --git a/gettext-tools/src/urlget.c b/gettext-tools/src/urlget.c index 43feac818..db5a3bd4b 100644 --- a/gettext-tools/src/urlget.c +++ b/gettext-tools/src/urlget.c @@ -1,5 +1,5 @@ /* Get the contents of an URL. - Copyright (C) 2001-2003, 2005-2009 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2005-2010 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software: you can redistribute it and/or modify @@ -265,6 +265,7 @@ fetch (const char *url, const char *file) fflush (stderr); } +#if USEJAVA /* First try: using Java. */ { const char *class_name = "gnu.gettext.GetURL"; @@ -272,15 +273,15 @@ fetch (const char *url, const char *file) const char *gettextjar; const char *args[2]; -#if USEJEXE +# 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 = relocate (GETTEXTJEXEDIR); -#else +# else gettextjexedir = NULL; -#endif +# endif /* Make it possible to override the gettext.jar location. This is necessary for running the testsuite before "make install". */ @@ -309,6 +310,7 @@ fetch (const char *url, const char *file) return; } } +#endif /* Second try: using "wget -q -O - -T 30 url". */ {