summaryrefslogtreecommitdiff
path: root/waflib/Tools/c_tests.py
diff options
context:
space:
mode:
authorKarl Linden <karl.j.linden@gmail.com>2018-10-06 10:51:14 +0200
committerKarl Linden <karl.j.linden@gmail.com>2018-10-06 13:16:24 +0200
commiteeef49954a0cc4bc5f120c12fe9eb988bd93ccd8 (patch)
treeacc5261a87172e240c77217eaaec0eb586aa9dfa /waflib/Tools/c_tests.py
parentf5f22c6befc1b4bc5807de00496c087125f92adf (diff)
downloadjack2-eeef49954a0cc4bc5f120c12fe9eb988bd93ccd8.tar.gz
Revert "Stupid attempt at updating waf"
This reverts commit cf3f8205c4509966f04e6b77dad7c002db16d9d8. It was a good initiative, but waf 2.0 introces backward incompatible changes that break the pkg-config checks. The config checks will be updated before migrating to waf 2.0.
Diffstat (limited to 'waflib/Tools/c_tests.py')
-rw-r--r--waflib/Tools/c_tests.py25
1 files changed, 12 insertions, 13 deletions
diff --git a/waflib/Tools/c_tests.py b/waflib/Tools/c_tests.py
index f858df57..3b37f54c 100644
--- a/waflib/Tools/c_tests.py
+++ b/waflib/Tools/c_tests.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# encoding: utf-8
-# Thomas Nagy, 2016-2018 (ita)
+# Thomas Nagy, 2010 (ita)
"""
Various configuration tests.
@@ -58,7 +58,7 @@ def link_lib_test_fun(self):
@conf
def check_library(self, mode=None, test_exec=True):
"""
- Checks if libraries can be linked with the current linker. Uses :py:func:`waflib.Tools.c_tests.link_lib_test_fun`.
+ Check if libraries can be linked with the current linker. Uses :py:func:`waflib.Tools.c_tests.link_lib_test_fun`.
:param mode: c or cxx or d
:type mode: string
@@ -72,7 +72,8 @@ def check_library(self, mode=None, test_exec=True):
features = 'link_lib_test',
msg = 'Checking for libraries',
mode = mode,
- test_exec = test_exec)
+ test_exec = test_exec,
+ )
########################################################################################
@@ -88,7 +89,7 @@ INLINE_VALUES = ['inline', '__inline__', '__inline']
@conf
def check_inline(self, **kw):
"""
- Checks for the right value for inline macro.
+ Check for the right value for inline macro.
Define INLINE_MACRO to 1 if the define is found.
If the inline macro is not 'inline', add a define to the ``config.h`` (#define inline __inline__)
@@ -97,6 +98,7 @@ def check_inline(self, **kw):
:param features: by default *c* or *cxx* depending on the compiler present
:type features: list of string
"""
+
self.start_msg('Checking for inline')
if not 'define_name' in kw:
@@ -133,7 +135,7 @@ int main(int argc, char **argv) {
@conf
def check_large_file(self, **kw):
"""
- Checks for large file support and define the macro HAVE_LARGEFILE
+ Check for large file support and define the macro HAVE_LARGEFILE
The test is skipped on win32 systems (DEST_BINFMT == pe).
:param define_name: define to set, by default *HAVE_LARGEFILE*
@@ -141,6 +143,7 @@ def check_large_file(self, **kw):
:param execute: execute the test (yes by default)
:type execute: bool
"""
+
if not 'define_name' in kw:
kw['define_name'] = 'HAVE_LARGEFILE'
if not 'execute' in kw:
@@ -194,12 +197,9 @@ extern int foo;
'''
class grep_for_endianness(Task.Task):
- """
- Task that reads a binary and tries to determine the endianness
- """
color = 'PINK'
def run(self):
- txt = self.inputs[0].read(flags='rb').decode('latin-1')
+ txt = self.inputs[0].read(flags='rb').decode('iso8859-1')
if txt.find('LiTTleEnDian') > -1:
self.generator.tmp.append('little')
elif txt.find('BIGenDianSyS') > -1:
@@ -211,19 +211,18 @@ class grep_for_endianness(Task.Task):
@after_method('process_source')
def grep_for_endianness_fun(self):
"""
- Used by the endianness configuration test
+ Used by the endiannes configuration test
"""
self.create_task('grep_for_endianness', self.compiled_tasks[0].outputs[0])
@conf
def check_endianness(self):
"""
- Executes a configuration test to determine the endianness
+ Execute a configuration test to determine the endianness
"""
tmp = []
def check_msg(self):
return tmp[0]
- self.check(fragment=ENDIAN_FRAGMENT, features='c grep_for_endianness',
- msg='Checking for endianness', define='ENDIANNESS', tmp=tmp, okmsg=check_msg)
+ self.check(fragment=ENDIAN_FRAGMENT, features='c grep_for_endianness', msg="Checking for endianness", define='ENDIANNESS', tmp=tmp, okmsg=check_msg)
return tmp[0]