2010-10-14 13:52:01 +00:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
2012-10-02 13:30:05 +00:00
|
|
|
|
2010-10-14 13:52:01 +00:00
|
|
|
#AC_PREREQ(2.60)
|
2012-04-04 11:15:33 +00:00
|
|
|
AC_INIT(lsyncd, 2.0.7, axkibe@gmail.com)
|
2012-10-02 13:30:05 +00:00
|
|
|
AM_INIT_AUTOMAKE([foreign])
|
|
|
|
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
2010-11-26 16:17:36 +00:00
|
|
|
AC_CONFIG_SRCDIR([lsyncd.c])
|
|
|
|
AC_CONFIG_HEADER([config.h])
|
2012-10-02 00:16:00 +00:00
|
|
|
|
2012-10-02 13:39:22 +00:00
|
|
|
###
|
2010-10-14 13:52:01 +00:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
2010-11-28 17:34:42 +00:00
|
|
|
|
2012-10-02 00:16:00 +00:00
|
|
|
AC_PATH_PROG([A2X], [a2x], [no])
|
|
|
|
if test x${A2X} = xno ; then
|
|
|
|
AC_MSG_ERROR([Program 'a2x' (package asciidoc) is required])
|
|
|
|
fi
|
|
|
|
|
2010-11-28 17:34:42 +00:00
|
|
|
###
|
2012-10-02 13:42:05 +00:00
|
|
|
# Checks for Lua
|
|
|
|
|
|
|
|
# Try versioned Lua 5.2 first
|
|
|
|
PKG_CHECK_MODULES([LUA52], [lua5.2],,[
|
|
|
|
PKG_CHECK_MODULES([LUA52], [lua52],,[
|
|
|
|
PKG_CHECK_MODULES([LUA52], [lua-5.2],,[:])
|
|
|
|
])
|
2010-11-28 17:34:42 +00:00
|
|
|
])
|
2012-10-02 13:42:05 +00:00
|
|
|
AC_PATH_PROGS([LUA52], [lua5.2 lua52], [no])
|
|
|
|
AC_PATH_PROGS([LUAC52], [luac5.2 luac52], [no])
|
2010-11-28 17:34:42 +00:00
|
|
|
|
2012-10-02 13:42:05 +00:00
|
|
|
if test -z "${LUA52_PKG_ERRORS}" -a "${LUA52}" != no -a "${LUAC52}" != no ; then
|
|
|
|
LUA_VERSION="5.2"
|
|
|
|
LUA_CFLAGS="${LUA52_CFLAGS}"
|
|
|
|
LUA_LIBS="${LUA52_LIBS}"
|
|
|
|
LUA="${LUA52}"
|
|
|
|
LUAC="${LUAC52}"
|
|
|
|
else
|
|
|
|
# Fall back to versioned Lua 5.1
|
|
|
|
PKG_CHECK_MODULES([LUA51], [lua5.1 >= 5.1.3],,[
|
|
|
|
PKG_CHECK_MODULES([LUA51], [lua51 >= 5.1.3],,[
|
|
|
|
PKG_CHECK_MODULES([LUA51], [lua-5.1 >= 5.1.3],,[:])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AC_PATH_PROGS([LUA51], [lua5.1 lua51], [no])
|
|
|
|
AC_PATH_PROGS([LUAC51], [luac5.1 luac51], [no])
|
2012-10-02 00:32:15 +00:00
|
|
|
|
2012-10-02 13:42:05 +00:00
|
|
|
if test -z "${LUA51_PKG_ERRORS}" -a "${LUA51}" != no -a "${LUAC51}" != no ; then
|
|
|
|
LUA_VERSION="5.1"
|
|
|
|
LUA_CFLAGS="${LUA51_CFLAGS}"
|
|
|
|
LUA_LIBS="${LUA51_LIBS}"
|
|
|
|
LUA="${LUA51}"
|
|
|
|
LUAC="${LUAC51}"
|
|
|
|
else
|
|
|
|
# Try any Lua now
|
|
|
|
PKG_CHECK_MODULES([LUA], [lua >= 5.1.3],,[:])
|
|
|
|
AC_PATH_PROG([LUA], [lua], [no])
|
|
|
|
AC_PATH_PROG([LUAC], [luac], [no])
|
|
|
|
|
|
|
|
if test -z "${LUA_PKG_ERRORS}" -a "${LUA}" != no -a "${LUAC}" != no ; then
|
|
|
|
LUA_VERSION="(unknown version)"
|
|
|
|
else
|
|
|
|
AC_MSG_ERROR([Need a Lua toolchain with matching versions ('lua' library and 'lua' and 'luac' programs)])
|
|
|
|
fi
|
|
|
|
fi
|
2012-10-02 00:32:15 +00:00
|
|
|
fi
|
|
|
|
|
2012-10-02 13:42:05 +00:00
|
|
|
AX_SUBST_L([LUA_CFLAGS], [LUA_LIBS], [LUA], [LUAC])
|
|
|
|
|
|
|
|
|
2010-11-28 17:34:42 +00:00
|
|
|
###
|
2010-10-14 13:52:01 +00:00
|
|
|
# Checks for header files.
|
2010-10-26 20:29:12 +00:00
|
|
|
AC_CHECK_HEADERS([sys/inotify.h])
|
|
|
|
|
2010-12-07 15:42:46 +00:00
|
|
|
###
|
|
|
|
# --without-inotify option
|
|
|
|
AC_ARG_WITH([inotify],
|
2011-11-21 12:52:35 +00:00
|
|
|
[ --without-inotify Do not use Linux inotify event interface. On by default.],
|
|
|
|
[],[with_inotify=yes])
|
|
|
|
if test "x${with_inotify}" == xyes; then
|
2011-08-16 14:25:30 +00:00
|
|
|
echo "compiling with inotify"
|
|
|
|
AC_DEFINE(LSYNCD_WITH_INOTIFY,,"descr")
|
2010-12-07 15:42:46 +00:00
|
|
|
else
|
2011-08-16 14:25:30 +00:00
|
|
|
echo "compiling without inotify"
|
2010-12-07 15:42:46 +00:00
|
|
|
fi
|
2010-11-26 16:17:36 +00:00
|
|
|
AM_CONDITIONAL([INOTIFY], [test x${with_inotify} != xno])
|
2010-10-26 20:29:12 +00:00
|
|
|
|
2011-08-16 14:25:30 +00:00
|
|
|
###
|
2012-04-04 11:15:33 +00:00
|
|
|
# --with-fsevents
|
2011-08-16 14:25:30 +00:00
|
|
|
# disabled per default, experimental, works only with OS X 10.5/10.6
|
|
|
|
AC_ARG_WITH([fsevents],
|
|
|
|
[ --with-fsevents Uses MacOS (10.5) /dev/fsevents. EXPERIMENTAL!
|
|
|
|
Off by default.])
|
2011-11-21 12:52:35 +00:00
|
|
|
if test "x${with_fsevents}" == xyes; then
|
2011-08-16 14:25:30 +00:00
|
|
|
echo "compiling with fsevents. WARNING experimental!"
|
|
|
|
AC_DEFINE(LSYNCD_WITH_FSEVENTS,,"descr")
|
|
|
|
fi
|
2012-04-04 11:15:33 +00:00
|
|
|
AM_CONDITIONAL([FSEVENTS],
|
2011-08-16 14:25:30 +00:00
|
|
|
[test x${with_fsevents} != x -a xno${with_fsevents} != xno])
|
2010-11-26 16:52:24 +00:00
|
|
|
|
2010-10-14 13:52:01 +00:00
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
# Checks for library functions.
|
|
|
|
AC_CONFIG_FILES([Makefile])
|
|
|
|
AC_OUTPUT
|
2011-01-12 15:54:19 +00:00
|
|
|
|
2012-10-02 13:42:05 +00:00
|
|
|
AC_MSG_NOTICE([
|
|
|
|
Summary:
|
|
|
|
Using Lua ${LUA_VERSION}
|
|
|
|
])
|