glusterfs/site.h.in

45 lines
1.7 KiB
C
Raw Normal View History

build: add site.h as a place to put environment-specific defines Most people consume Gluster in one of two ways: * From packages provided by their OS/distribution vendor * By building themselves from source For the first group it doesn't matter whether configuration is done in a configure script, via command-line options to that configure script, or in a header file. All of these end up as edits to some file under the packager's control, which is then run through their tools and process (e.g. rpmbuild) to create the packages that users will install. For the second group, convenience matters. Such users might not even have a script wrapped around the configure process, and editing one line in a header file is a lot easier than editing several in the configure script. This also prevents a messy profusion of configure options, dozens of which might need to be added to support a single such user's preferences. This comes back around as greater simplicity for packagers as well. This patch defines site.h as the header file for options and parameters that someone building the code for themselves might want to tweak. The project can ship one version to reflect the developers' guess at the best defaults for most users, and sophisticated users with unusual needs can override many options at once just by maintaining their own version of that file. Everybody wins. Further guidelines for how to determine whether an option should go in configure.ac or site.h are explained within site.h itself. Fixes #201 Change-Id: I5b8fb518d42450737423c4c1f43ebeb3130b4ff6 Signed-off-by: Jeff Darcy <jdarcy@fb.com> Reviewed-on: https://review.gluster.org/17206 Tested-by: Jeff Darcy <jeff@pl.atyp.us> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
2017-05-08 12:55:49 -04:00
/*
* Guidelines for using this file vs. configure.ac
*
* (1) If it already exists in configure.ac, leave it there.
*
* (2) If it needs to take effect at configure (not compile) time, it *needs*
* to go in configure.ac.
*
* (3) If it affects file paths, which are the things most likely to be based
* on an OS or distribution's generic filesystem hierarchy and not on a
* particular package's definition (e.g. an RPM specfile), it should probably
* go in configure.ac.
*
* (4) If it affects default sizes, limits, thresholds, or modes of operation
* (e.g. IPv4 vs. IPv6), it should probably go here.
*
* (5) For anything else, is it more like the things in 3 or the things in 4?
* Which approach is more convenient for the people who are likely to use the
* new option(s)? Make your best guesses, confirm with others, and go with
* what works.
*/
#define SITE_H_ENABLE_LEAST_PRIORITY "on"
#define SITE_H_MD_CACHE_TIMEOUT "1"
#define SITE_H_NFS_DISABLE "on"
build: add site.h as a place to put environment-specific defines Most people consume Gluster in one of two ways: * From packages provided by their OS/distribution vendor * By building themselves from source For the first group it doesn't matter whether configuration is done in a configure script, via command-line options to that configure script, or in a header file. All of these end up as edits to some file under the packager's control, which is then run through their tools and process (e.g. rpmbuild) to create the packages that users will install. For the second group, convenience matters. Such users might not even have a script wrapped around the configure process, and editing one line in a header file is a lot easier than editing several in the configure script. This also prevents a messy profusion of configure options, dozens of which might need to be added to support a single such user's preferences. This comes back around as greater simplicity for packagers as well. This patch defines site.h as the header file for options and parameters that someone building the code for themselves might want to tweak. The project can ship one version to reflect the developers' guess at the best defaults for most users, and sophisticated users with unusual needs can override many options at once just by maintaining their own version of that file. Everybody wins. Further guidelines for how to determine whether an option should go in configure.ac or site.h are explained within site.h itself. Fixes #201 Change-Id: I5b8fb518d42450737423c4c1f43ebeb3130b4ff6 Signed-off-by: Jeff Darcy <jdarcy@fb.com> Reviewed-on: https://review.gluster.org/17206 Tested-by: Jeff Darcy <jeff@pl.atyp.us> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
2017-05-08 12:55:49 -04:00
/*
* As an example of how to use this file, here's what the Facebook version looks
* like:
#define SITE_H_ENABLE_LEAST_PRIORITY "off"
#define SITE_H_MD_CACHE_TIMEOUT "180"
#define SITE_H_NFS_DISABLE "off"
* Each time we add a value here, we lessen the risk of values being
* inconsistent across production automation, test automation, and manual
* developer testing. We also save effort compared to updating values for each
* kind of external automation. To do the same thing with configure scripts or
* specfiles, we'd have to make much more complicated and less discoverable
* changes there.
*
* Other orgs are likely to have the same issues regarding their preferred
* settings, and likewise should add their favorites here as well.
build: add site.h as a place to put environment-specific defines Most people consume Gluster in one of two ways: * From packages provided by their OS/distribution vendor * By building themselves from source For the first group it doesn't matter whether configuration is done in a configure script, via command-line options to that configure script, or in a header file. All of these end up as edits to some file under the packager's control, which is then run through their tools and process (e.g. rpmbuild) to create the packages that users will install. For the second group, convenience matters. Such users might not even have a script wrapped around the configure process, and editing one line in a header file is a lot easier than editing several in the configure script. This also prevents a messy profusion of configure options, dozens of which might need to be added to support a single such user's preferences. This comes back around as greater simplicity for packagers as well. This patch defines site.h as the header file for options and parameters that someone building the code for themselves might want to tweak. The project can ship one version to reflect the developers' guess at the best defaults for most users, and sophisticated users with unusual needs can override many options at once just by maintaining their own version of that file. Everybody wins. Further guidelines for how to determine whether an option should go in configure.ac or site.h are explained within site.h itself. Fixes #201 Change-Id: I5b8fb518d42450737423c4c1f43ebeb3130b4ff6 Signed-off-by: Jeff Darcy <jdarcy@fb.com> Reviewed-on: https://review.gluster.org/17206 Tested-by: Jeff Darcy <jeff@pl.atyp.us> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Amar Tumballi <amarts@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org>
2017-05-08 12:55:49 -04:00
*/