[1835] | 1 | From 644c2853a171a3853bdb2d084287ff2e02dbca4f Mon Sep 17 00:00:00 2001 |
---|
| 2 | From: Marc Dionne <marc.c.dionne@gmail.com> |
---|
| 3 | Date: Fri, 28 Jan 2011 19:03:39 -0500 |
---|
| 4 | Subject: [PATCH 3/8] Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD |
---|
| 5 | |
---|
| 6 | Some linux autoconf tests require particular compile flags such as |
---|
| 7 | -Werror. Add a parameter to the AC_CHECK_LINUX_BUILD macro that |
---|
| 8 | lets the caller pass in any needed special flags. |
---|
| 9 | |
---|
| 10 | Reviewed-on: http://gerrit.openafs.org/3769 |
---|
| 11 | Tested-by: BuildBot <buildbot@rampaginggeek.com> |
---|
| 12 | Reviewed-by: Derrick Brashear <shadow@dementia.org> |
---|
| 13 | (cherry picked from commit ca38c9546e323b59189670b80740510fb9ec5269) |
---|
| 14 | |
---|
| 15 | Change-Id: If4daa7b1202e30046d22bda5eca6b191130945ea |
---|
| 16 | [andersk@mit.edu: Remove modifications of existing tests] |
---|
| 17 | Signed-off-by: Anders Kaseorg <andersk@mit.edu> |
---|
| 18 | Reviewed-on: http://gerrit.openafs.org/3996 |
---|
| 19 | Tested-by: BuildBot <buildbot@rampaginggeek.com> |
---|
| 20 | Reviewed-by: Russ Allbery <rra@stanford.edu> |
---|
| 21 | Reviewed-on: http://gerrit.openafs.org/4039 |
---|
| 22 | Reviewed-by: Derrick Brashear <shadow@dementia.org> |
---|
| 23 | Tested-by: Derrick Brashear <shadow@dementia.org> |
---|
| 24 | --- |
---|
| 25 | src/cf/linux-test1.m4 | 7 +++++-- |
---|
| 26 | src/cf/linux-test4.m4 | 3 ++- |
---|
| 27 | 2 files changed, 7 insertions(+), 3 deletions(-) |
---|
| 28 | |
---|
| 29 | diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 |
---|
| 30 | index 3115cdb..97a520f 100644 |
---|
| 31 | --- a/src/cf/linux-test1.m4 |
---|
| 32 | +++ b/src/cf/linux-test1.m4 |
---|
| 33 | @@ -85,13 +85,16 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [ |
---|
| 34 | CPPFLAGS="$save_CPPFLAGS" |
---|
| 35 | AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)]) |
---|
| 36 | |
---|
| 37 | -dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define]) |
---|
| 38 | +dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define], [CFLAGS]) |
---|
| 39 | AC_DEFUN([AC_CHECK_LINUX_BUILD], |
---|
| 40 | [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl |
---|
| 41 | AC_CACHE_CHECK([$1], [ac_linux_build], |
---|
| 42 | - [AC_TRY_KBUILD([$3], [$4], |
---|
| 43 | + [save_CPPFLAGS="$CPPFLAGS" |
---|
| 44 | + CPPFLAGS="$CPPFLAGS $7" |
---|
| 45 | + AC_TRY_KBUILD([$3], [$4], |
---|
| 46 | AS_VAR_SET([ac_linux_build], [yes]), |
---|
| 47 | AS_VAR_SET([ac_linux_build], [no])) |
---|
| 48 | + CPPFLAGS="$save_CPPFLAGS" |
---|
| 49 | ]) |
---|
| 50 | AS_IF([test AS_VAR_GET([ac_linux_build]) = yes], |
---|
| 51 | [AC_DEFINE([$5],1,[$6])]) |
---|
| 52 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 |
---|
| 53 | index 3f22f7a..67ddf91 100644 |
---|
| 54 | --- a/src/cf/linux-test4.m4 |
---|
| 55 | +++ b/src/cf/linux-test4.m4 |
---|
| 56 | @@ -684,7 +684,8 @@ struct dentry _dentry; |
---|
| 57 | struct nameidata _nameidata; |
---|
| 58 | (void)_inode.i_op->permission(&_inode, 0, &_nameidata);], |
---|
| 59 | [IOP_PERMISSION_TAKES_NAMEIDATA], |
---|
| 60 | - [define if your iops.permission takes a nameidata argument]) |
---|
| 61 | + [define if your iops.permission takes a nameidata argument], |
---|
| 62 | + []) |
---|
| 63 | ]) |
---|
| 64 | |
---|
| 65 | |
---|
| 66 | -- |
---|
| 67 | 1.7.3.4 |
---|
| 68 | |
---|