~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/drizzled.cc

  • Committer: Monty Taylor
  • Date: 2008-12-20 23:44:07 UTC
  • mto: (722.2.2 devel)
  • mto: This revision was merged to the branch mainline in revision 727.
  • Revision ID: monty@inaugust.com-20081220234407-585wdrdd1vxqqzam
Removed all the setting of DEFS everywhere. Use configmake.h to get the values
we need.

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
#include <drizzled/function/time/get_format.h>
46
46
#include <drizzled/errmsg.h>
47
47
#include <drizzled/unireg.h>
 
48
#include <drizzled/configmake.h>
48
49
 
49
50
 
50
51
#if TIME_WITH_SYS_TIME
497
498
extern "C" bool drizzled_get_one_option(int, const struct my_option *, char *);
498
499
static void set_server_version(void);
499
500
static int init_thread_environment();
500
 
static char *get_relative_path(const char *path);
 
501
static const char *get_relative_path(const char *path);
501
502
static void fix_paths(void);
502
503
void handle_connections_sockets();
503
504
pthread_handler_t kill_server_thread(void *arg);
3960
3961
 
3961
3962
  /* Set directory paths */
3962
3963
  strncpy(language, LANGUAGE, sizeof(language)-1);
3963
 
  strncpy(drizzle_real_data_home, get_relative_path(DATADIR),
 
3964
  strncpy(drizzle_real_data_home, get_relative_path(LOCALSTATEDIR),
3964
3965
          sizeof(drizzle_real_data_home)-1);
3965
3966
  drizzle_data_home_buff[0]=FN_CURLIB;  // all paths are relative from here
3966
3967
  drizzle_data_home_buff[1]=0;
4008
4009
 
4009
4010
  const char *tmpenv;
4010
4011
  if (!(tmpenv = getenv("MY_BASEDIR_VERSION")))
4011
 
    tmpenv = DEFAULT_DRIZZLE_HOME;
 
4012
    tmpenv = PREFIX;
4012
4013
  (void) strncpy(drizzle_home, tmpenv, sizeof(drizzle_home)-1);
4013
4014
}
4014
4015
 
4342
4343
}
4343
4344
 
4344
4345
 
4345
 
static char *get_relative_path(const char *path)
 
4346
static const char *get_relative_path(const char *path)
4346
4347
{
4347
4348
  if (test_if_hard_path(path) &&
4348
 
      is_prefix(path,DEFAULT_DRIZZLE_HOME) &&
4349
 
      strcmp(DEFAULT_DRIZZLE_HOME,FN_ROOTDIR))
 
4349
      is_prefix(path,PREFIX) &&
 
4350
      strcmp(PREFIX,FN_ROOTDIR))
4350
4351
  {
4351
 
    path+=(uint) strlen(DEFAULT_DRIZZLE_HOME);
 
4352
    if (strlen(PREFIX) < strlen(path))
 
4353
      path+=(size_t) strlen(PREFIX);
4352
4354
    while (*path == FN_LIBCHAR)
4353
4355
      path++;
4354
4356
  }
4355
 
  return (char*) path;
 
4357
  return path;
4356
4358
}
4357
4359
 
4358
4360
 
4378
4380
  (void) my_load_path(drizzle_real_data_home,drizzle_real_data_home,drizzle_home);
4379
4381
  (void) my_load_path(pidfile_name,pidfile_name,drizzle_real_data_home);
4380
4382
  (void) my_load_path(opt_plugin_dir, opt_plugin_dir_ptr ? opt_plugin_dir_ptr :
4381
 
                                      get_relative_path(PLUGINDIR), drizzle_home);
 
4383
                                      get_relative_path(PKGPLUGINDIR),
 
4384
                                      drizzle_home);
4382
4385
  opt_plugin_dir_ptr= opt_plugin_dir;
4383
4386
 
4384
 
  char *sharedir=get_relative_path(SHAREDIR);
 
4387
  const char *sharedir=get_relative_path(PKGDATADIR);
4385
4388
  if (test_if_hard_path(sharedir))
4386
4389
    strncpy(buff,sharedir,sizeof(buff)-1);              /* purecov: tested */
4387
4390
  else