Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

187 lines (156 sloc) 4.456 kB
dnl this files has to be processed by autoconf
AC_PREREQ(2.61)
AC_INIT
AC_CONFIG_SRCDIR([README])
AC_CONFIG_SRCDIR(job.c)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(beanstalkd,$($srcdir/version.sh))
AM_MAINTAINER_MODE
AS_COMPILER_FLAGS(CFLAGS, "-Wall -Werror")
AC_PROG_CC
AC_PROG_INSTALL
DEFAULT_INSTALL_PREFIX="/usr/local"
STANDARD_PREFIXES="/usr /usr/local /opt /local"
dnl {{{ --with-libdir
AC_ARG_WITH(libdir,
[AS_HELP_STRING([--with-libdir],[look for libraries in .../NAME rather than .../lib])
],
[LIBDIR=$with_libdir],
[LIBDIR=lib]
)
dnl }}}
dnl {{{ --disable-rpath
AC_ARG_ENABLE(rpath,
[AS_HELP_STRING([--disable-rpath],[disable passing additional runtime library search paths])
],
[BEAN_RPATH=no],
[BEAN_RPATH=yes]
)
dnl }}}
dnl {{{ check for rpath support
AC_MSG_CHECKING([if compiler supports -R])
AC_CACHE_VAL(bt_cv_cc_dashr,[
SAVE_LIBS=$LIBS
LIBS="-R /usr/$LIBDIR $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[bt_cv_cc_dashr=yes],[bt_cv_cc_dashr=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$bt_cv_cc_dashr])
if test $bt_cv_cc_dashr = "yes"; then
ld_runpath_switch=-R
else
AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
AC_CACHE_VAL(bt_cv_cc_rpath,[
SAVE_LIBS=$LIBS
LIBS="-Wl,-rpath,/usr/$LIBDIR $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[bt_cv_cc_rpath=yes],[bt_cv_cc_rpath=no])
LIBS=$SAVE_LIBS])
AC_MSG_RESULT([$bt_cv_cc_rpath])
if test $bt_cv_cc_rpath = "yes"; then
ld_runpath_switch=-Wl,-rpath,
else
ld_runpath_switch=-L
fi
fi
if test "$BEAN_RPATH" = "no"; then
ld_runpath_switch=
fi
dnl }}}
dnl {{{ --with-event
AC_ARG_WITH(event,
[AS_HELP_STRING([--with-event],[specify libevent install prefix])
],
[ ],
[with_event=yes]
)
if test "x$with_event" = "xno"; then
AC_MSG_ERROR([can't continue without libevent])
else
AC_MSG_CHECKING([libevent install prefix])
if test "x$with_event" = "xyes"; then
for i in `echo "$STANDARD_PREFIXES"`; do
if test -f "$i/include/event.h"; then
LIBEVENT_DIR="$i"
break;
fi
done
else
if test -f "$with_event/include/event.h"; then
LIBEVENT_DIR="$with_event"
break;
else
AC_MSG_ERROR([Can't find libevent headers under $with_event directory])
fi
fi
if test "x$LIBEVENT_DIR" = "x"; then
AC_MSG_ERROR([Unable to locate libevent headers, please use --with-event=<DIR>])
fi
AC_MSG_RESULT([$LIBEVENT_DIR])
LDFLAGS="$LDFLAGS -L$LIBEVENT_DIR/$LIBDIR"
CFLAGS="$CFLAGS -I$LIBEVENT_DIR/include"
LIBS="$LIBS -levent"
AC_CHECK_FUNCS([posix_fallocate])
AC_CHECK_FUNCS([fdatasync])
AC_CHECK_LIB([socket], [bind], [
LIBS="$LIBS -lsocket"
])
AC_CHECK_LIB([nsl], [inet_aton], [
LIBS="$LIBS -lnsl"
])
if test "$BEAN_RPATH" != "no"; then
LDFLAGS="$LDFLAGS $ld_runpath_switch$LIBEVENT_DIR/$LIBDIR"
fi
AC_CHECK_LIB([event], [event_get_version], [], [
AC_MSG_ERROR([event_get_version() is missing, check config.log for more details])
])
AC_CHECK_LIB([event], [event_reinit], [], [
AC_MSG_ERROR([beanstalkd requires libevent version 1.4.1 or later.])
])
if test -f "$LIBEVENT_DIR/$LIBDIR/libevent.so"; then
LIBEVENT="$LIBEVENT_DIR/$LIBDIR/libevent.so";
else
if test -f "$LIBEVENT_DIR/lib/libevent.so"; then
LIBEVENT="$LIBEVENT_DIR/lib/libevent.so";
else
if test -f "$LIBEVENT_DIR/lib64/libevent.so"; then
LIBEVENT="$LIBEVENT_DIR/lib64/libevent.so";
fi
fi
fi
fi
dnl }}}
dnl {{{ --enable-debug
AC_ARG_ENABLE(debug,
[AS_HELP_STRING([--enable-debug],[enable debugging symbols and compile flags])
],
[
if test x"$enableval" = xyes ; then
debug="yes"
else
debug="no"
fi
]
)
if test x"$debug" = xyes ; then
AC_DEFINE([BEAN_DEBUG], [], [debug build])
if test x"$GCC" = xyes; then
dnl Remove any optimization flags from CFLAGS
changequote({,})
CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9s]*//g'`
CFLAGS=`echo "$CFLAGS" | sed -e 's/-g[0-2]\? //g'`
changequote([,])
CFLAGS="$CFLAGS -g3 -Wall -O0"
fi
dnl Do not strip symbols from developer object files.
INSTALL_STRIP_FLAG=""
else
dnl Make sure to strip symbols from non-developer object files.
INSTALL_STRIP_FLAG="-s"
fi
dnl }}}
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_UINT16_T
AC_SUBST(INSTALL_STRIP_FLAG)
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
dnl vim700: ts=2 sw=2 et
Jump to Line
Something went wrong with that request. Please try again.