diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-05 17:27:31 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-08-05 17:30:35 -0700 |
commit | 46e9b987ff689c1acfe29c7b980298408d1b95a6 (patch) | |
tree | 178f0fcc50a343c3528349ee2c8919c60392af3f /attoconf/lib | |
parent | d7bb91cd264300351e94e37a84b1de45f2312745 (diff) | |
download | attobuild-46e9b987ff689c1acfe29c7b980298408d1b95a6.tar.gz attobuild-46e9b987ff689c1acfe29c7b980298408d1b95a6.tar.bz2 attobuild-46e9b987ff689c1acfe29c7b980298408d1b95a6.tar.xz attobuild-46e9b987ff689c1acfe29c7b980298408d1b95a6.zip |
Add some stuff whose need became obvious when I tried to use it
Diffstat (limited to 'attoconf/lib')
-rw-r--r-- | attoconf/lib/c.py | 5 | ||||
-rw-r--r-- | attoconf/lib/lex.py | 34 | ||||
-rw-r--r-- | attoconf/lib/yacc.py | 34 |
3 files changed, 71 insertions, 2 deletions
diff --git a/attoconf/lib/c.py b/attoconf/lib/c.py index 4d3f252..75bf931 100644 --- a/attoconf/lib/c.py +++ b/attoconf/lib/c.py @@ -111,6 +111,7 @@ def try_compile_link_cxx(build, body, CXXFLAGS=[], CPPFLAGS=[], LDFLAGS=[], LDLI LDFLAGS = build.vars['LDFLAGS'][0] + LDFLAGS LDLIBS = build.vars['LDLIBS'][0] + LDLIBS in_ = 'atto-test.cxx' + ins = [in_] out = 'atto-test' args = CXX + CXXFLAGS + CPPFLAGS + LDFLAGS + ins + LDLIBS + ['-o', out] @@ -252,7 +253,7 @@ class C(Link, Preprocess): self.add_option('CC', init=['gcc'], type=shell, check=cc, help='C compiler command', hidden=False) - self.add_option('CFLAGS', init=[], + self.add_option('CFLAGS', init=['-O2', '-g'], type=shell, check=cflags, help='C compiler flags', hidden=False) @@ -263,6 +264,6 @@ class Cxx(Link, Preprocess): self.add_option('CXX', init=['g++'], type=shell, check=cxx, help='C++ compiler command', hidden=False) - self.add_option('CXXFLAGS', init=[], + self.add_option('CXXFLAGS', init=['-O2', '-g'], type=shell, check=cxxflags, help='C++ compiler flags', hidden=False) diff --git a/attoconf/lib/lex.py b/attoconf/lib/lex.py new file mode 100644 index 0000000..d25455b --- /dev/null +++ b/attoconf/lib/lex.py @@ -0,0 +1,34 @@ +# Copyright 2013 Ben Longbons <b.r.longbons@gmail.com> +# +# This file is part of attoconf. +# +# attoconf is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# attoconf is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with attoconf. If not, see <http://www.gnu.org/licenses/>. + +from __future__ import print_function, division, absolute_import + +from ..classy import ClassyProject +from .c import shell + +def flex(build, FLEX): + # TODO actually test it + pass + +class Flex(ClassyProject): + __slots__ = () + def vars(self): + super(Flex, self).vars() + self.add_option('FLEX', init=['flex'], + type=shell, check=flex, + help='Lexical analyzer command', + hidden=False) diff --git a/attoconf/lib/yacc.py b/attoconf/lib/yacc.py new file mode 100644 index 0000000..c8ddb03 --- /dev/null +++ b/attoconf/lib/yacc.py @@ -0,0 +1,34 @@ +# Copyright 2013 Ben Longbons <b.r.longbons@gmail.com> +# +# This file is part of attoconf. +# +# attoconf is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# attoconf is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with attoconf. If not, see <http://www.gnu.org/licenses/>. + +from __future__ import print_function, division, absolute_import + +from ..classy import ClassyProject +from .c import shell + +def bison(build, BISON): + # TODO actually test it + pass + +class Bison(ClassyProject): + __slots__ = () + def vars(self): + super(Bison, self).vars() + self.add_option('BISON', init=['bison'], + type=shell, check=bison, + help='Lexical analyzer command', + hidden=False) |