[DGD] New patch for DGD compiled with Msys

Jared Maddox absinthdraco at gmail.com
Wed Jan 18 07:22:26 CET 2012


Sorry about the length, looks like the mail server disapproves of attachments.

--- Resent message below

I finally shifted enough time from my other projects to write a more
proper patch for compiling DGD on Msys.

This is intended only for if someone doesn't like dealing with MSVC
(e.g. cross-compiling, space/speed issues), use at your own risk.

This is not (at least without further revisions) intended to be
merged. Concerns:
1) The DGD version is still 1.4.7. If you need or want something
newer, then this will at most be useful for reference.
2) I assume that it won't play nicely in BSD or SysV environments,
though I'd be happy to be proven wrong.
3) Only compilation and (VERY) basic behavior with kernellib 1.3.4
(connecting to the binary port, setting the password, cd, ls,
shutdown) has been tested.

--- Patch below

diff -r -c -N dgd/src/GNUmakefile dgd-msys/src/GNUmakefile
*** dgd/src/GNUmakefile	Wed Dec 31 18:00:00 1969
--- dgd-msys/src/GNUmakefile	Mon Jan 16 20:11:17 2012
***************
*** 0 ****
--- 1,71 ----
+ #
+ # This file is part of DGD, http://dgd-osr.sourceforge.net/
+ # Copyright (C) 1993-2010 Dworkin B.V.
+ # Copyright (C) 2010-2011 DGD Authors (see the file Changelog for details)
+ #
+ # This program is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU Affero General Public License as
+ # published by the Free Software Foundation, either version 3 of the
+ # License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU Affero General Public License for more details.
+ #
+ # You should have received a copy of the GNU Affero General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
+
+ # This is mostly just a wrapper file. It's purpose is to provide an easy
+ # way to compile DGD on the MSYS enviroment for Windows.
+
+ ifeq ($(OS),Windows_NT)
+  HOST= WIN32
+  PLATFORM_DEFINES= -D_WIN32_WINNT=0x501
+ else
+  HOST=	DARWIN
+  PLATFORM_DEFINES=
+ endif
+
+ ifeq ($(OS),Windows_NT)
+  LIBS= -lws2_32 -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lodbc32 -lodbccp32
+ else
+  LIBS=	-ldl		# FreeBSD may require "make HOST=FREEBSD LIBS="
+ endif
+
+ DMAKE=	make
+ BIN=	../bin
+
+ a.out: always
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' a.out
+
+ always:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' always
+
+ $(BIN)/driver: a.out
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' $(BIN)/driver
+
+ install:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' install
+
+ lint:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' lint
+
+ comp.sub:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' comp.sub
+
+ lex.sub:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' lex.sub
+
+ ed.sub:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' ed.sub
+
+ comp/parser.h:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' comp/parser.h
+
+ comp/a.out:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' comp/a.out
+
+ clean:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' clean
diff -r -c -N dgd/src/Makefile dgd-msys/src/Makefile
*** dgd/src/Makefile	Tue Mar 22 10:54:08 2011
--- dgd-msys/src/Makefile	Mon Jan 16 20:06:32 2012
***************
*** 17,23 ****
  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  HOST=	DARWIN
! DEFINES=-D$(HOST)	#-DNETWORK_EXTENSIONS #-DDUMP_FUNCS #-DCO_THROTTLE=50
  DEBUG=	-O -g
  CCFLAGS=$(DEFINES) $(DEBUG)
  CFLAGS=	-I. -Icomp -Ilex -Ied -Iparser -Ikfun $(CCFLAGS)
--- 17,24 ----
  # along with this program.  If not, see <http://www.gnu.org/licenses/>.
  #
  HOST=	DARWIN
! PLATFORM_DEFINES=
! DEFINES=-D$(HOST)	$(PLATFORM_DEFINES)	#-DNETWORK_EXTENSIONS
#-DDUMP_FUNCS #-DCO_THROTTLE=50
  DEBUG=	-O -g
  CCFLAGS=$(DEFINES) $(DEBUG)
  CFLAGS=	-I. -Icomp -Ilex -Ied -Iparser -Ikfun $(CCFLAGS)
diff -r -c -N dgd/src/host/GNUmakefile dgd-msys/src/host/GNUmakefile
*** dgd/src/host/GNUmakefile	Wed Dec 31 18:00:00 1969
--- dgd-msys/src/host/GNUmakefile	Mon Jan 16 20:20:47 2012
***************
*** 0 ****
--- 1,102 ----
+ #
+ # This file is part of DGD, http://dgd-osr.sourceforge.net/
+ # Copyright (C) 1993-2010 Dworkin B.V.
+ # Copyright (C) 2010-2011 DGD Authors (see the file Changelog for details)
+ #
+ # This program is free software: you can redistribute it and/or modify
+ # it under the terms of the GNU Affero General Public License as
+ # published by the Free Software Foundation, either version 3 of the
+ # License, or (at your option) any later version.
+ #
+ # This program is distributed in the hope that it will be useful,
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ # GNU Affero General Public License for more details.
+ #
+ # You should have received a copy of the GNU Affero General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
+
+ # This is mostly just a wrapper file. It's purpose is to provide an easy
+ # way to compile DGD on the MSYS enviroment for Windows.
+ HOST=	DARWIN
+ DEBUG=	-O -g
+
+ ifeq ($(HOST),WIN32)
+  DEFINES=-D$(HOST)
+
+  SRC= connect.c dload.c dosfile.c local.c time.c windgd.c	xfloat.c
+  OBJ= connect.o dload.o dosfile.o local.o time.o windgd.o	crypt.o
xfloat.o asn.o
+  SUBOBJ=	connect.o dload.o dosfile.o local.o time.o windgd.o crypt.o
xfloat.o asn.o
+ else
+  DEFINES=-D$(HOST)
+
+  SRC=	local.c random.c dirent.c dload.c time.c connect.c xfloat.c
+  OBJ=	local.o random.o dirent.o dload.o time.o connect.o crypt.o
xfloat.o asn.o
+  SUBOBJ=	local.o random.o dirent.o dload.o time.o crypt.o xfloat.o asn.o
+ endif
+
+ CCFLAGS=$(DEFINES) $(DEBUG)
+ CFLAGS=	-I. -I.. $(CCFLAGS)
+ LINTFLAGS=-abcehpruz
+ CC=	gcc
+ DMAKE=	make
+
+
+ $(OBJ):	../dgd.h ../host.h ../config.h ../alloc.h ../error.h
+
+ connect.o: ../hash.h ../comm.h
+
+ xfloat.o: ../xfloat.h
+
+
+ ifeq ($(HOST),WIN32)
+
+ dgd:	$(OBJ)
+ 	@for i in $(OBJ); do echo host/$$i; done > dgd
+
+ lint:
+ 	lint $(LINTFLAGS) $(CFLAGS) $(SRC) crypt.c
+
+ sub:	$(SUBOBJ)
+ 	@for i in $(SUBOBJ); do echo ../host/$$i; done > sub
+
+ clean:
+ 	rm -f dgd sub $(SRC) $(OBJ)
+
+ 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/$@ $@
+
+ xfloat.c: simfloat.c
+ 	cp simfloat.c $@
+
+ else
+
+ dgd:	$(OBJ)
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' dgd
+
+ lint:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' lint
+
+ sub:	$(SUBOBJ)
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' sub
+
+ clean:
+ 	$(DMAKE) -f Makefile 'HOST=$(HOST)'
'PLATFORM_DEFINES=$(PLATFORM_DEFINES)' 'LIBS=$(LIBS)' clean
+
+ endif



More information about the DGD mailing list