Skip to content

Commit 63a0c13

Browse files
committed
Add liburing dependency check for PAX storage
Add AC_CHECK_LIB check for liburing in the PAX dependency block to detect missing liburing-devel early during configure phase. PAX storage requires liburing for io_uring-based fast I/O. This check prevents unclear linker errors during compilation.
1 parent edfeb57 commit 63a0c13

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed

configure

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9463,6 +9463,55 @@ $as_echo "#define HAVE_ZSTD 1" >>confdefs.h
94639463

94649464
fi
94659465

9466+
# Check liburing
9467+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_uring_queue_init in -luring" >&5
9468+
$as_echo_n "checking for io_uring_queue_init in -luring... " >&6; }
9469+
if ${ac_cv_lib_uring_io_uring_queue_init+:} false; then :
9470+
$as_echo_n "(cached) " >&6
9471+
else
9472+
ac_check_lib_save_LIBS=$LIBS
9473+
LIBS="-luring $LIBS"
9474+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9475+
/* end confdefs.h. */
9476+
9477+
/* Override any GCC internal prototype to avoid an error.
9478+
Use char because int might match the return type of a GCC
9479+
builtin and then its argument prototype would still apply. */
9480+
#ifdef __cplusplus
9481+
extern "C"
9482+
#endif
9483+
char io_uring_queue_init ();
9484+
int
9485+
main ()
9486+
{
9487+
return io_uring_queue_init ();
9488+
;
9489+
return 0;
9490+
}
9491+
_ACEOF
9492+
if ac_fn_c_try_link "$LINENO"; then :
9493+
ac_cv_lib_uring_io_uring_queue_init=yes
9494+
else
9495+
ac_cv_lib_uring_io_uring_queue_init=no
9496+
fi
9497+
rm -f core conftest.err conftest.$ac_objext \
9498+
conftest$ac_exeext conftest.$ac_ext
9499+
LIBS=$ac_check_lib_save_LIBS
9500+
fi
9501+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uring_io_uring_queue_init" >&5
9502+
$as_echo "$ac_cv_lib_uring_io_uring_queue_init" >&6; }
9503+
if test "x$ac_cv_lib_uring_io_uring_queue_init" = xyes; then :
9504+
cat >>confdefs.h <<_ACEOF
9505+
#define HAVE_LIBURING 1
9506+
_ACEOF
9507+
9508+
LIBS="-luring $LIBS"
9509+
9510+
else
9511+
as_fn_error $? "library 'uring' is required for PAX support" "$LINENO" 5
9512+
fi
9513+
9514+
94669515
# Check cmake >= 3.11.0 using AX_COMPARE_VERSION
94679516
# Extract the first word of "cmake", so it can be a program name with args.
94689517
set dummy cmake; ac_word=$2

configure.ac

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,10 @@ if test "$enable_pax" = yes; then
972972
[AC_MSG_ERROR([libzstd >= 1.4.0 is required for PAX support])]
973973
)
974974

975+
# Check liburing
976+
AC_CHECK_LIB(uring, io_uring_queue_init, [],
977+
[AC_MSG_ERROR([library 'uring' is required for PAX support])])
978+
975979
# Check cmake >= 3.11.0 using AX_COMPARE_VERSION
976980
AC_PATH_PROG([CMAKE], [cmake], [no])
977981
if test "$CMAKE" = "no"; then

0 commit comments

Comments
 (0)