summaryrefslogtreecommitdiffstats
path: root/m4/want_lz4.m4
blob: 923403027e11326f6e03197ac8d35fe99bae1523 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
AC_DEFUN([DOVECOT_WANT_LZ4], [
  AS_IF([test "$want_lz4" != "no"], [
    AC_CHECK_HEADER(lz4.h, [
      AC_CHECK_LIB(lz4, LZ4_compress, [
        have_lz4=yes
        have_compress_lib=yes
        AC_DEFINE(HAVE_LZ4,, [Define if you have lz4 library])
        COMPRESS_LIBS="$COMPRESS_LIBS -llz4"
      ], [
        AS_IF([test "$want_lz4" = "yes"], [
          AC_ERROR([Can't build with lz4 support: liblz4 not found])
        ])
      ])
      AC_CHECK_LIB(lz4, LZ4_compress_default, [
        AC_DEFINE(HAVE_LZ4_COMPRESS_DEFAULT,,
          [Define if you have LZ4_compress_default])
      ])
    ], [
      AS_IF([test "$want_lz4" = "yes"], [
        AC_ERROR([Can't build with lz4 support: lz4.h not found])
      ])
    ])
  ])
])