2003-06-07 13:18:32 +00:00
|
|
|
dnl Check to find the lzo headers/libraries
|
|
|
|
|
2004-01-10 23:21:36 +00:00
|
|
|
AC_DEFUN([tinc_LZO],
|
2003-06-07 13:18:32 +00:00
|
|
|
[
|
2010-02-10 12:24:33 +00:00
|
|
|
AC_ARG_ENABLE([lzo],
|
|
|
|
AS_HELP_STRING([--disable-lzo], [disable lzo compression support]))
|
|
|
|
AS_IF([test "x$enable_lzo" != "xno"], [
|
|
|
|
AC_DEFINE(HAVE_LZO, 1, [enable lzo compression support])
|
|
|
|
AC_ARG_WITH(lzo,
|
|
|
|
AS_HELP_STRING([--with-lzo=DIR], [lzo base directory, or:]),
|
|
|
|
[lzo="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval/include"
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval/lib"]
|
|
|
|
)
|
2003-07-29 11:50:39 +00:00
|
|
|
|
2010-02-10 12:24:33 +00:00
|
|
|
AC_ARG_WITH(lzo-include,
|
|
|
|
AS_HELP_STRING([--with-lzo-include=DIR], [lzo headers directory]),
|
|
|
|
[lzo_include="$withval"
|
|
|
|
CPPFLAGS="$CPPFLAGS -I$withval"]
|
|
|
|
)
|
2003-06-07 13:18:32 +00:00
|
|
|
|
2010-02-10 12:24:33 +00:00
|
|
|
AC_ARG_WITH(lzo-lib,
|
|
|
|
AS_HELP_STRING([--with-lzo-lib=DIR], [lzo library directory]),
|
|
|
|
[lzo_lib="$withval"
|
|
|
|
LDFLAGS="$LDFLAGS -L$withval"]
|
|
|
|
)
|
2003-06-07 13:18:32 +00:00
|
|
|
|
2010-02-10 12:24:33 +00:00
|
|
|
AC_CHECK_LIB(lzo2, lzo1x_1_compress,
|
|
|
|
[LIBS="$LIBS -llzo2"],
|
|
|
|
[AC_CHECK_LIB(lzo, lzo1x_1_compress,
|
|
|
|
[LIBS="$LIBS -llzo"],
|
|
|
|
[AC_MSG_ERROR("lzo libraries not found."); break]
|
|
|
|
)]
|
|
|
|
)
|
2006-11-29 17:18:39 +00:00
|
|
|
|
2010-02-10 12:24:33 +00:00
|
|
|
AC_CHECK_HEADERS(lzo/lzo1x.h,
|
|
|
|
[AC_DEFINE(LZO1X_H, [<lzo/lzo1x.h>], [Location of lzo1x.h])],
|
|
|
|
[AC_CHECK_HEADERS(lzo2/lzo1x.h,
|
|
|
|
[AC_DEFINE(LZO1X_H, [<lzo2/lzo1x.h>], [Location of lzo1x.h])],
|
|
|
|
[AC_CHECK_HEADERS(lzo1x.h,
|
|
|
|
[AC_DEFINE(LZO1X_H, [<lzo1x.h>], [Location of lzo1x.h])],
|
|
|
|
[AC_MSG_ERROR("lzo header files not found."); break]
|
|
|
|
)]
|
2006-11-29 17:18:39 +00:00
|
|
|
)]
|
2010-02-10 12:24:33 +00:00
|
|
|
)
|
|
|
|
])
|
2003-06-07 13:18:32 +00:00
|
|
|
])
|