<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 13-12-08 10:38 AM, <a class="moz-txt-link-abbreviated" href="mailto:davyaxel@free.fr">davyaxel@free.fr</a>
wrote:<br>
</div>
<blockquote
cite="mid:936485932.605004422.1386517090285.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">The Dri3 helpers rely on some EGL extension, and it would be great
to disable automatically the compilation of the DRI3 code if the
EGL extensions are not defined.
For example EGL_EXT_image_dma_buf_import is recent, and the
definition of the symbols around the extension might be missing in the
OpenGL library.</pre>
</blockquote>
Looks like AC_CHECK_DECLS might be the macro to use. Checking for
one of symbols from the extension might be good enough. For example,
EGL_LINUX_DMA_BUF_EXT.<br>
<blockquote
cite="mid:936485932.605004422.1386517090285.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
Another issue is that we need EGLNativePixmapType to be (struct gbm_bo*).</pre>
</blockquote>
<blockquote>typedef struct gbm_bo *EGLNativePixmapType;<br>
</blockquote>
AC_CHECK_MEMBERS can be used to check for the declaration of members
that would only be defined in the gbm version of
EGLNativePixmapType.<br>
<blockquote
cite="mid:936485932.605004422.1386517090285.JavaMail.root@zimbra26-e5.priv.proxad.net"
type="cite">
<pre wrap="">
I didn't know how to deal with the issue, that's why I've put the comment
lines 242-245 in glamor_egl.c.
Do you know how to solve these issues?</pre>
</blockquote>
This is what we have to solve this configuration challenge in
Autoconf:<br>
<br>
AC_CHECK_DECLS (symbols, [action-if-found], [action-if-not-found],
[includes = ‘AC_INCLUDES_DEFAULT’])<br>
<blockquote>For each of the symbols (comma-separated list with
optional function argument types for C++ overloads), define
HAVE_DECL_symbol (in all capitals) to ‘1’ if symbol is declared,
otherwise to ‘0’. If action-if-not-found is given, it is
additional shell code to execute when one of the function
declarations is needed, otherwise action-if-found is executed. <br>
</blockquote>
AC_CHECK_FUNCS (function..., [action-if-found],
[action-if-not-found])<br>
<blockquote>For each function enumerated in the
blank-or-newline-separated argument list, define HAVE_function (in
all capitals) if it is available. If action-if-found is given, it
is additional shell code to execute when one of the functions is
found. You can give it a value of ‘break’ to break out of the loop
on the first match. If action-if-not-found is given, it is
executed when one of the functions is not found. <br>
</blockquote>
AC_CHECK_HEADERS (header-file..., [action-if-found],
[action-if-not-found], [includes])<br>
<blockquote>For each given system header file header-file in the
blank-separated argument list that exists, define HAVE_header-file
(in all capitals). If action-if-found is given, it is additional
shell code to execute when one of the header files is found. You
can give it a value of ‘break’ to break out of the loop on the
first match. If action-if-not-found is given, it is executed when
one of the header files is not found. <br>
</blockquote>
AC_CHECK_MEMBERS (members, [action-if-found], [action-if-not-found],
[includes = ‘AC_INCLUDES_DEFAULT’])<br>
<blockquote>Check for the existence of each ‘aggregate.member’ of
members using the previous macro. When member belongs to
aggregate, define HAVE_aggregate_member (in all capitals, with
spaces and dots replaced by underscores). If action-if-found is
given, it is executed for each of the found members. If
action-if-not-found is given, it is executed for each of the
members that could not be found. <br>
</blockquote>
AC_CHECK_TYPES (types, [action-if-found], [action-if-not-found],
[includes = ‘AC_INCLUDES_DEFAULT’])<br>
<blockquote>For each type of the types that is defined, define
HAVE_type (in all capitals). Each type must follow the rules of
AC_CHECK_TYPE. If no includes are specified, the default includes
are used (see Default Includes). If action-if-found is given, it
is additional shell code to execute when one of the types is
found. If action-if-not-found is given, it is executed when one of
the types is not found. <br>
</blockquote>
And if none of the above does the job, one can write any short
program to be compiled:<br>
<br>
AC_COMPILE_IFELSE (input, [action-if-true], [action-if-false])<br>
<blockquote>Run the compiler and compilation flags of the current
language (see Language Choice) on the input, run the shell
commands action-if-true on success, action-if-false otherwise. The
input can be made by AC_LANG_PROGRAM and friends. <br>
</blockquote>
<br>
<br>
The AC_CHECK_[...] macros will add #define HAVE_[...] in config.h,
similar to:<br>
<blockquote><tt>#define HAVE_SYS_TYPES_H 1</tt><br>
</blockquote>
Can you provide a list of "things" to check? I can write it up, test
to see if it works the way I expect and you can then use the #define
it the code. If you need something other than the new #define in
config.h, let me know what that might be. It could be, for example,
to abort the configuration, or print a warning like "you asked for
[...], but it is not possible because [...] is not available.<br>
<br>
In the mean time, I'll get back to the libgbm v9 issue. I suppose
one part of the code can make do with <9 and another part needs
>=9. Seems ok. I need to spend some more time understanding this
module. I was surprised glamor_egl.c was not being compiled by the
makefile given I have all the prereqs.<br>
<br>
<br>
<br>
<br>
<br>
<br>
</body>
</html>