* [PATCH, request-for-review] Update CTF's ctf_dict_t detection
@ 2023-01-16 9:11 Dodji Seketeli
2023-01-16 16:35 ` Guillermo E. Martinez
0 siblings, 1 reply; 3+ messages in thread
From: Dodji Seketeli @ 2023-01-16 9:11 UTC (permalink / raw)
To: Guillermo E. Martinez; +Cc: libabigail
Hello,
As ctf_dict_t can be an opaque type depending on the version of
ctf-api.h, using AC_CHECK_TYPE won't work to detect it because that
macro invokes sizeof(ctf_dict_t).
With this change, we don't require that ctf_dict_t be fully defined.
* configure.ac: Use AC_COMPILE_IFELSE to try and compile a code
snippet that doesn't need that ctf_dict_t be fully defined.
Would this be OK to commit?
Thanks.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
configure.ac | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index d19c2f96..4d214b1c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -334,11 +334,12 @@ if test x$ENABLE_CTF != xno; then
fi
if test x$LIBCTF = xyes; then
- dnl Test if struct btf_enum64 is present.
- AC_CHECK_TYPE([struct ctf_dict_t],
- [HAVE_CTF_DICT_T=yes],
- [HAVE_CTF_DICT_T=no],
- [#include <ctf-api.h>])
+ dnl Test if struct struct ctf_dict_t is present.
+ AC_LANG(C++)
+ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <ctf-api.h>
+ ctf_dict_t* c;]])],
+ [HAVE_CTF_DICT_T=yes],
+ [HAVE_CTF_DICT_T=no])
if test x$HAVE_CTF_DICT_T = xyes; then
AC_DEFINE([HAVE_CTF_DICT_T], 1, [struct ctf_dict_t is present])
--
2.31.1
--
Dodji
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, request-for-review] Update CTF's ctf_dict_t detection
2023-01-16 9:11 [PATCH, request-for-review] Update CTF's ctf_dict_t detection Dodji Seketeli
@ 2023-01-16 16:35 ` Guillermo E. Martinez
2023-01-16 17:42 ` Dodji Seketeli
0 siblings, 1 reply; 3+ messages in thread
From: Guillermo E. Martinez @ 2023-01-16 16:35 UTC (permalink / raw)
To: Dodji Seketeli; +Cc: libabigail
On Mon, Jan 16, 2023 at 10:11:08AM +0100, Dodji Seketeli wrote:
> Hello,
>
> As ctf_dict_t can be an opaque type depending on the version of
> ctf-api.h, using AC_CHECK_TYPE won't work to detect it because that
> macro invokes sizeof(ctf_dict_t).
>
> With this change, we don't require that ctf_dict_t be fully defined.
>
> * configure.ac: Use AC_COMPILE_IFELSE to try and compile a code
> snippet that doesn't need that ctf_dict_t be fully defined.
>
> Would this be OK to commit?
It LGTM. I tested it, dependencies to enable CTF are detected by
`configure' script.
> Thanks.
>
Thanks!
> Signed-off-by: Dodji Seketeli <dodji@redhat.com>
> ---
> configure.ac | 11 ++++++-----
> [...]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH, request-for-review] Update CTF's ctf_dict_t detection
2023-01-16 16:35 ` Guillermo E. Martinez
@ 2023-01-16 17:42 ` Dodji Seketeli
0 siblings, 0 replies; 3+ messages in thread
From: Dodji Seketeli @ 2023-01-16 17:42 UTC (permalink / raw)
To: Guillermo E. Martinez via Libabigail
Cc: Dodji Seketeli, Guillermo E. Martinez
Hello,
"Guillermo E. Martinez via Libabigail" <libabigail@sourceware.org> a
écrit:
>> Would this be OK to commit?
>
> It LGTM. I tested it, dependencies to enable CTF are detected by
> `configure' script.
I have applied it to the master branch of the git repository.
Thanks!
[...]
Cheers,
--
Dodji
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-16 17:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-16 9:11 [PATCH, request-for-review] Update CTF's ctf_dict_t detection Dodji Seketeli
2023-01-16 16:35 ` Guillermo E. Martinez
2023-01-16 17:42 ` Dodji Seketeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).