2010-05-30 03:02:40 +09:00
|
|
|
AC_INIT(src/object.cpp)
|
2009-02-22 15:47:06 +09:00
|
|
|
AC_CONFIG_AUX_DIR(ac)
|
2011-04-24 00:23:08 +09:00
|
|
|
AM_INIT_AUTOMAKE(msgpack, 0.5.6)
|
2009-02-15 09:09:56 +00:00
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
|
2009-02-22 15:14:21 +09:00
|
|
|
AC_SUBST(CFLAGS)
|
2010-04-18 00:08:03 +09:00
|
|
|
CFLAGS="-O4 -Wall $CFLAGS"
|
2009-02-22 15:14:21 +09:00
|
|
|
|
2010-04-18 00:08:03 +09:00
|
|
|
AC_SUBST(CXXFLAGS)
|
|
|
|
CXXFLAGS="-O4 -Wall $CXXFLAGS"
|
2009-02-22 15:14:21 +09:00
|
|
|
|
2010-07-06 17:45:15 +09:00
|
|
|
|
2010-04-18 00:08:03 +09:00
|
|
|
AC_PROG_CC
|
2010-07-06 17:45:15 +09:00
|
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if C++ API is enabled])
|
|
|
|
AC_ARG_ENABLE(cxx,
|
|
|
|
AS_HELP_STRING([--disable-cxx],
|
|
|
|
[don't build C++ API]) )
|
|
|
|
AC_MSG_RESULT([$enable_cxx])
|
|
|
|
if test "$enable_cxx" != "no"; then
|
|
|
|
AC_PROG_CXX
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
fi
|
|
|
|
AM_CONDITIONAL(ENABLE_CXX, test "$enable_cxx" != "no")
|
|
|
|
|
2009-02-22 15:14:21 +09:00
|
|
|
|
2010-04-18 00:08:03 +09:00
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AM_PROG_AS
|
2009-02-22 15:14:21 +09:00
|
|
|
|
2010-05-30 03:02:40 +09:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([if debug option is enabled])
|
|
|
|
AC_ARG_ENABLE(debug,
|
|
|
|
AS_HELP_STRING([--disable-debug],
|
2010-07-06 17:45:15 +09:00
|
|
|
[disable assert macros and omit -g option]) )
|
|
|
|
AC_MSG_RESULT([$enable_debug])
|
2010-05-30 03:02:40 +09:00
|
|
|
if test "$enable_debug" != "no"; then
|
|
|
|
CXXFLAGS="$CXXFLAGS -g"
|
|
|
|
CFLAGS="$CFLAGS -g"
|
|
|
|
else
|
|
|
|
CXXFLAGS="$CXXFLAGS -DNDEBUG"
|
|
|
|
CFLAGS="$CFLAGS -DNDEBUG"
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
2010-01-20 14:49:51 +09:00
|
|
|
AC_CACHE_CHECK([for __sync_* atomic operations], msgpack_cv_atomic_ops, [
|
2010-01-21 17:25:32 +09:00
|
|
|
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); }
|
|
|
|
], [], msgpack_cv_atomic_ops="yes")
|
|
|
|
])
|
2010-01-20 14:49:51 +09:00
|
|
|
if test "$msgpack_cv_atomic_ops" != "yes"; then
|
2010-01-21 17:25:32 +09:00
|
|
|
AC_MSG_ERROR([__sync_* atomic operations are not supported.
|
|
|
|
|
2010-01-20 14:49:51 +09:00
|
|
|
Note that gcc < 4.1 is not supported.
|
2010-01-21 17:25:32 +09:00
|
|
|
|
|
|
|
If you are using gcc >= 4.1 and the default target CPU architecture is "i386", try to
|
2011-02-23 23:48:26 +09:00
|
|
|
add CFLAGS="-march=i686" and CXXFLAGS="-march=i686" options to ./configure as follows:
|
2010-01-20 14:49:51 +09:00
|
|
|
|
|
|
|
$ ./configure CFLAGS="-march=i686" CXXFLAGS="-march=i686"
|
|
|
|
])
|
|
|
|
fi
|
|
|
|
|
2010-07-06 17:45:15 +09:00
|
|
|
|
2010-07-06 17:00:58 +09:00
|
|
|
major=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
|
|
|
|
minor=`echo $VERSION | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'`
|
|
|
|
AC_SUBST(VERSION_MAJOR, $major)
|
|
|
|
AC_SUBST(VERSION_MINOR, $minor)
|
|
|
|
|
2010-07-06 17:45:15 +09:00
|
|
|
|
2010-07-06 23:30:15 +09:00
|
|
|
AC_OUTPUT([Makefile
|
|
|
|
src/Makefile
|
|
|
|
src/msgpack/version.h
|
|
|
|
test/Makefile])
|
2009-02-15 09:09:56 +00:00
|
|
|
|