Changeset 21294
- Timestamp:
- 10/14/08 02:48:48 (3 months ago)
- Location:
- platform/wii/ruby_for_wii/ruby_1_8
- Files:
-
- 2 added
- 9 modified
-
common.mk (modified) (2 diffs)
-
config.sub (modified) (2 diffs)
-
configure_wii.sh (added)
-
ext/Setup (modified) (3 diffs)
-
ext/socket/extconf.rb (modified) (3 diffs)
-
ext/socket/getaddrinfo.c (modified) (5 diffs)
-
ext/socket/getnameinfo.c (modified) (1 diff)
-
ext/socket/socket.c (modified) (15 diffs)
-
gekko.c (added)
-
process.c (modified) (1 diff)
-
signal.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
platform/wii/ruby_for_wii/ruby_1_8/common.mk
r21288 r21294 59 59 variable.$(OBJEXT) \ 60 60 version.$(OBJEXT) \ 61 gekko.$(OBJEXT) \ 61 62 $(MISSING) 62 63 … … 433 434 version.$(OBJEXT): {$(VPATH)}version.c $(RUBY_H_INCLUDES) \ 434 435 {$(VPATH)}version.h {$(VPATH)}revision.h 436 gekko.$(OBJEXT): {$(VPATH)}gekko.c $(RUBY_H_INCLUDES) 435 437 436 438 dist: $(PROGRAM) -
platform/wii/ruby_for_wii/ruby_1_8/config.sub
r21288 r21294 5 5 # Free Software Foundation, Inc. 6 6 7 timestamp='2008-0 1-16'7 timestamp='2008-09-30' 8 8 9 9 # This file is (in principle) common to ALL GNU software. … … 149 149 -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ 150 150 -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ 151 -apple | -axis | -knuth | -cray )151 -apple | -axis | -knuth | -cray | -gekko) 152 152 os= 153 153 basic_machine=$1 -
platform/wii/ruby_for_wii/ruby_1_8/ext/Setup
r21288 r21294 1 #option nodynamic1 option nodynamic 2 2 3 3 #Win32API … … 11 11 #digest/sha2 12 12 #dl 13 #enumerator13 enumerator 14 14 #etc 15 15 #fcntl … … 23 23 #readline 24 24 #sdbm 25 #socket26 #stringio25 socket 26 stringio 27 27 #strscan 28 28 #syck 29 #syslog29 syslog 30 30 #tcltklib 31 #thread31 thread 32 32 #tk 33 33 #win32ole 34 #zlib34 zlib -
platform/wii/ruby_for_wii/ruby_1_8/ext/socket/extconf.rb
r21288 r21294 1 1 require 'mkmf' 2 3 #CPPFLAGS = -DHAVE_SENDMSG -DHAVE_RECVMSG -Dsocklen_t=int -DHAVE_SOCKET -DHAVE_HSTERROR -DHAVE_GETIPNODEBYNAME -I. -I/Users/takeru/tmp/devkitpro/libogc/include -I/Users/takeru/tmp/devkitpro/libogc/include 4 # -DHAVE_SENDMSG -DHAVE_RECVMSG -DHAVE_INET_NTOP -DHAVE_INET_PTON -DHAVE_GETSERVBYPORT -Dsocklen_t=int -DHAVE_SOCKET -DHAVE_HSTERROR -DHAVE_GETIPNODEBYNAME -DHAVE_SOCKETPAIR -DHAVE_GETHOSTNAME -I. -I/Users/takeru/tmp/devkitpro/libogc/include -I/Users/takeru/tmp/devkitpro/libogc/include 5 #-DHAVE_INET_NTOP -DHAVE_INET_PTON -DHAVE_GETSERVBYPORT -DHAVE_SOCKETPAIR -DHAVE_GETHOSTNAME 6 puts "RUBY_PLATFORM=#{RUBY_PLATFORM}" 7 GEKKO = Config::CONFIG["CFLAGS"] =~ /-DGEKKO/ 2 8 3 9 case RUBY_PLATFORM … … 259 265 $objs += ["getaddrinfo.#{$OBJEXT}"] 260 266 $objs += ["getnameinfo.#{$OBJEXT}"] 261 have_func("inet_ntop") or have_func("inet_ntoa") 262 have_func("inet_pton") or have_func("inet_aton") 263 have_func("getservbyport") 267 unless GEKKO 268 have_func("inet_ntop") or have_func("inet_ntoa") 269 have_func("inet_pton") or have_func("inet_aton") 270 have_func("getservbyport") 271 end 264 272 have_header("arpa/nameser.h") 265 273 have_header("resolv.h") … … 276 284 have_func("hsterror") 277 285 have_func("getipnodebyname") or have_func("gethostbyname2") 278 have_func("socketpair") 279 unless have_func("gethostname") 280 have_func("uname") 286 unless GEKKO 287 have_func("socketpair") 288 unless have_func("gethostname") 289 have_func("uname") 290 end 281 291 end 282 292 if enable_config("socks", ENV["SOCKS_SERVER"]) -
platform/wii/ruby_for_wii/ruby_1_8/ext/socket/getaddrinfo.c
r21288 r21294 45 45 #if defined(__BEOS__) && !defined(BONE) 46 46 # include <net/socket.h> 47 #elif defined(GEKKO) 48 # include <network.h> 49 #define socket io_net_socket 50 #define gethostbyname net_gethostbyname 51 #include <errno.h> 52 #define h_errno errno 47 53 #else 48 54 # include <sys/socket.h> … … 388 394 port = htons((unsigned short)atoi(servname)); 389 395 } else { 396 #if !defined(GEKKO) 390 397 struct servent *sp; 391 398 char *proto; … … 418 425 } else 419 426 ERR(EAI_PROTOCOL); /*xxx*/ 420 } 421 } 422 427 #else 428 ERR(EAI_SERVICE); 429 ERR(EAI_PROTOCOL); 430 #endif 431 } 432 } 433 423 434 /* 424 435 * hostname == NULL. … … 619 630 #endif 620 631 if (hp == NULL) { 632 #if !defined(GEKKO) 621 633 switch (h_error) { 622 634 case HOST_NOT_FOUND: … … 632 644 break; 633 645 } 646 #else 647 error = EAI_NODATA; 648 #endif 634 649 goto bad; 635 650 } -
platform/wii/ruby_for_wii/ruby_1_8/ext/socket/getnameinfo.c
r21288 r21294 41 41 #if defined(__BEOS__) && !defined(BONE) 42 42 # include <net/socket.h> 43 #elif defined(GEKKO) 44 # include <network.h> 45 #include <errno.h> 46 #define h_errno errno 43 47 #else 44 48 # include <sys/socket.h> -
platform/wii/ruby_for_wii/ruby_1_8/ext/socket/socket.c
r21288 r21294 29 29 #if defined(__BEOS__) && !defined(BONE) 30 30 # include <net/socket.h> 31 #elif defined(GEKKO) 32 # include <network.h> 33 #define setsockopt io_net_setsockopt 34 #define shutdown io_net_shutdown 35 #define sendto io_net_sendto 36 #define send io_net_send 37 #define recvfrom io_net_recvfrom 38 #define socket io_net_socket 39 #define connect io_net_connect 40 #define bind io_net_bind 41 #define listen io_net_listen 42 #define gethostbyname net_gethostbyname 43 #define accept io_net_accept 44 #define h_addr 45 #define MSG_OOB 0 31 46 #else 32 47 # include <sys/socket.h> … … 464 479 VALUE sock, lev, optname; 465 480 { 466 #if !defined(__BEOS__) 481 #if !defined(__BEOS__) && !defined(GEKKO) 467 482 int level, option; 468 483 socklen_t len; … … 913 928 hostp = host_str(host, hbuf, sizeof(hbuf)); 914 929 portp = port_str(port, pbuf, sizeof(pbuf)); 915 930 //printf("hostp=%s portp=%s\n", hostp, portp); 916 931 if (socktype == 0 && flags == 0 && str_isnumber(portp)) { 917 932 socktype = SOCK_DGRAM; … … 923 938 hints.ai_flags = flags; 924 939 error = getaddrinfo(hostp, portp, &hints, &res); 940 //printf("getaddrinfo error=%d\n", error); 925 941 if (error) { 926 942 if (hostp && hostp[strlen(hostp)-1] == '\n') { … … 1013 1029 { 1014 1030 int fd; 1015 1016 1031 fd = socket(domain, type, proto); 1032 //printf("socket1:domain=%d type=%d proto=%d fd=%d\n", domain, type, proto, fd); 1017 1033 if (fd < 0) { 1018 1034 if (errno == EMFILE || errno == ENFILE) { 1019 1035 rb_gc(); 1020 1036 fd = socket(domain, type, proto); 1037 //printf("socket2:domain=%d type=%d proto=%d fd=%d\n", domain, type, proto, fd); 1021 1038 } 1022 1039 } … … 1070 1087 #define WAIT_IN_PROGRESS 0 1071 1088 #endif 1089 #ifdef GEKKO 1090 #define WAIT_IN_PROGRESS 0 1091 #endif 1072 1092 #ifndef WAIT_IN_PROGRESS 1073 1093 /* BSD origin code apparently has a problem */ … … 1089 1109 socklen_t sockerrlen; 1090 1110 #endif 1111 1112 /* 1113 { 1114 struct sockaddr_in *sa; 1115 sa = (struct sockaddr_in*)sockaddr; 1116 printf("ruby_connect:sockaddr_in f=%d p=%d a=%x\n", sa->sin_family, ntohs(sa->sin_port), sa->sin_addr.s_addr); 1117 } 1118 */ 1091 1119 1092 1120 #if defined(HAVE_FCNTL) … … 1112 1140 #endif /* HAVE_FCNTL */ 1113 1141 1142 1114 1143 for (;;) { 1115 1144 #if defined(SOCKS) && !defined(SOCKS5) … … 1122 1151 status = connect(fd, sockaddr, len); 1123 1152 } 1153 //printf("ruby_connect:connect:status=%d\n", status); 1154 1155 1124 1156 if (status < 0) { 1125 1157 switch (errno) { … … 1145 1177 #endif 1146 1178 status = wait_connectable(fd); 1179 //printf("ruby_connect:wait_connectable:status=%d\n", status); 1147 1180 if (status) { 1148 1181 break; … … 1227 1260 const char *syscall = 0; 1228 1261 1262 //printf("arg->remote.serv=%d\n", NUM2INT(arg->remote.serv)); 1229 1263 arg->remote.res = sock_addrinfo(arg->remote.host, arg->remote.serv, SOCK_STREAM, 1230 1264 (type == INET_SERVER) ? AI_PASSIVE : 0); 1265 1231 1266 /* 1232 1267 * Maybe also accept a local address … … 1240 1275 for (res = arg->remote.res; res; res = res->ai_next) { 1241 1276 status = ruby_socket(res->ai_family,res->ai_socktype,res->ai_protocol); 1277 //printf("socket:status=%d\n", status); 1242 1278 syscall = "socket(2)"; 1243 1279 fd = status; … … 1261 1297 } 1262 1298 1299 /* 1300 { 1301 struct sockaddr_in *sa; 1302 sa = (struct sockaddr_in*)res->ai_addr; 1303 printf("sockaddr_in f=%d p=%d a=%x len=%d\n", sa->sin_family, ntohs(sa->sin_port), sa->sin_addr.s_addr, res->ai_addrlen); 1304 } 1305 */ 1306 1263 1307 if (status >= 0) { 1264 1308 status = ruby_connect(fd, res->ai_addr, res->ai_addrlen, 1265 1309 (type == INET_SOCKS)); 1310 //printf("connect:status=%d\n", status); 1266 1311 syscall = "connect(2)"; 1267 1312 } … … 3427 3472 VALUE *argv; 3428 3473 { 3474 #if !defined(GEKKO) 3429 3475 VALUE service, proto; 3430 3476 struct servent *sp; … … 3450 3496 } 3451 3497 return INT2FIX(port); 3498 #else 3499 rb_notimplement(); 3500 #endif 3452 3501 } 3453 3502 -
platform/wii/ruby_for_wii/ruby_1_8/process.c
r21288 r21294 1547 1547 status = system(StringValueCStr(cmd)); 1548 1548 last_status_set((status & 0xff) << 8, 0); 1549 #elif defined(GEKKO) 1550 status = 0; 1549 1551 #else 1550 1552 volatile VALUE prog = 0; -
platform/wii/ruby_for_wii/ruby_1_8/signal.c
r21288 r21294 20 20 #ifdef __BEOS__ 21 21 #undef SIGBUS 22 #endif 23 24 #ifdef GEKKO 25 #define MACOS_UNUSE_SIGNAL 22 26 #endif 23 27 … … 578 582 #endif 579 583 580 #if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL) 584 #if !defined(BSD_SIGNAL) && !defined(POSIX_SIGNAL) && !defined(GEKKO) 581 585 if (rb_trap_accept_nativethreads[sig]) { 582 586 ruby_nativethread_signal(sig, sighandler);
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)