[PATCH 15/37] autofs-5.1.2 - configure: add cache variable for Linux proc filesystem check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Thomas Petazzoni <thomas.petazzoni@xxxxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Ian Kent <raven@xxxxxxxxxx>
---
 CHANGELOG  |    1 +
 aclocal.m4 |   15 +++++----------
 configure  |   16 ++++++++--------
 3 files changed, 14 insertions(+), 18 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 5fcd123..ec1812a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -14,6 +14,7 @@ xx/xx/2016 autofs-5.1.3
 - Fix fgets(3) size argument (another one).
 - fix short memory allocation in lookup_amd_instance().
 - fix count_mounts() function.
+- configure: add cache variable for Linux proc filesystem check.
 
 15/06/2016 autofs-5.1.2
 =======================
diff --git a/aclocal.m4 b/aclocal.m4
index fe949a2..00811e0 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])
diff --git a/configure b/configure
index 5a05fe1..8467582 100755
--- a/configure
+++ b/configure
@@ -2194,16 +2194,16 @@ $as_echo "$searchpath" >&6; }
 #
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Linux proc filesystem" >&5
 $as_echo_n "checking for Linux proc filesystem... " >&6; }
-if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux"
-then
-	linux_procfs=yes
+if ${ac_cv_linux_procfs+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-	linux_procfs=no
+  ac_cv_linux_procfs=no
+	 test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" && ac_cv_linux_procfs=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $linux_procfs" >&5
-$as_echo "$linux_procfs" >&6; }
-if test $linux_procfs = yes
-then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_linux_procfs" >&5
+$as_echo "$ac_cv_linux_procfs" >&6; }
+ if test $ac_cv_linux_procfs = yes
+ then
 
 $as_echo "#define HAVE_LINUX_PROCFS 1" >>confdefs.h
 

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



[Index of Archives]     [Linux Filesystem Development]     [Linux Ext4]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux