From: Russ Allbery Date: Wed, 15 Jul 2009 06:22:00 +0000 (-0700) Subject: Provide an AFSDIR_DATA_DIR path for architecture-independent data X-Git-Tag: openafs-devel-1_5_61~96 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=79f00021ce2d7049e0c69815ab4599a9161145e6;p=packages%2Fo%2Fopenafs.git Provide an AFSDIR_DATA_DIR path for architecture-independent data Add AFSDIR_DATA_DIR to dirpath.h, defined to be the location for installing and finding architecture-independent data files. Add a corresponding AFSDIR_CLIENT_DATA_DIRPATH macro that retrieves the possibly-prefixed version of this path. This will be ${datadir}/openafs with normal UNIX installation paths and /usr/vice/etc for Transarc paths. Since there is no apparent need for this path on Windows, it is not defined in Windows builds. The only intended use for this path for right now is the message catalog for fstrace. Reviewed-on: http://gerrit.openafs.org/91 Verified-by: Derrick Brashear Reviewed-by: Derrick Brashear --- diff --git a/acinclude.m4 b/acinclude.m4 index 0c2d8eeeb..8aafc1615 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1642,6 +1642,7 @@ if test "x$enable_transarc_paths" = "xyes" ; then afslocaldir=${afslocaldir=/usr/afs/local} afsbackupdir=${afsbackupdir=/usr/afs/backup} afsbosconfigdir=${afsbosconfigdir=/usr/afs/local} + afsdatadir=${afsdatadir=/usr/vice/etc} else afsconfdir=${afsconfdir='${sysconfdir}/openafs/server'} viceetcdir=${viceetcdir='${sysconfdir}/openafs'} @@ -1654,6 +1655,7 @@ else afslocaldir=${afslocaldir='${localstatedir}/openafs'} afsbackupdir=${afsbackupdir='${localstatedir}/openafs/backup'} afsbosconfigdir=${afsbosconfigdir='${sysconfdir}/openafs'} + afsdatadir=${afsdatadir='${datadir}/openafs'} fi AC_SUBST(afsconfdir) AC_SUBST(viceetcdir) @@ -1666,6 +1668,7 @@ AC_SUBST(afslogsdir) AC_SUBST(afslocaldir) AC_SUBST(afsbackupdir) AC_SUBST(afsbosconfigdir) +AC_SUBST(afsdatadir) if test "x$enable_kernel_module" = "xyes"; then ENABLE_KERNEL_MODULE=libafs diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index a12a9d7ce..792ea4481 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -11,9 +11,11 @@ afssrvbindir=@afssrvbindir@ afskerneldir=@afskerneldir@ afssrvlibexecdir=@afssrvlibexecdir@ afssrvsbindir=@afssrvsbindir@ +afsdatadir=@afsdatadir@ bindir=@bindir@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ +datadir=@datadir@ includedir=@includedir@ libdir=@libdir@ libexecdir=@libexecdir@ diff --git a/src/util/Makefile.in b/src/util/Makefile.in index 86869e9d7..c39998fd6 100644 --- a/src/util/Makefile.in +++ b/src/util/Makefile.in @@ -117,6 +117,7 @@ dirpath.h: ${srcdir}/dirpath.hin Makefile -e 's"@afslocaldir"${afslocaldir}"' \ -e 's"@afsbackupdir"${afsbackupdir}"' \ -e 's"@afsbosconfigdir"${afsbosconfigdir}"' \ + -e 's"@afsdatadir"${afsdatadir}"' \ ${srcdir}/dirpath.hin >dirpath.h.tmp && \ if cmp dirpath.h.tmp dirpath.h >/dev/null ; then : ; else \ mv dirpath.h.tmp dirpath.h ; fi) diff --git a/src/util/dirpath.c b/src/util/dirpath.c index dbc69fe8e..ca116b1c7 100644 --- a/src/util/dirpath.c +++ b/src/util/dirpath.c @@ -239,6 +239,11 @@ initDirPathArray(void) AFSDIR_CLIENT_DIRPATH(pathp, AFSDIR_CLIENT_ETC_DIR); #endif /* AFS_NT40_ENV */ +#ifndef AFS_NT40_ENV + pathp = dirPathArray[AFSDIR_CLIENT_DATA_DIRPATH_ID]; + AFSDIR_CLIENT_DIRPATH(pathp, AFSDIR_DATA_DIR); +#endif + /* server file paths */ pathp = dirPathArray[AFSDIR_SERVER_THISCELL_FILEPATH_ID]; AFSDIR_SERVER_FILEPATH(pathp, AFSDIR_SERVER_ETC_DIR, diff --git a/src/util/dirpath.hin b/src/util/dirpath.hin index ae1c46a78..db1dd8a4e 100644 --- a/src/util/dirpath.hin +++ b/src/util/dirpath.hin @@ -114,6 +114,7 @@ ConstructLocalLogPath(const char *cpath, #define AFSDIR_BIN_FILE_DIR "@afslocaldir/migrate/bin_files" #define AFSDIR_BOSCONFIG_DIR "@afsbosconfigdir" #define AFSDIR_BOSSERVER_DIR "@afssrvsbindir" +#define AFSDIR_DATA_DIR "@afsdatadir" /* file names */ #define AFSDIR_THISCELL_FILE "ThisCell" @@ -227,6 +228,7 @@ typedef enum afsdir_id { AFSDIR_SERVER_BACKUP_DIRPATH_ID, AFSDIR_CLIENT_VICE_DIRPATH_ID, AFSDIR_CLIENT_ETC_DIRPATH_ID, + AFSDIR_CLIENT_DATA_DIRPATH_ID, AFSDIR_SERVER_THISCELL_FILEPATH_ID, AFSDIR_SERVER_CELLSERVDB_FILEPATH_ID, AFSDIR_SERVER_NOAUTH_FILEPATH_ID, @@ -302,6 +304,7 @@ const char *getDirPath(afsdir_id_t string_id); /* client subdir paths */ #define AFSDIR_CLIENT_VICE_DIRPATH getDirPath(AFSDIR_CLIENT_VICE_DIRPATH_ID) #define AFSDIR_CLIENT_ETC_DIRPATH getDirPath(AFSDIR_CLIENT_ETC_DIRPATH_ID) +#define AFSDIR_CLIENT_DATA_DIRPATH getDirPath(AFSDIR_CLIENT_DATA_DIRPATH_ID) #define AFSDIR_SERVER_BIN_FILE_DIRPATH getDirPath(AFSDIR_SERVER_BIN_FILE_DIRPATH_ID) /* server file paths */