Import/Merge of libtest latest.
[m6w6/libmemcached] / libtest / has.cc
index 7cc933704bbfa5cd6d3d20bb6c07a971cfc4c89a..ba4bbfc65efd6af1aa31db34f11c9b3141bfee99 100644 (file)
@@ -82,7 +82,7 @@ bool has_gearmand()
   {
     std::stringstream arg_buffer;
 
-    if (getenv("PWD"))
+    if (getenv("PWD") and strcmp(MEMCACHED_BINARY, "gearmand/gearmand") == 0)
     {
       arg_buffer << getenv("PWD");
       arg_buffer << "/";
@@ -111,6 +111,19 @@ bool has_drizzled()
   return false;
 }
 
+bool has_mysqld()
+{
+  if (HAVE_MYSQLD_BUILD)
+  {
+    if (access(MYSQLD_BINARY, X_OK) == 0)
+    {
+      return true;
+    }
+  }
+
+  return false;
+}
+
 bool has_memcached()
 {
   if (HAVE_MEMCACHED_BINARY)
@@ -124,12 +137,10 @@ bool has_memcached()
     }
     arg_buffer << MEMCACHED_BINARY;
 
-    std::cout << "Value: " << arg_buffer.str() << std::endl;
     if (access(arg_buffer.str().c_str(), X_OK) == 0)
     {
       return true;
     }
-    std::cout << "Access was not 0 : " << strerror(errno) << std::endl;
   }
 
   return false;
@@ -137,6 +148,7 @@ bool has_memcached()
 
 bool has_memcached_sasl()
 {
+#if defined(HAVE_MEMCACHED_SASL_BINARY) && HAVE_MEMCACHED_SASL_BINARY
   if (HAVE_MEMCACHED_SASL_BINARY)
   {
     if (access(MEMCACHED_SASL_BINARY, X_OK) == 0)
@@ -144,6 +156,7 @@ bool has_memcached_sasl()
       return true;
     }
   }
+#endif
 
   return false;
 }