[libdispatch-dev] [PATCH 2/4] check whether to add -lm for testing to compile

Love Hörnquist Åstrand lha at kth.se
Fri Nov 20 08:40:40 PST 2009

> On the topic of auto* feature/help requests:
> (1) Is there a better way to do the MLINKS-like symlink creation in man/Makefile.am? In the BSD make framework, you use the MLINKS variable to declare a set of additional names for man pages, which at install-time result in symlinks. It would be nice if automake had a similar primitive, which created symlinks where available and copies otherwise, and in particular if the deinstall target knew how to remove them. Right now I'm using install-data-hook, probably poorly.

In heimdal we solved this by parsing the mdoc pages [1] [2] and make appropriate links from this information, scary, but very useful since people don't remember to update MLINKS. However, part of the problem is people don't care to update mdoc pages either.

> (2) Makefile.darwin runs all the test parts under a harness, and then collects and summarizes the results. There's a bit of non-portability in the harness still to address (as far as I'm aware, Mac OS X is the only system that has the posix_spawn flags required), but also I'd like to work from a potted example of how to hook up the test parts to the test support described in the automake documentation. Is there such a thing around to look at, or can I interest some hands in doing this?

Using automake test framework is trivial.

TESTS = test-app script

check_PROGRAMS = test-app

Return 0 for success, 77 for test does not apply. Heimdal uses a lot of these tests [3] [4].

If you want to run the test application/scripts under a specific environment, you can set TESTS_ENVIRONMENT (check check-valgrind in [5]). maybe-valgrind checks that the app is really a app generate from libfool and not a shell script, finding memory leaks/corruption in /bin/sh is no sport (make make execution so much slower).


[1] sed -n -e '/SYNOPSIS/q;/DESCRIPTION/q;s/^\.Nm \([^ ]*\).*/\1/p' $srcdir/$f
[2] http://github.com/heimdal/heimdal/blob/master/cf/install-catman.sh
[3] http://github.com/heimdal/heimdal/blob/master/lib/krb5/Makefile.am
[4] http://github.com/heimdal/heimdal/blob/master/tests/kdc/Makefile.am
[5] http://github.com/heimdal/heimdal/blob/master/cf/Makefile.am.common

More information about the libdispatch-dev mailing list