Abhay Raj Singh
2021-Jun-06 10:09 UTC
[Libguestfs] GSoC: Adding liburing dependency to libnbd
I think I can reuse the code below (libev part in configure.ac) and modify it for liburing, there is the libxml2 part that provides an option to disable libxml2 parts which I can reuse to provide similar behavior which is simpler the without headers and lib checks, I feel libev metho PKG_CHECK_MODULES([LIBEV], [libev], [ AC_SUBST([LIBEV_CFLAGS]) AC_SUBST([LIBEV_LIBS]) ],[ dnl no pkg-config for libev, searching manually: AC_CHECK_HEADERS([ev.h], [ AC_CHECK_LIB([ev], [ev_time], [ AC_SUBST([LIBEV_LIBS], ["-lev"]) ], [ AC_MSG_WARN([libev not found, some examples will not be compiled]) ]) ],[ AC_MSG_WARN([ev.h not found, some examples will not be compiled]) ]) ]) AS_IF([test "x$LIBEV_LIBS" != "x"], [ old_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $LIBEV_CFLAGS -Werror=strict-aliasing -O2" AC_MSG_CHECKING([if the compiler is new enough for good aliasing rules]) AC_COMPILE_IFELSE([ AC_LANG_PROGRAM([ #include <ev.h> static void cb (struct ev_loop *l, ev_timer *t, int e) { } static ev_timer timer; ], [ ev_timer_init (&timer, cb, 0, .1); ]) ], [ AC_MSG_RESULT([yes]) ], [ AC_MSG_RESULT([no]) LIBEV_CFLAGS="$LIBEV_CFLAGS -Wno-strict-aliasing" ]) CFLAGS="$old_CFLAGS" ]) AM_CONDITIONAL([HAVE_LIBEV], [test "x$LIBEV_LIBS" != "x"]) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20210606/5e0d6be9/attachment.htm>
Abhay Raj Singh
2021-Jun-06 14:56 UTC
[Libguestfs] GSoC: Adding liburing dependency to libnbd
I went with libxml2 like for now GitLab commit: https://gitlab.com/rathod-sahaab/libnbd/-/commit/e9b90859c0a286d7023efd40080b4d88c978d083 AC_ARG_WITH([liburing], [AS_HELP_STRING([--without-liburing], [disable use of liburing i.e. io_uring for asynchronus io @<:@default=check@:>@])], [], [with_liburing=check]) AS_IF([test "$with_liburing" != "no"],[ PKG_CHECK_MODULES([LIBURING], [liburing], [ AC_SUBST([LIBURING_CFLAGS]) AC_SUBST([LIBURING_LIBS]) AC_DEFINE([HAVE_LIBURING],[1],[liburing found at compile time.]) ], [ AC_MSG_WARN([liburing not found, io_uring support disabled.]) ]) ]) AM_CONDITIONAL([HAVE_LIBURING], [test "x$LIBURING_LIBS" != "x"]) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://listman.redhat.com/archives/libguestfs/attachments/20210606/720ccc1f/attachment.htm>