summaryrefslogtreecommitdiff
path: root/README.txt
blob: 97aeac3da4d349766e0e21e6aba9f84e7d864b83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
Waffle - a library for selecting GL API and window system at runtime

Summary
=======

Waffle is a cross-platform library that allows one to defer selection of GL
API and of window system until runtime. For example, on Linux, Waffle enables
an application to select X11/EGL with an OpenGL 3.3 core profile, Wayland
with OpenGL ES2, and other window system / API combinations.

Waffle's immediate goal is to enable Piglit [1] to test multiple GL flavors in
a cross-platform way, and to allow each Piglit test to choose its GL API and
window system at runtime. A future goal is to enable the ability to record
(with another tool such APITrace [2]) an application's GL calls on one
operating system or window system, and then replay that trace on a different
system.

For more information, visit to Waffle's website.


[1] http://cgit.freedesktop.org/piglit/tree/README
[2] http://github.com/apitrace/apitrace#readme


Links
=====

website:        http://people.freedesktop.org/~chadversary/waffle
mailing-list:   waffle@lists.freedesktop.org
maintainer:     Chad Versace <chad.versace@linux.intel.com>
source:         git://people.freedesktop.org/~chadversary/waffle.git
gitweb:         http://cgit.freedesktop.org/~chadversary/waffle
license:        BSD [http://www.opensource.org/licenses/bsd-license.php]


Examples
========

For example code and makefiles that demonstrate how to use and build with
Waffle, see the following:

    - Online examples at
      http://people.freedesktop.org/~chadversary/waffle/examples .

    - Installed examples at $PREFIX/share/doc/waffle-VERSION/examples, if
      Waffle is installed on your system.

    - The 'examples' directory in the source repository:
      http://cgit.freedesktop.org/~chadversary/waffle/tree/examples


Build Requirements
==================

Linux
-----

Waffle uses CMake for it build system.

    Archlinux: pacman -S cmake
    Fedora 17: yum install cmake

To build the manpages or html documentation, xsltproc and the Docbook XSL
stylesheets are required.

    Archlinux: pacman -S libxslt docbook-xsl
    Fedora 17: yum install libxslt docbook-style-xsl

If you choose to enable support for a given platform (for example,
-Dwaffle_has_glx=1), then CMake will complain if the necessary libraries are
not installed. Listed below are the required packages for each platform.

If you install Mesa from source, then Mesa must be configured with option
`--with-egl-platforms=PLATFORM_LIST`, where PLATFORM_LIST is
a comman-separated list of any combination of "x11", "wayland", and "drm".

    - GLX:
        - Archlinux: pacman -S libgl libxcb libx11
        - Fedora 17: yum install mesa-libGL-devel libxcb-devel libX11-devel

    - X11/EGL:
        - all: If you choose to install Mesa from source, use --with-egl-platforms=x11.
        - Archlinux: pacman -S libegl libxcb libx11
        - Fedora 17: yum install mesa-libEGL-devel libxcb-devel libX11-devel

    - Wayland:
        - all: Install wayland>=1.0 from source.
        - all: Install mesa-9.1-devel from source. Use --with-egl-platforms=wayland.

    - GBM:
        - all: Install mesa-9.1-devel from source. Use --with-egl-platforms=drm.
        - Archlinux: pacman -S systemd
        - Fedora 17: yum install libudev-devel


Installing
==========

For full details on configuring, building, and installing Waffle, see
/doc/building.txt. What follows is a quick how-to.


0. Be in the correct directory
------------------------------

    git clone git://people.freedesktop.org/~chadversary/waffle
    cd waffle

or

    tar xvf waffle-0.0.0.tar.xz
    cd waffle-0.0.0


1. Configure pkg-config
-----------------------
If any of Waffle's dependencies are installed in custom locations, you must
set the PKG_CONFIG_PATH environment variable. For example, if you installed
a dependeny into /usr/local, then:

    export PKG_CONFIG_PATH=/usr/local/share/pkgconfig:/usr/local/$libdir/pkgconfig:$PKG_CONFIG_PATH


2. Configure CMake
------------------
On Linux, you likely want to call cmake with the following
arguments.  It configures Waffle in debug mode and with support for only GLX.

    cmake \
        -DCMAKE_BUILD_TYPE=debug \
        -Dwaffle_has_glx=1 \
        .

If in addition to GLX you want support for X11/EGL, then add
-Dwaffle_has_x11_egl=1 to the cmake arguments. Likewise for Wayland, add
-Dwaffle_has_wayland=1; and for GBM, add -Dwaffle_has_gbm=1.

For the full list of Waffle's custom CMake options, see file `Options.cmake`.

To install into a custom location, autoconf-esque variables such
as CMAKE_INSTALL_LIBDIR are supported. See
$waffle_top/cmake/Modules/GNUInstallDirs.cmake for details. For example, to
install libwaffle into $HOME/lib, use the following cmake invocation:

    cmake \
        -DCMAKE_INSTALL_PREFIX=$HOME \
        -DCMAKE_INSTALL_LIBDIR=lib \
        -Dwaffle_has_glx=1 \
        .


3. Build and Install
--------------------

    make
    make check
    make install

Calling `make check` only runs unittests that do not access the native GL
platform. To run additional functional tests, which do access the native GL
platform, call `make check-func`.