Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

239 lines (189 sloc) 6.362 kB
AC_INIT(src/logic/boot.h)
AC_CONFIG_AUX_DIR(ac)
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE(kumofs, 0.3.6)
AC_CONFIG_HEADER(config.h)
AC_SUBST(CFLAGS)
CFLAGS="-O4 -Wall $CFLAGS"
AC_SUBST(CXXFLAGS)
CXXFLAGS="-O4 -Wall $CXXFLAGS"
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AM_PROG_AS
AM_PROG_CC_C_O
AC_CACHE_CHECK([for __sync_* atomic operations], kumofs_cv_atomic_ops, [
AC_TRY_LINK([
int atomic_sub(int i) { return __sync_sub_and_fetch(&i, 1); }
int atomic_add(int i) { return __sync_add_and_fetch(&i, 1); }
int atomic_cas(int i) { return __sync_bool_compare_and_swap(&i, 0, 1); }
], [], kumofs_cv_atomic_ops="yes")
])
if test "$kumofs_cv_atomic_ops" != "yes"; then
AC_MSG_ERROR([__sync_* atomic operations are not supported.
Note that gcc < 4.1 is not supported.
If you are using gcc >= 4.1 and the default target CPU architecture is "i386", try to
add CFLAGS="--march=i686" and CXXFLAGS="-march=i686" options to ./configure as follows:
$ ./configure CFLAGS="-march=i686" CXXFLAGS="-march=i686"
])
fi
AC_LANG_PUSH(C++)
AC_CACHE_CHECK([for inner class friend], kumofs_cv_inner_class_friend, [
AC_TRY_COMPILE([
class base {
class inner { int val; friend class base; };
class check { void test() { inner r; r.val = 0; } };
};
], [], kumofs_cv_inner_class_friend="yes")
])
if test "$kumofs_cv_inner_class_friend" != "yes"; then
AC_MSG_ERROR([inner class friend is not supported.
Note that g++ < 4.1 is not supported. Use g++ >= 4.1.])
fi
AC_LANG_POP
AC_ARG_WITH([msgpack],
AS_HELP_STRING([--with-msgpack=DIR],
[specify the root directory for msgpack library]),
[msgpack_path="$withval"], [])
if test "$msgpack_path" != ""; then
CXXFLAGS="$CXXFLAGS -I$msgpack_path/include"
CFLAGS="$CFLAGS -I$msgpack_path/include"
LDFLAGS="$LDFLAGS -L$msgpack_path/lib"
fi
storage_type="tchdb"
AC_ARG_WITH([tokyocabinet],
AS_HELP_STRING([--with-tokyocabinet@<:@=DIR@:>@],
[use Tokyo Cabinet for the backend storage]),
[tokyocabinet_path="$withval"], [])
if test "$tokyocabinet_path" != ""; then
CXXFLAGS="$CXXFLAGS -I$tokyocabinet_path/include"
CFLAGS="$CFLAGS -I$tokyocabinet_path/include"
LDFLAGS="$LDFLAGS -L$tokyocabinet_path/lib"
fi
#AC_ARG_WITH([luxio],
# AS_HELP_STRING([--with-luxio@<:@=DIR@:>@],
# [use LuxIO for the backend storage (NOT IMPLEMENTED)]),
# [luxio_path="$withval"], [])
#if test "$luxio_path" != ""; then
# storage_type="luxio"
# CXXFLAGS="$CXXFLAGS -I$luxio_path/include"
# CFLAGS="$CFLAGS -I$luxio_path/include"
# LDFLAGS="$LDFLAGS -L$luxio_path/lib"
#fi
AC_MSG_CHECKING([if tcbdb is enabled])
AC_ARG_ENABLE(tcbdb,
AS_HELP_STRING([--enable-tcbdb],
[use tcbdb instead of tchdb.]) )
if test "$enable_tcbdb" = "yes"; then
storage_type="tcbdb"
fi
AC_MSG_RESULT($enable_tcbdb)
AC_MSG_CHECKING([if tcadb is enabled])
AC_ARG_ENABLE(tcadb,
AS_HELP_STRING([--enable-tcadb],
[use tcadb instead of tchdb.]) )
if test "$enable_tcadb" = "yes"; then
storage_type="tcadb"
fi
AC_MSG_RESULT($enable_tcadb)
AC_MSG_CHECKING([if tcmalloc is enabled])
AC_ARG_WITH([tcmalloc],
AS_HELP_STRING([--with-tcmalloc@<:@=DIR@:>@],
[link libtcmalloc]),
[with_tcmalloc="$withval"], [with_tcmalloc="no"])
AC_MSG_RESULT($with_tcmalloc)
if test "$with_tcmalloc" != "no"; then
if test "$with_tcmalloc" != "yes"; then
LDFLAGS="$LDFLAGS -L$with_tcmalloc/lib"
LDFLAGS="$LDFLAGS -L$with_tcmalloc/lib64"
fi
AC_CHECK_LIB(tcmalloc,malloc,,
AC_MSG_ERROR([Can't find tcmalloc library]))
fi
AC_CHECK_LIB(stdc++, main)
AC_CHECK_LIB(pthread,pthread_create,,
AC_MSG_ERROR([Can't find pthread library]))
AC_CHECK_LIB(z,deflate,,
AC_MSG_ERROR([Can't find zlib library]))
AC_CHECK_HEADERS(openssl/sha.h,,
AC_MSG_ERROR([Can't find openssl header]))
AC_CHECK_LIB(crypto,SHA1,,
AC_MSG_ERROR([Can't find openssl library]))
AC_CHECK_LIB(msgpack,main,,
AC_MSG_ERROR([Can't find msgpack library.
--with-msgpack=DIR option may be needed.]))
AC_CHECK_LIB(msgpackc,main,,
AC_MSG_ERROR([Can't find msgpackc library.
--with-msgpack=DIR option may be needed.]))
AC_CHECK_HEADERS(tchdb.h,,
AC_MSG_ERROR([Can't find Tokyo Cabinet header.
--with-tokyocabinet=DIR option may be needed.]))
AC_CHECK_LIB(tokyocabinet,tchdbget,,
AC_MSG_ERROR([Can't find tokyocabinet library.
--with-tokyocabinet=DIR option may be needed.]))
case "$target_os" in
solaris*)
AC_CHECK_LIB(socket,accept,,
AC_MSG_ERROR([Can't find libsocket.]))
AC_CHECK_LIB(nsl,inet_ntop,,
AC_MSG_ERROR([Can't find libnsl.]))
AC_CHECK_LIB(sendfile,sendfile,,
AC_MSG_ERROR([Can't find libsendfile.]))
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
CFLAGS="$CFLAGS -D_REENTRANT"
;;
esac
AC_MSG_CHECKING([storage type])
AC_MSG_RESULT($storage_type)
AM_CONDITIONAL(STORAGE_TCHDB, test "$storage_type" = "tchdb")
AM_CONDITIONAL(STORAGE_TCBDB, test "$storage_type" = "tcbdb")
AM_CONDITIONAL(STORAGE_TCADB, test "$storage_type" = "tcadb")
AM_CONDITIONAL(STORAGE_LUXIO, test "$storage_type" = "luxio")
if test "$storage_type" = "tchdb" -o "$storage_type" = "tcbdb" -o "$storage_type" = "tcadb"; then
CXXFLAGS="$CXXFLAGS -DUSE_TOKYOCABINET"
CFLAGS="$CFLAGS -DUSE_TOKYOCABINET"
fi
if test "$storage_type" = "luxio"; then
AC_LANG_PUSH(C++)
AC_CHECK_HEADERS(luxio/btree.h) # FIXME luxio UINT8_MAX
#AC_CHECK_HEADERS(luxio/btree.h,,
# AC_MSG_ERROR([Can't find luxio header]))
AC_LANG_POP
fi
AC_MSG_CHECKING([if debug option is enabled])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--disable-debug],
[disable assert macros and omit -g option.]) )
if test "$enable_debug" != "no"; then
CXXFLAGS="$CXXFLAGS -g"
CFLAGS="$CFLAGS -g"
else
CXXFLAGS="$CXXFLAGS -DNDEBUG"
CFLAGS="$CFLAGS -DNDEBUG"
fi
AC_MSG_RESULT($enable_debug)
AC_MSG_CHECKING([if trace message is enabled])
AC_ARG_ENABLE(trace,
AS_HELP_STRING([--enable-trace], [enable trace messages.]) )
if test "$enable_trace" = "yes"; then
CXXFLAGS="$CXXFLAGS -DMLOGGER_LEVEL=0"
CFLAGS="$CFLAGS -DMLOGGER_LEVEL=0"
else
CXXFLAGS="$CXXFLAGS -DMLOGGER_LEVEL=2"
CFLAGS="$CFLAGS -DMLOGGER_LEVEL=2"
fi
AC_MSG_RESULT($enable_trace)
AC_OUTPUT([src/mp/Makefile
src/mpsrc/Makefile
src/gate/Makefile
src/storage/Makefile
src/log/Makefile
src/kazuhiki/Makefile
src/rpc/Makefile
src/logic/manager/Makefile
src/logic/server/Makefile
src/logic/gateway/Makefile
src/logic/Makefile
src/command/Makefile
src/Makefile
Makefile])
Jump to Line
Something went wrong with that request. Please try again.