Skip to content

Commit

Permalink
m4: Replace some if tests with AS_IF
Browse files Browse the repository at this point in the history
Fixes configure on older systems
  • Loading branch information
cmouse authored and villesavolainen committed Feb 6, 2019
1 parent 81541bd commit aed2050
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
12 changes: 6 additions & 6 deletions m4/want_bzlib.m4
@@ -1,20 +1,20 @@
AC_DEFUN([DOVECOT_WANT_BZLIB], [
if test "$want_bzlib" != "no"; then
AS_IF([test "$want_bzlib" != "no"], [
AC_CHECK_HEADER(bzlib.h, [
AC_CHECK_LIB(bz2, BZ2_bzdopen, [
have_bzlib=yes
have_compress_lib=yes
AC_DEFINE(HAVE_BZLIB,, [Define if you have bzlib library])
COMPRESS_LIBS="$COMPRESS_LIBS -lbz2"
], [
if test "$want_bzlib" = "yes"; then
AS_IF([test "$want_bzlib" = "yes"], [
AC_ERROR([Can't build with bzlib support: libbz2 not found])
fi
])
])
], [
if test "$want_bzlib" = "yes"; then
AS_IF([test "$want_bzlib" = "yes"], [
AC_ERROR([Can't build with bzlib support: bzlib.h not found])
fi
])
])
fi
])
])
12 changes: 6 additions & 6 deletions m4/want_lz4.m4
@@ -1,25 +1,25 @@
AC_DEFUN([DOVECOT_WANT_LZ4], [
if test "$want_lz4" != "no"; then
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"
], [
if test "$want_lz4" = "yes"; then
AS_IF([test "$want_lz4" = "yes"], [
AC_ERROR([Can't build with lz4 support: liblz4 not found])
fi
])
])
AC_CHECK_LIB(lz4, LZ4_compress_default, [
AC_DEFINE(HAVE_LZ4_COMPRESS_DEFAULT,,
[Define if you have LZ4_compress_default])
], [
])
], [
if test "$want_lz4" = "yes"; then
AS_IF([test "$want_lz4" = "yes"], [
AC_ERROR([Can't build with lz4 support: lz4.h not found])
fi
])
])
fi
])
])
12 changes: 6 additions & 6 deletions m4/want_lzma.m4
@@ -1,20 +1,20 @@
AC_DEFUN([DOVECOT_WANT_LZMA], [
if test "$want_lzma" != "no"; then
AS_IF([test "$want_lzma" != "no"], [
AC_CHECK_HEADER(lzma.h, [
AC_CHECK_LIB(lzma, lzma_stream_decoder, [
have_lzma=yes
have_compress_lib=yes
AC_DEFINE(HAVE_LZMA,, [Define if you have lzma library])
COMPRESS_LIBS="$COMPRESS_LIBS -llzma"
], [
if test "$want_lzma" = "yes"; then
AS_IF([test "$want_lzma" = "yes"], [
AC_ERROR([Can't build with lzma support: liblzma not found])
fi
])
])
], [
if test "$want_lzma" = "yes"; then
AS_IF([test "$want_lzma" = "yes"], [
AC_ERROR([Can't build with lzma support: lzma.h not found])
fi
])
])
fi
])
])

0 comments on commit aed2050

Please sign in to comment.