Update ddm4 and fix OS symbols.
authorBrian Aker <brian@tangent.org>
Thu, 18 Jul 2013 10:28:37 +0000 (06:28 -0400)
committerBrian Aker <brian@tangent.org>
Thu, 18 Jul 2013 10:28:37 +0000 (06:28 -0400)
12 files changed:
libmemcached/io.cc
libtest/cmdline.cc
libtest/core.cc
libtest/cpu.cc
libtest/main.cc
libtest/unittest.cc
m4/ax_debug.m4
m4/ax_harden_compiler_flags.m4
m4/ax_memcached.m4
m4/ax_platform.m4
m4/ax_prog_sphinx_build.m4
m4/hiredis.m4

index cb8ed5c23199eac47b5665ca6733384216b4ffbb..448cc3255f63529adb2185a13fcda8a0edc860a1 100644 (file)
@@ -99,7 +99,7 @@ static bool repack_input_buffer(memcached_instance_st* instance)
           case EWOULDBLOCK:
 #endif
           case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
           case ERESTART:
 #endif
             break; // No IO is fine, we can just move on
@@ -265,7 +265,7 @@ static memcached_return_t io_wait(memcached_instance_st* instance,
     assert_msg(active_fd == -1 , "poll() returned an unexpected value");
     switch (local_errno)
     {
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
     case ERESTART:
 #endif
     case EINTR:
@@ -430,7 +430,7 @@ static memcached_return_t _io_fill(memcached_instance_st* instance)
       case EWOULDBLOCK:
 #endif
       case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
       case ERESTART:
 #endif
         {
@@ -568,7 +568,7 @@ memcached_return_t memcached_io_slurp(memcached_instance_st* instance)
       case EWOULDBLOCK:
 #endif
       case EAGAIN:
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
       case ERESTART:
 #endif
         if (memcached_success(io_wait(instance, MEM_READ)))
index 94c41814a0af35236d8cb6b37f13783427699311..e813eb592c4da4730350ff103ff1994b6bb1f213 100644 (file)
@@ -359,7 +359,7 @@ bool Application::slurp()
     int error;
     switch ((error= errno))
     {
-#ifdef TARGET_OS_LINUX
+#ifdef __linux
     case ERESTART:
 #endif
     case EINTR:
index 8e8874717d609a46de1c97a5a7a2fbfe9d86e416..2542f43f5146dd45ec99bca783b37f0b17b84d8e 100644 (file)
@@ -42,8 +42,8 @@ namespace libtest {
 
 void create_core(void)
 {
-#if defined(TARGET_OS_OSX) && TARGET_OS_OSX
-  if (TARGET_OS_OSX)
+#if defined(__APPLE__) && __APPLE__
+  if (__APPLE__)
   {
     return;
   }
index 838804d7fc3a29b10de248deaaca0fe75ce390bc..0ee8df600ff148c6a868913240fdc59fe2aae46f 100644 (file)
@@ -50,7 +50,7 @@ namespace libtest {
 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];
index 46429241f56a264777ff91b973d8de8c5809f00b..83e95cd65a7bc10c9bab62c0b7611d70a354d957 100644 (file)
@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
     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;
index bbb56c661ec8b0c396a3d54424be0f51a2076133..c21438890c31760d13ae9ed14fc0fa3c4ab6644b 100644 (file)
@@ -618,9 +618,9 @@ static test_return_t application_doesnotexist_BINARY(void *)
   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));
@@ -818,8 +818,8 @@ static test_return_t wait_services_appliction_TEST(void *)
 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 ));
@@ -842,8 +842,8 @@ static test_return_t gdb_abort_services_appliction_TEST(void *)
   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);
index 4c72f27689b25dcf484e1eff68881ab8ee26f414..c4b4d4c2a3833db6db518dd4d02c72d22e5238e2 100644 (file)
@@ -53,6 +53,8 @@ AC_DEFUN([AX_DEBUG],
       [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.])])
index d4fccad605d56b726da94ffe6009dbb8948743e7..b47f9afecd4c0ec8b5a22e7e2ea528fc4fb5eb73 100644 (file)
 # -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],
@@ -64,13 +96,11 @@ AC_DEFUN([_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.
@@ -79,19 +109,37 @@ AC_DEFUN([_HARDEN_LINKER_FLAGS],
         [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])
@@ -100,6 +148,7 @@ AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
 
          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])
@@ -155,33 +204,7 @@ AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
           _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])
@@ -197,7 +220,10 @@ AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
           _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],
@@ -217,14 +243,14 @@ AC_DEFUN([_HARDEN_CC_COMPILER_FLAGS],
 
 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])
@@ -233,6 +259,7 @@ AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
 
          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])
@@ -282,33 +309,6 @@ AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
           _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])
@@ -326,7 +326,8 @@ AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
           _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],
@@ -338,6 +339,8 @@ AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
                 _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++])
@@ -347,16 +350,17 @@ AC_DEFUN([_HARDEN_CXX_COMPILER_FLAGS],
 # _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
            ])
+
index 160cfe32399e5eaa7f17f535b66faf8391cddba4..21067c68d05f6bc2a8406d7d9888e28b244fe86b 100644 (file)
 #  (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])
+      ])
+    ])
index 01ff25d90abd58f28cc055d3703fccae6af1dd3f..a09c69238931db0755a8396b23c22a03ee47a86d 100644 (file)
 #
 # 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"])
   ])
index 3a89a3316b631cb655c55f381795eabd3c0b5699..653c7bcec8eab47c32ede4095a1857203523e0d7 100644 (file)
 #   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])])
+         ])
index 068041780f617ed4a54621007b0f10c602ff3b73..6db092789ed24a51c20bbd491d47e8c882f5ca21 100644 (file)
@@ -1,34 +1,26 @@
-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
+      ])