summaryrefslogtreecommitdiff
path: root/libz/README-DEV
blob: 42a8ae170ae33f3e5bdc0439e391573c010b2981 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
This document describes how libz was packaged for build2. In particular, this
understanding will be useful when upgrading to a new upstream version. See
../README-DEV for general notes on zlib packaging.

Symlink the required upstream files into libz/:

$ cd libz &&
  ln -s ../../upstream/*.{c,h,map} ../../upstream/win32/*.def ./ &&
  rm zconf.h zlib.h

The upstream's (hand written) configure script pre-processes zconf.h.in and
replaces '#ifdef HAVE_UNISTD_H' and '#ifdef HAVE_STDARG_H' with '#if 1' on
POSIX. We replace these constructs in zconf.h.in with '#if @HAVE_...@' and use
the in module to generate zconf.h. We also edit zlib.h to include zconf.h
using angle brackets rather that quotes for the headers auto-generating
machinery to work properly.

$ cp ../../upstream/{zconf.h.in,zlib.h} ./
$ touch zconf.h
$ patch -p0 <zconf.h.in.patch
$ patch -p0 <zlib.h.patch

Note that there is no LICENSE/COPYING file in the upstream project as the
copyright notice is provided at the end of its README file. We extract it into
a separate (installable) LICENSE file.

Use the upstream's minigzip test for testing:

ln -s ../../../upstream/test/minigzip.c ../tests/minigzip/