diff options
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | configure.ac | 13 | ||||
-rw-r--r-- | src/core/wee-debug.c | 3 | ||||
-rw-r--r-- | src/core/weechat.c | 12 |
4 files changed, 11 insertions, 22 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ee09280d3..374cb4952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,11 +134,8 @@ if(ENABLE_TESTS AND NOT ENABLE_HEADLESS) endif() # option WEECHAT_HOME -if(NOT DEFINED WEECHAT_HOME OR "${WEECHAT_HOME}" STREQUAL "") - set(WEECHAT_HOME "~/.weechat") -endif() set(WEECHAT_HOME "${WEECHAT_HOME}" CACHE - STRING "WeeChat home directory for config, logs, scripts.. (default is \"~/.weechat\")" + STRING "Force a single WeeChat home directory for config, logs, scripts, etc." FORCE) mark_as_advanced(CLEAR WEECHAT_HOME) diff --git a/configure.ac b/configure.ac index 3473656c1..b46246c8f 100644 --- a/configure.ac +++ b/configure.ac @@ -134,7 +134,7 @@ AH_VERBATIM([PLUGIN_XFER], [#undef PLUGIN_XFER]) AH_VERBATIM([TESTS], [#undef TESTS]) AH_VERBATIM([MAN], [#undef MAN]) AH_VERBATIM([DOC], [#undef DOC]) -AH_VERBATIM([WEECHAT_HOME], [#define WEECHAT_HOME "~/.weechat"]) +AH_VERBATIM([WEECHAT_HOME], [#define WEECHAT_HOME ""]) AH_VERBATIM([CA_FILE], [#define CA_FILE "/etc/ssl/certs/ca-certificates.crt"]) # Arguments for ./configure @@ -172,12 +172,9 @@ AC_ARG_ENABLE(tests, [ --enable-tests turn on build of tests (d AC_ARG_ENABLE(man, [ --enable-man turn on build of man page (default=not built)],enable_man=$enableval,enable_man=no) AC_ARG_ENABLE(doc, [ --enable-doc turn on build of documentation (default=not built)],enable_doc=$enableval,enable_doc=no) -AC_ARG_VAR(WEECHAT_HOME, [WeeChat home directory for config, logs, scripts.. (default is "~/.weechat")]) +AC_ARG_VAR(WEECHAT_HOME, [Force a single WeeChat home directory for config, logs, scripts, etc.]) AC_ARG_VAR(CA_FILE, [File containing the certificate authorities (default is "/etc/ssl/certs/ca-certificates.crt"). This is the default value of option "weechat.network.gnutls_ca_file".]) -if test "x$WEECHAT_HOME" = "x" ; then - WEECHAT_HOME="~/.weechat" -fi AC_DEFINE_UNQUOTED(WEECHAT_HOME, "$WEECHAT_HOME") if test "x$CA_FILE" = "x" ; then @@ -1562,8 +1559,10 @@ if test "x$not_asked" != "x" || test "x$not_found" != "x"; then fi echo "" -echo "WeeChat home directory is ${WEECHAT_HOME}" -echo "" +if test "x$WEECHAT_HOME" != "x" ; then + echo "WeeChat home directory is forced by default to: ${WEECHAT_HOME}" + echo "" +fi eval echo "WeeChat will be installed in $bindir" echo "" echo "configure complete, now type 'make' to build WeeChat $VERSION" diff --git a/src/core/wee-debug.c b/src/core/wee-debug.c index 9a031167e..cae470ba8 100644 --- a/src/core/wee-debug.c +++ b/src/core/wee-debug.c @@ -591,6 +591,7 @@ void debug_directories () { char *extra_libdir; + const char *ptr_home = WEECHAT_HOME; extra_libdir = getenv (WEECHAT_EXTRA_LIBDIR); @@ -601,7 +602,7 @@ debug_directories () (weechat_home_temp) ? " " : "", (weechat_home_temp) ? _("(TEMPORARY, deleted on exit)") : ""); gui_chat_printf (NULL, _(" (default: %s)"), - WEECHAT_HOME); + (ptr_home && ptr_home[0]) ? ptr_home : "~/.weechat"); gui_chat_printf (NULL, " lib: %s", WEECHAT_LIBDIR); gui_chat_printf (NULL, " lib (extra): %s", (extra_libdir && extra_libdir[0]) ? extra_libdir : "-"); diff --git a/src/core/weechat.c b/src/core/weechat.c index 6d97bfe35..32456bdde 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -496,16 +496,8 @@ weechat_create_home_dir () if (!weechat_home) { config_weechat_home = WEECHAT_HOME; - if (!config_weechat_home[0]) - { - string_fprintf (stderr, - _("Error: WEECHAT_HOME is undefined, check build " - "options\n")); - weechat_shutdown (EXIT_FAILURE, 0); - /* make C static analyzer happy (never executed) */ - return; - } - weechat_set_home_path (config_weechat_home); + weechat_set_home_path ( + (config_weechat_home[0] ? config_weechat_home : "~/.weechat")); } /* if home already exists, it has to be a directory */ |