case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
case ERESTART:
#endif
break; // No IO is fine, we can just move on
assert_msg(active_fd == -1 , "poll() returned an unexpected value");
switch (local_errno)
{
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
case ERESTART:
#endif
case EINTR:
case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
case ERESTART:
#endif
{
case EWOULDBLOCK:
#endif
case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
case ERESTART:
#endif
if (memcached_success(io_wait(instance, MEM_READ)))
int error;
switch ((error= errno))
{
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
case ERESTART:
#endif
case EINTR:
void create_core(void)
{
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
- if (TARGET_OS_OSX)
+#if defined(__APPLE__) && __APPLE__
+ if (__APPLE__)
{
return;
}
size_t number_of_cpus()
{
size_t number_of_cpu= 1;
-#if defined(TARGET_OS_LINUX) && TARGET_OS_LINUX
+#if defined(__linux) && __linux
number_of_cpu= sysconf(_SC_NPROCESSORS_ONLN);
#elif defined(HAVE_SYS_SYSCTL_H) && defined(CTL_HW) && defined(HW_NCPU) && defined(HW_AVAILCPU) && defined(HW_NCPU)
int mib[4];
Valgrind does not currently work reliably, or sometimes at all, on OSX
- Fri Jun 15 11:24:07 EDT 2012
*/
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+#if defined(__APPLE__) && __APPLE__
if (valgrind_is_caller())
{
return EXIT_SKIP;
true_app.will_fail();
const char *args[]= { "--fubar", 0 };
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
+#if defined(__APPLE__) && __APPLE__
ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args));
-#elif defined(TARGET_OS_FREEBSD) && TARGET_OS_FREEBSD
+#elif defined(__FreeBSD__) && __FreeBSD__
ASSERT_EQ(Application::INVALID_POSIX_SPAWN, true_app.run(args));
#else
ASSERT_EQ(Application::SUCCESS, true_app.run(args));
static test_return_t gdb_wait_services_appliction_TEST(void *)
{
test_skip(true, false);
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
- test_skip(0, TARGET_OS_OSX);
+#if defined(__APPLE__) && __APPLE__
+ test_skip(0, __APPLE__);
#endif
test_skip(0, access("/etc/services", R_OK ));
test_skip(0, access("libtest/abort", X_OK ));
test_skip(true, false);
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
- test_skip(0, TARGET_OS_OSX);
+#if defined(__APPLE__) && __APPLE__
+ test_skip(0, __APPLE__);
#endif
libtest::Application abort_app("libtest/abort", true);
[ax_enable_debug=yes
AC_DEFINE([DEBUG],[1],[Define to 1 to enable debugging code.])
AX_CHECK_LIBRARY([MCHECK],[mcheck.h],[mcheck],[AX_APPEND_LINK_FLAGS([-lmcheck])])],
+ AX_ADD_AM_MACRO([AM_YFLAGS+= --debug dnl Setting bison debugging
+ ])
[ax_enable_debug=no
AC_SUBST([MCHECK])
AC_DEFINE([DEBUG],[0],[Define to 1 to enable debugging code.])])
# -Wdeclaration-after-statement is counter to C99
# _APPEND_COMPILE_FLAGS_ERROR([-pedantic])
-#serial 10
+#serial 12
+
+AC_DEFUN([_SET_SANITIZE_FLAGS],
+ [AS_IF([test "x$MINGW" != xyes],[
+ AS_IF([test "x$enable_shared" = "xyes"],
+ [AS_CASE([$ax_harden_sanitize],
+ [thread],[
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])],
+ [address],[
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])],
+ [rest],[
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
+ _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])])
+ ])
+ ])
+ ])
AC_DEFUN([_WARNINGS_AS_ERRORS],
[AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
# Note: Should this be LIBS or LDFLAGS?
AC_DEFUN([_APPEND_LINK_FLAGS_ERROR],
- [AC_REQUIRE([AX_APPEND_LINK_FLAGS])
- AX_APPEND_LINK_FLAGS([$1],[LDFLAGS],[-Werror])
+ [AX_APPEND_LINK_FLAGS([$1],[LDFLAGS],[-Werror])
])
AC_DEFUN([_APPEND_COMPILE_FLAGS_ERROR],
- [AC_REQUIRE([AX_APPEND_COMPILE_FLAGS])
- AX_APPEND_COMPILE_FLAGS([$1],,[-Werror])
+ [AX_APPEND_COMPILE_FLAGS([$1],,[-Werror])
])
# Everything above this does the heavy lifting, while what follows does the specifics.
[AS_IF([test "$CC" != "clang"],
[_APPEND_LINK_FLAGS_ERROR([-z relro -z now])
AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],[AX_APPEND_LINK_FLAGS([-Werror])])
- AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[_APPEND_LINK_FLAGS_ERROR([-rdynamic])])
+ AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
+ [_APPEND_LINK_FLAGS_ERROR([-rdynamic])
+# AX_APPEND_LINK_FLAGS([--coverage])])
])
])
+AC_DEFUN([_AX_HARDEN_SANITIZE],
+ [AC_REQUIRE([AX_DEBUG])
+ AC_ARG_WITH([sanitize],
+ [AS_HELP_STRING([--with-sanitize],
+ [Enable sanitize flag for compiler if it supports them @<:@default=no@:>@])],
+ [AS_CASE([$with_sanitize],
+ [thread],[
+ ax_harden_sanitize='thread'],
+ [address],[
+ ax_harden_sanitize='with_sanitize'],
+ [ax_harden_sanitize='rest'])
+ ],
+ [AS_IF([test "x$ax_enable_debug" = xyes],[ax_harden_sanitize='rest'])])
+ ])
+
AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
[AC_LANG_PUSH([C])dnl
AS_IF([test "x$ax_enable_debug" = xyes],
[CFLAGS=''
_APPEND_COMPILE_FLAGS_ERROR([-H])
- _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
_APPEND_COMPILE_FLAGS_ERROR([-g])
- _APPEND_COMPILE_FLAGS_ERROR([-O0]),
+ _APPEND_COMPILE_FLAGS_ERROR([-g3])
+ _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-eliminate-unused-debug-types])
_APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
],[
_APPEND_COMPILE_FLAGS_ERROR([-g])
AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
[_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
+# _APPEND_COMPILE_FLAGS_ERROR([--coverage])
_APPEND_COMPILE_FLAGS_ERROR([-Wpragmas])
_APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])],
[_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
_APPEND_COMPILE_FLAGS_ERROR([-Wundef])
_APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
_APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
- AS_IF([test "x$MINGW" != xyes],[
- AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
- AS_IF([test "x$enable_shared" = "xyes"],[
- _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
- ])
- ])
- ])
+
_APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
_APPEND_COMPILE_FLAGS_ERROR([-Wunused])
_APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
_APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
_APPEND_COMPILE_FLAGS_ERROR([-Wpacked])
# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])
- _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
+# GCC 4.5 removed this.
+# _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
+
+ _SET_SANITIZE_FLAGS
AS_IF([test "x$ax_enable_debug" = xno],
[AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
[AC_LANG_PUSH([C++])
- AC_REQUIRE([_APPEND_COMPILE_FLAGS_ERROR])
-
AS_IF([test "x$ax_enable_debug" = xyes],
[CXXFLAGS=''
_APPEND_COMPILE_FLAGS_ERROR([-H])
- _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
_APPEND_COMPILE_FLAGS_ERROR([-g])
- _APPEND_COMPILE_FLAGS_ERROR([-O0]),
+ _APPEND_COMPILE_FLAGS_ERROR([-g3])
+ _APPEND_COMPILE_FLAGS_ERROR([-fmudflapth])
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-inline])
+ _APPEND_COMPILE_FLAGS_ERROR([-fno-eliminate-unused-debug-types])
_APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
],[
_APPEND_COMPILE_FLAGS_ERROR([-g])
AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
[_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
+# _APPEND_COMPILE_FLAGS_ERROR([--coverage])
_APPEND_COMPILE_FLAGS_ERROR([-Wpragmas])
_APPEND_COMPILE_FLAGS_ERROR([-Wunknown-pragmas])],
[_APPEND_COMPILE_FLAGS_ERROR([-Wno-unknown-pragmas])
_APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
_APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])
# _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])
- AS_IF([test "x$MINGW" != xyes],[
- AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
- AS_IF([test "x$enable_shared" = "xyes"],[
- _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
- _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
- ])
- ])
- ])
# _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
_APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
_APPEND_COMPILE_FLAGS_ERROR([-Wunused])
_APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
_APPEND_COMPILE_FLAGS_ERROR([-Wpacked])
# _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long])
- _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
+# GCC 4.5 removed this.
+# _APPEND_COMPILE_FLAGS_ERROR([-Wunreachable-code])
AS_IF([test "x$ax_enable_debug" = xno],
[AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
_APPEND_COMPILE_FLAGS_ERROR([-fstack-protector-all])
])])])])
+ _SET_SANITIZE_FLAGS
+
AS_IF([test "x$ac_cv_warnings_as_errors" = xyes],
[AX_APPEND_FLAG([-Werror])])
AC_LANG_POP([C++])
# _HARDEN_CC_COMPILER_FLAGS, _HARDEN_CXX_COMPILER_FLAGS
AC_DEFUN([AX_HARDEN_COMPILER_FLAGS],
[AC_PREREQ([2.63])dnl
- AC_REQUIRE([_WARNINGS_AS_ERRORS])
- AC_REQUIRE([AX_APPEND_LINK_FLAGS])
AC_REQUIRE([AX_COMPILER_VERSION])
- AC_REQUIRE([AX_DEBUG])
- AC_REQUIRE([AX_VCS_CHECKOUT])
+ AC_REQUIRE([AX_ASSERT])
+ _WARNINGS_AS_ERRORS
+ _AX_HARDEN_SANITIZE
AC_REQUIRE([gl_VISIBILITY])
AS_IF([test -n "$CFLAG_VISIBILITY"],[CPPFLAGS="$CPPFLAGS $CFLAG_VISIBILITY"])
- AC_REQUIRE([_HARDEN_LINKER_FLAGS])
- AC_REQUIRE([_HARDEN_CC_COMPILER_FLAGS])
- AC_REQUIRE([_HARDEN_CXX_COMPILER_FLAGS])
+ _WARNINGS_AS_ERRORS
+ _HARDEN_LINKER_FLAGS
+ _HARDEN_CC_COMPILER_FLAGS
+ _HARDEN_CXX_COMPILER_FLAGS
])
+
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#serial 4
+#serial 3
AC_DEFUN([AX_PROG_MEMCACHED],
- [AX_WITH_PROG([MEMCACHED_BINARY],[memcached],[unknown])
- ax_memcached_success=
- AS_IF([test x"$MEMCACHED_BINARY" != xunknown],
- [AS_IF([test -x "$MEMCACHED_BINARY"],
- [ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
- AS_IF([test -n "$ax_memcached_version"],
- [ax_memcached_success='ok'
- AC_MSG_RESULT([memcached version "$ax_memcached_version"])
- AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])])
- ])
- ])
-
- AS_IF([test -n "$ax_memcached_success"],
- [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
- AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$MEMCACHED_BINARY",[Name of the memcached binary used in make test])
- ],
- [AC_DEFINE([HAVE_MEMCACHED_BINARY], [0], [If Memcached binary is available])
- MEMCACHED_BINARY=
- ])
- ])
+ [AX_WITH_PROG([MEMCACHED_BINARY],[memcached])
+ AS_IF([test -f "$ac_cv_path_MEMCACHED_BINARY"],
+ [AC_DEFINE([HAVE_MEMCACHED_BINARY], [1], [If Memcached binary is available])
+ AC_DEFINE_UNQUOTED([MEMCACHED_BINARY],"$ac_cv_path_MEMCACHED_BINARY",[Name of the memcached binary used in make test])
+ ax_memcached_version=`$MEMCACHED_BINARY -h | sed 1q | awk '{print \$ 2 }' | sed 's|[\-a-z0-9]*$||' | awk -F. '{printf "%d.%d.%d", $[]1, $[]2, $[]3}'`
+ AC_MSG_RESULT([memcached version "$ax_memcached_version"])
+ AC_DEFINE_UNQUOTED([MEMCACHED_VERSION],"$ax_memcached_version",[Memcached binary version])
+ ])
+ ])
#
# LICENSE
#
-# Copyright (c) 2012 Brian Aker <brian@tangent.org>
+# Copyright (c) 2012-2013 Brian Aker <brian@tangent.org>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 3
+#serial 4
#
AC_DEFUN([AX_PLATFORM],
[AC_REQUIRE([AC_CANONICAL_HOST])
- AC_REQUIRE([AC_CANONICAL_TARGET])
AC_DEFINE_UNQUOTED([HOST_VENDOR],["$host_vendor"],[Vendor of Build System])
AC_DEFINE_UNQUOTED([HOST_OS],["$host_os"], [OS of Build System])
AC_DEFINE_UNQUOTED([HOST_CPU],["$host_cpu"], [CPU of Build System])
- AC_DEFINE_UNQUOTED([TARGET_VENDOR],["$target_vendor"],[Vendor of Target System])
- AC_DEFINE_UNQUOTED([TARGET_OS],["$target_os"], [OS of Target System])
- AC_DEFINE_UNQUOTED([TARGET_CPU],["$target_cpu"], [CPU of Target System])
-
AS_CASE([$target_os],
[*mingw*],
- [TARGET_WINDOWS="true"
- AC_DEFINE([TARGET_OS_WINDOWS], [1], [Whether we are building for Windows])
+ [HOST_WINDOWS="true"
+ AC_DEFINE([HOST_OS_WINDOWS], [1], [Whether we are building for Windows])
AC_DEFINE([EAI_SYSTEM], [11], [Another magical number])
AH_BOTTOM([
#ifndef HAVE_SYS_SOCKET_H
# define SHUT_RDWR SD_BOTH
#endif
])],
- [*freebsd*],[AC_DEFINE([TARGET_OS_FREEBSD],[1],[Whether we are building for FreeBSD])
+ [*freebsd*],[AC_DEFINE([HOST_OS_FREEBSD],[1],[Whether we are building for FreeBSD])
AC_DEFINE([__APPLE_CC__],[1],[Workaround for bug in FreeBSD headers])],
- [*solaris*],[AC_DEFINE([TARGET_OS_SOLARIS],[1],[Whether we are building for Solaris])],
+ [*solaris*],[AC_DEFINE([HOST_OS_SOLARIS],[1],[Whether we are building for Solaris])],
[*darwin*],
- [TARGET_OSX="true"],
+ [HOST_OSX="true"],
[*linux*],
- [TARGET_LINUX="true"
- AC_DEFINE([TARGET_OS_LINUX],[1],[Whether we build for Linux])])
+ [HOST_LINUX="true"
+ AC_DEFINE([HOST_OS_LINUX],[1],[Whether we build for Linux])])
- AM_CONDITIONAL([BUILD_WIN32],[test "x${TARGET_WINDOWS}" = "xtrue"])
- AM_CONDITIONAL([TARGET_OSX],[test "x${TARGET_OSX}" = "xtrue"])
- AM_CONDITIONAL([TARGET_LINUX],[test "x${TARGET_LINUX}" = "xtrue"])
+ AM_CONDITIONAL([BUILD_WIN32],[test "x${HOST_WINDOWS}" = "xtrue"])
+ AM_CONDITIONAL([HOST_OSX],[test "x${HOST_OSX}" = "xtrue"])
+ AM_CONDITIONAL([HOST_LINUX],[test "x${HOST_LINUX}" = "xtrue"])
+ AM_CONDITIONAL([HOST_FREEBSD],[test "x${HOST_OS_FREEBSD}" = "xtrue"])
])
# and this notice are preserved. This file is offered as-is, without any
# warranty.
-#serial 3
+#serial 5
AC_DEFUN([AX_PROG_SPHINX_BUILD],
- [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
- AS_IF([test x"SPHINXBUILD" = x":"],
- [SPHINXBUILD=],
- [AS_IF([test -x "$SPHINXBUILD"],
- [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
- junk=`$SPHINXBUILD &> version_file`
- ax_sphinx_build_version=`head -1 version_file`
- rm version_file
- AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
- $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
- AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
- rm -rf conftest.d
- ])
- ])
+ [AX_WITH_PROG([SPHINXBUILD],[sphinx-build],[:])
+ AS_IF([test x"SPHINXBUILD" = x":"],
+ [SPHINXBUILD=],
+ [AS_IF([test -x "$SPHINXBUILD"],
+ [AC_MSG_CHECKING([Checking to see if $SPHINXBUILD is recent])
+ junk=`$SPHINXBUILD --version &> version_file`
+ AS_IF([test $? -eq 0],
+ [ax_sphinx_build_version=`head -1 version_file`],
+ [junk=`$SPHINXBUILD &> version_file`
+ ax_sphinx_build_version=`head -1 version_file`
+ rm version_file
+ AC_MSG_RESULT([$SPHINXBUILD is version "$ax_sphinx_build_version"])
+ $SPHINXBUILD -Q -C -b man -d conftest.d . . >/dev/null 2>&1
+ AS_IF([test $? -eq 0], ,[SPHINXBUILD=])
+ rm -rf conftest.d ])
+ ])
+ rm -f version_file
+ ])
- AS_IF([test -n "${SPHINXBUILD}"],
- [AC_SUBST([SPHINXBUILD])
- ifelse([$1], , :, [$1])],
- [ifelse([$2], , :, [$2])])
- ])
+ AS_IF([test -n "${SPHINXBUILD}"],
+ [AC_SUBST([SPHINXBUILD])
+ ifelse([$1], , :, [$1])],
+ [ifelse([$2], , :, [$2])])
+ ])
-dnl Copyright (C) 2011 Brian Aker (brian@tangent.org)
+# Copyright (C) 2011 Brian Aker (brian@tangent.org)
+#
+# serial 2
-AC_DEFUN([_SEARCH_LIBHIREDIS],[
- AC_REQUIRE([AX_CHECK_LIBRARY])
+AC_DEFUN([_SEARCH_HIREDIS],
+ [AC_REQUIRE([AX_CHECK_LIBRARY])
- AS_IF([test "x$ac_enable_hires" = "xyes"],[
- AX_CHECK_LIBRARY([LIBHIREDIS], [hiredis/hiredis.h], [hiredis],
- [
- LIBHIREDIS_LDFLAGS="-lhiredis"
- AC_DEFINE([HAVE_HIREDIS], [1], [If Hiredis available])
- ],
- [
- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
- ac_enable_hires="no"
- ])
+ AS_IF([test "x$ac_enable_hiredis" = "xyes"],
+ [hiredis_header="hiredis/hiredis.h"],
+ [hiredis_header="does_not_exist"])
- ],
- [
- AC_DEFINE([HAVE_HIREDIS], [0], [If Hiredis is available])
- ])
+ AX_CHECK_LIBRARY([HIREDIS],[$hiredis_header],[hiredis],,
+ [AC_DEFINE([HAVE_HIREDIS],[0],[Define to 1 if HIREDIS is found])])
- AM_CONDITIONAL(HAVE_HIREDIS, [test "x$ac_cv_lib_hiredis_main" = "xyes"])
- ])
+ AS_IF([test "x$ax_cv_have_HIREDIS" = xno],[ac_enable_hiredis="no"])
+ ])
-AC_DEFUN([AX_HAVE_LIBHIREDIS],[
+ AC_DEFUN([AX_ENABLE_LIBHIREDIS],
+ [AC_ARG_ENABLE([hiredis],
+ [AS_HELP_STRING([--disable-hiredis],
+ [Build with hiredis support @<:@default=on@:>@])],
+ [ac_enable_hiredis="$enableval"],
+ [ac_enable_hiredis="yes"])
- AC_ARG_ENABLE([hires],
- [AS_HELP_STRING([--disable-hires],
- [Build with hires support @<:@default=on@:>@])],
- [ac_enable_hires="$enableval"],
- [ac_enable_hires="yes"])
-
- _SEARCH_LIBHIREDIS
-])
+ _SEARCH_HIREDIS
+ ])