autoconf: Complain if libatomic-ops is not found.

Use --without-libatomic-ops if you don't want it.

Fixes part of #826.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
This commit is contained in:
Tommi Virtanen 2011-03-11 13:07:31 -08:00
parent a9afdca18e
commit a2c02d1799

View File

@ -130,18 +130,16 @@ PKG_CHECK_MODULES([LIBEDIT], [libedit >= 2.11],
#libatomic-ops? You want it! #libatomic-ops? You want it!
AC_ARG_WITH([libatomic-ops], AC_ARG_WITH([libatomic-ops],
[AS_HELP_STRING([--with-libatomic-ops], [AS_HELP_STRING([--without-libatomic-ops],
[use libatomic-ops to build Ceph's atomic_t type])], [disable libatomic-ops for the atomic_t type])],
[], [],
[with_libatomic_ops=check]) [with_libatomic_ops=yes])
AS_IF([test "x$with_libatomic_ops" != xno], AS_IF([test "x$with_libatomic_ops" != xno],
[AC_CHECK_HEADER([atomic_ops.h], [AC_CHECK_HEADER([atomic_ops.h],
[HAVE_ATOMIC_OPS=1], [HAVE_ATOMIC_OPS=1],
[if test "x$with_libatomic_ops" != xcheck; then [AC_MSG_FAILURE(
AC_MSG_FAILURE( [no libatomic-ops found (use --without-libatomic-ops to disable)])
[--with-libatomic-ops was given but atomic_ops.h not found]) ])])
fi
])])
AS_IF([test "$HAVE_ATOMIC_OPS" = "1"], AS_IF([test "$HAVE_ATOMIC_OPS" = "1"],
[], [],
AC_DEFINE([NO_ATOMIC_OPS], [1], [Defined if you don't have atomic_ops])) AC_DEFINE([NO_ATOMIC_OPS], [1], [Defined if you don't have atomic_ops]))