www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Removing zlib1.dll in favor of zlib1.lib

reply Etienne Cimon <etcimon gmail.com> writes:
I wrote a zlib.mak file for statically compiling the new zlib 1.2.8 on 
dmc, using make -fzlib.mak

I'm copying it here because it may help remove the default dependency on 
zlib1.dll in DMD, not that it's a big deal, but some of us were talking 
about a standalone GUI application using dwt or dfl a few threads back 
and this would be necessary if it needs basic compression too on 
Windows. So here it is:

STATICLIB = zlib1.lib
CC = dmc
CFLAGS = -mn -g -DNO_snprintf=1
LD = $(CC)
LDFLAGS = -L/co -L/ma
LT = lib
LTFLAGS = -c

OBJS = adler32.obj compress.obj crc32.obj deflate.obj infback.obj \
        inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj 
zutil.obj \
	   gzclose.obj gzlib.obj gzread.obj gzwrite.obj

all: $(STATICLIB)

.c.obj:
	$(CC) $(CFLAGS) -c -o$  $<

$(STATICLIB): $(OBJS)
	-del $(STATICLIB)
	$(LT) $(LTFLAGS) $  $(OBJS)

clean:
	-del $(STATICLIB)
	-del $(SHAREDLIB)
	-del $(IMPLIB)
	-del *.obj
	-del *.exe
	-del *.map
	-del foo.gz

adler32.obj: zutil.h zlib.h zconf.h
compress.obj: zlib.h zconf.h
crc32.obj: zutil.h zlib.h zconf.h crc32.h
deflate.obj: deflate.h zutil.h zlib.h zconf.h
example.obj: zlib.h zconf.h
gzclose.obj: zlib.h zconf.h gzguts.h
gzlib.obj: zlib.h zconf.h gzguts.h
gzread.obj: zlib.h zconf.h gzguts.h
gzwrite.obj: zlib.h zconf.h gzguts.h
inffast.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
inflate.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 
inffixed.h
infback.obj: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 
inffixed.h
inftrees.obj: zutil.h zlib.h zconf.h inftrees.h
minigzip.obj: zlib.h zconf.h
trees.obj: deflate.h zutil.h zlib.h zconf.h trees.h
uncompr.obj: zlib.h zconf.h
zutil.obj: zutil.h zlib.h zconf.h
May 07 2014
parent reply Jacob Carlborg <doob me.com> writes:
On 08/05/14 06:54, Etienne Cimon wrote:
 I wrote a zlib.mak file for statically compiling the new zlib 1.2.8 on
 dmc, using make -fzlib.mak
Isn't zlib already included in Phobos. It contains the sources at least. -- /Jacob Carlborg
May 07 2014
parent reply Etienne Cimon <etcimon gmail.com> writes:
On 2014-05-08 02:08, Jacob Carlborg wrote:
 On 08/05/14 06:54, Etienne Cimon wrote:
 I wrote a zlib.mak file for statically compiling the new zlib 1.2.8 on
 dmc, using make -fzlib.mak
Isn't zlib already included in Phobos. It contains the sources at least.
Yes, I see version 1.2.5 here: https://github.com/D-Programming-Language/phobos/tree/fixmaster/etc/c/zlib I saw the dll in the dmd2 bin folder so I assumed it was necessary. Is it?
May 08 2014
next sibling parent Jacob Carlborg <doob me.com> writes:
On 2014-05-08 15:50, Etienne Cimon wrote:

 I saw the dll in the dmd2 bin folder so I assumed it was necessary. Is it?
Actually, I don't know. I just know the zlib source code is included in Phobos, in etc/c/zlib. -- /Jacob Carlborg
May 08 2014
prev sibling parent reply "Kagamin" <spam here.lot> writes:
I wrote a D application, using zlib from phobos, it didn't 
require dll, IIRC.
May 08 2014
parent reply Etienne Cimon <etcimon gmail.com> writes:
On 2014-05-08 15:50, Kagamin wrote:
 I wrote a D application, using zlib from phobos, it didn't require dll,
 IIRC.
Thanks!
May 08 2014
parent "Kagamin" <spam here.lot> writes:
You can just compile a sample application using zlib from phobos 
and see if it works without dll.
May 09 2014