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"}
280 case `(uname -m || echo unknown) 2>/dev/null` in
282 SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."}
283 CFLAGS=${CFLAGS-"-xpentium -fast"} ;;
285 SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."}
286 CFLAGS=${CFLAGS-"-fast -xcg92"} ;;
288 SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
289 CFLAGS=${CFLAGS-"-O2"}
290 LDSHARED=${LDSHARED-"ld"} ;;
291 SunStudio\ 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
292 CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
293 LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
294 UNIX_System_V\ 4.2.0)
295 SFLAGS=${CFLAGS-"-KPIC -O"}
296 CFLAGS=${CFLAGS-"-O"}
297 LDSHARED=${LDSHARED-"cc -G"} ;;
299 SFLAGS=${CFLAGS-"-Kconform_pic -O"}
300 CFLAGS=${CFLAGS-"-O"}
301 LDSHARED=${LDSHARED-"cc -G"} ;;
303 SFLAGS=${CFLAGS-"-KPIC -O"}
304 CFLAGS=${CFLAGS-"-O"}
305 LDSHARED=${LDSHARED-"cc -G"} ;;
306 AIX*) # Courtesy of dbakker@arrayasolutions.com
307 SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
308 CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
309 LDSHARED=${LDSHARED-"xlc -G"} ;;
310 # send working options for other systems to zlib@gzip.org
311 *) SFLAGS=${CFLAGS-"-O"}
312 CFLAGS=${CFLAGS-"-O"}
313 LDSHARED=${LDSHARED-"cc -shared"} ;;
317 # destination names for shared library if not defined above
318 SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
319 SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
320 SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
322 echo >> configure.log
324 # see if shared library build supported
325 if test $shared -eq 1; then
326 echo Checking for shared library support... | tee -a configure.log
327 # we must test in two steps (cc then ld), required at least on SunOS 4.x
328 if try $CC -w -c $SFLAGS $test.c &&
329 try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then
330 echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
331 elif test -z "$old_cc" -a -z "$old_cflags"; then
332 echo No shared library support. | tee -a configure.log
335 echo 'No shared library support; try without defining CC and CFLAGS' | tee -a configure.log
339 if test $shared -eq 0; then
342 TEST="all teststatic"
346 echo Building static library $STATICLIB version $VER with $CC. | tee -a configure.log
349 TEST="all teststatic testshared"
352 echo >> configure.log
354 # check for underscores in external names for use by assembler code
358 echo >> configure.log
359 show "$NM $test.o | grep _hello"
360 if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
361 CPP="$CPP -DNO_UNDERLINE"
362 echo Checking for underline in external names... No. | tee -a configure.log
364 echo Checking for underline in external names... Yes. | tee -a configure.log
368 echo >> configure.log
370 # check for large file support, and if none, check for fseeko()
372 #include <sys/types.h>
375 if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then
376 CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
377 SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
379 TEST="${TEST} test64"
380 echo "Checking for off64_t... Yes." | tee -a configure.log
381 echo "Checking for fseeko... Yes." | tee -a configure.log
383 echo "Checking for off64_t... No." | tee -a configure.log
384 echo >> configure.log
392 if try $CC $CFLAGS -o $test $test.c; then
393 echo "Checking for fseeko... Yes." | tee -a configure.log
395 CFLAGS="${CFLAGS} -DNO_FSEEKO"
396 SFLAGS="${SFLAGS} -DNO_FSEEKO"
397 echo "Checking for fseeko... No." | tee -a configure.log
401 echo >> configure.log
403 # check for strerror() for use by gz* functions
407 int main() { return strlen(strerror(errno)); }
409 if try $CC $CFLAGS -o $test $test.c; then
410 echo "Checking for strerror... Yes." | tee -a configure.log
412 CFLAGS="${CFLAGS} -DNO_STRERROR"
413 SFLAGS="${SFLAGS} -DNO_STRERROR"
414 echo "Checking for strerror... No." | tee -a configure.log
417 # copy clean zconf.h for subsequent edits
418 cp -p zconf.h.in zconf.h
420 echo >> configure.log
422 # check for unistd.h and save result in zconf.h
425 int main() { return 0; }
427 if try $CC -c $CFLAGS $test.c; then
428 sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
429 mv zconf.temp.h zconf.h
430 echo "Checking for unistd.h... Yes." | tee -a configure.log
432 echo "Checking for unistd.h... No." | tee -a configure.log
435 echo >> configure.log
437 # check for stdarg.h and save result in zconf.h
440 int main() { return 0; }
442 if try $CC -c $CFLAGS $test.c; then
443 sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h
444 mv zconf.temp.h zconf.h
445 echo "Checking for stdarg.h... Yes." | tee -a configure.log
447 echo "Checking for stdarg.h... No." | tee -a configure.log
450 # if the z_ prefix was requested, save that in zconf.h
451 if test $zprefix -eq 1; then
452 sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
453 mv zconf.temp.h zconf.h
454 echo >> configure.log
455 echo "Using z_ prefix on all symbols." | tee -a configure.log
458 # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
459 if test $solo -eq 1; then
460 sed '/#define ZCONF_H/a\
463 ' < zconf.h > zconf.temp.h
464 mv zconf.temp.h zconf.h
466 PIC_OBJC='$(PIC_OBJZ)'
469 # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
470 if test $cover -eq 1; then
471 CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage"
472 if test -n "$GCC_CLASSIC"; then
477 echo >> configure.log
479 # conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions
480 # (using stdarg or not), with or without "n" (proving size of buffer), and with or without a
481 # return value. The most secure result is vsnprintf() with a return value. snprintf() with a
482 # return value is secure as well, but then gzprintf() will be limited to 20 arguments.
495 if try $CC -c $CFLAGS $test.c; then
496 echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
498 echo >> configure.log
502 int mytest(const char *fmt, ...)
507 vsnprintf(buf, sizeof(buf), fmt, ap);
513 return (mytest("Hello%d\n", 1));
516 if try $CC $CFLAGS -o $test $test.c; then
517 echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
519 echo >> configure.log
523 int mytest(const char *fmt, ...)
529 n = vsnprintf(buf, sizeof(buf), fmt, ap);
535 return (mytest("Hello%d\n", 1));
539 if try $CC -c $CFLAGS $test.c; then
540 echo "Checking for return value of vsnprintf()... Yes." | tee -a configure.log
542 CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
543 SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
544 echo "Checking for return value of vsnprintf()... No." | tee -a configure.log
545 echo " WARNING: apparently vsnprintf() does not return a value. zlib" | tee -a configure.log
546 echo " can build but will be open to possible string-format security" | tee -a configure.log
547 echo " vulnerabilities." | tee -a configure.log
550 CFLAGS="$CFLAGS -DNO_vsnprintf"
551 SFLAGS="$SFLAGS -DNO_vsnprintf"
552 echo "Checking for vsnprintf() in stdio.h... No." | tee -a configure.log
553 echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | tee -a configure.log
554 echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
555 echo " vulnerabilities." | tee -a configure.log
557 echo >> configure.log
561 int mytest(const char *fmt, ...)
567 n = vsprintf(buf, fmt, ap);
573 return (mytest("Hello%d\n", 1));
577 if try $CC -c $CFLAGS $test.c; then
578 echo "Checking for return value of vsprintf()... Yes." | tee -a configure.log
580 CFLAGS="$CFLAGS -DHAS_vsprintf_void"
581 SFLAGS="$SFLAGS -DHAS_vsprintf_void"
582 echo "Checking for return value of vsprintf()... No." | tee -a configure.log
583 echo " WARNING: apparently vsprintf() does not return a value. zlib" | tee -a configure.log
584 echo " can build but will be open to possible string-format security" | tee -a configure.log
585 echo " vulnerabilities." | tee -a configure.log
589 echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()." | tee -a configure.log
591 echo >> configure.log
597 snprintf(buf, sizeof(buf), "%s", "foo");
606 if try $CC $CFLAGS -o $test $test.c; then
607 echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
609 echo >> configure.log
615 return snprintf(buf, sizeof(buf), "%s", "foo");
623 if try $CC -c $CFLAGS $test.c; then
624 echo "Checking for return value of snprintf()... Yes." | tee -a configure.log
626 CFLAGS="$CFLAGS -DHAS_snprintf_void"
627 SFLAGS="$SFLAGS -DHAS_snprintf_void"
628 echo "Checking for return value of snprintf()... No." | tee -a configure.log
629 echo " WARNING: apparently snprintf() does not return a value. zlib" | tee -a configure.log
630 echo " can build but will be open to possible string-format security" | tee -a configure.log
631 echo " vulnerabilities." | tee -a configure.log
634 CFLAGS="$CFLAGS -DNO_snprintf"
635 SFLAGS="$SFLAGS -DNO_snprintf"
636 echo "Checking for snprintf() in stdio.h... No." | tee -a configure.log
637 echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | tee -a configure.log
638 echo " can build but will be open to possible buffer-overflow security" | tee -a configure.log
639 echo " vulnerabilities." | tee -a configure.log
641 echo >> configure.log
647 return sprintf(buf, "%s", "foo");
655 if try $CC -c $CFLAGS $test.c; then
656 echo "Checking for return value of sprintf()... Yes." | tee -a configure.log
658 CFLAGS="$CFLAGS -DHAS_sprintf_void"
659 SFLAGS="$SFLAGS -DHAS_sprintf_void"
660 echo "Checking for return value of sprintf()... No." | tee -a configure.log
661 echo " WARNING: apparently sprintf() does not return a value. zlib" | tee -a configure.log
662 echo " can build but will be open to possible string-format security" | tee -a configure.log
663 echo " vulnerabilities." | tee -a configure.log
668 # see if we can hide zlib internal symbols that are linked between separate source files
669 if test "$gcc" -eq 1; then
670 echo >> configure.log
672 #define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
673 int ZLIB_INTERNAL foo;
679 if tryboth $CC -c $CFLAGS $test.c; then
680 CFLAGS="$CFLAGS -DHAVE_HIDDEN"
681 SFLAGS="$SFLAGS -DHAVE_HIDDEN"
682 echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
684 echo "Checking for attribute(visibility) support... No." | tee -a configure.log
688 # clean up files produced by running the compiler and linker
689 rm -f $test.[co] $test $test$shared_ext $test.gcno
691 # show the results in the log
692 echo >> configure.log
693 echo ALL = $ALL >> configure.log
694 echo AR = $AR >> configure.log
695 echo ARFLAGS = $ARFLAGS >> configure.log
696 echo CC = $CC >> configure.log
697 echo CFLAGS = $CFLAGS >> configure.log
698 echo CPP = $CPP >> configure.log
699 echo EXE = $EXE >> configure.log
700 echo LDCONFIG = $LDCONFIG >> configure.log
701 echo LDFLAGS = $LDFLAGS >> configure.log
702 echo LDSHARED = $LDSHARED >> configure.log
703 echo LDSHAREDLIBC = $LDSHAREDLIBC >> configure.log
704 echo OBJC = $OBJC >> configure.log
705 echo PIC_OBJC = $PIC_OBJC >> configure.log
706 echo RANLIB = $RANLIB >> configure.log
707 echo SFLAGS = $SFLAGS >> configure.log
708 echo SHAREDLIB = $SHAREDLIB >> configure.log
709 echo SHAREDLIBM = $SHAREDLIBM >> configure.log
710 echo SHAREDLIBV = $SHAREDLIBV >> configure.log
711 echo STATICLIB = $STATICLIB >> configure.log
712 echo TEST = $TEST >> configure.log
713 echo VER = $VER >> configure.log
714 echo exec_prefix = $exec_prefix >> configure.log
715 echo includedir = $includedir >> configure.log
716 echo libdir = $libdir >> configure.log
717 echo mandir = $mandir >> configure.log
718 echo prefix = $prefix >> configure.log
719 echo sharedlibdir = $sharedlibdir >> configure.log
720 echo uname = $uname >> configure.log
721 echo -------------------- >> configure.log
722 echo >> configure.log
723 echo >> configure.log
725 # udpate Makefile with the configure results
728 /^CFLAGS *=/s#=.*#=$CFLAGS#
729 /^SFLAGS *=/s#=.*#=$SFLAGS#
730 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
731 /^LDSHARED *=/s#=.*#=$LDSHARED#
732 /^CPP *=/s#=.*#=$CPP#
733 /^STATICLIB *=/s#=.*#=$STATICLIB#
734 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
735 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
736 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
738 /^ARFLAGS *=/s#=.*#=$ARFLAGS#
739 /^RANLIB *=/s#=.*#=$RANLIB#
740 /^LDCONFIG *=/s#=.*#=$LDCONFIG#
741 /^LDSHAREDLIBC *=/s#=.*#=$LDSHAREDLIBC#
742 /^EXE *=/s#=.*#=$EXE#
743 /^prefix *=/s#=.*#=$prefix#
744 /^exec_prefix *=/s#=.*#=$exec_prefix#
745 /^libdir *=/s#=.*#=$libdir#
746 /^sharedlibdir *=/s#=.*#=$sharedlibdir#
747 /^includedir *=/s#=.*#=$includedir#
748 /^mandir *=/s#=.*#=$mandir#
749 /^OBJC *=/s#=.*#= $OBJC#
750 /^PIC_OBJC *=/s#=.*#= $PIC_OBJC#
751 /^all: */s#:.*#: $ALL#
752 /^test: */s#:.*#: $TEST#
755 # create zlib.pc with the configure results
758 /^CFLAGS *=/s#=.*#=$CFLAGS#
759 /^CPP *=/s#=.*#=$CPP#
760 /^LDSHARED *=/s#=.*#=$LDSHARED#
761 /^STATICLIB *=/s#=.*#=$STATICLIB#
762 /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
763 /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
764 /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
766 /^ARFLAGS *=/s#=.*#=$ARFLAGS#
767 /^RANLIB *=/s#=.*#=$RANLIB#
768 /^EXE *=/s#=.*#=$EXE#
769 /^prefix *=/s#=.*#=$prefix#
770 /^exec_prefix *=/s#=.*#=$exec_prefix#
771 /^libdir *=/s#=.*#=$libdir#
772 /^sharedlibdir *=/s#=.*#=$sharedlibdir#
773 /^includedir *=/s#=.*#=$includedir#
774 /^mandir *=/s#=.*#=$mandir#
775 /^LDFLAGS *=/s#=.*#=$LDFLAGS#
777 s/\@VERSION\@/$VER/g;