~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to build/autoconf/zlib.m4

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl This Source Code Form is subject to the terms of the Mozilla Public
2
 
dnl License, v. 2.0. If a copy of the MPL was not distributed with this
3
 
dnl file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
 
 
5
 
dnl Usage: MOZ_ZLIB_CHECK([version])
6
 
 
7
 
AC_DEFUN([MOZ_ZLIB_CHECK],
8
 
[
9
 
 
10
 
MOZZLIB=$1
11
 
 
12
 
MOZ_ARG_WITH_STRING(system-zlib,
13
 
[  --with-system-zlib[=PFX]
14
 
                          Use system libz [installed at prefix PFX]],
15
 
    ZLIB_DIR=$withval)
16
 
 
17
 
if test -z "$MOZ_ZLIB_LIBS$MOZ_ZLIB_CFLAGS$SKIP_LIBRARY_CHECKS"; then
18
 
    _SAVE_CFLAGS=$CFLAGS
19
 
    _SAVE_LDFLAGS=$LDFLAGS
20
 
    _SAVE_LIBS=$LIBS
21
 
 
22
 
    if test -n "${ZLIB_DIR}" -a "${ZLIB_DIR}" != "yes"; then
23
 
        MOZ_ZLIB_CFLAGS="-I${ZLIB_DIR}/include"
24
 
        MOZ_ZLIB_LIBS="-L${ZLIB_DIR}/lib"
25
 
        CFLAGS="$MOZ_ZLIB_CFLAGS $CFLAGS"
26
 
        LDFLAGS="$MOZ_ZLIB_LIBS $LDFLAGS"
27
 
    fi
28
 
    if test -z "$ZLIB_DIR" -o "$ZLIB_DIR" = no; then
29
 
        MOZ_NATIVE_ZLIB=
30
 
    else
31
 
        AC_CHECK_LIB(z, gzread, [MOZ_NATIVE_ZLIB=1 MOZ_ZLIB_LIBS="$MOZ_ZLIB_LIBS -lz"],
32
 
            [MOZ_NATIVE_ZLIB=])
33
 
        if test "$MOZ_NATIVE_ZLIB" = 1; then
34
 
            MOZZLIBNUM=`echo $MOZZLIB | awk -F. changequote(<<, >>)'{printf "0x%x\n", (((<<$>>1 * 16 + <<$>>2) * 16) + <<$>>3) * 16 + <<$>>4}'changequote([, ])`
35
 
            AC_TRY_COMPILE([ #include <stdio.h>
36
 
                             #include <string.h>
37
 
                             #include <zlib.h> ],
38
 
                           [ #if ZLIB_VERNUM < $MOZZLIBNUM
39
 
                             #error "Insufficient zlib version ($MOZZLIBNUM required)."
40
 
                             #endif ],
41
 
                           MOZ_NATIVE_ZLIB=1,
42
 
                           AC_MSG_ERROR([Insufficient zlib version for --with-system-zlib ($MOZZLIB required)]))
43
 
        fi
44
 
    fi
45
 
    CFLAGS=$_SAVE_CFLAGS
46
 
    LDFLAGS=$_SAVE_LDFLAGS
47
 
    LIBS=$_SAVE_LIBS
48
 
fi
49
 
 
50
 
AC_SUBST(MOZ_ZLIB_CFLAGS)
51
 
AC_SUBST(MOZ_ZLIB_LIBS)
52
 
AC_SUBST(MOZ_NATIVE_ZLIB)
53
 
 
54
 
])