diff --git a/Makefile.am b/Makefile.am index c2521ee8..f314eadf 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ config-paths.h: Makefile @echo '#define PKGDATADIR "$(datadir)/WindowMaker"' >> $@ @echo '' >> $@ @echo '/* where the global defaults are stored */' >> $@ - @echo '#define DEFSDATADIR "$(defsdatadir)"' >> $@ + @echo '#define PKGCONFDIR "$(pkgconfdir)"' >> $@ @echo '' >> $@ @echo '/* where the user data root is located */' >> $@ @echo '#define GSUSER_SUBDIR "GNUstep"' >> $@ diff --git a/WINGs/userdefaults.c b/WINGs/userdefaults.c index 76d3b30e..27c9610e 100644 --- a/WINGs/userdefaults.c +++ b/WINGs/userdefaults.c @@ -116,9 +116,9 @@ char *wglobaldefaultspathfordomain(const char *domain) char *t = NULL; size_t len; - len = strlen(DEFSDATADIR) + strlen(domain) + 2; + len = strlen(PKGCONFDIR) + strlen(domain) + 2; t = wmalloc(len); - snprintf(t, len, "%s/%s", DEFSDATADIR, domain); + snprintf(t, len, "%s/%s", PKGCONFDIR, domain); return t; } diff --git a/configure.ac b/configure.ac index 6b12b1e8..ea1b8c6f 100644 --- a/configure.ac +++ b/configure.ac @@ -834,21 +834,23 @@ AS_IF([test "x$with_gnustepdir" = "x"], AC_SUBST([wprefs_datadir])dnl AC_SUBST([wprefs_bindir])dnl -dnl Support for DEFSDATADIR option -dnl ============================ -AC_ARG_WITH([defsdatadir], - [AS_HELP_STRING([--with-defsdatadir=PATH], [specify where global defaults are located [SYSCONFDIR/WindowMaker]])], + +dnl Support for PKGCONFDIR option +dnl ============================= +AC_ARG_WITH([pkgconfdir], + [AS_HELP_STRING([--with-pkgconfdir=PATH], [specify where global defaults are located [SYSCONFDIR/WindowMaker]])], [AS_CASE([$withval], - [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-defsdatadir, expected a path]) ], + [yes|no], [AC_MSG_ERROR([bad value '$withval' for --with-pkgconfdir, expected a path]) ], [/*], [], dnl Absolute path, ok [\$*], [], dnl Assumes it starts with a reference to $prefix or a similar variable, ok - [AC_MSG_ERROR([bad path '$withval' for defsdatadir, expecting an absolute path])])], - [with_defsdatadir=""]) + [AC_MSG_ERROR([bad path '$withval' for pkgconfdir, expecting an absolute path])])], + [with_pkgconfdir=""]) + +AS_IF([test "x$with_pkgconfdir" != "x"], + [pkgconfdir="$with_pkgconfdir"], + [pkgconfdir='${sysconfdir}/${PACKAGE_TARNAME}']) +AC_SUBST([pkgconfdir])dnl -AS_IF([test "x$with_defsdatadir" != "x"], - [defsdatadir="$with_defsdatadir"], - [defsdatadir='${sysconfdir}/WindowMaker']) -AC_SUBST([defsdatadir])dnl dnl Enable User Defined Menu thing dnl ============================== diff --git a/doc/Makefile.am b/doc/Makefile.am index dd12b477..bdb07ed1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -37,7 +37,7 @@ wmaker.1: wmaker.in Makefile $(top_builddir)/config.h --header "$(top_builddir)/config.h" --filter "HAVE_INOTIFY" \ --filter "USE_ICCCM_WMREPLACE" \ -D"pkgdatadir=$(pkgdatadir)" --replace "pkgdatadir" \ - -D"defsdatadir=$(defsdatadir)" --replace "defsdatadir" \ + -D"pkgconfdir=$(pkgconfdir)" --replace "pkgconfdir" \ -o "wmaker.1" "$(srcdir)/wmaker.in" wmsetbg.1: wmsetbg.in Makefile $(top_builddir)/config.h diff --git a/doc/build/Compilation.texi b/doc/build/Compilation.texi index f1a8a596..d722692b 100644 --- a/doc/build/Compilation.texi +++ b/doc/build/Compilation.texi @@ -449,7 +449,7 @@ Specific to @sc{Window Maker}, this option defines an additional path where @emp searched. Nothing will be installed there; the default path taken is @file{@emph{DATADIR}/pixmaps}, where @var{DATADIR} is the path defined from @option{--datadir}. -@item --with-defsdatadir=@i{DIR} +@item --with-pkgconfdir=@i{DIR} Specific to @sc{Window Maker}, defines the directory where system configuration files, e.g., @file{WindowMaker}, @file{WMRootMenu}, etc., are installed. The default value is @file{@emph{SYSCONFDIR}/WindowMaker}, where @var{SYSCONFDIR} is diff --git a/doc/wmaker.in b/doc/wmaker.in index 321063f1..9422e61b 100644 --- a/doc/wmaker.in +++ b/doc/wmaker.in @@ -85,7 +85,7 @@ Attribute Editor (right drag the application's title bar, select Attributes) instead of modifying this file directly. There are just a few options not available using the Attributes Editor. .TP -.B @defsdatadir@/ +.B @pkgconfdir@/ All the above-mentioned files are READ from here if not found except for WMState, which is COPIED from here. No matter where they are read from, if it's necessary to write configuration changes back into this diff --git a/src/defaults.c b/src/defaults.c index 2f68539c..64ce2404 100644 --- a/src/defaults.c +++ b/src/defaults.c @@ -866,7 +866,7 @@ static WMPropList *readGlobalDomain(const char *domainName, Bool requireDictiona char path[PATH_MAX]; struct stat stbuf; - snprintf(path, sizeof(path), "%s/%s", DEFSDATADIR, domainName); + snprintf(path, sizeof(path), "%s/%s", PKGCONFDIR, domainName); if (stat(path, &stbuf) >= 0) { globalDict = WMReadPropListFromFile(path); if (globalDict && requireDictionary && !WMIsPLDictionary(globalDict)) { @@ -916,7 +916,7 @@ void wDefaultsMergeGlobalMenus(WDDomain * menuDomain) return; #ifdef GLOBAL_PREAMBLE_MENU_FILE - submenu = WMReadPropListFromFile(DEFSDATADIR "/" GLOBAL_PREAMBLE_MENU_FILE); + submenu = WMReadPropListFromFile(PKGCONFDIR "/" GLOBAL_PREAMBLE_MENU_FILE); if (submenu && !WMIsPLArray(submenu)) { wwarning(_("invalid global menu file %s"), GLOBAL_PREAMBLE_MENU_FILE); @@ -930,7 +930,7 @@ void wDefaultsMergeGlobalMenus(WDDomain * menuDomain) #endif #ifdef GLOBAL_EPILOGUE_MENU_FILE - submenu = WMReadPropListFromFile(DEFSDATADIR "/" GLOBAL_EPILOGUE_MENU_FILE); + submenu = WMReadPropListFromFile(PKGCONFDIR "/" GLOBAL_EPILOGUE_MENU_FILE); if (submenu && !WMIsPLArray(submenu)) { wwarning(_("invalid global menu file %s"), GLOBAL_EPILOGUE_MENU_FILE); diff --git a/src/main.c b/src/main.c index b89a2139..bf5b1a0a 100644 --- a/src/main.c +++ b/src/main.c @@ -658,7 +658,7 @@ static int real_main(int argc, char **argv) printf("Window Maker %s\n", VERSION); exit(0); } else if (strcmp(argv[i], "--global_defaults_path") == 0) { - printf("%s\n", DEFSDATADIR); + printf("%s\n", PKGCONFDIR); exit(0); } else if (strcmp(argv[i], "-locale") == 0 || strcmp(argv[i], "--locale") == 0) { i++; diff --git a/src/misc.c b/src/misc.c index 502f2b56..33e0bcc1 100644 --- a/src/misc.c +++ b/src/misc.c @@ -1017,7 +1017,7 @@ Bool UpdateDomainFile(WDDomain * domain) dict = domain->dictionary; if (WMIsPLDictionary(domain->dictionary)) { /* retrieve global system dictionary */ - snprintf(path, sizeof(path), "%s/%s", DEFSDATADIR, domain->domain_name); + snprintf(path, sizeof(path), "%s/%s", PKGCONFDIR, domain->domain_name); if (stat(path, &stbuf) >= 0) { shared_dict = WMReadPropListFromFile(path); if (shared_dict) {