libs-base/config/procfs.m4
Jonathan Gapen 285d35f3e9 Split autoconf macros out of aclocal.m4
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9470 72102866-910b-0410-8b05-ffd578937521
2001-03-21 23:11:49 +00:00

26 lines
1,001 B
Text

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,
[ AC_ARG_WITH(enable_procfs,
[ --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
dnl Check whether /proc is mounted and readable by checking the entry
dnl for process number 1, which every system should have.
if test -d /proc/1; then
ac_cv_sys_procfs=yes
else
ac_cv_sys_procfs=no
fi
elif test "$enable_procfs" = cross; then
AC_MSG_WARN(Pass --enable-procfs argument to enable use of /proc filesystem.)
fi])
if test $ac_cv_sys_procfs = yes; then
AC_DEFINE(HAVE_PROCFS, 1, [Define if system supports the /proc filesystem])
fi
]
)