]> git.ipfire.org Git - thirdparty/ipset.git/commitdiff
Compatibility: check kvcalloc, kvfree, kvzalloc in slab.h too
authorJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 7 Nov 2022 20:47:23 +0000 (21:47 +0100)
committerJozsef Kadlecsik <kadlec@netfilter.org>
Mon, 7 Nov 2022 20:47:23 +0000 (21:47 +0100)
configure.ac

index 1acc9762952779a2c800ae5d92cb30cd4c034de7..e1ff357bb3c2bc288be4f81e5232c075c19ea8f4 100644 (file)
@@ -443,6 +443,10 @@ if test -f $ksourcedir/include/linux/mm.h && \
    $GREP -q 'kvcalloc' $ksourcedir/include/linux/mm.h; then
        AC_MSG_RESULT(yes)
        AC_SUBST(HAVE_KVCALLOC, define)
+elif test -f $ksourcedir/include/linux/slab.h && \
+     $GREP -q 'kvcalloc' $ksourcedir/include/linux/slab.h; then
+       AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_KVCALLOC, define)
 else
        AC_MSG_RESULT(no)
        AC_SUBST(HAVE_KVCALLOC, undef)
@@ -453,6 +457,10 @@ if test -f $ksourcedir/include/linux/mm.h && \
    $GREP -q 'kvfree' $ksourcedir/include/linux/mm.h; then
        AC_MSG_RESULT(yes)
        AC_SUBST(HAVE_KVFREE, define)
+elif test -f $ksourcedir/include/linux/slab.h && \
+     $GREP -q 'kvfree' $ksourcedir/include/linux/slab.h; then
+       AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_KVFREE, define)
 else
        AC_MSG_RESULT(no)
        AC_SUBST(HAVE_KVFREE, undef)
@@ -837,11 +845,15 @@ else
        AC_SUBST(HAVE_NLMSG_UNICAST, undef)
 fi
 
-AC_MSG_CHECKING([kernel source for kvzalloc() in mm.h])
+AC_MSG_CHECKING([kernel source for kvzalloc() in mm.h and slab.h])
 if test -f $ksourcedir/include/linux/mm.h && \
    $GREP -q 'static inline void \*kvzalloc(' $ksourcedir/include/linux/mm.h; then
        AC_MSG_RESULT(yes)
        AC_SUBST(HAVE_KVZALLOC, define)
+elif test -f $ksourcedir/include/linux/slab.h && \
+   $GREP -q 'kvzalloc' $ksourcedir/include/linux/slab.h; then
+       AC_MSG_RESULT(yes)
+       AC_SUBST(HAVE_KVZALLOC, define)
 else
        AC_MSG_RESULT(no)
        AC_SUBST(HAVE_KVZALLOC, undef)