source: branches/fc15-dev/server/common/patches/openafs-0002-Linux-Add-general-autoconf-macro-for-Linux-kernel.patch @ 1878

Last change on this file since 1878 was 1835, checked in by achernya, 13 years ago
OpenAFS builds on F15 Get OpenAFS to build on F15, using the cherry-picked patches.
File size: 3.9 KB
RevLine 
[1835]1From 0b40abe79e44c98adbbd5adb80ac2f10e6d1316a Mon Sep 17 00:00:00 2001
2From: Simon Wilkinson <sxw@inf.ed.ac.uk>
3Date: Tue, 27 Apr 2010 17:41:22 +0100
4Subject: [PATCH 2/8] Linux: Add general autoconf macro for Linux kernel
5
6Add AC_CHECK_LINUX_BUILD() to do a standardised Linux build, which
7takes a "checking" message, the autoconf variable to use to cache
8the results, headers and code to run, preprocessor variable to
9define, and a description of that variable.
10
11Reviewed-on: http://gerrit.openafs.org/1854
12Reviewed-by: Derrick Brashear <shadow@dementia.org>
13Tested-by: Derrick Brashear <shadow@dementia.org>
14(cherry picked from commit a89d6b029d059d01b8bbfc18b9ee6e3f5a964b85)
15
16Change-Id: I75c5efbf69b54e0f0b1aedcb157992e13c6a8aa7
17[andersk@mit.edu: Remove reimplementation of existing check macros]
18Signed-off-by: Anders Kaseorg <andersk@mit.edu>
19Reviewed-on: http://gerrit.openafs.org/3993
20Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
21Tested-by: BuildBot <buildbot@rampaginggeek.com>
22Reviewed-by: Russ Allbery <rra@stanford.edu>
23Reviewed-on: http://gerrit.openafs.org/4038
24Reviewed-by: Derrick Brashear <shadow@dementia.org>
25Tested-by: Derrick Brashear <shadow@dementia.org>
26---
27 src/cf/linux-test1.m4 |   28 ++++++++++++++++++----------
28 src/cf/linux-test4.m4 |   11 +++++------
29 2 files changed, 23 insertions(+), 16 deletions(-)
30
31diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4
32index 2da3bb8..3115cdb 100644
33--- a/src/cf/linux-test1.m4
34+++ b/src/cf/linux-test1.m4
35@@ -85,16 +85,24 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [
36     CPPFLAGS="$save_CPPFLAGS"
37     AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)])
38 
39+dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define])
40+AC_DEFUN([AC_CHECK_LINUX_BUILD],
41+ [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl
42+  AC_CACHE_CHECK([$1], [ac_linux_build],
43+   [AC_TRY_KBUILD([$3], [$4],
44+                 AS_VAR_SET([ac_linux_build], [yes]),
45+                 AS_VAR_SET([ac_linux_build], [no]))
46+   ])
47+  AS_IF([test AS_VAR_GET([ac_linux_build]) = yes],
48+        [AC_DEFINE([$5],1,[$6])])
49+ ])
50+
51 dnl AC_CHECK_LINUX_STRUCT([structure], [element], [includes])
52 AC_DEFUN([AC_CHECK_LINUX_STRUCT],
53- [AS_VAR_PUSHDEF([ac_linux_struct], [ac_cv_linux_struct_$1_has_$2])dnl
54-  AC_CACHE_CHECK([for $2 in struct $1], [ac_linux_struct],
55-   [AC_TRY_KBUILD([#include <linux/$3>],
56-                 [struct $1 _test; printk("%x\n", &_test.$2); ],
57-                 AS_VAR_SET([ac_linux_struct], [yes]),
58-                 AS_VAR_SET([ac_linux_struct], [no]))
59-   ])
60-  AS_IF([test AS_VAR_GET([ac_linux_struct]) = yes],
61-       [AC_DEFINE(AS_TR_CPP(STRUCT_$1_HAS_$2), 1,
62-                  [Define if kernel struct $1 has the $2 element])])
63+ [AC_CHECK_LINUX_BUILD([for $2 in struct $1],
64+                      [ac_cv_linux_struct_$1_has_$2],
65+                      [#include <linux/$3>],
66+                      [struct $1 _test; printk("%x\n", &_test.$2); ],
67+                      AS_TR_CPP(STRUCT_$1_HAS_$2),
68+                      [Define if kernel struct $1 has the $2 element])
69  ])
70diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4
71index 89fccf5..3f22f7a 100644
72--- a/src/cf/linux-test4.m4
73+++ b/src/cf/linux-test4.m4
74@@ -675,18 +675,17 @@ struct nameidata _nameidata;
75 
76 
77 AC_DEFUN([LINUX_IOP_I_PERMISSION_TAKES_NAMEIDATA], [
78-  AC_MSG_CHECKING([whether inode_operations.permission takes a nameidata])
79-  AC_CACHE_VAL([ac_cv_linux_func_i_permission_takes_nameidata], [
80-    AC_TRY_KBUILD(
81+  AC_CHECK_LINUX_BUILD([whether inode_operations.permission takes a nameidata],
82+                      [ac_cv_linux_func_i_permission_takes_nameidata],
83 [#include <linux/fs.h>
84 #include <linux/namei.h>],
85 [struct inode _inode;
86 struct dentry _dentry;
87 struct nameidata _nameidata;
88 (void)_inode.i_op->permission(&_inode, 0, &_nameidata);],
89-      ac_cv_linux_func_i_permission_takes_nameidata=yes,
90-      ac_cv_linux_func_i_permission_takes_nameidata=no)])
91-  AC_MSG_RESULT($ac_cv_linux_func_i_permission_takes_nameidata)])
92+                      [IOP_PERMISSION_TAKES_NAMEIDATA],
93+                      [define if your iops.permission takes a nameidata argument])
94+])
95 
96 
97 AC_DEFUN([LINUX_IOP_I_PUT_LINK_TAKES_COOKIE], [
98--
991.7.3.4
100
Note: See TracBrowser for help on using the repository browser.