From: Bruno Haible Date: Mon, 8 Mar 2004 15:04:13 +0000 (+0000) Subject: Distinguish the sscli 'csc' from the chicken Scheme 'csc'. X-Git-Tag: v0.14.2~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0ac849a552ad05962ec8dcd0a53a0d91228d5c32;p=thirdparty%2Fgettext.git Distinguish the sscli 'csc' from the chicken Scheme 'csc'. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 9ca13b402..72cc410a8 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,25 @@ +2004-03-08 Bruno Haible + + * csharpcomp.c (compile_csharp_using_sscli): Test whether csc is not + the chicken scheme's 'csc' compiler. + Reported by Colin Marquardt . + +2004-02-07 Bruno Haible + + * 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 * allocsa.h (sa_alignof): Define differently with HP-UX cc, to avoid diff --git a/gettext-tools/lib/csharpcomp.c b/gettext-tools/lib/csharpcomp.c index 5a607ba5c..2926e67e8 100644 --- a/gettext-tools/lib/csharpcomp.c +++ b/gettext-tools/lib/csharpcomp.c @@ -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; } diff --git a/gettext-tools/m4/ChangeLog b/gettext-tools/m4/ChangeLog index 7e721e43d..b4c746405 100644 --- a/gettext-tools/m4/ChangeLog +++ b/gettext-tools/m4/ChangeLog @@ -1,3 +1,9 @@ +2004-03-08 Bruno Haible + + * csharpcomp.m4 (gt_CSHARPCOMP): Test whether csc is not the chicken + scheme's 'csc' compiler. + Reported by Colin Marquardt . + 2004-01-18 Bruno Haible * csharp.m4 (gt_CSHARP_CHOICE): Drop extra quoting of the # sign. diff --git a/gettext-tools/m4/csharpcomp.m4 b/gettext-tools/m4/csharpcomp.m4 index ee7dfc60e..063ef049f 100644 --- a/gettext-tools/m4/csharpcomp.m4 +++ b/gettext-tools/m4/csharpcomp.m4 @@ -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