summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2015-08-02 14:46:58 -0700
committerMark Adler <madler@alumni.caltech.edu>2015-08-02 21:35:50 -0700
commit55d98b4c302c74b619968bd02cf3b5e18d845977 (patch)
treeffdbc1f067646102925b013ebd52ab058b03aa44
parentbfcace04f91bd27c8c7c040da2396fe4b7724422 (diff)
downloadzlib-55d98b4c302c74b619968bd02cf3b5e18d845977.tar.gz
zlib-55d98b4c302c74b619968bd02cf3b5e18d845977.tar.bz2
zlib-55d98b4c302c74b619968bd02cf3b5e18d845977.zip
Allow building zlib outside of the source directory.
To build, simply run configure from the source directory by specifying its path. That path will be used to find the source files. The source directory will not be touched. All new and modified files will be made in the current directory. Discovered in the process that not all makes understand % or $<, and not all compilers understand -include or -I-. This required a larger Makefile.in with explicit dependencies.
-rw-r--r--Makefile.in221
-rwxr-xr-xconfigure37
2 files changed, 197 insertions, 61 deletions
diff --git a/Makefile.in b/Makefile.in
index f608c6c..7408644 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -53,6 +53,9 @@ includedir = ${prefix}/include
53mandir = ${prefix}/share/man 53mandir = ${prefix}/share/man
54man3dir = ${mandir}/man3 54man3dir = ${mandir}/man3
55pkgconfigdir = ${libdir}/pkgconfig 55pkgconfigdir = ${libdir}/pkgconfig
56SRCDIR=
57ZINC=
58ZINCOUT=-I.
56 59
57OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o 60OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
58OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 61OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
@@ -113,8 +116,8 @@ test64: all64
113 fi; \ 116 fi; \
114 rm -f $$TMP64 117 rm -f $$TMP64
115 118
116infcover.o: test/infcover.c zlib.h zconf.h 119infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
117 $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c 120 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
118 121
119infcover: infcover.o libz.a 122infcover: infcover.o libz.a
120 $(CC) $(CFLAGS) -o $@ infcover.o libz.a 123 $(CC) $(CFLAGS) -o $@ infcover.o libz.a
@@ -140,24 +143,140 @@ match.lo: match.S
140 mv _match.o match.lo 143 mv _match.o match.lo
141 rm -f _match.s 144 rm -f _match.s
142 145
143example.o: test/example.c zlib.h zconf.h 146example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
144 $(CC) $(CFLAGS) -I. -c -o $@ test/example.c 147 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
145 148
146minigzip.o: test/minigzip.c zlib.h zconf.h 149minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
147 $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c 150 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
148 151
149example64.o: test/example.c zlib.h zconf.h 152example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
150 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c 153 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
151 154
152minigzip64.o: test/minigzip.c zlib.h zconf.h 155minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
153 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c 156 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
154 157
155.SUFFIXES: .lo
156 158
157.c.lo: 159adler32.o: $(SRCDIR)adler32.c
160 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
161
162crc32.o: $(SRCDIR)crc32.c
163 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
164
165deflate.o: $(SRCDIR)deflate.c
166 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
167
168infback.o: $(SRCDIR)infback.c
169 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
170
171inffast.o: $(SRCDIR)inffast.c
172 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
173
174inflate.o: $(SRCDIR)inflate.c
175 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
176
177inftrees.o: $(SRCDIR)inftrees.c
178 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
179
180trees.o: $(SRCDIR)trees.c
181 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
182
183zutil.o: $(SRCDIR)zutil.c
184 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
185
186compress.o: $(SRCDIR)compress.c
187 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
188
189uncompr.o: $(SRCDIR)uncompr.c
190 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
191
192gzclose.o: $(SRCDIR)gzclose.c
193 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
194
195gzlib.o: $(SRCDIR)gzlib.c
196 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
197
198gzread.o: $(SRCDIR)gzread.c
199 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
200
201gzwrite.o: $(SRCDIR)gzwrite.c
202 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
203
204
205adler32.lo: $(SRCDIR)adler32.c
206 -@mkdir objs 2>/dev/null || test -d objs
207 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
208 -@mv objs/adler32.o $@
209
210crc32.lo: $(SRCDIR)crc32.c
158 -@mkdir objs 2>/dev/null || test -d objs 211 -@mkdir objs 2>/dev/null || test -d objs
159 $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $< 212 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
160 -@mv objs/$*.o $@ 213 -@mv objs/crc32.o $@
214
215deflate.lo: $(SRCDIR)deflate.c
216 -@mkdir objs 2>/dev/null || test -d objs
217 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
218 -@mv objs/deflate.o $@
219
220infback.lo: $(SRCDIR)infback.c
221 -@mkdir objs 2>/dev/null || test -d objs
222 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
223 -@mv objs/infback.o $@
224
225inffast.lo: $(SRCDIR)inffast.c
226 -@mkdir objs 2>/dev/null || test -d objs
227 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
228 -@mv objs/inffast.o $@
229
230inflate.lo: $(SRCDIR)inflate.c
231 -@mkdir objs 2>/dev/null || test -d objs
232 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
233 -@mv objs/inflate.o $@
234
235inftrees.lo: $(SRCDIR)inftrees.c
236 -@mkdir objs 2>/dev/null || test -d objs
237 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
238 -@mv objs/inftrees.o $@
239
240trees.lo: $(SRCDIR)trees.c
241 -@mkdir objs 2>/dev/null || test -d objs
242 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
243 -@mv objs/trees.o $@
244
245zutil.lo: $(SRCDIR)zutil.c
246 -@mkdir objs 2>/dev/null || test -d objs
247 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
248 -@mv objs/zutil.o $@
249
250compress.lo: $(SRCDIR)compress.c
251 -@mkdir objs 2>/dev/null || test -d objs
252 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
253 -@mv objs/compress.o $@
254
255uncompr.lo: $(SRCDIR)uncompr.c
256 -@mkdir objs 2>/dev/null || test -d objs
257 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
258 -@mv objs/uncompr.o $@
259
260gzclose.lo: $(SRCDIR)gzclose.c
261 -@mkdir objs 2>/dev/null || test -d objs
262 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
263 -@mv objs/gzclose.o $@
264
265gzlib.lo: $(SRCDIR)gzlib.c
266 -@mkdir objs 2>/dev/null || test -d objs
267 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
268 -@mv objs/gzlib.o $@
269
270gzread.lo: $(SRCDIR)gzread.c
271 -@mkdir objs 2>/dev/null || test -d objs
272 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
273 -@mv objs/gzread.o $@
274
275gzwrite.lo: $(SRCDIR)gzwrite.c
276 -@mkdir objs 2>/dev/null || test -d objs
277 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
278 -@mv objs/gzwrite.o $@
279
161 280
162placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a 281placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
163 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS) 282 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
@@ -203,7 +322,7 @@ install-libs: $(LIBS)
203 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \ 322 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
204 ($(LDCONFIG) || true) >/dev/null 2>&1; \ 323 ($(LDCONFIG) || true) >/dev/null 2>&1; \
205 fi 324 fi
206 cp zlib.3 $(DESTDIR)$(man3dir) 325 cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
207 chmod 644 $(DESTDIR)$(man3dir)/zlib.3 326 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
208 cp zlib.pc $(DESTDIR)$(pkgconfigdir) 327 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
209 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc 328 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
@@ -212,7 +331,7 @@ install-libs: $(LIBS)
212 331
213install: install-libs 332install: install-libs
214 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi 333 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
215 cp zlib.h zconf.h $(DESTDIR)$(includedir) 334 cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
216 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h 335 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
217 336
218uninstall: 337uninstall:
@@ -226,18 +345,18 @@ uninstall:
226 345
227docs: zlib.3.pdf 346docs: zlib.3.pdf
228 347
229zlib.3.pdf: zlib.3 348zlib.3.pdf: $(SRCDIR)zlib.3
230 groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf 349 groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
231 350
232zconf.h.cmakein: zconf.h.in 351zconf.h.cmakein: $(SRCDIR)zconf.h.in
233 -@ TEMPFILE=zconfh_$$; \ 352 -@ TEMPFILE=zconfh_$$; \
234 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\ 353 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
235 sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\ 354 sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
236 touch -r zconf.h.in zconf.h.cmakein &&\ 355 touch -r $(SRCDIR)zconf.h.in $@ &&\
237 rm $$TEMPFILE 356 rm $$TEMPFILE
238 357
239zconf: zconf.h.in 358zconf: $(SRCDIR)zconf.h.in
240 cp -p zconf.h.in zconf.h 359 cp -p $(SRCDIR)zconf.h.in zconf.h
241 360
242mostlyclean: clean 361mostlyclean: clean
243clean: 362clean:
@@ -255,34 +374,32 @@ maintainer-clean: distclean
255distclean: clean zconf zconf.h.cmakein docs 374distclean: clean zconf zconf.h.cmakein docs
256 rm -f Makefile zlib.pc configure.log 375 rm -f Makefile zlib.pc configure.log
257 -@rm -f .DS_Store 376 -@rm -f .DS_Store
258 -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile 377 @if [ -f Makefile.in ]; then \
259 -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile 378 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
260 -@touch -r Makefile.in Makefile 379 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
380 touch -r $(SRCDIR)Makefile.in Makefile ; fi
381 @if [ ! -f zconf.h.in ]; then rm -f zconf.h zconf.h.cmakein ; fi
382 @if [ ! -f zlib.3 ]; then rm -f zlib.3.pdf ; fi
261 383
262tags: 384tags:
263 etags *.[ch] 385 etags $(SRCDIR)*.[ch]
264 386
265depend: 387adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
266 makedepend -- $(CFLAGS) -- *.[ch] 388gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
267 389compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
268# DO NOT DELETE THIS LINE -- make depend depends on it. 390crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
269 391deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
270adler32.o zutil.o: zutil.h zlib.h zconf.h 392infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
271gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h 393inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
272compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h 394inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
273crc32.o: zutil.h zlib.h zconf.h crc32.h 395trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
274deflate.o: deflate.h zutil.h zlib.h zconf.h 396
275infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h 397adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
276inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h 398gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
277inftrees.o: zutil.h zlib.h zconf.h inftrees.h 399compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
278trees.o: deflate.h zutil.h zlib.h zconf.h trees.h 400crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
279 401deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
280adler32.lo zutil.lo: zutil.h zlib.h zconf.h 402infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
281gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h 403inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
282compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h 404inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
283crc32.lo: zutil.h zlib.h zconf.h crc32.h 405trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
284deflate.lo: deflate.h zutil.h zlib.h zconf.h
285infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
286inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
287inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
288trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h
diff --git a/configure b/configure
index b77a8a8..6438438 100755
--- a/configure
+++ b/configure
@@ -18,6 +18,18 @@ echo -------------------- >> configure.log
18echo $0 $* >> configure.log 18echo $0 $* >> configure.log
19date >> configure.log 19date >> configure.log
20 20
21# get source directory
22SRCDIR=`dirname $0`
23if test $SRCDIR = "."; then
24 ZINC=""
25 ZINCOUT="-I."
26 SRCDIR=""
27else
28 ZINC='-include zconf.h'
29 ZINCOUT='-I. -I$(SRCDIR)'
30 SRCDIR="$SRCDIR/"
31fi
32
21# set command prefix for cross-compilation 33# set command prefix for cross-compilation
22if [ -n "${CHOST}" ]; then 34if [ -n "${CHOST}" ]; then
23 uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`" 35 uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
@@ -28,10 +40,10 @@ fi
28STATICLIB=libz.a 40STATICLIB=libz.a
29 41
30# extract zlib version numbers from zlib.h 42# extract zlib version numbers from zlib.h
31VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` 43VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < ${SRCDIR}zlib.h`
32VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h` 44VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < ${SRCDIR}zlib.h`
33VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` 45VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
34VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` 46VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < ${SRCDIR}zlib.h`
35 47
36# establish commands for library building 48# establish commands for library building
37if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then 49if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
@@ -184,9 +196,9 @@ if test "$gcc" -eq 1 && ($cc -c $test.c) >> configure.log 2>&1; then
184 fi 196 fi
185 case "$uname" in 197 case "$uname" in
186 Linux* | linux* | GNU | GNU/* | solaris*) 198 Linux* | linux* | GNU | GNU/* | solaris*)
187 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; 199 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
188 *BSD | *bsd* | DragonFly) 200 *BSD | *bsd* | DragonFly)
189 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} 201 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
190 LDCONFIG="ldconfig -m" ;; 202 LDCONFIG="ldconfig -m" ;;
191 CYGWIN* | Cygwin* | cygwin* | OS/2*) 203 CYGWIN* | Cygwin* | cygwin* | OS/2*)
192 EXE='.exe' ;; 204 EXE='.exe' ;;
@@ -287,6 +299,9 @@ else
287 esac 299 esac
288 fi 300 fi
289 fi 301 fi
302 if test -n "$ZINC"; then
303 ZINC='-I- -I. -I$(SRCDIR)'
304 fi
290 ;; 305 ;;
291 SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} 306 SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
292 CFLAGS=${CFLAGS-"-O2"} 307 CFLAGS=${CFLAGS-"-O2"}
@@ -470,7 +485,7 @@ else
470fi 485fi
471 486
472# copy clean zconf.h for subsequent edits 487# copy clean zconf.h for subsequent edits
473cp -p zconf.h.in zconf.h 488cp -p ${SRCDIR}zconf.h.in zconf.h
474 489
475echo >> configure.log 490echo >> configure.log
476 491
@@ -764,6 +779,7 @@ echo STATICLIB = $STATICLIB >> configure.log
764echo TEST = $TEST >> configure.log 779echo TEST = $TEST >> configure.log
765echo VER = $VER >> configure.log 780echo VER = $VER >> configure.log
766echo Z_U4 = $Z_U4 >> configure.log 781echo Z_U4 = $Z_U4 >> configure.log
782echo SRCDIR = $SRCDIR >> configure.log
767echo exec_prefix = $exec_prefix >> configure.log 783echo exec_prefix = $exec_prefix >> configure.log
768echo includedir = $includedir >> configure.log 784echo includedir = $includedir >> configure.log
769echo libdir = $libdir >> configure.log 785echo libdir = $libdir >> configure.log
@@ -773,7 +789,7 @@ echo sharedlibdir = $sharedlibdir >> configure.log
773echo uname = $uname >> configure.log 789echo uname = $uname >> configure.log
774 790
775# udpate Makefile with the configure results 791# udpate Makefile with the configure results
776sed < Makefile.in " 792sed < ${SRCDIR}Makefile.in "
777/^CC *=/s#=.*#=$CC# 793/^CC *=/s#=.*#=$CC#
778/^CFLAGS *=/s#=.*#=$CFLAGS# 794/^CFLAGS *=/s#=.*#=$CFLAGS#
779/^SFLAGS *=/s#=.*#=$SFLAGS# 795/^SFLAGS *=/s#=.*#=$SFLAGS#
@@ -790,6 +806,9 @@ sed < Makefile.in "
790/^LDCONFIG *=/s#=.*#=$LDCONFIG# 806/^LDCONFIG *=/s#=.*#=$LDCONFIG#
791/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC# 807/^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
792/^EXE *=/s#=.*#=$EXE# 808/^EXE *=/s#=.*#=$EXE#
809/^SRCDIR *=/s#=.*#=$SRCDIR#
810/^ZINC *=/s#=.*#=$ZINC#
811/^ZINCOUT *=/s#=.*#=$ZINCOUT#
793/^prefix *=/s#=.*#=$prefix# 812/^prefix *=/s#=.*#=$prefix#
794/^exec_prefix *=/s#=.*#=$exec_prefix# 813/^exec_prefix *=/s#=.*#=$exec_prefix#
795/^libdir *=/s#=.*#=$libdir# 814/^libdir *=/s#=.*#=$libdir#
@@ -803,7 +822,7 @@ sed < Makefile.in "
803" > Makefile 822" > Makefile
804 823
805# create zlib.pc with the configure results 824# create zlib.pc with the configure results
806sed < zlib.pc.in " 825sed < ${SRCDIR}zlib.pc.in "
807/^CC *=/s#=.*#=$CC# 826/^CC *=/s#=.*#=$CC#
808/^CFLAGS *=/s#=.*#=$CFLAGS# 827/^CFLAGS *=/s#=.*#=$CFLAGS#
809/^CPP *=/s#=.*#=$CPP# 828/^CPP *=/s#=.*#=$CPP#