This commit was generated by cvs2svn to compensate for changes in r26947,

which included commits to RCS files with non-trunk default branches.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-04-25 08:03:26 +00:00
parent d55e5bfc69
commit e1c743cc4c
6 changed files with 289 additions and 69 deletions

View File

@@ -1,6 +1,64 @@
ChangeLog file for zlib ChangeLog file for zlib
Changes in 1.1.4 (11 March 2002)
- ZFREE was repeated on same allocation on some error conditions.
This creates a security problem described in
http://www.zlib.org/advisory-2002-03-11.txt
- Returned incorrect error (Z_MEM_ERROR) on some invalid data
- Avoid accesses before window for invalid distances with inflate window
less than 32K.
- force windowBits > 8 to avoid a bug in the encoder for a window size
of 256 bytes. (A complete fix will be available in 1.1.5).
Changes in 1.1.3 (9 July 1998)
- fix "an inflate input buffer bug that shows up on rare but persistent
occasions" (Mark)
- fix gzread and gztell for concatenated .gz files (Didier Le Botlan)
- fix gzseek(..., SEEK_SET) in write mode
- fix crc check after a gzeek (Frank Faubert)
- fix miniunzip when the last entry in a zip file is itself a zip file
(J Lillge)
- add contrib/asm586 and contrib/asm686 (Brian Raiter)
See http://www.muppetlabs.com/~breadbox/software/assembly.html
- add support for Delphi 3 in contrib/delphi (Bob Dellaca)
- add support for C++Builder 3 and Delphi 3 in contrib/delphi2 (Davide Moretti)
- do not exit prematurely in untgz if 0 at start of block (Magnus Holmgren)
- use macro EXTERN instead of extern to support DLL for BeOS (Sander Stoks)
- added a FAQ file
- Support gzdopen on Mac with Metrowerks (Jason Linhart)
- Do not redefine Byte on Mac (Brad Pettit & Jason Linhart)
- define SEEK_END too if SEEK_SET is not defined (Albert Chin-A-Young)
- avoid some warnings with Borland C (Tom Tanner)
- fix a problem in contrib/minizip/zip.c for 16-bit MSDOS (Gilles Vollant)
- emulate utime() for WIN32 in contrib/untgz (Gilles Vollant)
- allow several arguments to configure (Tim Mooney, Frodo Looijaard)
- use libdir and includedir in Makefile.in (Tim Mooney)
- support shared libraries on OSF1 V4 (Tim Mooney)
- remove so_locations in "make clean" (Tim Mooney)
- fix maketree.c compilation error (Glenn, Mark)
- Python interface to zlib now in Python 1.5 (Jeremy Hylton)
- new Makefile.riscos (Rich Walker)
- initialize static descriptors in trees.c for embedded targets (Nick Smith)
- use "foo-gz" in example.c for RISCOS and VMS (Nick Smith)
- add the OS/2 files in Makefile.in too (Andrew Zabolotny)
- fix fdopen and halloc macros for Microsoft C 6.0 (Tom Lane)
- fix maketree.c to allow clean compilation of inffixed.h (Mark)
- fix parameter check in deflateCopy (Gunther Nikl)
- cleanup trees.c, use compressed_len only in debug mode (Christian Spieler)
- Many portability patches by Christian Spieler:
. zutil.c, zutil.h: added "const" for zmem*
. Make_vms.com: fixed some typos
. Make_vms.com: msdos/Makefile.*: removed zutil.h from some dependency lists
. msdos/Makefile.msc: remove "default rtl link library" info from obj files
. msdos/Makefile.*: use model-dependent name for the built zlib library
. msdos/Makefile.emx, nt/Makefile.emx, nt/Makefile.gcc:
new makefiles, for emx (DOS/OS2), emx&rsxnt and mingw32 (Windows 9x / NT)
- use define instead of typedef for Bytef also for MSC small/medium (Tom Lane)
- replace __far with _far for better portability (Christian Spieler, Tom Lane)
- fix test for errno.h in configure (Tim Newsham)
Changes in 1.1.2 (19 March 98) Changes in 1.1.2 (19 March 98)
- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) - added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant)
See http://www.winimage.com/zLibDll/unzip.html See http://www.winimage.com/zLibDll/unzip.html

View File

@@ -1,9 +1,9 @@
ChangeLog history of changes ChangeLog history of changes
INDEX this file INDEX this file
FAQ Frequently Asked Questions about zlib
Make_vms.com script for Vax/VMS Make_vms.com script for Vax/VMS
Makefile makefile for Unix (generated by configure) Makefile makefile for Unix (generated by configure)
Makefile.in makefile for Unix (template for configure) Makefile.in makefile for Unix (template for configure)
Makefile.msc makefile for Microsoft C 16-bit
Makefile.riscos makefile for RISCOS Makefile.riscos makefile for RISCOS
README guess what README guess what
algorithm.txt description of the (de)compression algorithm algorithm.txt description of the (de)compression algorithm
@@ -19,6 +19,8 @@ msdos/Makefile.w32 makefile for Microsoft Visual C++ 32-bit
msdos/Makefile.b32 makefile for Borland C++ 32-bit msdos/Makefile.b32 makefile for Borland C++ 32-bit
msdos/Makefile.bor makefile for Borland C/C++ 16-bit msdos/Makefile.bor makefile for Borland C/C++ 16-bit
msdos/Makefile.dj2 makefile for DJGPP 2.x msdos/Makefile.dj2 makefile for DJGPP 2.x
msdos/Makefile.emx makefile for EMX 0.9c (32-bit DOS/OS2)
msdos/Makefile.msc makefile for Microsoft C 16-bit
msdos/Makefile.tc makefile for Turbo C msdos/Makefile.tc makefile for Turbo C
msdos/Makefile.wat makefile for Watcom C msdos/Makefile.wat makefile for Watcom C
msdos/zlib.def definition file for Windows DLL msdos/zlib.def definition file for Windows DLL
@@ -26,6 +28,8 @@ msdos/zlib.rc definition file for Windows DLL
nt/Makefile.nt makefile for Windows NT nt/Makefile.nt makefile for Windows NT
nt/zlib.dnt definition file for Windows NT DLL nt/zlib.dnt definition file for Windows NT DLL
nt/Makefile.emx makefile for EMX 0.9c/RSXNT 1.41 (Win32 Intel)
nt/Makefile.gcc makefile for Windows NT using GCC (mingw32)
zlib public header files (must be kept): zlib public header files (must be kept):

View File

@@ -28,15 +28,15 @@ $ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
$ then $ then
$ dele example.obj;*,minigzip.obj;* $ dele example.obj;*,minigzip.obj;*
$ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" - $ CALL MAKE adler32.OBJ "CC ''CCOPT' adler32" -
adler32.c zutil.h zlib.h zconf.h adler32.c zlib.h zconf.h
$ CALL MAKE compress.OBJ "CC ''CCOPT' compress" - $ CALL MAKE compress.OBJ "CC ''CCOPT' compress" -
compress.c zlib.h zconf.h compress.c zlib.h zconf.h
$ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" - $ CALL MAKE crc32.OBJ "CC ''CCOPT' crc32" -
crc32.c zutil.h zlib.h zconf.h crc32.c zlib.h zconf.h
$ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" - $ CALL MAKE deflate.OBJ "CC ''CCOPT' deflate" -
deflatec.c deflate.h zutil.h zlib.h zconf.h deflate.c deflate.h zutil.h zlib.h zconf.h
$ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" - $ CALL MAKE gzio.OBJ "CC ''CCOPT' gzio" -
gsio.c zutil.h zlib.h zconf.h gzio.c zutil.h zlib.h zconf.h
$ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" - $ CALL MAKE infblock.OBJ "CC ''CCOPT' infblock" -
infblock.c zutil.h zlib.h zconf.h infblock.h infblock.c zutil.h zlib.h zconf.h infblock.h
$ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" - $ CALL MAKE infcodes.OBJ "CC ''CCOPT' infcodes" -

View File

@@ -1,8 +1,9 @@
# Project: zlib_1_03 # Project: zlib_1_03
# Patched for zlib 1.1.2 rw@shadow.org.uk 19980430
# test works out-of-the-box, installs `somewhere' on demand
# Toolflags: # Toolflags:
CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fnah CCflags = -c -depend !Depend -IC: -g -throwback -DRISCOS -fah
C++flags = -c -depend !Depend -IC: -throwback C++flags = -c -depend !Depend -IC: -throwback
Linkflags = -aif -c++ -o $@ Linkflags = -aif -c++ -o $@
ObjAsmflags = -throwback -NoCache -depend !Depend ObjAsmflags = -throwback -NoCache -depend !Depend
@@ -10,37 +11,141 @@ CMHGflags =
LibFileflags = -c -l -o $@ LibFileflags = -c -l -o $@
Squeezeflags = -o $@ Squeezeflags = -o $@
# change the line below to where _you_ want the library installed.
libdest = lib:zlib
# Final targets: # Final targets:
@.zlib_lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \ @.lib: @.o.adler32 @.o.compress @.o.crc32 @.o.deflate @.o.gzio \
@.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \ @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil @.o.trees \
@.o.uncompress @.o.zutil @.o.uncompr @.o.zutil
LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \ LibFile $(LibFileflags) @.o.adler32 @.o.compress @.o.crc32 @.o.deflate \
@.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \ @.o.gzio @.o.infblock @.o.infcodes @.o.inffast @.o.inflate @.o.inftrees @.o.infutil \
@.o.trees @.o.uncompress @.o.zutil @.o.trees @.o.uncompr @.o.zutil
@.test: @.tests.minigzip @.tests.example test: @.minigzip @.example @.lib
echo Please run "Test" in directory tests @copy @.lib @.libc A~C~DF~L~N~P~Q~RS~TV
@.tests.minigzip: @.o.minigzip @.zlib_lib C:o.Stubs @echo running tests: hang on.
Link $(Linkflags) @.o.minigzip @.zlib_lib C:o.Stubs @/@.minigzip -f -9 libc
@.tests.example: @.o.example @.zlib_lib C:o.Stubs @/@.minigzip -d libc-gz
Link $(Linkflags) @.o.example @.zlib_lib C:o.Stubs @/@.minigzip -f -1 libc
@/@.minigzip -d libc-gz
@/@.minigzip -h -9 libc
@/@.minigzip -d libc-gz
@/@.minigzip -h -1 libc
@/@.minigzip -d libc-gz
@/@.minigzip -9 libc
@/@.minigzip -d libc-gz
@/@.minigzip -1 libc
@/@.minigzip -d libc-gz
@diff @.lib @.libc
@echo that should have reported '@.lib and @.libc identical' if you have diff.
@/@.example @.fred @.fred
@echo that will have given lots of hello!'s.
@.minigzip: @.o.minigzip @.lib C:o.Stubs
Link $(Linkflags) @.o.minigzip @.lib C:o.Stubs
@.example: @.o.example @.lib C:o.Stubs
Link $(Linkflags) @.o.example @.lib C:o.Stubs
install: @.lib
cdir $(libdest)
cdir $(libdest).h
@copy @.h.zlib $(libdest).h.zlib A~C~DF~L~N~P~Q~RS~TV
@copy @.h.zconf $(libdest).h.zconf A~C~DF~L~N~P~Q~RS~TV
@copy @.lib $(libdest).lib A~C~DF~L~N~P~Q~RS~TV
@echo okay, installed zlib in $(libdest)
clean:; remove @.minigzip
remove @.example
remove @.libc
-wipe @.o.* F~r~cV
remove @.fred
# User-editable dependencies: # User-editable dependencies:
.c.o: .c.o:
cc $(ccflags) -o $@ $< cc $(ccflags) -o $@ $<
# Static dependencies: # Static dependencies:
@.o.example: @.tests.c.example
cc $(ccflags) -o @.o.example @.tests.c.example
@.o.minigzip: @.tests.c.minigzip
cc $(ccflags) -o @.o.minigzip @.tests.c.minigzip
# Dynamic dependencies: # Dynamic dependencies:
o.minigzip: tests.c.minigzip o.example: c.example
o.minigzip: h.zlib
o.minigzip: h.zconf
o.example: tests.c.example
o.example: h.zlib o.example: h.zlib
o.example: h.zconf o.example: h.zconf
o.minigzip: c.minigzip
o.minigzip: h.zlib
o.minigzip: h.zconf
o.adler32: c.adler32
o.adler32: h.zlib
o.adler32: h.zconf
o.compress: c.compress
o.compress: h.zlib
o.compress: h.zconf
o.crc32: c.crc32
o.crc32: h.zlib
o.crc32: h.zconf
o.deflate: c.deflate
o.deflate: h.deflate
o.deflate: h.zutil
o.deflate: h.zlib
o.deflate: h.zconf
o.gzio: c.gzio
o.gzio: h.zutil
o.gzio: h.zlib
o.gzio: h.zconf
o.infblock: c.infblock
o.infblock: h.zutil
o.infblock: h.zlib
o.infblock: h.zconf
o.infblock: h.infblock
o.infblock: h.inftrees
o.infblock: h.infcodes
o.infblock: h.infutil
o.infcodes: c.infcodes
o.infcodes: h.zutil
o.infcodes: h.zlib
o.infcodes: h.zconf
o.infcodes: h.inftrees
o.infcodes: h.infblock
o.infcodes: h.infcodes
o.infcodes: h.infutil
o.infcodes: h.inffast
o.inffast: c.inffast
o.inffast: h.zutil
o.inffast: h.zlib
o.inffast: h.zconf
o.inffast: h.inftrees
o.inffast: h.infblock
o.inffast: h.infcodes
o.inffast: h.infutil
o.inffast: h.inffast
o.inflate: c.inflate
o.inflate: h.zutil
o.inflate: h.zlib
o.inflate: h.zconf
o.inflate: h.infblock
o.inftrees: c.inftrees
o.inftrees: h.zutil
o.inftrees: h.zlib
o.inftrees: h.zconf
o.inftrees: h.inftrees
o.inftrees: h.inffixed
o.infutil: c.infutil
o.infutil: h.zutil
o.infutil: h.zlib
o.infutil: h.zconf
o.infutil: h.infblock
o.infutil: h.inftrees
o.infutil: h.infcodes
o.infutil: h.infutil
o.trees: c.trees
o.trees: h.deflate
o.trees: h.zutil
o.trees: h.zlib
o.trees: h.zconf
o.trees: h.trees
o.uncompr: c.uncompr
o.uncompr: h.zlib
o.uncompr: h.zconf
o.zutil: c.zutil
o.zutil: h.zutil
o.zutil: h.zlib
o.zutil: h.zconf

View File

@@ -1,7 +1,7 @@
zlib 1.1.2 is a general purpose data compression library. All the code zlib 1.1.4 is a general purpose data compression library. All the code
is thread safe. The data format used by the zlib library is thread safe. The data format used by the zlib library
is described by RFCs (Request for Comments) 1950 to 1952 in the files is described by RFCs (Request for Comments) 1950 to 1952 in the files
ftp://ds.internic.net/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate
format) and rfc1952.txt (gzip format). These documents are also available in format) and rfc1952.txt (gzip format). These documents are also available in
other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html other formats from ftp://ftp.uu.net/graphics/png/documents/zlib/zdoc-index.html
@@ -14,49 +14,54 @@ except example.c and minigzip.c.
To compile all files and run the test program, follow the instructions To compile all files and run the test program, follow the instructions
given at the top of Makefile. In short "make test; make install" given at the top of Makefile. In short "make test; make install"
should work for most machines. For MSDOS, use one of the special should work for most machines. For Unix: "./configure; make test; make install"
makefiles such as Makefile.msc; for VMS, use Make_vms.com or descrip.mms. For MSDOS, use one of the special makefiles such as Makefile.msc.
For VMS, use Make_vms.com or descrip.mms.
Questions about zlib should be sent to <zlib@quest.jpl.nasa.gov> or, Questions about zlib should be sent to <zlib@gzip.org>, or to
if this fails, to the addresses given below in the Copyright section. Gilles Vollant <info@winimage.com> for the Windows DLL version.
The zlib home page is http://www.cdrom.com/pub/infozip/zlib/ The zlib home page is http://www.zlib.org or http://www.gzip.org/zlib/
The official zlib ftp site is ftp://ftp.cdrom.com/pub/infozip/zlib/ Before reporting a problem, please check this site to verify that
Mark Nelson <markn@tiny.com> wrote an article about zlib for the Jan. 1997 you have the latest version of zlib; otherwise get the latest version and
check whether the problem still exists or not.
PLEASE read the zlib FAQ http://www.gzip.org/zlib/zlib_faq.html
before asking for help.
Mark Nelson <markn@ieee.org> wrote an article about zlib for the Jan. 1997
issue of Dr. Dobb's Journal; a copy of the article is available in issue of Dr. Dobb's Journal; a copy of the article is available in
http://web2.airmail.net/markn/articles/zlibtool/zlibtool.htm http://dogma.net/markn/articles/zlibtool/zlibtool.htm
The changes made in version 1.1.2 are documented in the file ChangeLog. The changes made in version 1.1.4 are documented in the file ChangeLog.
The main changes since 1.1.1 are: The only changes made since 1.1.3 are bug corrections:
- added contrib/minzip, mini zip and unzip based on zlib (Gilles Vollant) - ZFREE was repeated on same allocation on some error conditions.
See http://www.winimage.com/zLibDll/unzip.html This creates a security problem described in
- preinitialize the inflate tables for fixed codes, to make the code http://www.zlib.org/advisory-2002-03-11.txt
completely thread safe (Mark) - Returned incorrect error (Z_MEM_ERROR) on some invalid data
- some simplifications and slight speed-up to the inflate code (Mark) - Avoid accesses before window for invalid distances with inflate window
- fix gzeof on non-compressed files (Allan Schrum) less than 32K.
- add -std1 option in configure for OSF1 to fix gzprintf (Martin Mokrejs) - force windowBits > 8 to avoid a bug in the encoder for a window size
- use default value of 4K for Z_BUFSIZE for 16-bit MSDOS (Tim Wegner + Glenn) of 256 bytes. (A complete fix will be available in 1.1.5).
- added os2/Makefile.def and os2/zlib.def (Andrew Zabolotny)
- add shared lib support for UNIX_SV4.2MP (MATSUURA Takanori) The beta version 1.1.5beta includes many more changes. A new official
- do not wrap extern "C" around system includes (Tom Lane) version 1.1.5 will be released as soon as extensive testing has been
- added amiga/Makefile.pup for Amiga powerUP SAS/C PPC (Andreas Kleinert) completed on it.
- allow "make install prefix=..." even after configure (Glenn Randers-Pehrson)
- allow "configure --prefix $HOME" (Tim Mooney)
Unsupported third party contributions are provided in directory "contrib". Unsupported third party contributions are provided in directory "contrib".
A Java implementation of zlib is available in the Java Development Kit 1.1 A Java implementation of zlib is available in the Java Development Kit
http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html http://www.javasoft.com/products/JDK/1.1/docs/api/Package-java.util.zip.html
See the zlib home page http://www.cdrom.com/pub/infozip/zlib/ for details. See the zlib home page http://www.zlib.org for details.
A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk> A Perl interface to zlib written by Paul Marquess <pmarquess@bfsec.bt.co.uk>
is in the CPAN (Comprehensive Perl Archive Network) sites, such as: is in the CPAN (Comprehensive Perl Archive Network) sites
ftp://ftp.cis.ufl.edu/pub/perl/CPAN/modules/by-module/Compress/Compress-Zlib* http://www.cpan.org/modules/by-module/Compress/
A Python interface to zlib written by A.M. Kuchling <amk@magnet.com> A Python interface to zlib written by A.M. Kuchling <amk@magnet.com>
is available from the Python Software Association sites, such as: is available in Python 1.5 and later versions, see
ftp://ftp.python.org/pub/python/contrib/Encoding/zlib*.tar.gz http://www.python.org/doc/lib/module-zlib.html
A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com> A zlib binding for TCL written by Andreas Kupries <a.kupries@westend.com>
is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html is availlable at http://www.westend.com/~kupries/doc/trf/man/man.html
@@ -77,8 +82,8 @@ Notes for some targets:
From Visual Basic, you can call the DLL functions which do not take From Visual Basic, you can call the DLL functions which do not take
a structure as argument: compress, uncompress and all gz* functions. a structure as argument: compress, uncompress and all gz* functions.
See contrib/visual-basic.txt for more information. See contrib/visual-basic.txt for more information, or get
I don't know how to handle structures in Visual Basic, sorry. http://www.tcfb.com/dowseware/cmp-z-it.zip
- For 64-bit Irix, deflate.c must be compiled without any optimization. - For 64-bit Irix, deflate.c must be compiled without any optimization.
With -O, one libpng test fails. The test works in 32 bit mode (with With -O, one libpng test fails. The test works in 32 bit mode (with
@@ -93,15 +98,14 @@ Notes for some targets:
- zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works - zlib doesn't work on HP-UX 9.05 with some versions of /bin/cc. It works
with other compilers. Use "make test" to check your compiler. with other compilers. Use "make test" to check your compiler.
- For shared memory multiprocessors, the decompression code assumes that
writes to pointers are atomic. Also the functions zalloc and zfree passed
to deflateInit must be multi-threaded in this case.
- gzdopen is not supported on RISCOS, BEOS and by some Mac compilers. - gzdopen is not supported on RISCOS, BEOS and by some Mac compilers.
- For Turbo C the small model is supported only with reduced performance to - For Turbo C the small model is supported only with reduced performance to
avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3 avoid any far allocation; it was tested with -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
- For PalmOs, see http://www.cs.uit.no/~perm/PASTA/pilot/software.html
Per Harald Myrvang <perm@stud.cs.uit.no>
Acknowledgments: Acknowledgments:
@@ -112,7 +116,7 @@ Acknowledgments:
Copyright notice: Copyright notice:
(C) 1995-1998 Jean-loup Gailly and Mark Adler (C) 1995-2002 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages warranty. In no event will the authors be held liable for any damages

59
src/zlib/configure vendored
View File

@@ -24,18 +24,34 @@ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
AR=${AR-"ar rc"} AR=${AR-"ar rc"}
RANLIB=${RANLIB-"ranlib"} RANLIB=${RANLIB-"ranlib"}
prefix=${prefix-/usr/local} prefix=${prefix-/usr/local}
exec_prefix=${exec_prefix-'${prefix}'}
libdir=${libdir-'${exec_prefix}/lib'}
includedir=${includedir-'${prefix}/include'}
shared_ext='.so' shared_ext='.so'
shared=0 shared=0
gcc=0 gcc=0
old_cc="$CC" old_cc="$CC"
old_cflags="$CFLAGS" old_cflags="$CFLAGS"
while test $# -ge 1
do
case "$1" in case "$1" in
-h* | --h*) echo 'syntax: configure [ --shared ] [--prefix PREFIX]'; exit 0;; -h* | --h*)
echo 'usage:'
echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]'
echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
exit 0;;
-p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;;
-i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;;
-p* | --p*) prefix="$2"; shift; shift;; -p* | --p*) prefix="$2"; shift; shift;;
-e* | --e*) exec_prefix="$2"; shift; shift;;
-l* | --l*) libdir="$2"; shift; shift;;
-i* | --i*) includedir="$2"; shift; shift;;
-s* | --s*) shared=1; shift;; -s* | --s*) shared=1; shift;;
esac esac
done
test=ztest$$ test=ztest$$
cat > $test.c <<EOF cat > $test.c <<EOF
@@ -46,6 +62,7 @@ EOF
test -z "$CC" && echo Checking for gcc... test -z "$CC" && echo Checking for gcc...
cc=${CC-gcc} cc=${CC-gcc}
cflags=${CFLAGS-"-O3"} cflags=${CFLAGS-"-O3"}
# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
case "$cc" in case "$cc" in
*gcc*) gcc=1;; *gcc*) gcc=1;;
esac esac
@@ -71,7 +88,10 @@ else
IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
CFLAGS=${CFLAGS-"-ansi -O2"} CFLAGS=${CFLAGS-"-ansi -O2"}
LDSHARED=${LDSHARED-"cc -shared"};; LDSHARED=${LDSHARED-"cc -shared"};;
OSF1) SFLAGS=${CFLAGS-"-O -std1"} OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,$SHAREDLIB -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};;
OSF1*) SFLAGS=${CFLAGS-"-O -std1"}
CFLAGS=${CFLAGS-"-O -std1"} CFLAGS=${CFLAGS-"-O -std1"}
LDSHARED=${LDSHARED-"cc -shared"};; LDSHARED=${LDSHARED-"cc -shared"};;
QNX*) SFLAGS=${CFLAGS-"-4 -O"} QNX*) SFLAGS=${CFLAGS-"-4 -O"}
@@ -124,11 +144,25 @@ if test $shared -eq 0; then
echo Building static library $LIBS version $VER with $CC. echo Building static library $LIBS version $VER with $CC.
fi fi
if test -f /usr/include/unistd.h; then cat > $test.c <<EOF
#include <unistd.h>
int main() { return 0; }
EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
CFLAGS="$CFLAGS -DHAVE_UNISTD_H" CFLAGS="$CFLAGS -DHAVE_UNISTD_H"
echo "Checking for unistd.h... Yes."
else
echo "Checking for unistd.h... No."
fi fi
if test ! -f /usr/include/errno.h; then cat > $test.c <<EOF
#include <errno.h>
int main() { return 0; }
EOF
if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
echo "Checking for errno.h... Yes."
else
echo "Checking for errno.h... No."
CFLAGS="$CFLAGS -DNO_ERRNO_H" CFLAGS="$CFLAGS -DNO_ERRNO_H"
fi fi
@@ -147,12 +181,24 @@ else
echo Checking for mmap support... No. echo Checking for mmap support... No.
fi fi
CPP=${CPP-"$CC -E"}
case $CFLAGS in
*ASMV*)
if test "`nm $test.o | grep _hello`" = ""; then
CPP="$CPP -DNO_UNDERLINE"
echo Checking for underline in external names... No.
else
echo Checking for underline in external names... Yes.
fi;;
esac
rm -f $test.[co] $test$shared_ext rm -f $test.[co] $test$shared_ext
# udpate Makefile # udpate Makefile
sed < Makefile.in " sed < Makefile.in "
/^CC *=/s%=.*%=$CC% /^CC *=/s%=.*%=$CC%
/^CFLAGS *=/s%=.*%=$CFLAGS% /^CFLAGS *=/s%=.*%=$CFLAGS%
/^CPP *=/s%=.*%=$CPP%
/^LDSHARED *=/s%=.*%=$LDSHARED% /^LDSHARED *=/s%=.*%=$LDSHARED%
/^LIBS *=/s%=.*%=$LIBS% /^LIBS *=/s%=.*%=$LIBS%
/^SHAREDLIB *=/s%=.*%=$SHAREDLIB% /^SHAREDLIB *=/s%=.*%=$SHAREDLIB%
@@ -160,4 +206,7 @@ sed < Makefile.in "
/^RANLIB *=/s%=.*%=$RANLIB% /^RANLIB *=/s%=.*%=$RANLIB%
/^VER *=/s%=.*%=$VER% /^VER *=/s%=.*%=$VER%
/^prefix *=/s%=.*%=$prefix% /^prefix *=/s%=.*%=$prefix%
/^exec_prefix *=/s%=.*%=$exec_prefix%
/^libdir *=/s%=.*%=$libdir%
/^includedir *=/s%=.*%=$includedir%
" > Makefile " > Makefile