From: Marc Dionne Date: Sat, 29 Jan 2011 00:03:39 +0000 (-0500) Subject: Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD X-Git-Tag: debian/1.4.14+dfsg-2~13 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=bd7c63deeb897ab28fee0cf8fc7f841fb20d5fb5;p=packages%2Fo%2Fopenafs.git Linux: allow compile flags to be passed to AC_CHECK_LINUX_BUILD Some linux autoconf tests require particular compile flags such as -Werror. Add a parameter to the AC_CHECK_LINUX_BUILD macro that lets the caller pass in any needed special flags. Reviewed-on: http://gerrit.openafs.org/3769 Tested-by: BuildBot Reviewed-by: Derrick Brashear (cherry picked from commit ca38c9546e323b59189670b80740510fb9ec5269) Change-Id: I8798e103b2aff77b87684b7fce56c730f0a74b8b [andersk@mit.edu: Remove modifications of existing tests] Signed-off-by: Anders Kaseorg Reviewed-on: http://gerrit.openafs.org/3996 Tested-by: BuildBot Reviewed-by: Russ Allbery (cherry picked from commit a9ca625ba761d28a54bf817438cb9d42eb421672) --- diff --git a/src/cf/linux-test1.m4 b/src/cf/linux-test1.m4 index 3115cdb65..97a520fd5 100644 --- a/src/cf/linux-test1.m4 +++ b/src/cf/linux-test1.m4 @@ -85,13 +85,16 @@ AC_DEFUN([LINUX_KBUILD_USES_EXTRA_CFLAGS], [ CPPFLAGS="$save_CPPFLAGS" AC_MSG_RESULT($ac_linux_kbuild_requires_extra_cflags)]) -dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define]) +dnl AC_CHECK_LINUX_BUILD([msg], [var], [includes], [code], [define], [CFLAGS]) AC_DEFUN([AC_CHECK_LINUX_BUILD], [AS_VAR_PUSHDEF([ac_linux_build], [$2])dnl AC_CACHE_CHECK([$1], [ac_linux_build], - [AC_TRY_KBUILD([$3], [$4], + [save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $7" + AC_TRY_KBUILD([$3], [$4], AS_VAR_SET([ac_linux_build], [yes]), AS_VAR_SET([ac_linux_build], [no])) + CPPFLAGS="$save_CPPFLAGS" ]) AS_IF([test AS_VAR_GET([ac_linux_build]) = yes], [AC_DEFINE([$5],1,[$6])]) diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 3f22f7a0d..67ddf913f 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -684,7 +684,8 @@ struct dentry _dentry; struct nameidata _nameidata; (void)_inode.i_op->permission(&_inode, 0, &_nameidata);], [IOP_PERMISSION_TAKES_NAMEIDATA], - [define if your iops.permission takes a nameidata argument]) + [define if your iops.permission takes a nameidata argument], + []) ])