Commit Graph

78 Commits

Author SHA1 Message Date
Simon Ser
7d3d2ae310
doc/man: remove manually written man pages
There is only one page written. Having manually-written man pages duplicates
information with doc comments. Besides, man pages are already generated by
Doxygen.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/-/issues/156
2020-04-16 19:53:28 +02:00
Simon Ser
3d1c6c6f68
autotools: add Meson files to EXTRA_DIST
This allows users to build Wayland with Meson from an autotools-generated
release tarball.

Signed-off-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/wayland/wayland/issues/141
2020-02-04 17:43:07 +01:00
Simon Ser
bfd4362fc2 autotools: use strict wayland-scanner mode
Otherwise an invalid protocol will print warnings to stdout but won't
make the build fail.

Signed-off-by: Simon Ser <contact@emersion.fr>
2020-01-15 13:26:20 +00:00
Pekka Paalanen
0d3044f2ea
scanner: include config.h from command line
Meson will need to build wayland-scanner twice with different config.h files,
once for build and another for host machine. It will be easier to include the
right config.h from compiler command line than playing with files.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2020-01-10 23:42:59 +01:00
Joshua Watt
e7d88f35eb Move wl_priv_signal to wayland-server-private.h
Including wayland-server-core.h in wayland-private.h is problematic
because wayland-private.h is included by wayland-scanner which should be
able to build against non-POSIX platforms (e.g. MinGW). The only reason
that wayland-server-core.h was included in wayland-private.h was for the
wl_private_signal definitions, so move those to a
wayland-server-private.h file that can be included by both
wayland-server.c and the tests.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2019-11-06 08:24:14 -06:00
Mosè Giordano
766edf0243 Add $(RT_LIBS) to fixed-benchmark LD dependencies
`tests/fixed-benchmark.c` calls `clock_gettime`.
2019-09-17 16:38:28 +01:00
Jonas Ådahl
493ab79bd2 proxy: Add API to tag proxy objects
When an application and a toolkit share the same Wayland connection,
it will receive events with each others objects. For example if the
toolkit manages a set of surfaces, and the application another set, if
both the toolkit and application listen to pointer focus events,
they'll receive focus events for each others surfaces.

In order for the toolkit and application layers to identify whether a
surface is managed by itself or not, it cannot only rely on retrieving
the proxy user data, without going through all it's own proxy objects
finding whether it's one of them.

By adding the ability to "tag" a proxy object, the toolkit and
application can use the tag to identify what the user data pointer
points to something known.

To create a tag, the recommended way is to define a statically allocated
constant char array containing some descriptive string. The tag will be
the pointer to the non-const pointer to the beginning of the array.

For example, to identify whether a focus event is for a surface managed
by the code in question:

	static const char *my_tag = "my tag";

	static void
	pointer_enter(void *data,
		      struct wl_pointer *wl_pointer,
		      uint32_t serial,
		      struct wl_surface *surface,
		      wl_fixed_t surface_x,
		      wl_fixed_t surface_y)
	{
		struct window *window;
		const char * const *tag;

		tag = wl_proxy_get_tag((struct wl_proxy *) surface);

		if (tag != &my_tag)
			return;

		window = wl_surface_get_user_data(surface);

		...
	}

	...

	static void
	init_window_surface(struct window *window)
	{
		struct wl_surface *surface;

		surface = wl_compositor_create_surface(compositor);
		wl_surface_set_user_data(surface, window);
		wl_proxy_set_tag((struct wl_proxy *) surface,
				 &my_tag);
	}

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2019-07-29 16:47:36 +00:00
orbea
2485a5c274 Add a missing -pthread to fix compile with slibtool.
When compiling wayland with slibtool instead of GNU libtool
it will fail building libtest_runner with an undefined
reference to pthread_join@@GLIBC_2.2.5. This is because
-pthread (Or -lpthread) is missing from display_test. If its
added the build succeeds as expected with slibtool and
continues to work with libtool. Its likely that libtool is
hiding this failure by silently adding the missing flag which
is not uncommon...

Exposed in commit aa51a833eb.

Fixes https://gitlab.freedesktop.org/wayland/wayland/issues/91

Signed-off-by: orbea <orbea@riseup.net>
2019-05-31 08:38:50 -07:00
Manuel Stoeckl
6db761d162 tests: Verify that wayland_scanner can catch bad identifiers
The test runs wayland_scanner on a set of XML protocol files which
have malformed element names, and confirms that an error is produced
and indicates the correct line.

Copyright notifications are not included in the test files, as
they are not code; of course, the project license still applies.

Signed-off-by: Manuel Stoeckl <code@mstoeckl.com>
2019-05-02 17:42:59 +00:00
Leonid Bobrov
dd3ba21457 configure: detect libdl and librt
Signed-off-by: Leonid Bobrov <mazocomp@disroot.org>
2019-04-06 19:53:25 +00:00
Leonid Bobrov via wayland-devel
c70fd8a812 tests: fix main symbol duplication
So far I got these errors before patching:

libtool: link: cc -o .libs/headers-test -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/headers-test.o tests/headers-protocol-test.o tests/headers-protocol-core-test.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib
ld: error: duplicate symbol: main
>>> defined at headers-test.c:53 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/headers-test.c:53)
>>>            tests/headers-test.o:(main)
>>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377)
>>>            test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a

libtool: link: cc -o .libs/exec-fd-leak-checker -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/exec-fd-leak-checker.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib
ld: error: duplicate symbol: main
>>> defined at exec-fd-leak-checker.c:57 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/exec-fd-leak-checker.c:57)
>>>            tests/exec-fd-leak-checker.o:(main)
>>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377)
>>>            test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a

Makefile.am: error: object 'tests/test-helpers.$(OBJEXT)' created both with libtool and without

libtool: link: cc -o .libs/fixed-benchmark -pthread -Wall -Wextra -Wno-unused-parameter -g -Wstrict-prototypes -Wmissing-prototypes -fvisibility=hidden -O2 -pipe tests/fixed-benchmark.o /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a -L.libs -lwayland-client -lffi -lm -lwayland-server -lkvm -Wl,-rpath-link,/usr/local/lib
ld: error: duplicate symbol: main
>>> defined at fixed-benchmark.c:100 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/fixed-benchmark.c:100)
>>>            tests/fixed-benchmark.o:(main)
>>> defined at test-runner.c:377 (/tmp/obj/wayland-1.16.0/wayland-1.16.0/tests/test-runner.c:377)
>>>            test-runner.o:(.text+0x250) in archive /tmp/obj/wayland-1.16.0/build-amd64/.libs/libtest-runner.a

This commit fixes all of that.

Signed-off-by: Leonid Bobrov <mazocomp@disroot.org>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2019-02-25 13:00:00 +02:00
Pekka Paalanen
d95cf31201 doc: move Contributing
Gitlab expects a CONTRIBUTING.md in the root directory, so move our
guide there.

Conversion to proper markup is a follow-up patch.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-06-14 14:39:47 +03:00
Daniel Stone
2031bcf5da wayland-egl: Pass nm path to check script
A previous patch used $NM as an environment variable, but this was only
set as a make variable. Make sure it is passed through from make to the
environment we use to run tests.

v2: Quote argument when passing to shell.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reported-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Fixes: 6903e4d539 ("wayland-egl: use correct `nm` path when cross-compiling")
Cc: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2018-03-19 11:39:11 -05:00
Emil Velikov
79cc3ad6bd wayland-egl: set the correct path to libwayland-egl.so
Earlier commit changed to passing the binary name as env. variable
introducing a typo.

That went unnoticed, since we do not check if the file is present or
not.

Cc: Pukka Paalanen <ppaalanen@gmail.com>
Cc: Daniel Stone <daniels@collabora.com>
Fixes: 85cb5ed64a ("wayland-egl-symbols-check: pass the DSO name via
the build system")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2018-03-19 11:39:49 +02:00
Emil Velikov
b02c4013e3 tests: add code, public-code and private-code tests
First one is deprecated in favour of the second option.

The latter is newly introduced and annotates the generated symbols
accordingly.

v2: Don't introduce small-public-code.c - reuse small-code.c (Pekka)

Cc: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2018-02-22 13:51:50 +02:00
Emil Velikov
ab6b156920 build: use public-code when using the local wayland-scanner
The core wayland interfaces are public, via the libwayland-server and
libwayland-client DSOs. Hence use "public-code" cmdline option, instead
of the deprecated code".

As the host wayland-scanner may not know about the new option, use the
legacy "code".

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2018-02-22 11:56:57 +02:00
Emil Velikov
8d8f2600ec wayland-egl: move the wayland-egl{, -core}.h headers to egl/
Now we have all the wayland-egl bits in a single place.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
2018-02-09 17:31:06 +00:00
Emil Velikov
85cb5ed64a wayland-egl-symbols-check: pass the DSO name via the build system
The location of the file is build system specific so, keep it there.

Cc: Daniel Stone <daniels@collabora.com>
Suggested-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
2018-02-09 17:31:03 +00:00
Emil Velikov
1fcb4d1387 build: wire-up wayland-egl
Wire-up the imported sources, test and pkg-config files.

v2:
 - Don't mangle with existing EXTRA_DIST list
 - Add the symbols check script to the `make check' target
 - Rename wayland-egl-{priv,backend}.h

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Arnaud Vrac <avrac@freebox.fr>
2018-02-09 17:31:00 +00:00
Derek Foreman
118aaec480 tests: Add missing file to distribution
In f74c9b98db I added tests.xml to the
repository, but not to the distribution tarball.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2018-01-19 11:54:26 -06:00
Derek Foreman
f74c9b98db tests: Add a test for fd leaks on zombie objects
Until recently, if a client destroying a resource raced with the
server generating an event on that resource that delivered a file
descriptor, we would leak the fd.

This tests for a leaked fd from that race condition.

Reviewed-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
2018-01-09 15:20:00 +00:00
Emil Velikov
5bb8268766 build: remove wayland-version.h.in from EXTRA_DIST
All the foo.in files are in the tarball, as long as their foo
counterparts are listed in AC_CONFIG_FILES

For example - *.pc.in, Makefile.in files, etc.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-09-18 12:21:55 +03:00
Jonas Ådahl
b88ada0760 Pass input/output files as arguments to wayland-scanner
When input/output files are passed as arguments to wayland-scanner,
instead of using stdin/stdout, warning and error messages will contain
the file name, together with line number, of the warning/error. Doing
this helps IDEs jump to the correct line.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
[Pekka: dropped the src/scanner.mk hunk, file deleted]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-08-18 15:20:24 +03:00
Giulio Camuffo
5e6eb03229 server: add a safer signal type and port wl_display to it
wl_list_for_each_safe, which is used by wl_signal_emit is not really
safe. If a signal has two listeners, and the first one removes and
re-inits the second one, it would enter an infinite loop, which was hit
in weston on resource destruction, which emits a signal.
This commit adds a new version of wl_signal, called wl_priv_signal,
which is private in wayland-server.c and which does not have this problem.
The old wl_signal cannot be improved without breaking backwards compatibility.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2017-01-25 13:46:23 +02:00
Pekka Paalanen
c9f64544a3 tests: add scanner tests
Add tests that ensure that wayland-scanner output for a given input does
not change unexpectedly. This makes it very easy to review
wayland-scanner patches.

Before, when patches were proposed for wayland-scanner, I had to
build wayland without the patches, save the generated files into a
temporary directory, apply the patches, build again, and diff the old
vs. new generated file.

No more. Now whenever someone makes intentional changes to
wayland-scanner's output, he will also have to patch the example output
files to match. That means that reviewers see the diff of the generated
files straight from the patch itself. Verifying the diff is true is as
easy as 'make check'.

The tests use separate example XML files instead of wayland.xml
directly, so that wayland.xml can be updated without fixing scanner
tests, avoiding the churn.

example.xml starts as a copy of wayland.xml. If wayland.xml starts using
new wayland-scanner features, they should be copied into example.xml
again to be covered by the tests.

This patch relies on the previous patch to actually add all the data
files for input and reference output.

The scanner output is fed through sed to remove parts that are allowed
to vary: the scanner version string.

v2: no need for scanner-test.sh to depend on the test data

Task: https://phabricator.freedesktop.org/T3313
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> (v1)
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Tested-by: Yong Bakos <ybakos@humanoriented.com>
2016-11-23 10:18:44 +02:00
Yong Bakos
b0cd65deac tests: Test wl_interface_equal
The test suite did not cover wl_interface_equal, so add one test that
specifically tests this method. Add the new test to Makefile.am.

Signed-off-by: Yong Bakos <ybakos@humanoriented.com>
[Pekka: add assert(&wl_registry_interface != &copy);]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-11-18 16:21:19 +02:00
Pekka Paalanen
aa51a833eb Makefile: build also test programs during a normal build
Put also test programs into noinst_PROGRAMS so that they get always
built. In check_PROGRAMS they are built for 'make check' but not for
'make'.

This makes it harder to accidentally break the test programs.

v2: also change check_LTLIBRARIES to noinst_LTLIBRARIES

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-11-17 13:33:31 +02:00
Pekka Paalanen
edd62e62b7 Makefile: do not put TESTS into check_PROGRAMS
If you assign TESTS into check_PROGRAMS, you cannot add a test that is
not built from source files.

Instead, use a temporary variable built_test_programs to hold the names
that are both programs built from source files and tests to execute.

This change is required by the following patch adding wayland-scanner
test script.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2016-11-16 13:23:43 +02:00
Giulio Camuffo
450f06e21a Add API to install protocol loggers on the server wl_display
The new wl_display_add_protocol_logger allows to set a function as
a logger, which will get called when a new request is received or an
event is sent.
This is akin to setting WAYLAND_DEBUG=1, but more powerful because it
can be enabled at run time and allows to show the log e.g. in a UI view.
A test is added for the new functionality.

Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Yong Bakos <ybakos@humanoriented.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-12 11:59:46 +03:00
Sungjae Park
be48da6a42 server: add listener API for new clients
Using display object, Emit a signal if a new client is created.

In the server-side, we can get the destroy event of a client,
But there is no way to get the created event of it.
Of course, we can get the client object from the global registry
binding callbacks.
But it can be called several times with same client object.
And even if A client creates display object,
(so there is a connection), The server could not know that.
There could be more use-cases not only for this.

Giulio: a test is added for the new functionality

Signed-off-by: Sung-jae Park <nicesj@nicesj.com>
Signed-off-by: Giulio Camuffo <giulio.camuffo@kdab.com>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2016-08-11 14:35:28 +03:00
Pekka Paalanen
4a41d26c4d build: fix ./configure --disable-dtd-validation
When configured with --disable-dtd-validation:

  CPPAS    src/dtddata.o
src/dtddata.S: Assembler messages:
src/dtddata.S:39: Error: file not found: src/wayland.dtd.embed
Makefile:1520: recipe for target 'src/dtddata.o' failed

This is because the variable name used does not match the implicit
variable name in autoconf.

Fix the variable name, making both --disable-dtd-validation and
--enable-dtd-validation to what they should.

Do not try to build dtddata.S if dtd-validation is disabled. It depends
on wayland.dtd.embed which is created by configure only if
dtd-validation is enabled.

If not building dtddata.S, also make sure the extern definitions in
scanner.c are compiled out.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=575212
Reported-by: leio@gentoo.org
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Tested-by: Bryce Harrington <bryce@osg.samsung.com>
2016-02-29 15:32:35 -08:00
Derek Foreman
8f2da5e82b Revert "build: build distcheck with --enable-fatal-warnings"
This reverts commit 8125919b0d.

This makes things far more annoying than intended, especially since
the list of default warnings isn't consistent from distro to distro.
2016-02-17 09:12:58 -06:00
Derek Foreman
8125919b0d build: build distcheck with --enable-fatal-warnings
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2016-02-16 22:13:56 -08:00
Pekka Paalanen
3dc7c2c846 Makefile: use automake rule for compiling .S
Automake seems to have its own rules for compiling an .o from an .S.
Essentially it does the same as our hand-crafted rule, but adds some
things like dependency file generation.

Remove our hand-crafted rule to use the automake rule, it is less
surprising.

http://www.gnu.org/software/automake/manual/html_node/Assembly-Support.html

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Víctor Jáquez <vjaquez@igalia.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-11-19 09:47:24 +02:00
Peter Hutterer
f66e2d53dd Validate the protocol xml during scanning
Embed the wayland.dtd protocol data into the scanner binary so we can validate
external protocol files without requiring makefile changes. Hat-tip to Pekka
Paalanen for the embedding trick.
The embedding trick doesn't work well if the to-be-embedded file is in a
different location than the source file, so copy/link it during configure and
then build it in from the local directory.

The current expat parser is not a validating parser, moving scanner.c to
another parser has the risk of breaking compatibility. This patch adds libxml2
as extra (optional) dependency, but that also requires parsing the input
twice.

If the protocol fails validation a warning is printed but no error is returned
otherwise.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-17 14:36:21 +02:00
Peter Hutterer
9d794d9f77 Revert "Remove protocol/wayland.dtd"
This reverts commit 06fb8bd371.

Having a DTD hooked up gives an indication of what we expect the protocol to
be, which is a clearer documentation than the current "whatever scanner.c
manages to parse".

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-11-17 14:36:21 +02:00
Auke Booij
06fb8bd371 Remove protocol/wayland.dtd
The wayland scanner defines the protocol. The DTD specification is not used.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Nils Christopher Brause <nilschrbrause@googlemail.com>
2015-10-09 15:32:34 -05:00
Derek Foreman
de1489564c build: Build libwayland-private
This splits the bulk of libwayland-util into libwayland-private.

libwayland-util (which is just wayland-util.c) is for use with the scanner.

libwayland-private is everything else.

Most things will want to link both libs.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2015-07-23 14:23:58 -07:00
Ross Burton
21f80b8982 build: always build wayland-scanner
The previous idiom for building a cross-compiled Wayland is to build once for
the build host (with --enable-scanner --disable-libraries) to get a
wayland-scanner binary that can then be used in a cross-compile (with
--disable-scanner).  The problem with this is that the cross wayland is missing
a wayland-scanner binary, which means you then can't do any Wayland development
on the target.

Instead, always build wayland-scanner for the target and change
--enable/disable-scanner to --with/without-host-scanner.  Normal builds use the
default of --without-host-scanner and run the wayland-scanner it just built, and
cross-compiled builds pass --with-host-scanner to use a previously built host
scanner but still get a wayland-scanner to install.

(a theoretically neater solution would be to build two scanners if required (one
to run and one to install), but automake makes this overly complicated)

[daniels: Bikeshedded naming with Ross's OK.]

Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-07-17 12:19:08 +01:00
Derek Foreman
4cdc51034c build: Use AM_CFLAGS instead of GCC_CFLAGS everywhere
This will make it easier if we ever want to add new flags to everything
in the future.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-23 10:07:40 +03:00
Derek Foreman
0e979d82d2 build: Build a subset of libwayland_util when not building libraries
The scanner doesn't need anything but wayland-util.c/.h so we can
shrink wayland-util when not building the main libraries.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-18 14:06:24 +03:00
Derek Foreman
5cfdbef3d2 build: Allow disabling building of wayland libraries
When cross-compiling it may be useful to build only the wayland-scanner
natively.  This patch makes it possible to disable build of the libraries.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-18 14:06:16 +03:00
Derek Foreman
aeeca31696 build: Stop putting FFI_CFLAGS in AM_CFLAGS
AM_CFLAGS are the defaults passed to anything that doesn't specify its own
_CFLAGS, so instead of putting FFI_CFLAGS there, let's just add that to
anything that actually needs it.

The only thing that needs it but didn't have it specifically was
libwayland_util (for connection.c)

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-18 14:06:08 +03:00
Derek Foreman
e06f88cf91 build: Move AM_CFLAGS and AM_CPPFLAGS to the top of Makefile.am
AM_CFLAGS and AM_CPPFLAGS aren't positional, so putting them at a
random place in Makefile.am can be misleading.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-06-18 14:05:24 +03:00
Derek Foreman
56a5a890b5 docs: remove and ignore doc/doxygen_sqlite3.db
Some newer versions of doxygen are generating this file now, and if
we don't clean it up distcheck will fail.

Known to affect doxygen 1.8.8 from debian jessie.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
Tested-by: Jon A. Cruz <jonc@osg.samsung.com>
2015-06-04 17:21:25 -07:00
Giulio Camuffo
1fab2e7ba9 tests: add an headers test
This test checks that the protocol and library headers include only what
they are supposed to include. That is, that the core headers do not
include the protocol headers and that the core protocol headers do not
include the non core library headers.
The build process now generates core protocol headers, but they are only
used in the test and don't get installed.

Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
2015-05-21 16:00:31 -07:00
Giulio Camuffo
ea73cb00bc wayland-egl: add a core header
The new core header doesn't include any other header, since it really
is not needed.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-04-30 14:30:08 +03:00
Giulio Camuffo
d74a9c079b introduce new headers wayland-client-core.h and wayland-server-core.h
wayland-client.h and wayland-server.h include the protocol headers generated
at build time. This means that a libwayland user cannot generate and use
protocol code created from a wayland.xml newer than the installed libwayland,
because it is not possible to only include the API header.

Another use case is language bindings, which would generate their own protocol
code and which only need to use the library ABI, not the generated C code.

This commit adds wayland-client-core.h and wayland-server-core.h which do not
include the protocol headers or any deprecated code.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
2015-04-30 14:11:25 +03:00
Andrew Oakley
a4afd90f9f configure.ac: use pkg-config to find expat
This is now done in the same way as the libffi dependency and still
allows the library to be installed in a non-standard location (with
PKG_CONFIG_PATH).
2015-01-28 21:29:10 -08:00
Mariusz Ceier
e3dc9a7af6 tests: C++ compilation test
This test includes one of wayland headers, which produced
error with C++ compiler. C compiler can't be used for this test,
because it issues only a warning[1] and only when wayland headers
are not installed in system headers path (/usr/include).

[1] wayland-server-protocol.h:201:2: warning: implicit declaration of function ‘wl_resource_post_event’

[daniels: Merged in Marek's follow-up to check for a C++ compiler.]

Signed-off-by: Mariusz Ceier <mceier+wayland@gmail.com>
Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-01-27 11:17:42 +00:00