2 # configure script for zlib.
4 # Normally configure builds both a static and a shared library.
5 # If you want to build just a static library, use: ./configure --static
7 # To impose specific compiler or flags or install directory, use for example:
8 # prefix=$HOME CC=cc CFLAGS="-O4" ./configure
9 # or for csh/tcsh users:
10 # (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
12 # Incorrect settings of CC or CFLAGS may prevent creating a shared library.
13 # If you have problems, try without defining CC and CFLAGS before reporting
16 # start off configure.log
17 echo -------------------- >> configure.log
18 echo $0 $* >> configure.log
21 # set command prefix for cross-compilation
22 if [ -n "${CHOST}" ]; then
23 uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
24 CROSS_PREFIX="${CHOST}-"
27 # destination name for static library
30 # extract zlib version numbers from zlib.h
31 VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
32 VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
33 VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
34 VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
36 # establish commands for library building
37 if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
38 AR=${AR-"${CROSS_PREFIX}ar"}
39 test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
42 test -n "${CROSS_PREFIX}" && echo Using ${AR} | tee -a configure.log
44 ARFLAGS=${ARFLAGS-"rc"}
45 if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
46 RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
47 test -n "${CROSS_PREFIX}" && echo Using ${RANLIB} | tee -a configure.log
49 RANLIB=${RANLIB-"ranlib"}
51 if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
52 NM=${NM-"${CROSS_PREFIX}nm"}
53 test -n "${CROSS_PREFIX}" && echo Using ${NM} | tee -a configure.log
58 # set defaults before processing command line options
59 LDCONFIG=${LDCONFIG-"ldconfig"}
60 LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
62 prefix=${prefix-/usr/local}
63 exec_prefix=${exec_prefix-'${prefix}'}
64 libdir=${libdir-'${exec_prefix}/lib'}
65 sharedlibdir=${sharedlibdir-'${libdir}'}
66 includedir=${includedir-'${prefix}/include'}
67 mandir=${mandir-'${prefix}/share/man'}
77 OBJC='$(OBJZ) $(OBJG)'
78 PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
80 # process command line options
85 echo 'usage:' | tee -a configure.log
86 echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' | tee -a configure.log
87 echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]' | tee -a configure.log
88 echo ' [--includedir=INCLUDEDIR] [--archs="-arch i386 -arch x86_64"]' | tee -a configure.log
90 -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
91 -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
92 -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
93 --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
94 -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
95 -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
96 -p* | --prefix) prefix="$2"; shift; shift ;;
97 -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
98 -l* | --libdir) libdir="$2"; shift; shift ;;
99 -i* | --includedir) includedir="$2"; shift; shift ;;
100 -s* | --shared | --enable-shared) shared=1; shift ;;
101 -t | --static) shared=0; shift ;;
102 --solo) solo=1; shift ;;
103 --cover) cover=1; shift ;;
104 -z* | --zprefix) zprefix=1; shift ;;
105 -6* | --64) build64=1; shift ;;
106 -a*=* | --archs=*) ARCHS=`echo $1 | sed 's/.*=//'`; shift ;;
107 --sysconfdir=*) echo "ignored option: --sysconfdir" | tee -a configure.log; shift ;;
108 --localstatedir=*) echo "ignored option: --localstatedir" | tee -a configure.log; shift ;;
109 *) echo "unknown option: $1"; echo "$0 --help for help" | tee -a configure.log; exit 1 ;;
113 # define functions for testing compiler and library characteristics and logging the results
120 echo === $test.c === >> configure.log
121 cat $test.c >> configure.log
122 echo === >> configure.log;;
124 echo $* >> configure.log
130 if ($CC -c $CFLAGS $test.c) 2>/dev/null; then
134 test "`( $* ) 2>&1 | tee -a configure.log`" = ""
136 echo - using any output from compiler to indicate an error >> configure.log
141 ( $* ) >> configure.log 2>&1
143 if test $ret -ne 0; then
144 echo "(exit code "$ret")" >> configure.log
155 printf %s "$got" >> configure.log
156 if test $ret -ne 0; then
162 echo >> configure.log
164 # check for gcc vs. cc and set compile and link flags based on the system identified by uname
166 extern int getchar();
167 int hello() {return getchar();}
170 test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc... | tee -a configure.log
171 cc=${CC-${CROSS_PREFIX}gcc}
172 cflags=${CFLAGS-"-O3"}
173 # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
178 case `$cc -v 2>&1` in
182 show $cc -c $cflags $test.c
183 if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) >> configure.log 2>&1; then
184 echo ... using gcc >> configure.log
186 CFLAGS="${CFLAGS--O3} ${ARCHS}"
187 SFLAGS="${CFLAGS--O3} -fPIC"
188 LDFLAGS="${LDFLAGS} ${ARCHS}"
189 if test $build64 -eq 1; then
190 CFLAGS="${CFLAGS} -m64"
191 SFLAGS="${SFLAGS} -m64"
193 if test "${ZLIBGCCWARN}" = "YES"; then
194 CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
196 if test -z "$uname"; then
197 uname=`(uname -s || echo unknown) 2>/dev/null`
200 Linux* | linux* | GNU | GNU/* | solaris*)
201 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
202 *BSD | *bsd* | DragonFly)
203 LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"}
204 LDCONFIG="ldconfig -m" ;;
205 CYGWIN* | Cygwin* | cygwin* | OS/2*)
209 rm -f $test.[co] $test $test$shared_ext
210 echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
212 LDSHARED=${LDSHARED-"$cc -shared"}
215 QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
216 # (alain.bonnefoy@icbt.com)
217 LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
219 LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
220 case `(uname -m || echo unknown) 2>/dev/null` in
223 SHAREDLIB='libz.so' ;;
226 SHAREDLIB='libz.sl' ;;
230 SHAREDLIB=libz$shared_ext
231 SHAREDLIBV=libz.$VER$shared_ext
232 SHAREDLIBM=libz.$VER1$shared_ext
233 LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
236 *) LDSHARED=${LDSHARED-"$cc -shared"} ;;
239 # find system name and corresponding cc options
242 echo ... using $CC >> configure.log
243 if test -z "$uname"; then
244 uname=`(uname -sr || echo unknown) 2>/dev/null`
247 HP-UX*) SFLAGS=${CFLAGS-"-O +z"}
248 CFLAGS=${CFLAGS-"-O"}
249 # LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
250 LDSHARED=${LDSHARED-"ld -b"}
251 case `(uname -m || echo unknown) 2>/dev/null` in
254 SHAREDLIB='libz.so' ;;
257 SHAREDLIB='libz.sl' ;;
259 IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
260 CFLAGS=${CFLAGS-"-ansi -O2"}
261 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
262 OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
263 CFLAGS=${CFLAGS-"-O -std1"}
264 LDFLAGS="${LDFLAGS} -Wl,-rpath,."
265 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
266 OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
267 CFLAGS=${CFLAGS-"-O -std1"}
268 LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
269 QNX*) SFLAGS=${CFLAGS-"-4 -O"}
270 CFLAGS=${CFLAGS-"-4 -O"}
271 LDSHARED=${LDSHARED-"cc"}
272 RANLIB=${RANLIB-"true"}
275 SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
276 CFLAGS=${CFLAGS-"-O3"}
277 LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
278 SunOS\ 5* | solaris*)
279 LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"}
280 SFLAGS=${CFLAGS-"-fast -KPIC"}
281 CFLAGS=${CFLAGS-"-fast"}
282 if test $build64 -eq 1; then
283 # old versions of SunPRO/Workshop/Studio don't support -m64,
284 # but newer ones do. Check for it.
285 flag64=`$CC -flags | egrep -- '^-m64'`
286 if test x"$flag64" != x"" ; then
287 CFLAGS="${CFLAGS} -m64"
288 SFLAGS="${SFLAGS} -m64"
290 case `(uname -m || echo unknown) 2>/dev/null` in
292 SFLAGS="$SFLAGS -xarch=amd64"
293 CFLAGS="$CFLAGS -xarch=amd64" ;;
295 SFLAGS="$SFLAGS -xarch=v9"
296 CFLAGS="$CFLAGS -xarch=v9" ;;
301 SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
302 CFLAGS=${CFLAGS-"-O2"}
303 LDSHARED=${LDSHARED-"ld"} ;;
304 SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
305 CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
306 LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
307 UNIX_System_V\ 4.2.0)
308 SFLAGS=${CFLAGS-"-KPIC -O"}
309 CFLAGS=${CFLAGS-"-O"}
310 LDSHARED=${LDSHARED-"cc -G"} ;;
312 SFLAGS=${CFLAGS-"-Kconform_pic -O"}
313 CFLAGS=${CFLAGS-"-O"}
314 LDSHARED=${LDSHARED-"cc -G"} ;;
316 SFLAGS=${CFLAGS-"-KPIC -O"}
317 CFLAGS=${CFLAGS-"-O"}
318 LDSHARED=${LDSHARED-"cc -G"} ;;
319 AIX*) # Courtesy of dbakker@arrayasolutions.com
320 SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
321 CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
322 LDSHARED=${LDSHARED-"xlc -G"} ;;
323 # send working options for other systems to zlib@gzip.org
324 *) SFLAGS=${CFLAGS-"-O"}
325 CFLAGS=${CFLAGS-"-O"}
326 LDSHARED=${LDSHARED-"cc -shared"} ;;
330 # destination names for shared library if not defined above
331 SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
332 SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
333 SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
335 echo >> configure.log
337 # see if shared library build supported
338 if test $shared -eq 1; then
339 echo Checking for shared library support... | tee -a configure.log
340 # we must test in two steps (cc then ld), required at least on SunOS 4.x
341 if try $CC -w -c $SFLAGS $test.c &&
342 try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
343 echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
344 elif test -z "$old_cc" -a -z "$old_cflags"; then
345 echo No shared library support. | tee -a configure.log
348 echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
352 if test $shared -eq 0; then
355 TEST="all teststatic"
359 echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
362 TEST="all teststatic testshared"
365 echo >> configure.log
367 # check for underscores in external names for use by assembler code
371 echo >> configure.log
372 show "$NM $test.o | grep _hello"
373 if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
374 CPP="$CPP -DNO_UNDERLINE"
375 echo Checking for underline in external names... No. | tee -a configure.log
377 echo Checking for underline in external names... Yes. | tee -a configure.log
381 echo >> configure.log
383 # check for large file support, and if none, check for fseeko()
385 #include <sys/types.h>
388 if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
389 CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
390 SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
392 TEST="${TEST} test64"
393 echo "Checking for off64_t... Yes." | tee -a configure.log
394 echo "Checking for fseeko... Yes." | tee -a configure.log
396 echo "Checking for off64_t... No." | tee -a configure.log
397 echo >> configure.log
405 if try $CC $CFLAGS -o $test $test.c; then
406 echo "Checking for fseeko... Yes." | tee -a configure.log
408 CFLAGS="${CFLAGS} -DNO_FSEEKO"
409 SFLAGS="${SFLAGS} -DNO_FSEEKO"
410 echo "Checking for fseeko... No." | tee -a configure.log
414 echo >> configure.log
416 # check for strerror() for use by gz* functions
420 int main() { return strlen(strerror(errno)); }
422 if try $CC $CFLAGS -o $test $test.c; then
423 echo "Checking for strerror... Yes." | tee -a configure.log
425 CFLAGS="${CFLAGS} -DNO_STRERROR"
426 SFLAGS="${SFLAGS} -DNO_STRERROR"
427 echo "Checking for strerror... No." | tee -a configure.log
430 # copy clean zconf.h for subsequent edits
431 cp -p zconf.h.in zconf.h
433 echo >> configure.log
435 # check for unistd.h and save result in zconf.h
438 int main() { return 0; }
440 if try $CC -c $CFLAGS $test.c; then
441 sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
442 mv zconf.temp.h zconf.h
443 echo "Checking for unistd.h... Yes." | tee -a configure.log
445 echo "Checking for unistd.h... No." | tee -a configure.log
448 echo >> configure.log
450 # check for stdarg.h and save result in zconf.h
453 int main() { return 0; }
455 if try $CC -c $CFLAGS $test.c; then
456 sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
457 mv zconf.temp.h zconf.h
458 echo "Checking for stdarg.h... Yes." | tee -a configure.log
460 echo "Checking for stdarg.h... No." | tee -a configure.log
463 # if the z_ prefix was requested, save that in zconf.h
464 if test $zprefix -eq 1; then
465 sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
466 mv zconf.temp.h zconf.h
467 echo >> configure.log
468 echo "Using z_ prefix on all symbols." | tee -a configure.log
471 # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
472 if test $solo -eq 1; then
473 sed '/#define ZCONF_H/a\
476 ' < zconf.h > zconf.temp.h
477 mv zconf.temp.h zconf.h
479 PIC_OBJC='$(PIC_OBJZ)'
482 # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
483 if test $cover -eq 1; then
484 CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
485 if test -n "$GCC_CLASSIC"; then
490 echo >> configure.log
492 # conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
493 # (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
494 # return value. The most secure result is vsnprintf() with a return value. snprintf() with a
495 # return value is secure as well, but then gzprintf() will be limited to 20 arguments.
508 if try $CC -c $CFLAGS $test.c; then
509 echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
511 echo >> configure.log
515 int mytest(const char *fmt, ...)
520 vsnprintf(buf, sizeof(buf), fmt, ap);
526 return (mytest("Hello%d\n", 1));
529 if try $CC $CFLAGS -o $test $test.c; then
530 echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
532 echo >> configure.log
536 int mytest(const char *fmt, ...)
542 n = vsnprintf(buf, sizeof(buf), fmt, ap);
548 return (mytest("Hello%d\n", 1));
552 if try $CC -c $CFLAGS $test.c; then
553 echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
555 CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
556 SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
557 echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
558 echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
559 echo " can build but will be open to possible string-format security" | tee -a configure.log
560 echo " vulnerabilities." | tee -a configure.log
563 CFLAGS="$CFLAGS -DNO_vsnprintf"
564 SFLAGS="$SFLAGS -DNO_vsnprintf"
565 echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
566 echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
567 echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
568 echo " vulnerabilities." | tee -a configure.log
570 echo >> configure.log
574 int mytest(const char *fmt, ...)
580 n = vsprintf(buf, fmt, ap);
586 return (mytest("Hello%d\n", 1));
590 if try $CC -c $CFLAGS $test.c; then
591 echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
593 CFLAGS="$CFLAGS -DHAS_vsprintf_void"
594 SFLAGS="$SFLAGS -DHAS_vsprintf_void"
595 echo "Checking for return value of vsprintf()... No." | tee -a configure.log
596 echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
597 echo " can build but will be open to possible string-format security" | tee -a configure.log
598 echo " vulnerabilities." | tee -a configure.log
602 echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
604 echo >> configure.log
610 snprintf(buf, sizeof(buf), "%s", "foo");
619 if try $CC $CFLAGS -o $test $test.c; then
620 echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
622 echo >> configure.log
628 return snprintf(buf, sizeof(buf), "%s", "foo");
636 if try $CC -c $CFLAGS $test.c; then
637 echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
639 CFLAGS="$CFLAGS -DHAS_snprintf_void"
640 SFLAGS="$SFLAGS -DHAS_snprintf_void"
641 echo "Checking for return value of snprintf()... No." | tee -a configure.log
642 echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
643 echo " can build but will be open to possible string-format security" | tee -a configure.log
644 echo " vulnerabilities." | tee -a configure.log
647 CFLAGS="$CFLAGS -DNO_snprintf"
648 SFLAGS="$SFLAGS -DNO_snprintf"
649 echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
650 echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
651 echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
652 echo " vulnerabilities." | tee -a configure.log
654 echo >> configure.log
660 return sprintf(buf, "%s", "foo");
668 if try $CC -c $CFLAGS $test.c; then
669 echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
671 CFLAGS="$CFLAGS -DHAS_sprintf_void"
672 SFLAGS="$SFLAGS -DHAS_sprintf_void"
673 echo "Checking for return value of sprintf()... No." | tee -a configure.log
674 echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
675 echo " can build but will be open to possible string-format security" | tee -a configure.log
676 echo " vulnerabilities." | tee -a configure.log
681 # see if we can hide zlib internal symbols that are linked between separate source files
682 if test "$gcc" -eq 1; then
683 echo >> configure.log
685 #define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
686 int ZLIB_INTERNAL foo;
692 if tryboth $CC -c $CFLAGS $test.c; then
693 CFLAGS="$CFLAGS -DHAVE_HIDDEN"
694 SFLAGS="$SFLAGS -DHAVE_HIDDEN"
695 echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
697 echo "Checking for attribute(visibility) support... No." | tee -a configure.log
701 echo >> configure.log
703 # find a four-byte unsiged integer type for crc calculations
706 #define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;}
713 is32(l, "unsigned long")
714 is32(s, "unsigned short")
719 if try $CC $CFLAGS $test.c -o $test && Z_U4=`./$test` && test -n "$Z_U4"; then
720 sed < zconf.h "/#define Z_U4/s/\/\* \.\/configure may/#define Z_U4 $Z_U4 \/* .\/configure put the/" > zconf.temp.h
721 mv zconf.temp.h zconf.h
722 echo "Looking for a four-byte integer type... Found." | tee -a configure.log
724 echo "Looking for a four-byte integer type... Not found." | tee -a configure.log
727 # clean up files produced by running the compiler and linker
728 rm -f $test.[co] $test $test$shared_ext $test.gcno
730 # show the results in the log
731 echo >> configure.log
732 echo ALL = $ALL >> configure.log
733 echo AR = $AR >> configure.log
734 echo ARFLAGS = $ARFLAGS >> configure.log
735 echo CC = $CC >> configure.log
736 echo CFLAGS = $CFLAGS >> configure.log
737 echo CPP = $CPP >> configure.log
738 echo EXE = $EXE >> configure.log
739 echo LDCONFIG = $LDCONFIG >> configure.log
740 echo LDFLAGS = $LDFLAGS >> configure.log
741 echo LDSHARED = $LDSHARED >> configure.log
742 echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
743 echo OBJC = $OBJC >> configure.log
744 echo PIC_OBJC = $PIC_OBJC >> configure.log
745 echo RANLIB = $RANLIB >> configure.log
746 echo SFLAGS = $SFLAGS >> configure.log
747 echo SHAREDLIB = $SHAREDLIB >> configure.log
748 echo SHAREDLIBM = $SHAREDLIBM >> configure.log
749 echo SHAREDLIBV = $SHAREDLIBV >> configure.log
750 echo STATICLIB = $STATICLIB >> configure.log
751 echo TEST = $TEST >> configure.log
752 echo VER = $VER >> configure.log
753 echo Z_U4 = $Z_U4 >> configure.log
754 echo exec_prefix = $exec_prefix >> configure.log
755 echo includedir = $includedir >> configure.log
756 echo libdir = $libdir >> configure.log
757 echo mandir = $mandir >> configure.log
758 echo prefix = $prefix >> configure.log
759 echo sharedlibdir = $sharedlibdir >> configure.log
760 echo uname = $uname >> configure.log
761 echo -------------------- >> configure.log
762 echo >> configure.log
763 echo >> configure.log
765 # udpate Makefile with the configure results
768 /^CFLAGS *=/s#=.*#=$CFLAGS#
769 /^SFLAGS *=/s#=.*#=$SFLAGS#
770 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
771 /^LDSHARED *=/s#=.*#=$LDSHARED#
772 /^CPP *=/s#=.*#=$CPP#
773 /^STATICLIB *=/s#=.*#=$STATICLIB#
774 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
775 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
776 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
778 /^ARFLAGS *=/s#=.*#=$ARFLAGS#
779 /^RANLIB *=/s#=.*#=$RANLIB#
780 /^LDCONFIG *=/s#=.*#=$LDCONFIG#
781 /^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
782 /^EXE *=/s#=.*#=$EXE#
783 /^prefix *=/s#=.*#=$prefix#
784 /^exec_prefix *=/s#=.*#=$exec_prefix#
785 /^libdir *=/s#=.*#=$libdir#
786 /^sharedlibdir *=/s#=.*#=$sharedlibdir#
787 /^includedir *=/s#=.*#=$includedir#
788 /^mandir *=/s#=.*#=$mandir#
789 /^OBJC *=/s#=.*#= $OBJC#
790 /^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
791 /^all: */s#:.*#: $ALL#
792 /^test: */s#:.*#: $TEST#
795 # create zlib.pc with the configure results
798 /^CFLAGS *=/s#=.*#=$CFLAGS#
799 /^CPP *=/s#=.*#=$CPP#
800 /^LDSHARED *=/s#=.*#=$LDSHARED#
801 /^STATICLIB *=/s#=.*#=$STATICLIB#
802 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
803 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
804 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
806 /^ARFLAGS *=/s#=.*#=$ARFLAGS#
807 /^RANLIB *=/s#=.*#=$RANLIB#
808 /^EXE *=/s#=.*#=$EXE#
809 /^prefix *=/s#=.*#=$prefix#
810 /^exec_prefix *=/s#=.*#=$exec_prefix#
811 /^libdir *=/s#=.*#=$libdir#
812 /^sharedlibdir *=/s#=.*#=$sharedlibdir#
813 /^includedir *=/s#=.*#=$includedir#
814 /^mandir *=/s#=.*#=$mandir#
815 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
817 s/\@VERSION\@/$VER/g;