diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-06 15:39:13 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-06 15:39:13 -0700 |
commit | 7b5f69de3f7b52b718507fe16c2560901e48a70c (patch) | |
tree | 66dc1930c069e34ed7ed45113b033d66721a5728 /attoconf/lib | |
parent | 9532822afccc8db328e07992313d458192f2a367 (diff) | |
download | attobuild-7b5f69de3f7b52b718507fe16c2560901e48a70c.tar.gz attobuild-7b5f69de3f7b52b718507fe16c2560901e48a70c.tar.bz2 attobuild-7b5f69de3f7b52b718507fe16c2560901e48a70c.tar.xz attobuild-7b5f69de3f7b52b718507fe16c2560901e48a70c.zip |
Refactor checks and vars
Diffstat (limited to 'attoconf/lib')
-rw-r--r-- | attoconf/lib/arches.py | 5 | ||||
-rw-r--r-- | attoconf/lib/install.py | 25 | ||||
-rw-r--r-- | attoconf/lib/make.py | 7 |
3 files changed, 24 insertions, 13 deletions
diff --git a/attoconf/lib/arches.py b/attoconf/lib/arches.py index c168292..595b396 100644 --- a/attoconf/lib/arches.py +++ b/attoconf/lib/arches.py @@ -20,6 +20,9 @@ from __future__ import print_function, division, absolute_import from ..classy import ClassyProject from ..types import triple +def build(build, BUILD): + pass + def host(build, HOST): if HOST is None: BUILD, origin = build.vars['BUILD'] @@ -41,7 +44,7 @@ class Arches2(ClassyProject): super(Arches2, self).arches() self.add_help('System types:', hidden=False) self.add_option('--build', init=None, - type=triple, check=None, + type=triple, check=build, help='configure for building on BUILD', hidden=False, help_def='native') self.add_option('--host', init=None, diff --git a/attoconf/lib/install.py b/attoconf/lib/install.py index 444c167..a807666 100644 --- a/attoconf/lib/install.py +++ b/attoconf/lib/install.py @@ -23,6 +23,18 @@ from ..classy import ClassyProject from ..types import shell_word, version, filepath, quoted_string +def package(build, PACKAGE): + pass + +def package_version(build, VERSION): + pass + +def package_name(build, NAME): + pass + +def prefix(build, PREFIX): + pass + def exec_prefix(build, EPREFIX): if EPREFIX is None: PREFIX, origin = build.vars['PREFIX'] @@ -86,6 +98,9 @@ def includedir(build, DIR): origin = 'derived from PREFIX' build.vars['INCLUDEDIR'] = (os.path.join(PREFIX, 'include'), origin) +def oldincludedir(build, DIR): + pass + def datarootdir(build, DIR): if DIR is None: PREFIX, origin = build.vars['PREFIX'] @@ -182,16 +197,16 @@ class Install(ClassyProject): def general(self): super(Install, self).general() self.add_option('--package', init=self.package, - type=shell_word, check=None, + type=shell_word, check=package, help='Short name of this package (don\'t change!)', hidden=True) self.add_option('--package-version', init=self.package_version, - type=version, check=None, + type=version, check=package_version, help='Version of this package (change in configure)', hidden=True, help_var='VERSION') self.add_option('--package-name', init=self.package_name, - type=quoted_string, check=None, + type=quoted_string, check=package_name, help='Long name of this package (don\'t change)', hidden=True, help_var='NAME') @@ -201,7 +216,7 @@ class Install(ClassyProject): self.add_help('Installation directories:', hidden=False) self.add_option('--prefix', init='/usr/local', - type=filepath, check=None, + type=filepath, check=prefix, help='install architecture-independent files in PREFIX', hidden=False) self.add_option('--exec-prefix', init=None, @@ -245,7 +260,7 @@ class Install(ClassyProject): help='C header files', hidden=False, help_var='DIR', help_def='PREFIX/include') self.add_option('--oldincludedir', init='/usr/include', - type=filepath, check=None, + type=filepath, check=oldincludedir, help='C header files for non-gcc', hidden=False, help_var='DIR') self.add_option('--datarootdir', init=None, diff --git a/attoconf/lib/make.py b/attoconf/lib/make.py index 890361a..816c444 100644 --- a/attoconf/lib/make.py +++ b/attoconf/lib/make.py @@ -45,13 +45,6 @@ class MakeHook(object): out.write('\n') # TODO preserve *original* order? for var, (val, origin) in sorted(build.vars.iteritems()): - if val is None: - if origin == 'default': - continue - # is it a good idea for Nones to survive this long? - # especially conditional ones ... - var = '# ' + var - val = 'not defined' out.write('%s = %s # %s\n' % (var, val, origin)) if self.infile is not None: out.write('\n# The rest was copied from %s\n' % self.infile) |