This commit is contained in:
Thomas Nagy 2016-06-25 20:10:04 +02:00
parent 02fb7ceff7
commit fc02c1d42a
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
44 changed files with 75 additions and 66 deletions

View File

@ -1,3 +1,3 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
# Thomas Nagy, 2005-2016 (ita)

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
"""
@ -16,7 +16,7 @@ def find_ar(conf):
conf.load('ar')
def configure(conf):
"""Find the ar program and set the default flags in ``conf.env.ARFLAGS``"""
"""Finds the ar program and sets the default flags in ``conf.env.ARFLAGS``"""
conf.find_program('ar', var='AR')
conf.add_os_flags('ARFLAGS')
if not conf.env.ARFLAGS:

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008-2010 (ita)
# Thomas Nagy, 2008-2016 (ita)
"""
Assembly support, used by tools such as gas and nasm
@ -41,7 +41,7 @@ from waflib.TaskGen import extension
class asm(Task.Task):
"""
Compile asm files by gas/nasm/yasm/...
Compiles asm files by gas/nasm/yasm/...
"""
color = 'BLUE'
run_str = '${AS} ${ASFLAGS} ${ASMPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${AS_SRC_F}${SRC} ${AS_TGT_F}${TGT}'
@ -49,7 +49,7 @@ class asm(Task.Task):
@extension('.s', '.S', '.asm', '.ASM', '.spp', '.SPP')
def asm_hook(self, node):
"""
Bind the asm extension to the asm task
Binds the asm extension to the asm task
:param node: input file
:type node: :py:class:`waflib.Node.Node`
@ -57,18 +57,18 @@ def asm_hook(self, node):
return self.create_compiled_task('asm', node)
class asmprogram(link_task):
"Link object files into a c program"
"Links object files into a c program"
run_str = '${ASLINK} ${ASLINKFLAGS} ${ASLNK_TGT_F}${TGT} ${ASLNK_SRC_F}${SRC}'
ext_out = ['.bin']
inst_to = '${BINDIR}'
class asmshlib(asmprogram):
"Link object files into a c shared library"
"Links object files into a c shared library"
inst_to = '${LIBDIR}'
class asmstlib(stlink_task):
"Link object files into a c static library"
"Links object files into a c static library"
pass # do not remove
def configure(conf):
conf.env['ASMPATH_ST'] = '-I%s'
conf.env.ASMPATH_ST = '-I%s'

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy 2009-2010 (ita)
# Thomas Nagy 2009-2016 (ita)
"""
The **bison** program is a code generator which creates C or C++ files.
@ -12,7 +12,7 @@ from waflib import Task
from waflib.TaskGen import extension
class bison(Task.Task):
"""Compile bison files"""
"""Compiles bison files"""
color = 'BLUE'
run_str = '${BISON} ${BISONFLAGS} ${SRC[0].abspath()} -o ${TGT[0].name}'
ext_out = ['.h'] # just to make sure
@ -20,7 +20,7 @@ class bison(Task.Task):
@extension('.y', '.yc', '.yy')
def big_bison(self, node):
"""
Create a bison task, which must be executed from the directory of the output file.
Creates a bison task, which must be executed from the directory of the output file.
"""
has_h = '-d' in self.env['BISONFLAGS']
@ -42,7 +42,7 @@ def big_bison(self, node):
def configure(conf):
"""
Detect the *bison* program
Detects the *bison* program
"""
conf.find_program('bison', var='BISON')
conf.env.BISONFLAGS = ['-d']

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"Base for c programs/libraries"

View File

@ -9,6 +9,8 @@ from waflib.Configure import conf
def get_extensions(lst):
"""
Returns the file extensions for the list of files given as input
:param lst: files to process
:list lst: list of string or :py:class:`waflib.Node.Node`
:return: list of file extensions
@ -16,17 +18,15 @@ def get_extensions(lst):
"""
ret = []
for x in Utils.to_list(lst):
try:
if not isinstance(x, str):
x = x.name
ret.append(x[x.rfind('.') + 1:])
except Exception:
pass
if not isinstance(x, str):
x = x.name
ret.append(x[x.rfind('.') + 1:])
return ret
def sniff_features(**kw):
"""
Look at the source files and return the features for a task generator (mainly cc and cxx)::
Computes and returns the features required for a task generator by
looking at the file extensions. This aimed for C/C++ mainly::
snif_features(source=['foo.c', 'foo.cxx'], type='shlib')
# returns ['cxx', 'c', 'cxxshlib', 'cshlib']
@ -39,7 +39,7 @@ def sniff_features(**kw):
:rtype: list of string
"""
exts = get_extensions(kw['source'])
type = kw['_type']
typ = kw['typ']
feats = []
# watch the order, cxx will have the precedence
@ -63,18 +63,27 @@ def sniff_features(**kw):
feats.append('java')
return 'java'
if type in ('program', 'shlib', 'stlib'):
if typ in ('program', 'shlib', 'stlib'):
will_link = False
for x in feats:
if x in ('cxx', 'd', 'fc', 'c'):
feats.append(x + type)
feats.append(x + typ)
will_link = True
if not will_link and not kw.get('features', []):
raise Errors.WafError('Cannot link from %r, try passing eg: features="c cprogram"?' % kw)
return feats
def set_features(kw, _type):
kw['_type'] = _type
def set_features(kw, typ):
"""
Inserts data in the input dict *kw* based on existing data and on the type of target
required (typ).
:param kw: task generator parameters
:type kw: dict
:param typ: type of target
:type typ: string
"""
kw['typ'] = typ
kw['features'] = Utils.to_list(kw.get('features', [])) + Utils.to_list(sniff_features(**kw))
@conf

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
# Thomas Nagy, 2005-2016 (ita)
"""
C/C++/D configuration helpers
@ -75,7 +75,7 @@ MACRO_TO_DESTOS = {
'_WIN64' : 'win32',
'_WIN32' : 'win32',
# Note about darwin: this is also tested with 'defined __APPLE__ && defined __MACH__' somewhere below in this file.
'__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' : 'darwin',
'__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__' : 'darwin',
'__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__' : 'darwin', # iphone
'__QNX__' : 'qnx',
'__native_client__' : 'nacl' # google native client platform

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008-2010
# Thomas Nagy 2008-2016 (ita)
"""
MacOSX related tools

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
C/C++ preprocessor for finding dependencies

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010 (ita)
# Thomas Nagy, 2016 (ita)
"""
Various configuration tests.

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
# Thomas Nagy, 2005-2016 (ita)
"""
Classes and methods shared by tools providing support for C-like language such

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2009-2010 (ita)
# Thomas Nagy 2009-2016 (ita)
"""
Detect the Clang++ C++ compiler

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
# Thomas Nagy, 2010 (ita)
# Thomas Nagy, 2016 (ita)
"""
Try to detect a D compiler from the list of supported compilers::

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
C# support. A simple example::

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2010 (ita)
# Thomas Nagy, 2005-2016 (ita)
"Base for c++ programs and libraries"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
# Thomas Nagy, 2007-2010 (ita)
# Thomas Nagy, 2007-2016 (ita)
from waflib import Utils, Task, Errors
from waflib.TaskGen import taskgen_method, feature, extension

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010 (ita)
# Thomas Nagy, 2016 (ita)
from waflib import Utils
from waflib.Configure import conf

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2010 (ita)
# Thomas Nagy, 2016 (ita)
"""
Provide a scanner for finding dependencies on d files

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2007 (dv)
# Thomas Nagy, 2008-2010 (ita)
# Thomas Nagy, 2008-2016 (ita)
import sys
from waflib.Tools import ar, d

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
"""
fortran support

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
"""
Fortran configuration helpers

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
import re

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# John O'Meara, 2006
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
The **flex** program is a code generator which creates C or C++ files.

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# KWS 2010
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
import re
from waflib import Utils

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008-2010 (ita)
# Thomas Nagy, 2008-2016 (ita)
"Detect as/gas/gcc for compiling assembly files"

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
import re
from waflib import Utils

View File

@ -1,6 +1,6 @@
#! /usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
Support for GLib2 tools:

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Stian Selnes 2008
# Thomas Nagy 2009-2010 (ita)
# Thomas Nagy 2009-2016 (ita)
"""
Detect the Intel C compiler

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2009-2010 (ita)
# Thomas Nagy 2009-2016 (ita)
"""
Detect the Intel C++ compiler

View File

@ -1,7 +1,7 @@
#! /usr/bin/env python
# encoding: utf-8
# DC 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
import re
from waflib import Utils

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
Support for translation tools such as msgfmt and intltool

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
Java support

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Sebastian Schlingmann, 2008
# Thomas Nagy, 2008-2010 (ita)
# Thomas Nagy, 2008-2016 (ita)
"""
Lua support.

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2008-2010 (ita)
# Thomas Nagy, 2008-2016 (ita)
"""
Nasm tool (asm processing)

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# andersg at 0x63.nu 2007
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
"""
Support for Perl extensions. A C/C++ compiler is required::

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# daniel.svensson at purplescout.se 2008
# Thomas Nagy 2010 (ita)
# Thomas Nagy 2016 (ita)
"""
Support for Ruby extensions. A C/C++ compiler is required::

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
from waflib.Tools import ccroot, ar

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
from waflib.Tools import ccroot, ar

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
"""
TeX/LaTeX/PDFLaTeX/XeLaTeX support

View File

@ -1,7 +1,7 @@
#!/usr/bin/env python
# encoding: utf-8
# Carlos Rafael Giani, 2006
# Thomas Nagy, 2010
# Thomas Nagy, 2010-2016 (ita)
"""
Unit testing system for C/C++/D providing test execution:

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009
# Michael Kuhn, 2009

View File

@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2006-2010 (ita)
# Thomas Nagy, 2006-2016 (ita)
# Ralf Habacker, 2006 (rh)
# Yinon Ehrlich, 2009
# Michael Kuhn, 2009