pkgs/lib/strings.nix: add 'enableFeature' function to simplify generation of GNU Autoconf "--{enable,disable}-feature" strings

This commit is contained in:
Peter Simons 2013-02-24 19:28:24 +01:00
parent 5f32207dfc
commit 7181888c23

View File

@ -171,4 +171,9 @@ rec {
assert ! eqStrings name filename;
name;
# Create an --{enable,disable}-<feat> string that can be passed to
# standard GNU Autoconf scripts.
enableFeature = enable: feat: "--${if enable then "enable" else "disable"}-${feat}";
}