Skip to content

Commit a7fc8fc

Browse files
tuhaihebaobao0206
authored andcommitted
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 118c86c commit a7fc8fc

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

configure

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

98579857
fi
98589858

9859+
# Check liburing
9860+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for io_uring_queue_init in -luring" >&5
9861+
$as_echo_n "checking for io_uring_queue_init in -luring... " >&6; }
9862+
if ${ac_cv_lib_uring_io_uring_queue_init+:} false; then :
9863+
$as_echo_n "(cached) " >&6
9864+
else
9865+
ac_check_lib_save_LIBS=$LIBS
9866+
LIBS="-luring $LIBS"
9867+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
9868+
/* end confdefs.h. */
9869+
9870+
/* Override any GCC internal prototype to avoid an error.
9871+
Use char because int might match the return type of a GCC
9872+
builtin and then its argument prototype would still apply. */
9873+
#ifdef __cplusplus
9874+
extern "C"
9875+
#endif
9876+
char io_uring_queue_init ();
9877+
int
9878+
main ()
9879+
{
9880+
return io_uring_queue_init ();
9881+
;
9882+
return 0;
9883+
}
9884+
_ACEOF
9885+
if ac_fn_c_try_link "$LINENO"; then :
9886+
ac_cv_lib_uring_io_uring_queue_init=yes
9887+
else
9888+
ac_cv_lib_uring_io_uring_queue_init=no
9889+
fi
9890+
rm -f core conftest.err conftest.$ac_objext \
9891+
conftest$ac_exeext conftest.$ac_ext
9892+
LIBS=$ac_check_lib_save_LIBS
9893+
fi
9894+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uring_io_uring_queue_init" >&5
9895+
$as_echo "$ac_cv_lib_uring_io_uring_queue_init" >&6; }
9896+
if test "x$ac_cv_lib_uring_io_uring_queue_init" = xyes; then :
9897+
cat >>confdefs.h <<_ACEOF
9898+
#define HAVE_LIBURING 1
9899+
_ACEOF
9900+
9901+
LIBS="-luring $LIBS"
9902+
9903+
else
9904+
as_fn_error $? "library 'uring' is required for PAX support" "$LINENO" 5
9905+
fi
9906+
9907+
98599908
# Check cmake >= 3.11.0 using AX_COMPARE_VERSION
98609909
# Extract the first word of "cmake", so it can be a program name with args.
98619910
set dummy cmake; ac_word=$2

configure.ac

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

1038+
# Check liburing
1039+
AC_CHECK_LIB(uring, io_uring_queue_init, [],
1040+
[AC_MSG_ERROR([library 'uring' is required for PAX support])])
1041+
10381042
# Check cmake >= 3.11.0 using AX_COMPARE_VERSION
10391043
AC_PATH_PROG([CMAKE], [cmake], [no])
10401044
if test "$CMAKE" = "no"; then

0 commit comments

Comments
 (0)