0003-configure-add-cache-variable-for-Linux-proc-filesyst.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From bb5cc9cee1963362fe56b4fac65fed4912da4215 Mon Sep 17 00:00:00 2001
  2. From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  3. Date: Sat, 30 Jul 2016 22:30:01 +0200
  4. Subject: [PATCH] configure: add cache variable for Linux proc filesystem check
  5. When cross-compiling, whether the /proc filesystem is available in the
  6. build environment does not give any indication as to whether it will
  7. be available in the execution environment.
  8. This commit therefore adjust the AF_LINUX_PROCFS macro to use
  9. AC_CACHE_CHECK(), so that an ac_cv_linux_procfs variable can be
  10. preseeded in the environment to force the result of this check.
  11. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  12. ---
  13. aclocal.m4 | 15 +++++----------
  14. 1 file changed, 5 insertions(+), 10 deletions(-)
  15. diff --git a/aclocal.m4 b/aclocal.m4
  16. index 2115204..333699c 100644
  17. --- a/aclocal.m4
  18. +++ b/aclocal.m4
  19. @@ -80,16 +80,11 @@ dnl
  20. dnl Check for the Linux /proc filesystem
  21. dnl --------------------------------------------------------------------------
  22. AC_DEFUN(AF_LINUX_PROCFS,
  23. -[AC_MSG_CHECKING(for Linux proc filesystem)
  24. -if test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux"
  25. -then
  26. - linux_procfs=yes
  27. -else
  28. - linux_procfs=no
  29. -fi
  30. -AC_MSG_RESULT($linux_procfs)
  31. -if test $linux_procfs = yes
  32. -then
  33. +[AC_CACHE_CHECK([for Linux proc filesystem], [ac_cv_linux_procfs],
  34. + [ac_cv_linux_procfs=no
  35. + test "x`cat /proc/sys/kernel/ostype 2>&-`" = "xLinux" && ac_cv_linux_procfs=yes])
  36. + if test $ac_cv_linux_procfs = yes
  37. + then
  38. AC_DEFINE(HAVE_LINUX_PROCFS, 1,
  39. [Define if you have the Linux /proc filesystem.])
  40. fi])
  41. --
  42. 2.7.4