1 |
dnl AC_SYS_PROCFS |
2 |
dnl This macro defines HAVE_PROCFS if either it finds a mounted /proc |
3 |
dnl or the user explicitly enables it for cross-compiles. |
4 |
AC_DEFUN(AC_SYS_PROCFS, |
5 |
[ AC_ARG_ENABLE(procfs, |
6 |
[ --enable-procfs Use /proc filesystem (default)], |
7 |
enable_procfs="$enableval", if test "$cross_compiling" = yes; then enable_procfs=cross; else enable_procfs=yes; fi;) |
8 |
|
9 |
AC_CACHE_CHECK([kernel support for /proc filesystem], ac_cv_sys_procfs, |
10 |
[if test "$enable_procfs" = yes; then |
11 |
# Suggested change for the following line was |
12 |
# if test -d /proc/0; then |
13 |
# but it doesn't work on my linux - /proc/0 does not exist, but /proc |
14 |
# works fine |
15 |
if (mount | grep 'proc' >/dev/null 2>/dev/null); then |
16 |
ac_cv_sys_procfs=yes |
17 |
else |
18 |
ac_cv_sys_procfs=no |
19 |
fi |
20 |
case "$target_os" in |
21 |
# Solaris has proc, but it is not readable |
22 |
solaris*) ac_cv_sys_procfs=no;; |
23 |
irix*) ac_cv_sys_procfs=no;; |
24 |
# Cygwin does have proc, but it does not show with mount |
25 |
cygwin*) ac_cv_sys_procfs=yes;; |
26 |
esac |
27 |
elif test "$enable_procfs" = cross; then |
28 |
AC_MSG_WARN(Pass --enable-procfs argument to enable use of /proc filesystem.) |
29 |
else |
30 |
ac_cv_sys_procfs=no |
31 |
fi]) |
32 |
|
33 |
if test $ac_cv_sys_procfs = yes; then |
34 |
AC_DEFINE(HAVE_PROCFS, 1, [Define if system supports the /proc filesystem]) |
35 |
fi |
36 |
] |
37 |
) |