[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gettext-0.14.1: /usr/bin/csc is not necessarily csharp
From: |
Bruno Haible |
Subject: |
Re: gettext-0.14.1: /usr/bin/csc is not necessarily csharp |
Date: |
Mon, 8 Mar 2004 16:00:33 +0100 |
User-agent: |
KMail/1.5 |
Colin Marquardt wrote:
> I'm building gettext-0.14.1 (as part of cvsgnome 2.5.2,
> http://www.akcaagac.com/index_cvsgnome.html) on a Debian unstable
> system. It seems to think that my /usr/bin/csc (part of the
> "chicken" package, "a simple Scheme-to-C compiler") is some C sharp
> executable.
>
> configure runs through, build then fails complaining that csc does
> not support the -n flag
Thanks for the report. The appended patch fixes it.
Bruno
*** gettext-tools/m4/csharpcomp.m4 30 Jan 2004 11:01:18 -0000 1.4
--- gettext-tools/m4/csharpcomp.m4 8 Mar 2004 14:59:45 -0000
***************
*** 1,4 ****
! # csharpcomp.m4 serial 2 (gettext-0.14.1)
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
--- 1,4 ----
! # 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,49 ****
;;
sscli)
if test -n "$HAVE_CSC_IN_PATH" \
! && csc -help >/dev/null 2>/dev/null; then
HAVE_CSC=1
ac_result="csc"
break
--- 43,50 ----
;;
sscli)
if test -n "$HAVE_CSC_IN_PATH" \
! && 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
*** gettext-tools/lib/csharpcomp.c 16 Jan 2004 10:53:42 -0000 1.3
--- gettext-tools/lib/csharpcomp.c 8 Mar 2004 14:59:45 -0000
***************
*** 324,339 ****
if (!csc_tested)
{
/* Test for presence of csc:
! "csc -help >/dev/null 2>/dev/null" */
char *argv[3];
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);
csc_tested = true;
}
--- 324,374 ----
if (!csc_tested)
{
/* Test for presence of csc:
! "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;
! 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;
}