From a6d64cbe54bcede737ed1ea3004d6926ec849be9 Mon Sep 17 00:00:00 2001 From: Adam Tkac Date: Thu, 27 Mar 2008 18:13:28 +0000 Subject: [PATCH] Introduced common/zlib/{configure.ac,Makefile.am}. Renamed macros generated by old configure to same as generated by new configure and add config.h include where needed. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/branches/1.5-xserver@2454 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- common/zlib/Makefile.am | 7 +++++++ common/zlib/configure | 4 ++-- common/zlib/configure.ac | 20 ++++++++++++++++++++ common/zlib/minigzip.c | 14 +++++++++----- common/zlib/zconf.h | 4 ++++ common/zlib/zutil.h | 10 +++++++--- 6 files changed, 49 insertions(+), 10 deletions(-) create mode 100644 common/zlib/Makefile.am create mode 100644 common/zlib/configure.ac diff --git a/common/zlib/Makefile.am b/common/zlib/Makefile.am new file mode 100644 index 00000000..5da5a6ef --- /dev/null +++ b/common/zlib/Makefile.am @@ -0,0 +1,7 @@ +noinst_LTLIBRARIES = libz.la + +libz_la_SOURCES = adler32.c compress.c crc32.c deflate.c deflate.h example.c \ + gzio.c infblock.c infblock.h infcodes.c infcodes.h inffast.c \ + inffast.h inffixed.h inflate.c inftrees.c inftrees.h infutil.c \ + infutil.h maketree.c minigzip.c trees.c trees.h uncompr.c zconf.h \ + zlib.h zutil.c zutil.h diff --git a/common/zlib/configure b/common/zlib/configure index 7c66e10b..a19ff2e8 100755 --- a/common/zlib/configure +++ b/common/zlib/configure @@ -162,9 +162,9 @@ int main() { return 0; } EOF if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then echo "Checking for errno.h... Yes." + CFLAGS="$CFLAGS -DHAVE_ERRNO_H" else echo "Checking for errno.h... No." - CFLAGS="$CFLAGS -DNO_ERRNO_H" fi cat > $test.c <&1`" = ""; then - CFLAGS="$CFLAGS -DUSE_MMAP" + CFLAGS="$CFLAGS -DHAVE_MMAP" echo Checking for mmap support... Yes. else echo Checking for mmap support... No. diff --git a/common/zlib/configure.ac b/common/zlib/configure.ac new file mode 100644 index 00000000..2befc77e --- /dev/null +++ b/common/zlib/configure.ac @@ -0,0 +1,20 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.61]) +AC_INIT([zlib], [1.1.4]) +AM_INIT_AUTOMAKE([-Wall foreign dist-bzip2]) + +# Checks for programs. +AC_PROG_CC +AC_PROG_LIBTOOL + +# Checks for header files. +AC_CHECK_HEADERS([unistd.h errno.h]) + +# Checks for library functions. +AC_FUNC_MMAP + +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT diff --git a/common/zlib/minigzip.c b/common/zlib/minigzip.c index 8be02bd6..40508785 100644 --- a/common/zlib/minigzip.c +++ b/common/zlib/minigzip.c @@ -15,6 +15,10 @@ /* @(#) $Id: minigzip.c,v 1.1 2004/10/08 09:44:26 const_k Exp $ */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include "zlib.h" @@ -25,7 +29,7 @@ extern void exit OF((int)); #endif -#ifdef USE_MMAP +#ifdef HAVE_MMAP # include # include # include @@ -75,7 +79,7 @@ char *prog; void error OF((const char *msg)); void gz_compress OF((FILE *in, gzFile out)); -#ifdef USE_MMAP +#ifdef HAVE_MMAP int gz_compress_mmap OF((FILE *in, gzFile out)); #endif void gz_uncompress OF((gzFile in, FILE *out)); @@ -105,7 +109,7 @@ void gz_compress(in, out) int len; int err; -#ifdef USE_MMAP +#ifdef HAVE_MMAP /* Try first compressing with mmap. If mmap fails (minigzip used in a * pipe), use the normal fread loop. */ @@ -125,7 +129,7 @@ void gz_compress(in, out) if (gzclose(out) != Z_OK) error("failed gzclose"); } -#ifdef USE_MMAP /* MMAP version, Miguel Albrecht */ +#ifdef HAVE_MMAP /* MMAP version, Miguel Albrecht */ /* Try compressing the input file at once using mmap. Return Z_OK if * if success, Z_ERRNO otherwise. @@ -160,7 +164,7 @@ int gz_compress_mmap(in, out) if (gzclose(out) != Z_OK) error("failed gzclose"); return Z_OK; } -#endif /* USE_MMAP */ +#endif /* HAVE_MMAP */ /* =========================================================================== * Uncompress input to output then close both files. diff --git a/common/zlib/zconf.h b/common/zlib/zconf.h index c8d6ce9a..d1705ae1 100644 --- a/common/zlib/zconf.h +++ b/common/zlib/zconf.h @@ -8,6 +8,10 @@ #ifndef _ZCONF_H #define _ZCONF_H +#ifdef HAVE_CONFIG_H +#include +#endif + /* * If you *really* need a unique prefix for all types and library functions, * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. diff --git a/common/zlib/zutil.h b/common/zlib/zutil.h index 17eb77f2..82084988 100644 --- a/common/zlib/zutil.h +++ b/common/zlib/zutil.h @@ -13,6 +13,10 @@ #ifndef _Z_UTIL_H #define _Z_UTIL_H +#ifdef HAVE_CONFIG_H +#include +#endif + #include "zlib.h" #ifdef STDC @@ -20,10 +24,10 @@ # include # include #endif -#ifdef NO_ERRNO_H - extern int errno; -#else +#ifdef HAVE_ERRNO_H # include +#else + extern int errno; #endif #ifndef local -- 2.39.5