1 dnl this files has to be processed by autoconf
5 AC_CONFIG_SRCDIR([README])
6 AC_CONFIG_SRCDIR(job.c)
7 AC_CONFIG_HEADERS(config.h)
8 AM_INIT_AUTOMAKE(beanstalkd,$($srcdir/version.sh))
14 DEFAULT_INSTALL_PREFIX="/usr/local"
15 STANDARD_PREFIXES="/usr /usr/local /opt /local"
20 [AS_HELP_STRING([--with-libdir],[look for libraries in .../NAME rather than .../lib])
22 [LIBDIR=$with_libdir],
27 dnl {{{ --disable-rpath
29 [AS_HELP_STRING([--disable-rpath],[disable passing additional runtime library search paths])
36 dnl {{{ check for rpath support
37 AC_MSG_CHECKING([if compiler supports -R])
38 AC_CACHE_VAL(bt_cv_cc_dashr,[
40 LIBS="-R /usr/$LIBDIR $LIBS"
41 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[bt_cv_cc_dashr=yes],[bt_cv_cc_dashr=no])
43 AC_MSG_RESULT([$bt_cv_cc_dashr])
44 if test $bt_cv_cc_dashr = "yes"; then
47 AC_MSG_CHECKING([if compiler supports -Wl,-rpath,])
48 AC_CACHE_VAL(bt_cv_cc_rpath,[
50 LIBS="-Wl,-rpath,/usr/$LIBDIR $LIBS"
51 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[bt_cv_cc_rpath=yes],[bt_cv_cc_rpath=no])
53 AC_MSG_RESULT([$bt_cv_cc_rpath])
54 if test $bt_cv_cc_rpath = "yes"; then
55 ld_runpath_switch=-Wl,-rpath,
60 if test "$BEAN_RPATH" = "no"; then
67 [AS_HELP_STRING([--with-event],[specify libevent install prefix])
73 if test "x$with_event" = "xno"; then
74 AC_MSG_ERROR([can't continue without libevent])
76 AC_MSG_CHECKING([libevent install prefix])
78 if test "x$with_event" = "xyes"; then
79 for i in `echo "$STANDARD_PREFIXES"`; do
80 if test -f "$i/include/event.h"; then
86 if test -f "$with_event/include/event.h"; then
87 LIBEVENT_DIR="$with_event"
90 AC_MSG_ERROR([Can't find libevent headers under $with_event directory])
94 if test "x$LIBEVENT_DIR" = "x"; then
95 AC_MSG_ERROR([Unable to locate libevent headers, please use --with-event=<DIR>])
98 AC_MSG_RESULT([$LIBEVENT_DIR])
99 LDFLAGS="$LDFLAGS -L$LIBEVENT_DIR/$LIBDIR"
100 CFLAGS="$CFLAGS -I$LIBEVENT_DIR/include"
103 if test "$BEAN_RPATH" != "no"; then
104 LDFLAGS="$LDFLAGS $ld_runpath_switch$LIBEVENT_DIR/$LIBDIR"
107 AC_CHECK_LIB([event], [event_get_version], [], [
108 AC_MSG_ERROR([event_get_version() is missing, check config.log for more details])
111 if test -f "$LIBEVENT_DIR/$LIBDIR/libevent.so"; then
112 LIBEVENT="$LIBEVENT_DIR/$LIBDIR/libevent.so";
114 if test -f "$LIBEVENT_DIR/lib/libevent.so"; then
115 LIBEVENT="$LIBEVENT_DIR/lib/libevent.so";
117 if test -f "$LIBEVENT_DIR/lib64/libevent.so"; then
118 LIBEVENT="$LIBEVENT_DIR/lib64/libevent.so";
126 dnl {{{ --enable-debug
128 [AS_HELP_STRING([--enable-debug],[enable debugging symbols and compile flags])
131 if test x"$enableval" = xyes ; then
139 if test x"$debug" = xyes ; then
140 AC_DEFINE([BEAN_DEBUG], [], [debug build])
142 if test x"$GCC" = xyes; then
143 dnl Remove any optimization flags from CFLAGS
145 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9s]*//g'`
146 CFLAGS=`echo "$CFLAGS" | sed -e 's/-g[0-2]\? //g'`
148 CFLAGS="$CFLAGS -g3 -Wall -O0"
151 dnl Do not strip symbols from developer object files.
152 INSTALL_STRIP_FLAG=""
154 dnl Make sure to strip symbols from non-developer object files.
155 INSTALL_STRIP_FLAG="-s"
159 AC_SUBST(INSTALL_STRIP_FLAG)
161 AC_CONFIG_FILES([Makefile])
164 dnl vim700: ts=2 sw=2 et