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"])