doc: General makefile cleanup.

This is a general cleanup of the makefile in order to bring it more inline
with standard make practices. Cleanups included more use of automatic
variables, switching AM_V_GEN to AM_V_at to have one 'GEN' visible per file,
splitting copy operations to proper rules, and using order only dependencies
to properly create directories on-demand.

Changes also correct missing use of $(builddir) that has gone unnoticed as
it defaults to the current directory ('.').

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
doc: Minor makefile cleanup.

Split out directory creation to leverage order only prerequisites.

Signed-off-by: Jon A. Cruz <jonc@osg.samsung.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
doc: fix doxygen->man command line

It was telling it to scan the doxyfile as well as the C source, and
listing some source files more than once.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
doc: Split libwayland-client and -server into different pages

This was suggested before to make it clearer that things like wl_display
are different objects in each of them. I made these into two appendixes
because the protocol spec was already an appendix.

Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
[Bryce requested minor changes, not yet here.]

Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
doc: fix for parallel make

Move the *_8h.xml files to a per-chapter temporary file so two
chapters can be converted from doxygen at the same time. Tested
with make -j 9.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
doc: Make it easier to add a new doxygen page

The repetitive parts of generating the server and client documentation are
merged, so it is easier to add another doxygen chapter: add a new line to
$publican_sources in publican/Makefile.am, and a list of C source files to
doxygen/Makefile.am.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
fixup doc: Make it easier to add a new doxygen page

This supersedes the previous one and fixes a typo where a slash was missing.

Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
test-runner: move leak checking into function

1) now we can use it in the test-compositor
2) it looks better

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
test-compositor: extend leak checks into clients

Run leak checks also on clients of test-compositor.

Checking leaks in memory is the same as in normal TEST.

The problem here is with fds. We pass WAYLAND_SOCKET
fd to the client and this fd is over taken by wl_display and
closed in wl_display_disonnect(). The result is that
the client closed one more fd than it opened. That would
not be a problem if every client used wl_display_connect() -
but this is not the case. E. g. sanity-tests usually do not
call wl_display_connect().

Solution is simple: when client does not call wl_display_connect(),
it states it by invoking TEST_CLIENT_NOT_USING_WL_DISPLAY_CONNECT macro.
Because mostly (we can use word 'only' at the moment) sanity-test
clients do not use wl_display_connect(), this does not introduce any changes
to regular testing clients (and thus for the guys that write those clients)

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
tests: add tests for leak check in clients

Sanity tests for leak checks in clients of test compositor
and also check if the test-compositor itself is not leaking
anything.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
tests: use atomic operation in leak checker

In some tests we use threads, so we need to be sure that
the allocation counters are race-free.

This works only for gcc >= 4.1.2 since in this version
were introduced the atomic operations.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
connection-test: add tests for closure leaks

When we destroy closure, we are leaking memory sometimes.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
client: release display queue in wl_display_disconnect()

Don't leak events, not even on exit

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
client: unref or destroy proxy when releasing queue

When we release event queue with queued events, we can leak
proxies in some cases.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
tests: add possibility to disable leak check for single test

In tests that are using external libraries (i. e. pthread) we
can get failure because of leaks in the external library.
Until we have some better solution (if ever), let these (and only these)
tests to disable leak checks.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
display-test: disable leak check in tests that use pthread

pthread is leaking and it makes our tests fail.

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>