summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2005-09-09 20:47:29 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2005-09-09 20:47:29 +0000
commit590a4f3a553773d5804c3e9c4685ed52978fa171 (patch)
tree1c4a427a3f6e1ffb0f7a2f9145c21734ed681d4e
parent159fad8d3af38bf04a1fb2b0eb1ec15548852f43 (diff)
downloadcoreutils-590a4f3a553773d5804c3e9c4685ed52978fa171.tar.xz
(utils_cv_func_setpriority): Simplify the tests.
Define HAVE_NICE rather than NICE_PRIORITY (since a niceness is not a priority); all uses changed.
-rw-r--r--configure.ac39
1 files changed, 17 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index d0ef80bbe..bf2425f4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -114,29 +114,24 @@ if test $ac_cv_func_syslog = no; then
done
fi
-AC_MSG_CHECKING(for 3-argument setpriority function)
-AC_CACHE_VAL(utils_cv_func_setpriority,
-[AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <sys/time.h>
- #include <sys/resource.h>]], [[setpriority(0, 0, 0);]])],
- [utils_cv_func_setpriority=yes],
- [utils_cv_func_setpriority=no])])
-AC_MSG_RESULT($utils_cv_func_setpriority)
-if test $utils_cv_func_setpriority = yes; then
- OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
- MAN="$MAN nice.1"
-else
- AC_MSG_CHECKING(for nice function)
- AC_CACHE_VAL(utils_cv_func_nice,
- [AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[nice();]])],
- [utils_cv_func_nice=yes],
- [utils_cv_func_nice=no])])
- AC_MSG_RESULT($utils_cv_func_nice)
- if test $utils_cv_func_nice = yes; then
- AC_DEFINE(NICE_PRIORITY, 1, [FIXME])
- OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
- MAN="$MAN nice.1"
- fi
+AC_CACHE_CHECK([for 3-argument setpriority function],
+ [utils_cv_func_setpriority],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[#include <sys/time.h>
+ #include <sys/resource.h>
+ ]],
+ [[setpriority (0, 0, 0);]])],
+ [utils_cv_func_setpriority=yes],
+ [utils_cv_func_setpriority=no])])
+if test $utils_cv_func_setpriority = no; then
+ AC_CHECK_FUNCS([nice])
fi
+case $utils_cv_func_setpriority,$ac_cv_func_nice in
+*yes*)
+ OPTIONAL_BIN_PROGS="$OPTIONAL_BIN_PROGS nice\$(EXEEXT)"
+ MAN="$MAN nice.1";;
+esac
AC_DEFUN([coreutils_DUMMY_1],
[