msgpack/configure.in

62 lines
1.4 KiB
Plaintext
Raw Normal View History

AC_INIT(msgpack/unpack_template.h)
2009-02-22 15:47:06 +09:00
AC_CONFIG_AUX_DIR(ac)
2010-01-20 15:17:33 +09:00
AM_INIT_AUTOMAKE(msgpack, 0.4.1)
AC_CONFIG_HEADER(config.h)
2009-02-22 15:14:21 +09:00
AC_SUBST(CFLAGS)
if test "" = "$CFLAGS"; then
CFLAGS="-g -O4"
fi
AC_PROG_CC
CFLAGS="-O4 -Wall $CFLAGS -I.."
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_SUBST(CXXFLAGS)
if test "" = "$CXXFLAGS"; then
CXXFLAGS="-g -O4"
fi
fi
# FIXME enable_cxx
2009-02-22 15:14:21 +09:00
AC_PROG_CXX
CXXFLAGS="-O4 -Wall $CXXFLAGS -I.. -I../c"
2009-02-22 15:14:21 +09:00
2010-01-20 15:17:33 +09:00
# FIXME enable_cxx
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS(tr1/unordered_map)
AC_CHECK_HEADERS(tr1/unordered_set)
AC_LANG_POP([C++])
2009-02-22 15:14:21 +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")
])
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.
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
add CFLAGS="--march=i686" and CXXFLAGS="-march=i668" options to ./configure as follows:
$ ./configure CFLAGS="-march=i686" CXXFLAGS="-march=i686"
])
fi
2009-02-22 15:14:21 +09:00
AM_CONDITIONAL(ENABLE_CXX, test "$enable_cxx" != "no")
AC_PROG_LIBTOOL
2009-02-22 15:14:21 +09:00
AC_OUTPUT([Makefile c/Makefile cpp/Makefile])