Anyways, a few weeks ago I barely got it to mostly compile for 0.51
(dated Dec. 2008), but it had issues (cstdio needed, getopt* for
getopt_long not compiling at all), so I contacted the author. He
replied, said he fixed a few things for latest GCCs, added -q upon
request, and pointed me to the GIT repo. Today I finally took a look
at rebuilding it (finally worked around Internet issues I encountered
this past week). And I noticed that 0.511 is available on Sourceforge
(dated Oct. 2), so I switched to that.
Various minor issues crop up: same ol' silly Autoconf 2.63 typo, G+
+ lacking some backwards-compatible headers (so I switched back to
4.2.3), srcs no longer include getopt_long (although 0.51's didn't
work anyways) so I had to grab it from GNU BinUtils (and make two tiny
tweaks), and it basically works (although had to manually compile
getopt* and add them to makefile).
I even wrote up a silly .CMD (using "wget" for the external files,
lines are longer than 126 bytes). It seems to work, but I only really
vaguely tested Befunge (although numwarp.b also seems to work for
Brainf***, so that's good). I'm not posting the .CMD here since I'm
fairly certain nobody cares (but feel free to ask).
Basically, I'm wondering why getopt_long (apparently a GNU extension)
isn't available in libsupp or even DJGPP's lib. I understand you
probably don't want to contaminate the *BSD-ish license of the lib,
but it seems like something that should be put somewhere. Maybe it's
the EsCo dude's responsibility, who knows, but I felt it was important
enough to mention. (Plus, like I said, it won't build by default
unless you remove two instances ATTRIBUTE_UNUSED and comment out the
include of ansidecl.h, whatever that is). One old post said popt is
superior, but I'm not familiar with that (although Richard Dawe ported
it a while back).
Any thoughts? :-)
Well, it's moot for EsCo since both are GPL anyways, and I at least
got it to work already. Besides, anybody requiring it in their own
programs is likely to already be aware of potential license issues.
For reference, though, a quick look shows that Popt (used by RPM) is
GPL or LGPL license, and even NetBSD (since 1.5) etc. have their own
getopt_long. I honestly doubt it would be too trivial to port to
DJGPP, but hey, it's probably possible.
On Oct 20, 1:56 pm, Rugxulo <rugx...@gmail.com> wrote:
>
> On Oct 20, 1:13 pm, DJ Delorie <d...@delorie.com> wrote:
>
> > DJGPP's library is old; it might just be that getopt_long() wasn't
> > even considered back then. Feel free to add one, but keep in mind the
> > licensing issues - GPL/LGPL is unacceptable in libc, BSD is OK.
>
> even NetBSD (since 1.5) etc. have their own getopt_long. I honestly
> doubt it would be too trivial to port to DJGPP, but hey, it's probably possible.
Well, NetBSD seems to be harder to get working than FreeBSD.
http://ftp6.tw.freebsd.org/FreeBSD/development/FreeBSD-CVS/src/contrib/file/
getopt_long.c,v
mygetopt.h,v
Both of those need very minor editing, but it seems to compile / work
with EsCo, so I guess it would work okay for DJGPP in general. But I'm
really unfamiliar with getopt in general, so I can't say how well this
version actually works or what needs to be done (tests?), though.
> > On Oct 20, 1:13 pm, DJ Delorie <d...@delorie.com> wrote:
>
> > > DJGPP's library is old; it might just be that getopt_long() wasn't
> > > even considered back then. Feel free to add one, but keep in mind the
> > > licensing issues - GPL/LGPL is unacceptable in libc, BSD is OK.
>
> > even NetBSD (since 1.5) etc. have their own getopt_long. I honestly
> > doubt it would be too trivial to port to DJGPP, but hey, it's probably possible.
>
> Well, NetBSD seems to be harder to get working than FreeBSD.
>
> http://ftp6.tw.freebsd.org/FreeBSD/development/FreeBSD-CVS/src/contri...
>
> getopt_long.c,v
> mygetopt.h,v
>
> Both of those need very minor editing, but it seems to compile / work
> with EsCo, so I guess it would work okay for DJGPP in general.
Okay, maybe I was confused about it working in EsCo at the time (or
else forget how I did it), but I just now did barely hack it
(hopefully not too too incorrectly, heh) to work now for sure. Feel
free to take a look as it probably needs some massaging from you.
http://rugxulo.googlepages.com/getopt_l.zip
Archive: getopt_l.zip
Length Date Time Name
-------- ---- ---- ----
13911 10-26-09 14:05 getopt_long.c,v
3113 10-26-09 14:05 mygetopt.h,v
12821 10-29-09 14:42 getopt_long.c
9826 10-29-09 14:42 getopt_long.o
2763 10-29-09 14:41 mygetopt.h
-------- -------
42434 5 files
P.S. If you want to test with EsCo, you'll have to do the following:
a). manually fix the "\\r" typo to "\r" before running "sh configure"
b). put getopt_long.o in "esco\src"
c). edit src\escoconf.cpp and src\consoleface.cpp to refer to
"mygetopt.h" instead of <getopt.h>
d). edit src\makefile to put "getopt_long.o" after the line
"esco_OBJ.* = "
On Oct 29, 3:02 pm, Rugxulo <rugx...@gmail.com> wrote:
>
> P.S. If you want to test with EsCo, you'll have to do the following:
>
> c). edit src\escoconf.cpp and src\consoleface.cpp to refer to
> "mygetopt.h" instead of <getopt.h>
Oops, this means you need mygetopt.h in your "esco\include" subdir in
order for it to find it.