summaryrefslogtreecommitdiff
path: root/tools
AgeCommit message (Collapse)Author
2015-09-10ccanlint: Add cflags support to _infoAndrew Jeffery
2015-09-09configurator: Add OpenMP detectionAndrew Jeffery
2015-08-19configurator: avoid potential unused parameter warnings hosing our config.hCody P Schafer
Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19configurator: sometimes _GNU_SOURCE is already defined, in those cases avoid ↵Cody P Schafer
redefinition Config defines are disabled if a warning is emitted (we may want to reconsider that), and warnings are emitted for define redefinition. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-19configurator: hide type punningCody P Schafer
As for the type punning: gcc-5.1 with optimization (at least) warns about type punning in the previous example. The new usage should be exactly equivalent to the old, but just seperates the cast and deref into 2 statements. Frankly, I'm suprised gcc's type-punning analysis is so limited. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-08-17configurator: avoid leaks that LeakSanitizer doesn't likeCody P Schafer
These leaks aren't really an issue since they are completely bounded, but if one is building with leak sanitizer enabled (as -fsanitize=address does in gcc-5.1), it kills the configurator, which isn't very useful for us. Add the few free() calls it's looking for. This is not an actual code issue, they just workaround some optional compiler peculiarities. Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (split off leak change)
2015-07-09tools/modfiles: include _info (unless requested not to)Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/create-ccan-tree: clean up modfiles binary after use.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/create-ccan-tree: fix nested modules with -aRusty Russell
The cp -a would copy nested submodules, and worse, if that submodule was copied later it would end up duplicated in a subdir, eg. "ccan/tal/str/str/". Using modfiles handles this properly, and also uses git to filter out ignored files & other junk. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools/modfiles: list files in a module.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools: include LICENSE file in manifest.Rusty Russell
It's generally a symlink, so the lstat & S_ISREG tests were eliminating it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-07-09tools: don't include submodules in manifest.Rusty Russell
They currently get classed as "other_files"; they should be entirely ignored. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-06-18ccanlint: handle circular test-depends.Rusty Russell
eg. asort depends on order, but order testdepends on asort. Probably not the greatest thing to do, but don't barf because of it. Reported-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-28tal: rename tal_dup to tal_dup_arr, make tal_dup simpler.Rusty Russell
It's a bit too powerful, if you just want to memdup one thing, it's hard to remember what the extra args are for. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-05-24tools: add HAVE_UNALIGNED_ACCESS test.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-04-10ccanlint: avoid segfault when module_builds' linking failsPeter Barker
In the case that the objects built but linking failed, module_builds.c called score_file_error with a NULL ccan_file object and 0 for line number. score_file_error assumed that the ccan_file object it is passed was not-NULL when appending file errors to the score's aggregate error string. It attempted to dereference it to get "fullname". score_error was factored out from score_file_error. It takes a "source" parameter, which is the file's full name (and possibly line number) in the score_file_error case, and the ccan module name in the case of link failure.
2015-03-30tools/ccanlint: slight neatening of license logic.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2015-03-30ccanlint - avoid e.g. GPL vs LGPL mismatch in license checkingPeter Barker
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-11-10ccanlint: offer to insert license comments where they're missing.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-11-10ccanlint: check all headers for examples.Rusty Russell
pushpull module doesn't have examples in pushpull.h. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-10-27mem: Implement memrchr()David Gibson
The memrchr() function, which works like memchr(), but searches from the back of the region to the front is implemented in the GNU C library, but isn't standard. This patch adds an implementation of the function to the mem module, when it's not available in the system C library. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
2014-10-13configurator: Fix CTZ detectionRasmus Villemoes
The literal "1" in "1 << (sizeof(long{, long})*8 - 1)" should be 1L or 1LL, so that the expression has the right type. Otherwise, the shift is only by 31 bits on x86 (other platforms may behave differently). To avoid language lawyers shouting UB at me, and since __builtin_ctz{,l,ll} formally takes unsigned parameters, use UL and ULL suffixes. Also, fix a typo (missing parenthesis) in the code for CTZLL causing the detection of __builtin_ctzll to always fail for the wrong reason. Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-08-01tools/ccanlint: add global .valgrind_suppressions file.Rusty Russell
Seems like my local Ubuntu install is giving bogus warnings. Allow local valgrind overrides. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-07-29configurator: add BUILTIN_CTZ*, BUILTIN_FFS, and ICCARM_INTRINSICSCody P Schafer
Realistically, the ICCARM_INTRINSICS probably won't ever be generated by configurator, but will show up in manually created or alternately generated config.h's. Signed-off-by: Cody P Schafer <dev@codyps.com>
2014-06-23tools/configurator: set HAVE_CLOCK_GETTIME even if it's in -lrt.Rusty Russell
This avoids conflicts with autoconf and other config.h sources. Based on the work by Cody P Schafer <dev@codyps.com>. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-21compiler: Add PURE_FUNCTIONCody P Schafer
CC: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Cody P Schafer <dev@codyps.com> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-16ccan: Correct some poor conventions in _info includesDavid Gibson
There are a couple of small problems with the includes used in most of ccan's _info files. * _info routinely uses printf(), and so should include <stdio.h>, but only some of them do. We get away with it, because they do include <string.h>, which apparently includes <stdio.h> indirectly, but we should be explicit about it. * Most _info files were including config.h after the system headers. That _seems_ sensible, but actually causes problems. Because config.h defines _GNU_SOURCE it can change the behaviour of the system headers. More specifically it can make them behave differently to how the individual module headers (which have included config.h) expects them to behave. This patch adjusts all the existing _info files and, more importantly, the template constructed by ccanlint. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-10io failtest timer tools: fallout from time changes.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-06-10tools: use tal/grab_fileRusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-05-27tools/ccanlint: detect more unmentioned dependencies.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-05-27tools/ccanlint: don't assert on relative directories for -d.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2014-02-06tools/configurator: add HAVE_SYS_TERMIOS_HRusty Russell
As recently required by ccan/opt. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-04-01ccanlint: --deps-fail-ignore.Rusty Russell
Useful for bulk testing modules, where some might not have required external (non-CCAN) dependencies. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-03-31ccanlint: don't crash if given bad directory name.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-14ccanlint: fix stack smash.Rusty Russell
"engla" on IRC reported that ccanlint on linux/powerpc would loop infinitely calling dep_failed after all tests are run and the score is output. Reproduced, and discovered that cannot_run() takes a container_of(), except our top node is not a struct ccanlint. The result was harmless on x86, but set dep_failed to the return address on powerpc, causing that to be called repeatedly. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-12ccanlint: handle when _info doesn't compile.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2013-01-03Merge branch 'rfc822'Rusty Russell
2013-01-03ccanlint: ignore "unused" non-ccan dependencies.Rusty Russell
We can't really tell if non-ccan dependencies are used, so don't try. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-17configurator: fix single-arg case.Rusty Russell
In this case, CCAN_CFLAGS should be "". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-07ccanlint: fix --compiler and --cflags options to apply to _info files as well.Rusty Russell
We weren't using the compiler and cflags options in tools/compile. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: manifest.c should use path_canon.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03ccanlint: remove redundant num_lines in struct ccan_file.Rusty Russell
We can use tal_count. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03ccanlint: print module name properly for nested modules.Rusty Russell
eg: tal/str: Module's tests cover all the code (tests_coverage): PASS (+3/6) tal/str: Total score: 55/58 Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal/path instead of opencoding most paths.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal/path instead of writing own path handlers.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use tal instead of talloc.Rusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: use rbuf instead of grab_file.Rusty Russell
Slowly removing the talloc dependency. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03ccanlint: handle nested modules when mentioned in examples.Rusty Russell
If we see an ccan include line in an example, we add that to the dependencies to try to build the example, but we didn't handle nested modules. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-12-03tools: don't abort on malformed documentation lines.Rusty Russell
ccanlint would abort with 'Malformed line 53' if there was a bad header. That's very poor, and deeply unhelpful. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-11-22configurator: test for HAVE_FCHDIRRusty Russell
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>