ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/01/13/14:15:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Rugxulo <rugxulo AT gmail DOT com>
Newsgroups: comp.os.msdos.djgpp,comp.lang.ruby
Subject: Ruby 1.8.7pl330 + DJGPP (was Re: GCC-4.5.2)
Date: Thu, 13 Jan 2011 11:06:31 -0800 (PST)
Organization: http://groups.google.com
Lines: 74
Message-ID: <1fe05fe1-8da1-4680-98d9-0394c965dc0c@d8g2000yqf.googlegroups.com>
References: <4D24895D DOT 5010701 AT iki DOT fi> <4D2BF57A DOT 8080206 AT iki DOT fi>
NNTP-Posting-Host: 65.13.115.246
Mime-Version: 1.0
X-Trace: posting.google.com 1294945591 7357 127.0.0.1 (13 Jan 2011 19:06:31 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Thu, 13 Jan 2011 19:06:31 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: d8g2000yqf.googlegroups.com; posting-host=65.13.115.246; posting-account=p5rsXQoAAAB8KPnVlgg9E_vlm2dvVhfO
User-Agent: G2/1.0
X-HTTP-UserAgent: Opera/9.80 (Windows NT 5.1; U; en) Presto/2.7.62 Version/11.00,gzip(gfe)
Bytes: 3901
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hi,

On Jan 11, 12:15=A0am, Andris Pavenis <andris DOT pave DOT  DOT  DOT  AT iki DOT fi> wrote:
>
> Also
> =A0 =A0 =A0 =A0 - binary RPMs (built in CentOS-5.5 i686)
> =A0 =A0 =A0 =A0 - DJGPP packages for DJGPP v2.03r2
> =A0 =A0 =A0 =A0 - DJGPP packages for DJGPP v2.04 pre
> =A0 =A0 =A0 =A0 - corresponding source packages
> are available for testing purposes.
>
> See:
> =A0 =A0 =A0 =A0http://ap1.pp.fi/djgpp/gcc/4.5.2/
>
> I have done only very little testing myself.

Cool, thanks. I'll be honest, I wasn't sure 4.5.x would ever arrive on
DJGPP, and I blindly assumed the plugin architecture made that harder.
Nevertheless, at least whats-his-face can properly tune for Atom
now.   ;-)

Anyways, I noticed you said you weren't able to test it too heavily
yet. Well, I wanted to (weakly) help, so I decided to build Ruby 1.8.7
pl330, esp. since I've compiled it with DJGPP before (a year ago) and
it's non-trivial. (Unfortunately I don't really know any Ruby, far
from it.)

Good news! It (almost) compiles, had to tweak util.c first, then it
built okay (miniruby, ruby), plus "make test" works even with default -
O2 now (thankfully). It also works with the only two Ruby programs
I've ever written (see old thread). So I guess that's a fair test.
However, note that I didn't even bother trying the /djgpp/ subdir as
last time that didn't work, and I doubt they fixed it since then. I
just did a normal "./configure && make" under Bash (and using DJDEV
2.04 beta) on WinXP (Home SP3 32-bit).

It's probably a dumb idea, I'll probably get flamed, but I guess I'll
cc news://comp.lang.ruby anyways so somebody can know that I actually
tried (and barely patched) it for DJGPP. Here's the fix (and I admit I
didn't know a good way to use #define inside a DJGPP #ifdef to use
open() instead of _open, so I had to just manually fix it).

--- util.c	2010-11-22 07:21:34 +0000
+++ ../ruby-1.8.7-p330/util.c	2011-01-13 12:28:14 +0000
@@ -234,7 +234,7 @@
     memcpy(RSTRING_PTR(str), buf, RSTRING_LEN(str));
 }

-#if defined(__CYGWIN32__) || defined(_WIN32)
+//#if defined(__CYGWIN32__) || defined(_WIN32)
 #if defined __CYGWIN32__ || defined __MINGW32__
 extern int _open(const char *, int, ...);
 extern int _close(int);
@@ -250,9 +250,9 @@
     // It doesn't exist, so see if we can open it.
     */

-    if ((fd =3D _open(s, O_CREAT|O_EXCL, 0666)) >=3D 0) {
-	_close(fd);
-	_unlink(s);	/* don't leave it laying around */
+    if ((fd =3D open(s, O_CREAT|O_EXCL, 0666)) >=3D 0) {
+	close(fd);
+	unlink(s);	/* don't leave it laying around */
 	return 1;
     }
     else if (errno =3D=3D EEXIST) {
@@ -262,7 +262,7 @@
     return 0;
 }
 #endif
-#endif
+//#endif

 #if defined __DJGPP__

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019