2001-03-21 23:11:49 +00:00
|
|
|
dnl AC_SYS_PROCFS
|
|
|
|
dnl This macro defines HAVE_PROCFS if either it finds a mounted /proc
|
|
|
|
dnl or the user explicitly enables it for cross-compiles.
|
|
|
|
AC_DEFUN(AC_SYS_PROCFS,
|
2002-05-02 15:17:54 +00:00
|
|
|
[ AC_ARG_ENABLE(procfs,
|
2001-03-21 23:11:49 +00:00
|
|
|
[ --enable-procfs Use /proc filesystem (default)],
|
|
|
|
enable_procfs="$enableval", if test "$cross_compiling" = yes; then enable_procfs=cross; else enable_procfs=yes; fi;)
|
|
|
|
|
|
|
|
AC_CACHE_CHECK([kernel support for /proc filesystem], ac_cv_sys_procfs,
|
|
|
|
[if test "$enable_procfs" = yes; then
|
2002-05-02 15:17:54 +00:00
|
|
|
# Suggested change for the following line was
|
|
|
|
# if test -d /proc/0; then
|
|
|
|
# but it doesn't work on my linux - /proc/0 does not exist, but /proc
|
|
|
|
# works fine
|
2003-07-26 06:48:44 +00:00
|
|
|
if (mount | grep 'proc' >/dev/null 2>/dev/null); then
|
2001-03-21 23:11:49 +00:00
|
|
|
ac_cv_sys_procfs=yes
|
|
|
|
else
|
|
|
|
ac_cv_sys_procfs=no
|
|
|
|
fi
|
2003-08-29 15:15:32 +00:00
|
|
|
case "$target_os" in
|
|
|
|
# Solaris has proc, but it is not readable
|
|
|
|
solaris*) ac_cv_sys_procfs=no;;
|
2003-10-01 03:55:35 +00:00
|
|
|
irix*) ac_cv_sys_procfs=no;;
|
|
|
|
# Cygwin does have proc, but it does not show with mount
|
|
|
|
cygwin*) ac_cv_sys_procfs=yes;;
|
2003-08-29 15:15:32 +00:00
|
|
|
esac
|
2001-03-21 23:11:49 +00:00
|
|
|
elif test "$enable_procfs" = cross; then
|
|
|
|
AC_MSG_WARN(Pass --enable-procfs argument to enable use of /proc filesystem.)
|
2002-05-02 15:17:54 +00:00
|
|
|
else
|
|
|
|
ac_cv_sys_procfs=no
|
2001-03-21 23:11:49 +00:00
|
|
|
fi])
|
|
|
|
|
|
|
|
if test $ac_cv_sys_procfs = yes; then
|
|
|
|
AC_DEFINE(HAVE_PROCFS, 1, [Define if system supports the /proc filesystem])
|
|
|
|
fi
|
|
|
|
]
|
|
|
|
)
|