1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-22 14:08:06 +01:00

configure: Add option to specify global defaults directory.

Previously, this was only (partially) possible by redefining the macro
GLOBAL_DEFAULTS_SUBDIR.  This told Window Maker to look for the global
config files in a particular subdirectory of SYSCONFDIR.

However:
* This is undocumented.
* GLOBAL_DEFAULTS_SUBDIR is ignored when installing the config files.  They
  are always installed to SYSCONFDIR/WindowMaker.

To solve these issues, we add a "--with-defsdatadir" option to configure
which allows a user to specify the global defaults directory.
This commit is contained in:
Doug Torrance
2017-03-10 02:39:31 -05:00
committed by Carlos R. Mafra
parent ac92f1a844
commit 6fa1c0c009
7 changed files with 24 additions and 24 deletions

View File

@@ -103,17 +103,14 @@ char *wdefaultspathfordomain(const char *domain)
}
/* XXX: doesn't quite belong to *user*defaults.c */
#ifndef GLOBAL_DEFAULTS_SUBDIR
#define GLOBAL_DEFAULTS_SUBDIR "WindowMaker"
#endif
char *wglobaldefaultspathfordomain(const char *domain)
{
char *t = NULL;
size_t len;
len = strlen( SYSCONFDIR ) + strlen( GLOBAL_DEFAULTS_SUBDIR ) + strlen(domain) + 3;
len = strlen(DEFSDATADIR) + strlen(domain) + 2;
t = wmalloc(len);
snprintf(t, len, "%s/%s/%s", SYSCONFDIR, GLOBAL_DEFAULTS_SUBDIR, domain);
snprintf(t, len, "%s/%s", DEFSDATADIR, domain);
return t;
}