~brianaker/libmemcached/gear-clean

« back to all changes in this revision

Viewing changes to libtest/has.cc

  • Committer: Brian Aker
  • Date: 2021-05-13 06:07:09 UTC
  • Revision ID: brian@tangent.org-20210513060709-tis67obw5k799o7a
More Gear/MySQL removal and udp test disable since server no longer comes compiled with it

Show diffs side-by-side

added added

removed removed

Lines of Context:
64
64
  return false;
65
65
}
66
66
 
67
 
bool has_libdrizzle(void)
68
 
{
69
 
#if defined(HAVE_LIBDRIZZLE) && HAVE_LIBDRIZZLE
70
 
  if (HAVE_LIBDRIZZLE)
71
 
  {
72
 
    return true;
73
 
  }
74
 
#endif
75
 
 
76
 
  return false;
77
 
}
78
 
 
79
 
bool has_postgres_support(void)
80
 
{
81
 
  char *getenv_ptr;
82
 
  if (bool((getenv_ptr= getenv("POSTGES_IS_RUNNING_AND_SETUP"))))
83
 
  {
84
 
    (void)(getenv_ptr);
85
 
    if (HAVE_LIBPQ)
86
 
    {
87
 
      return true;
88
 
    }
89
 
  }
90
 
 
91
 
  return false;
92
 
}
93
 
 
94
 
 
95
 
bool has_gearmand()
96
 
{
97
 
#if defined(GEARMAND_BINARY) && defined(HAVE_GEARMAND_BINARY) && HAVE_GEARMAND_BINARY
98
 
  if (HAVE_GEARMAND_BINARY)
99
 
  {
100
 
    std::stringstream arg_buffer;
101
 
 
102
 
    char *getenv_ptr;
103
 
    if (bool((getenv_ptr= getenv("PWD"))) and 
104
 
        ((strcmp(GEARMAND_BINARY, "./gearmand/gearmand") == 0) or (strcmp(GEARMAND_BINARY, "gearmand/gearmand") == 0)))
105
 
    {
106
 
      arg_buffer << getenv_ptr;
107
 
      arg_buffer << "/";
108
 
    }
109
 
    arg_buffer << GEARMAND_BINARY;
110
 
 
111
 
    if (access(arg_buffer.str().c_str(), X_OK) == 0)
112
 
    {
113
 
      return true;
114
 
    }
115
 
  }
116
 
#endif
117
 
 
118
 
  return false;
119
 
}
120
 
 
121
 
bool has_drizzled()
122
 
{
123
 
#if defined(DRIZZLED_BINARY) && defined(HAVE_DRIZZLED_BINARY) && HAVE_DRIZZLED_BINARY
124
 
  if (HAVE_DRIZZLED_BINARY)
125
 
  {
126
 
    if (access(DRIZZLED_BINARY, X_OK) == 0)
127
 
    {
128
 
      return true;
129
 
    }
130
 
  }
131
 
#endif
132
 
 
133
 
  return false;
134
 
}
135
 
 
136
 
bool has_mysqld()
137
 
{
138
 
#if defined(MYSQLD_BINARY) && defined(HAVE_MYSQLD_BUILD) && HAVE_MYSQLD_BUILD
139
 
  if (HAVE_MYSQLD_BUILD)
140
 
  {
141
 
    if (access(MYSQLD_BINARY, X_OK) == 0)
142
 
    {
143
 
      return true;
144
 
    }
145
 
  }
146
 
#endif
147
 
 
148
 
  return false;
149
 
}
150
 
 
151
67
static char memcached_binary_path[FILENAME_MAX];
152
68
 
153
69
static void initialize_memcached_binary_path()
209
125
  return NULL;
210
126
}
211
127
 
212
 
const char *gearmand_binary() 
213
 
{
214
 
#if defined(GEARMAND_BINARY)
215
 
  return GEARMAND_BINARY;
216
 
#else
217
 
  return NULL;
218
 
#endif
219
 
}
220
 
 
221
 
const char *drizzled_binary() 
222
 
{
223
 
#if defined(DRIZZLED_BINARY)
224
 
  return DRIZZLED_BINARY;
225
 
#else
226
 
  return NULL;
227
 
#endif
228
 
}
229
 
 
230
128
} // namespace libtest