Always keep UDP mappings alive for nodes that also have a meta-connection.
[tinc] / m4 / lzo.m4
1 dnl Check to find the lzo headers/libraries
2
3 AC_DEFUN([tinc_LZO],
4 [
5   AC_ARG_ENABLE([lzo],
6     AS_HELP_STRING([--disable-lzo], [disable lzo compression support]))
7   AS_IF([test "x$enable_lzo" != "xno"], [
8     AC_DEFINE(HAVE_LZO, 1, [enable lzo compression support])
9     AC_ARG_WITH(lzo,
10       AS_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]),
11       [lzo="$withval"
12        CPPFLAGS="$CPPFLAGS -I$withval/include"
13        LDFLAGS="$LDFLAGS -L$withval/lib"]
14     )
15
16     AC_ARG_WITH(lzo-include,
17       AS_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]),
18       [lzo_include="$withval"
19        CPPFLAGS="$CPPFLAGS -I$withval"]
20     )
21
22     AC_ARG_WITH(lzo-lib,
23       AS_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]),
24       [lzo_lib="$withval"
25        LDFLAGS="$LDFLAGS -L$withval"]
26     )
27
28     AC_CHECK_LIB(lzo2, lzo1x_1_compress,
29       [LIBS="$LIBS -llzo2"],
30       [AC_CHECK_LIB(lzo, lzo1x_1_compress,
31         [LIBS="$LIBS -llzo"],
32         [AC_MSG_ERROR("lzo libraries not found."); break]
33       )]
34     )
35
36     AC_CHECK_HEADERS(lzo/lzo1x.h,
37       [AC_DEFINE(LZO1X_H, [<lzo/lzo1x.h>], [Location of lzo1x.h])],
38       [AC_CHECK_HEADERS(lzo2/lzo1x.h,
39         [AC_DEFINE(LZO1X_H, [<lzo2/lzo1x.h>], [Location of lzo1x.h])],
40         [AC_CHECK_HEADERS(lzo1x.h,
41           [AC_DEFINE(LZO1X_H, [<lzo1x.h>], [Location of lzo1x.h])],
42           [AC_MSG_ERROR("lzo header files not found."); break]
43         )]
44       )]
45     )
46   ])
47 ])