From f2ff24bd62f8b588f5966e115c1ec26c64e0a913 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 10 Apr 2006 15:11:37 +0200 Subject: Bug#15069 [patch] my_print_defaults does'nt care --sysconfdir - Grab the path from "configure --sysconfdir=" and set it as the first place to look for my.cnf files Do this both in Makefiles for libmysql and mysys - Patch provided by Francesco Riosa. Thank you! libmysql/Makefile.shared: Grab the path from "--sysconfdir=" into the defined variable DEFAULT_SYSYCONFDIR mysys/Makefile.am: Grab the path from "--sysconfdir=" into the defined variable DEFAULT_SYSYCONFDIR mysys/default.c: Use DEFAULT_SYSCONFDIR as first place to look for my.cnf file if "--sysconfdir=" been specified as argument to configure --- mysys/Makefile.am | 1 + mysys/default.c | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'mysys') diff --git a/mysys/Makefile.am b/mysys/Makefile.am index ee0dcb544b6..2de8d7820f5 100644 --- a/mysys/Makefile.am +++ b/mysys/Makefile.am @@ -70,6 +70,7 @@ DEFS = -DDEFAULT_BASEDIR=\"$(prefix)\" \ -DSHAREDIR="\"$(MYSQLSHAREdir)\"" \ -DDEFAULT_HOME_ENV=MYSQL_HOME \ -DDEFAULT_GROUP_SUFFIX_ENV=MYSQL_GROUP_SUFFIX \ + -DDEFAULT_SYSCONFDIR="\"$(sysconfdir)\"" \ @DEFS@ libmysys_a_DEPENDENCIES= @THREAD_LOBJECTS@ diff --git a/mysys/default.c b/mysys/default.c index edd02402a2a..90f8dc5f689 100644 --- a/mysys/default.c +++ b/mysys/default.c @@ -48,7 +48,7 @@ char *defaults_extra_file=0; /* Which directories are searched for options (and in which order) */ -#define MAX_DEFAULT_DIRS 6 +#define MAX_DEFAULT_DIRS 7 const char *default_directories[MAX_DEFAULT_DIRS + 1]; #ifdef __WIN__ @@ -959,11 +959,13 @@ static uint my_get_system_windows_directory(char *buffer, uint size) 4. getenv(DEFAULT_HOME_ENV) 5. Directory above where the executable is located 6. "" + 7. --sysconfdir= On Novell NetWare, this is: 1. sys:/etc/ 2. getenv(DEFAULT_HOME_ENV) 3. "" + 4. --sysconfdir= On OS/2, this is: 1. getenv(ETC) @@ -971,12 +973,14 @@ static uint my_get_system_windows_directory(char *buffer, uint size) 3. getenv(DEFAULT_HOME_ENV) 4. "" 5. "~/" + 6. --sysconfdir= Everywhere else, this is: 1. /etc/ 2. getenv(DEFAULT_HOME_ENV) 3. "" 4. "~/" + 5. --sysconfdir= */ @@ -1040,6 +1044,10 @@ static void init_default_directories() } *ptr++= (char *)&config_dir; } +#endif +#ifdef DEFAULT_SYSCONFDIR + if (DEFAULT_SYSCONFDIR != "") + *ptr++= DEFAULT_SYSCONFDIR; #endif *ptr= 0; /* end marker */ } -- cgit v1.2.1