]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
urlget: Don't attempt to run the Java program if we don't install it.
authorBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 22:38:04 +0000 (00:38 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 3 Jun 2010 22:38:04 +0000 (00:38 +0200)
gettext-tools/src/ChangeLog
gettext-tools/src/Makefile.am
gettext-tools/src/urlget.c

index 18575d3c8d4c2c5517e0e32d09a70fefd3432613..f3a5e0d2f5b34d0fffa88deabcfd681592d0b337 100644 (file)
@@ -1,3 +1,10 @@
+2010-06-03  Bruno Haible  <bruno@clisp.org>
+
+       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  <bruno@clisp.org>
 
        Link with libunistring, if it exists.
index 31d3c573c6905c0f6f7906880c3539d730d20309..d9e76464e1fd8ea633b6f217fb62eb02c2b2ebec 100644 (file)
@@ -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
index 43feac818c53ad531bd342bc72f1f108c20f82be..db5a3bd4b08c0ac96b642d562ede358fdf86220b 100644 (file)
@@ -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 <haible@clisp.cons.org>, 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".  */
   {