Bug #1776
closedmake fails when compiling socket
Description
=begin
This is on cygwin on Windows XP, with a pristine trunk HEAD. After a successful
$ ./configure --enable-shared
make fails when compiling socket. The error message is as follows:
compiling socket
make: *** [mkmain.sh] Error 1
The mkmf.log file found in ext/socket is attached.
Regards, Martin.
=end
Updated by duerst (Martin Dürst) over 14 years ago
=begin
Attaching a file apparently failed (see Bug #1779).
I'm including the last few lines of the abovementioned mkmf.log file here:
have_type: checking for socklen_t in sys/types.h,netdb.h,string.h,sys/socket.h,netinet/in.h,arpa/inet.h... -------------------- yes
"gcc -I../../.ext/include/i386-cygwin -I../.././include -I../.././ext/socket -I. -O3 -g -Wall -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -c conftest.c"
checked program was:
/* begin /
1: #include "ruby.h"
2:
3: #include <sys/types.h>
4: #include <netdb.h>
5: #include <string.h>
6: #include <sys/socket.h>
7: #include <netinet/in.h>
8: #include <arpa/inet.h>
9:
10: /top/
11: typedef socklen_t conftest_type;
12: int conftestval[sizeof(conftest_type)?1:-1];
/ end */
/cygdrive/c/ruby/ruby/lib/mkmf.rb:277:in ensure in block in postpone': undefined method
close' for nil:NilClass (NoMethodError)
from /cygdrive/c/ruby/ruby/lib/mkmf.rb:281:in block in postpone' from /cygdrive/c/ruby/ruby/lib/mkmf.rb:249:in
open'
from /cygdrive/c/ruby/ruby/lib/mkmf.rb:271:in postpone' from /cygdrive/c/ruby/ruby/lib/mkmf.rb:685:in
checking_for'
from /cygdrive/c/ruby/ruby/lib/mkmf.rb:826:in have_header' from /cygdrive/c/ruby/ruby/ext/socket/extconf.rb:303:in
<top (required)>'
from ./ext/extmk.rb:154:in load' from ./ext/extmk.rb:154:in
extmake'
from ./ext/extmk.rb:445:in block in <main>' from ./ext/extmk.rb:441:in
each'
from ./ext/extmk.rb:441:in `'
=end
Updated by neomjp (neomjp neomjp) over 14 years ago
=begin
Worked for me here with cygwin-1.7.0-51 on XP, gcc4-core-4.3.2-2, ruby-1.8.7-p72-2, and compiling ruby-1.9.2-r24017 .
Looks like you have ruby 1.9.x installed in /cygdrive/c/ruby or c:\ruby, and that is the ruby that comes first in PATH. I suspect that it is a non-cygwin native win32 ruby, which failed to handle a cygwin-style path.
from ./ext/extmk.rb:154:in `load'
conf = ["#{$srcdir}/makefile.rb", "#{$srcdir}/extconf.rb"].find {|f| File.exist?(f)}
......
if conf
load $0 = conf
else
......
I suspect $srcdir had some cygwin-style path in it.
By the way, --enable-shared is the default in cygwin and is probably unnecessary. configure.in says:
case "$target_os" in
when(cygwin*|mingw*)
.....
case "$target_os" in
when(mingw*)
......
esac
: ${enable_shared=yes}
;;
when(aix*)
=end
Updated by yugui (Yuki Sonoda) over 14 years ago
- Assignee set to nobu (Nobuyoshi Nakada)
=begin
=end
Updated by duerst (Martin Dürst) over 14 years ago
- Status changed from Open to Closed
=begin
We haven't observed this problem for a long time anymore, so I think this bug should be closed.
=end