autofs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Ian Kent <raven@themaw.net>
Cc: autofs@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Subject: [PATCH] configure: add cache variable for Linux proc filesystem check
Date: Sat, 30 Jul 2016 22:32:05 +0200	[thread overview]
Message-ID: <1469910725-11607-1-git-send-email-thomas.petazzoni@free-electrons.com> (raw)

When cross-compiling, whether the /proc filesystem is available in the
build environment does not give any indication as to whether it will
be available in the execution environment.

This commit therefore adjust the AF_LINUX_PROCFS macro to use
AC_CACHE_CHECK(), so that an ac_cv_linux_procfs variable can be
preseeded in the environment to force the result of this check.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 aclocal.m4 | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 2115204..333699c 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -80,16 +80,11 @@ dnl
 dnl Check for the Linux /proc filesystem
 dnl --------------------------------------------------------------------------
 AC_DEFUN(AF_LINUX_PROCFS,
-[AC_MSG_CHECKING(for Linux proc filesystem)
-if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux"
-then
-	linux_procfs=yes
-else
-	linux_procfs=no
-fi
-AC_MSG_RESULT($linux_procfs)
-if test $linux_procfs = yes
-then
+[AC_CACHE_CHECK([for Linux proc filesystem], [ac_cv_linux_procfs],
+	[ac_cv_linux_procfs=no
+	 test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" && ac_cv_linux_procfs=yes])
+ if test $ac_cv_linux_procfs = yes
+ then
 	AC_DEFINE(HAVE_LINUX_PROCFS, 1,
 		[Define if you have the Linux /proc filesystem.])
 fi])
-- 
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe autofs" in

                 reply	other threads:[~2016-07-30 20:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469910725-11607-1-git-send-email-thomas.petazzoni@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=autofs@vger.kernel.org \
    --cc=raven@themaw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).