]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Distinguish the sscli 'csc' from the chicken Scheme 'csc'.
authorBruno Haible <bruno@clisp.org>
Mon, 8 Mar 2004 15:04:13 +0000 (15:04 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:49 +0000 (12:11 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/csharpcomp.c
gettext-tools/m4/ChangeLog
gettext-tools/m4/csharpcomp.m4

index 9ca13b40231ea4bf095ca9e59f0eee5daac7acd7..72cc410a8745d7b16659a30cf2ce9e51b2600ec4 100644 (file)
@@ -1,3 +1,25 @@
+2004-03-08  Bruno Haible  <bruno@clisp.org>
+
+       * csharpcomp.c (compile_csharp_using_sscli): Test whether csc is not
+       the chicken scheme's 'csc' compiler.
+       Reported by Colin Marquardt <colin@marquardt-home.de>.
+
+2004-02-07  Bruno Haible  <bruno@clisp.org>
+
+       * xalloc.h (xalloc_oversized): New macro, from gnulib.
+       * quotearg.h: New file, from gnulib.
+       * quotearg.c: New file, from gnulib.
+       * sh-quote.c: Include quotearg.h.
+       (sh_quoting_options): New variable.
+       (init_sh_quoting_options): New function.
+       (shell_quote_length, shell_quote_copy, shell_quote): Rewrite to use
+       quotearg.
+       * Makefile.am (libgettextlib_la_SOURCES): Add quotearg.h, quotearg.c.
+       * Makefile.msvc (OBJECTS): Add quotearg.obj.
+       (quotearg.obj): New rule.
+       * Makefile.vms (OBJECTS): Add quotearg.obj.
+       (quotearg.obj): New rule.
+
 2004-02-06  Bruno Haible  <bruno@clisp.org>
 
        * allocsa.h (sa_alignof): Define differently with HP-UX cc, to avoid
index 5a607ba5c0952a7e3e84600b0983f9275f930c91..2926e67e89367ccfe0f00e49f88c68b16554b68c 100644 (file)
@@ -324,16 +324,51 @@ compile_csharp_using_sscli (const char * const *sources,
   if (!csc_tested)
     {
       /* Test for presence of csc:
-        "csc -help >/dev/null 2>/dev/null"  */
+        "csc -help >/dev/null 2>/dev/null \
+         && ! { csc -help 2>/dev/null | grep -i chicken > /dev/null; }"  */
       char *argv[3];
+      pid_t child;
+      int fd[1];
       int exitstatus;
 
       argv[0] = "csc";
       argv[1] = "-help";
       argv[2] = NULL;
-      exitstatus = execute ("csc", "csc", argv, false, false, true, true, true,
-                           false);
-      csc_present = (exitstatus == 0);
+      child = create_pipe_in ("csc", "csc", argv, DEV_NULL, true, true, false,
+                             fd);
+      csc_present = false;
+      if (child != -1)
+       {
+         /* Read the subprocess output, and test whether it contains the
+            string "chicken".  */
+         char c[7];
+         size_t count = 0;
+
+         csc_present = true;
+         while (safe_read (fd[0], &c[count], 1) > 0)
+           {
+             if (c[count] >= 'A' && c[count] <= 'Z')
+               c[count] += 'a' - 'A';
+             count++;
+             if (count == 7)
+               {
+                 if (memcmp (c, "chicken", 7) == 0)
+                   csc_present = false;
+                 c[0] = c[1]; c[1] = c[2]; c[2] = c[3];
+                 c[3] = c[4]; c[4] = c[5]; c[5] = c[6];
+                 count--;
+               }
+           }
+
+         close (fd[0]);
+
+         /* Remove zombie process from process list, and retrieve exit
+            status.  */
+         exitstatus =
+           wait_subprocess (child, "csc", false, true, true, false);
+         if (exitstatus != 0)
+           csc_present = false;
+       }
       csc_tested = true;
     }
 
index 7e721e43dcf76f92309d8026b443781130035cbf..b4c746405324396cfa6bed2df2dd4b73102166de 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-08  Bruno Haible  <bruno@clisp.org>
+
+       * csharpcomp.m4 (gt_CSHARPCOMP): Test whether csc is not the chicken
+       scheme's 'csc' compiler.
+       Reported by Colin Marquardt <colin@marquardt-home.de>.
+
 2004-01-18  Bruno Haible  <bruno@clisp.org>
 
        * csharp.m4 (gt_CSHARP_CHOICE): Drop extra quoting of the # sign.
index ee7dfc60e4f7e4a5b90efc1d77380aa9576ae3f2..063ef049fb9cd2dc56de2f0458cd15a371e34bfd 100644 (file)
@@ -1,4 +1,4 @@
-# csharpcomp.m4 serial 2 (gettext-0.14.1)
+# csharpcomp.m4 serial 3 (gettext-0.15)
 dnl Copyright (C) 2003-2004 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
@@ -43,7 +43,8 @@ AC_DEFUN([gt_CSHARPCOMP],
         ;;
       sscli)
         if test -n "$HAVE_CSC_IN_PATH" \
-           && csc -help >/dev/null 2>/dev/null; then
+           && csc -help >/dev/null 2>/dev/null \
+           && ! { csc -help 2>/dev/null | grep -i chicken > /dev/null; }; then
           HAVE_CSC=1
           ac_result="csc"
           break