[DGD] DGD For MSys, mark 2
Jared Maddox
absinthdraco at gmail.com
Thu Jan 3 05:55:17 CET 2013
I've redone my patch to compile DGD on the MSys environment. This
version was diff'd against a .zip copy that it looks like I grabbed on
the 27th of December. I didn't grab a current copy of the kernellib,
so this is NOT a tested build. However, I seem to have learned a good
deal from last time, because I only altered 3 files this time, and one
of those was just to insert an obnoxious warning into the README.
I've made certain to add plenty of comments.
Note that like the previous version, I'm only mailing this in case
someone comes looking for such a patch. I haven't tested the resulting
executable, and therefor don't know if I'm done or not. Depending on
the outcome of certain inquiries on the MinGW/MSys mailing list, I'm
likely to modify the host detection code.
I previously tried to send the patch as an attachment, and apparently
it got rejected by the mailer-daemon , so here it is inlined:
diff -r dgd-master/README dgd-msys/README
0a1,16
> WARNING:
> This is a modified and UNTESTED VERSION of DGD. It was altered on Januray
> 2nd, 2013, by Jared Maddox, to add support for the MSys environment. If you
> want a known-good version, then look to the sources described below.
>
> KNOWN BUGS:
> For some reason, "make clean" didn't clean:
> comp/parser.h
> comp/parser.c
> host/dosfile.c
> host/dosfile.o
> host/windgd.c
> host/windgd.o
>
>
>
diff -r dgd-master/src/Makefile dgd-msys/src/Makefile
19a20,38
>
> # Added by Jared Maddox on Jan 2, 2013.
> # If you're running into a bug while compiling this, it's likely my
> # fault.
> #
> # In addition to the other changes that I've made, I replaced all
> # instances of "a.out" with $(EXECUTABLE). This localizes the executable
> # name up here, near the top of the file. I'm not very savy on Make, but
> # I think it also allows the executable name to be overridden from the
> # command line, which isn't necessary, but is nice.
> #
> PLATFORM_DEFINES=
> EXECUTABLE= a.out
> ifeq ($(OS),MINGW32_NT-5.1)
> HOST=WIN32
> PLATFORM_DEFINES= -D_WIN32_WINNT=0x501
> EXECUTABLE= a.exe
> endif
>
42c61
< DEFINES=-D$(HOST) # -DSLASHSLASH -DNETWORK_EXTENSIONS -DCLOSURES
-DCO_THROTTLE=50
---
> DEFINES=-D$(HOST) $(PLATFORM_DEFINES) # -DSLASHSLASH -DNETWORK_EXTENSIONS -DCLOSURES -DCO_THROTTLE=50
47c66
< LIBS= -ldl
---
>
60a80,86
> # Basically transfered from my old port. Not certain HOW much of this is
> # required, but likely more than you'd think.
> #
> ifeq ($(OS),MINGW32_NT-5.1)
> LIBS= -lws2_32 -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
> endif
>
68c94
< a.out: $(OBJ) always
---
> $(EXECUTABLE): $(OBJ) always
82c108
< @rm -f a.out
---
> @rm -f $(EXECUTABLE)
84c110
< all: a.out
---
> all: $(EXECUTABLE)
86c112
< $(BIN)/driver: a.out
---
> $(BIN)/driver: $(EXECUTABLE)
88c114
< cp a.out $(BIN)/driver
---
> cp $(EXECUTABLE) $(BIN)/driver
114c140
< comp/a.out:
---
> comp/$(EXECUTABLE):
116c142
< 'YACC=$(YACC)' 'LIBS=$(LIBS)' a.out
---
> 'YACC=$(YACC)' 'LIBS=$(LIBS)' $(EXECUTABLE)
119c145
< rm -f a.out $(OBJ) comp.sub lex.sub ed.sub
---
> rm -f $(EXECUTABLE) $(OBJ) comp.sub lex.sub ed.sub
diff -r dgd-master/src/host/Makefile dgd-msys/src/host/Makefile
40,44c40,58
< SRC= local.c dirent.c dload.c time.c connect.c xfloat.c
< SUBOBJ= local.o dirent.o dload.o time.o crypt.o xfloat.o asn.o
< ifdef SYSV_STYLE
< SRC+=lrand48.c
< SUBOBJ+=lrand48.o
---
> # Added by Jared Maddox, Jan 2, 2013
> # Note: This was basically just copied from my old DGD-for-MSys version,
> # expect untested bugs.
> #
> ifneq ($(HOST),WIN32)
> # This was just indented from what was already in this file, so it
> # should be fine.
> #
>
> SRC= local.c dirent.c dload.c time.c connect.c xfloat.c
> SUBOBJ= local.o dirent.o dload.o time.o crypt.o xfloat.o asn.o
> ifdef SYSV_STYLE
> SRC+=lrand48.c
> SUBOBJ+=lrand48.o
> else
> SRC+=random.c
> SUBOBJ+=random.o
> endif
> OBJ= $(SUBOBJ) connect.o
46,47c60,66
< SRC+=random.c
< SUBOBJ+=random.o
---
> # This, in comparison, was copied from my previous implementation. Don't
> # depend on it being bug-free.
> #
>
> SRC= local.c dload.c time.c connect.c xfloat.c dosfile.c windgd.c
> OBJ= $(SUBOBJ) connect.o dosfile.o windgd.o
> SUBOBJ= local.o dload.o time.o crypt.o xfloat.o asn.o
49d67
< OBJ= $(SUBOBJ) connect.o
62a81,86
> # Next, we have the copy rules.
> #
> ifneq ($(HOST),WIN32)
> # These are the versions that already existed here, but wrapped to
> # control their use.
> #
83a108,135
>
> else
> # And here we have the forms that I've copied from my old
> # implementation.
> #
>
> connect.c: win32/connect.c
> cp win32/$@ $@
>
> dload.c: win32/dload.c
> cp win32/$@ $@
>
> dosfile.c: win32/dosfile.c
> cp win32/$@ $@
>
> local.c: win32/local.c
> cp win32/$@ $@
>
> time.c: win32/time.c
> cp win32/$@ $@
>
> windgd.c: win32/windgd.c
> cp win32/$@ $@
>
> endif
> # Finally, we go on to what we can count on for both versions.
> #
>
More information about the DGD
mailing list