source:
branches/fc15-dev/server/common/patches/openafs-0002-Linux-Add-general-autoconf-macro-for-Linux-kernel.patch
@
1893
Last change on this file since 1893 was 1835, checked in by achernya, 13 years ago | |
---|---|
File size: 3.9 KB |
-
src/cf/linux-test1.m4
From 0b40abe79e44c98adbbd5adb80ac2f10e6d1316a Mon Sep 17 00:00:00 2001 From: Simon Wilkinson <sxw@inf.ed.ac.uk> Date: Tue, 27 Apr 2010 17:41:22 +0100 Subject: [PATCH 2/8] Linux: Add general autoconf macro for Linux kernel Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which takes a "checking" message, the autoconf variable to use to cache the results, headers and code to run, preprocessor variable to define, and a description of that variable. Reviewed-on: http://gerrit.openafs.org/1854 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org> (cherry picked from commit a89d6b029d059d01b8bbfc18b9ee6e3f5a964b85) Change-Id: I75c5efbf69b54e0f0b1aedcb157992e13c6a8aa7 [andersk@mit.edu: Remove reimplementation of existing check macros] Signed-off-by: Anders Kaseorg <andersk@mit.edu> Reviewed-on: http://gerrit.openafs.org/3993 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Russ Allbery <rra@stanford.edu> Reviewed-on: http://gerrit.openafs.org/4038 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org> --- src/cf/linux-test1.m4 | 28 ++++++++++++++++++---------- src/cf/linux-test4.m4 | 11 +++++------ 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 index 2da3bb8..3115cdb 100644
a b AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [ 85 85 CPPFLAGS="$save_CPPFLAGS" 86 86 AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)]) 87 87 88 dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define]) 89 AC_DEFUN([AC_CHECK_LINUX_BUILD], 90 [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl 91 AC_CACHE_CHECK([$1], [ac_linux_build], 92 [AC_TRY_KBUILD([$3], [$4], 93 AS_VAR_SET([ac_linux_build], [yes]), 94 AS_VAR_SET([ac_linux_build], [no])) 95 ]) 96 AS_IF([test AS_VAR_GET([ac_linux_build]) = yes], 97 [AC_DEFINE([$5],1,[$6])]) 98 ]) 99 88 100 dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes]) 89 101 AC_DEFUN([AC_CHECK_LINUX_STRUCT], 90 [AS_VAR_PUSHDEF([ac_linux_struct], [ac_cv_linux_struct_$1_has_$2])dnl 91 AC_CACHE_CHECK([for $2 in struct $1], [ac_linux_struct], 92 [AC_TRY_KBUILD([#include <linux/$3>], 93 [struct $1 _test; printk("%x\n", &_test.$2); ], 94 AS_VAR_SET([ac_linux_struct], [yes]), 95 AS_VAR_SET([ac_linux_struct], [no])) 96 ]) 97 AS_IF([test AS_VAR_GET([ac_linux_struct]) = yes], 98 [AC_DEFINE(AS_TR_CPP(STRUCT_$1_HAS_$2), 1, 99 [Define if kernel struct $1 has the $2 element])]) 102 [AC_CHECK_LINUX_BUILD([for $2 in struct $1], 103 [ac_cv_linux_struct_$1_has_$2], 104 [#include <linux/$3>], 105 [struct $1 _test; printk("%x\n", &_test.$2); ], 106 AS_TR_CPP(STRUCT_$1_HAS_$2), 107 [Define if kernel struct $1 has the $2 element]) 100 108 ]) -
src/cf/linux-test4.m4
diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 89fccf5..3f22f7a 100644
a b struct nameidata _nameidata; 675 675 676 676 677 677 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [ 678 AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata]) 679 AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [ 680 AC_TRY_KBUILD( 678 AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes a nameidata], 679 [ac_cv_linux_func_i_permission_takes_nameidata], 681 680 [#include <linux/fs.h> 682 681 #include <linux/namei.h>], 683 682 [struct inode _inode; 684 683 struct dentry _dentry; 685 684 struct nameidata _nameidata; 686 685 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);], 687 ac_cv_linux_func_i_permission_takes_nameidata=yes,688 ac_cv_linux_func_i_permission_takes_nameidata=no)])689 AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])686 [IOP_PERMISSION_TAKES_NAMEIDATA], 687 [define if your iops.permission takes a nameidata argument]) 688 ]) 690 689 691 690 692 691 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
Note: See TracBrowser
for help on using the repository browser.