1996-08-18 17:59:48 +00:00
|
|
|
#
|
2013-10-31 18:44:40 +00:00
|
|
|
# $FreeBSD$
|
1996-08-18 17:59:48 +00:00
|
|
|
#
|
|
|
|
|
2019-09-05 14:13:08 +00:00
|
|
|
PACKAGE= runtime
|
1996-08-18 17:59:48 +00:00
|
|
|
LIB= z
|
2015-06-15 19:28:07 +00:00
|
|
|
SHLIBDIR?= /lib
|
2010-03-22 21:11:55 +00:00
|
|
|
SHLIB_MAJOR= 6
|
2014-03-06 00:25:21 +00:00
|
|
|
MAN= zlib.3 zopen.3
|
2018-12-06 20:03:06 +00:00
|
|
|
MLINKS+= zopen.3 zdopen.3
|
1996-08-18 17:59:48 +00:00
|
|
|
|
2019-05-08 08:43:15 +00:00
|
|
|
ZLIBSRC= ${SRCTOP}/sys/contrib/zlib
|
2017-01-04 09:30:47 +00:00
|
|
|
|
|
|
|
.PATH: ${ZLIBSRC}
|
|
|
|
|
2010-03-22 21:11:55 +00:00
|
|
|
#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
|
|
|
|
#CFLAGS=-g -DDEBUG
|
|
|
|
#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
|
|
|
|
# -Wstrict-prototypes -Wmissing-prototypes
|
1996-08-18 17:59:48 +00:00
|
|
|
|
2022-03-31 14:25:53 +00:00
|
|
|
CFLAGS+= -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I${.CURDIR}
|
2000-12-06 01:49:08 +00:00
|
|
|
|
2010-01-02 09:58:07 +00:00
|
|
|
WARNS?= 3
|
|
|
|
|
1998-02-28 06:27:59 +00:00
|
|
|
CLEANFILES+= example.o example foo.gz minigzip.o minigzip
|
1996-08-18 17:59:48 +00:00
|
|
|
|
2010-03-22 21:11:55 +00:00
|
|
|
SRCS+= adler32.c
|
|
|
|
SRCS+= compress.c
|
|
|
|
SRCS+= crc32.c
|
|
|
|
SRCS+= deflate.c
|
|
|
|
SRCS+= gzclose.c
|
|
|
|
SRCS+= gzlib.c
|
|
|
|
SRCS+= gzread.c
|
|
|
|
SRCS+= gzwrite.c
|
|
|
|
SRCS+= infback.c
|
|
|
|
SRCS+= inffast.c
|
|
|
|
SRCS+= inflate.c
|
|
|
|
SRCS+= inftrees.c
|
|
|
|
SRCS+= trees.c
|
|
|
|
SRCS+= uncompr.c
|
|
|
|
SRCS+= zutil.c
|
|
|
|
|
2021-12-06 18:12:46 +00:00
|
|
|
# Wrapper relies on FreeBSD-specific fpos_t representation and non-portable
|
|
|
|
# funopen. Not needed for bootstrapping, so just disable it.
|
|
|
|
.if ${.MAKE.OS} == "FreeBSD" || !defined(BOOTSTRAPPING)
|
|
|
|
SRCS+= zopen.c
|
|
|
|
.endif
|
|
|
|
|
2017-04-09 03:50:48 +00:00
|
|
|
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
|
2017-04-08 06:39:13 +00:00
|
|
|
CFLAGS+= -DUNALIGNED_OK
|
|
|
|
.endif
|
2010-03-22 21:11:55 +00:00
|
|
|
|
|
|
|
VERSION_DEF= ${.CURDIR}/Versions.def
|
|
|
|
SYMBOL_MAPS= ${.CURDIR}/Symbol.map
|
|
|
|
CFLAGS+= -DSYMBOL_VERSIONING
|
|
|
|
|
2000-01-14 07:57:47 +00:00
|
|
|
INCS= zconf.h zlib.h
|
1996-08-18 17:59:48 +00:00
|
|
|
|
2017-01-04 09:30:47 +00:00
|
|
|
.PATH: ${ZLIBSRC}/test
|
2014-06-11 20:48:40 +00:00
|
|
|
|
2020-05-12 01:47:33 +00:00
|
|
|
ZLIB_VERSION!= sed -n '/define.*ZLIB_VERSION/{s,[^0-9.],,gp;q;}' ${ZLIBSRC}/zlib.h
|
|
|
|
|
|
|
|
zlib.pc: zlib.pc.in
|
|
|
|
sed -e 's,@prefix@,/usr,g ; \
|
|
|
|
s,@exec_prefix@,$${prefix},g ; \
|
|
|
|
s,@libdir@,$${exec_prefix}/lib,g ; \
|
|
|
|
s,@sharedlibdir@,$${libdir},g ; \
|
|
|
|
s,@includedir@,$${prefix}/include,g ; \
|
|
|
|
s,@VERSION@,${ZLIB_VERSION},g ;' \
|
|
|
|
${.ALLSRC} > ${.TARGET}
|
|
|
|
|
1996-08-18 17:59:48 +00:00
|
|
|
minigzip: all minigzip.o
|
|
|
|
$(CC) -o minigzip minigzip.o -L. -lz
|
|
|
|
|
|
|
|
example: all example.o
|
|
|
|
$(CC) -o example example.o -L. -lz
|
|
|
|
|
|
|
|
test: example minigzip
|
|
|
|
(export LD_LIBRARY_PATH=. ; ./example )
|
|
|
|
(export LD_LIBRARY_PATH=. ; \
|
|
|
|
echo hello world | ./minigzip | ./minigzip -d )
|
|
|
|
|
2021-03-16 06:13:07 +00:00
|
|
|
PCFILES= zlib.pc
|
2014-06-11 20:44:54 +00:00
|
|
|
|
1996-08-18 17:59:48 +00:00
|
|
|
.include <bsd.lib.mk>
|