gcc - Error when compiling Ruby 1.8.7 from source: math.c:37: error: missing binary operator before token "(" -
this odd:
: josh@josh; wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.bz2 : josh@josh; tar xvjf ruby-1.8.7.tar.bz2 : josh@josh; cd ruby-1.8.7/ : josh@josh; cflags='-o0 -g -wall' ./configure --disable-pthread : josh@josh; make gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c array.c [...] gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c math.c math.c: in function ‘domain_check’: math.c:37: error: missing binary operator before token "(" make: *** [math.o] error 1
sure enough, math.c cannot compiled:
: josh@josh; gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c math.c math.c: in function ‘domain_check’: math.c:37: error: missing binary operator before token "("
there's nothing wrong math.c:
static void domain_check(x, msg) double x; char *msg; { while(1) { if (errno) { rb_sys_fail(msg); } if (isnan(x)) { #if defined(edom) errno = edom; #elif define(erange) # <== line 37 errno = erange; #endif continue; } break; } }
let's see pre-processor generating:
: josh@josh; gcc -e -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c math.c >/tmp/math.c math.c:37: error: missing binary operator before token "("
ok, looks alright, let's compile , see problem is:
: josh@josh; gcc -o0 -g -wall -druby_export -d_gnu_source=1 -i. -i. -c /tmp/math.c : josh@josh; echo $? 0 : josh@josh; ls -l math.o -rw-r--r-- 1 josh josh 20904 2011-03-04 13:47 math.o
now i've manually compiled math.c math.o, can build ruby. i'd still know in world going on.
any ideas?
it should read "#elif defined(xxx)"
Comments
Post a Comment