bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Building m4-1.4 under Cray Unicos


From: Keith Thompson
Subject: Building m4-1.4 under Cray Unicos
Date: Sat, 4 Nov 2000 00:47:37 -0800 (PST)

I've run into a problem building GNU m4 version 1.4 on a Cray T3E
running Unicos.  I also have a workaround (or a solution, depending on
how you look at it).

config.guess says "alpha-cray-unicosmk2.0.5.X"

The C compiler on this system, "Cray Standard C Version 6.3.0.2", is
ANSI-compliant (or nearly so), but configure incorrectly decides that
it isn't.  Once it's done this, it tries to use ansi2knr, and this causes
various problems that I won't describe in detail.

configure, starting at line 824, generates the following C test program:
========================================================================
#line 824 "configure"
#include "confdefs.h"
#if !defined(__STDC__) || __STDC__ != 1
choke me
#endif  

int main() { return 0; }
int t() {
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
; return 0; }
========================================================================

The problem: Cray's C compiler defines __STDC__ as 2 by default.  I think
this is intended to imply that it supports standard C with extensions.

If you specify the argument "-h stdc", it sets __STDC__ to 1.  At first
I thought this was the solution, but when __STDC__ is set to 1, the
ecvt() function in <stdlib.h> becomes invisible (even if _POSIX_SOURCE)
is defined).

The workaround I've implemented is to apply the following patch to
configure:
========================================================================
*** configure,01        Sat Nov  5 19:44:17 1994
--- configure   Thu Nov  2 14:15:07 2000
***************
*** 822,828 ****
    cat > conftest.$ac_ext <<EOF
  #line 824 "configure"
  #include "confdefs.h"
! #if !defined(__STDC__) || __STDC__ != 1
  choke me
  #endif        
  
--- 822,828 ----
    cat > conftest.$ac_ext <<EOF
  #line 824 "configure"
  #include "confdefs.h"
! #if !defined(__STDC__) || __STDC__ < 1
  choke me
  #endif        
  
========================================================================

This has worked on at least two Cray T3Es.

This is admittedly an ugly workaround (even the C99 standard specifies
that __STDC__ is 1).  Perhaps it should be used only on Cray systems.

-- 
Keith Thompson (The_Other_Keith) address@hidden  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center           <*>  <http://www.sdsc.edu/~kst>
Welcome to the last year of the 20th century.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]