autoconf: add AC_CHECK_LINUX_TYPE macro
authorAndrew Deason <adeason@sinenomine.net>
Thu, 30 Aug 2012 12:06:33 +0000 (08:06 -0400)
committerDerrick Brashear <shadow@dementix.org>
Thu, 30 Aug 2012 16:01:06 +0000 (09:01 -0700)
add a macro which looks for a given type in a given linux kernel
header file

Change-Id: Id3b0bcf65241c635f0109ed370b3079da8cd5656
Reviewed-on: http://gerrit.openafs.org/8021
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Marc Dionne <marc.c.dionne@gmail.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>

src/cf/linux-test1.m4

index 51238cd..4e799e2 100644 (file)
@@ -125,6 +125,16 @@ AC_DEFUN([AC_CHECK_LINUX_FUNC],
                   [Define if your kernel has the $1 function])])
  ])
 
+dnl AC_CHECK_LINUX_TYPE([type], [includes])
+AC_DEFUN([AC_CHECK_LINUX_TYPE],
+ [AC_CHECK_LINUX_BUILD([for $1],
+                       [ac_cv_linux_type_$1_exists],
+                       [#include <linux/$2>],
+                       [$1 _test; ],
+                       AS_TR_CPP(HAVE_LINUX_$1),
+                       [Define if kernel defines $1])
+ ])
+
 dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes])
 AC_DEFUN([AC_CHECK_LINUX_STRUCT],
  [AC_CHECK_LINUX_TYPED_STRUCT([struct $1], [$2], [$3])