summaryrefslogtreecommitdiff
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-11-28 23:24:39 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-11-28 23:24:39 +0000
commit69010992fb9c7c12a15e91ddb462514b98ded7d7 (patch)
treeffe14233a1cd0a1c6801b583cfc577e1bfc9ce11 /m4/acinclude.m4
parentf6f198a025a591f12f7bfdf0401c5f3d38177d35 (diff)
downloadATCD-69010992fb9c7c12a15e91ddb462514b98ded7d7.tar.gz
ChangeLogTag:Sun Nov 28 17:06:00 1999 Ossama Othman <othman@cs.wustl.edu>
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m4137
1 files changed, 136 insertions, 1 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index 76d4847fa5e..3ae6fd35f1e 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -92,9 +92,13 @@ AC_DEFUN(ACE_USE_TEMP_FILE, dnl
[
if test -f ${srcdir}/$1; then
mv ${srcdir}/$1 ${srcdir}/$1.conf
+ touch ${srcdir}/$1
fi
- touch ${srcdir}/$1
+ if test -f ./$1; then
+ mv ./$1 ./$1.conf
+ touch ./$1
+ fi
$2
@@ -103,6 +107,12 @@ AC_DEFUN(ACE_USE_TEMP_FILE, dnl
else
rm ${srcdir}/$1
fi
+
+ if test -f ./$1.conf; then
+ mv ./$1.conf ./$1
+ else
+ rm ./$1
+ fi
])
dnl Run given test(s) with warnings converted to errors
@@ -376,6 +386,92 @@ EOF
])
+dnl Check if getrlimit() takes an enum as 1st argument
+dnl Usage: ACE_CHECK_SETRLIMIT_ENUM
+AC_DEFUN(ACE_CHECK_SETRLIMIT_ENUM, dnl
+[
+if test "$ac_cv_func_setrlimit" = yes; then
+ AC_MSG_CHECKING([if setrlimit() takes an enum as 1st argument])
+ AC_EGREP_HEADER([setrlimit.*\(.*[^,]*enum], sys/resource.h,
+ [
+ cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <sys/resource.h>
+EOF
+
+changequote(, )dnl
+dnl Here we attempt to determine the type of the first argument of
+dnl getrusage from its prototype. It should either be an int or an
+dnl enum. If it is an enum, determine the enum type.
+ ace_setrlimit_enum=`eval "$ac_cpp conftest.$ac_ext" | \
+ egrep 'setrlimit.*\(.*[^,]*enum' | \
+ sed -e 's/^.*setrlimit.*(.*enum//' -e 's/[^ ]*,.*$//'`
+changequote([, ])dnl
+
+ ace_setrlimit_enum="enum $ace_setrlimit_enum"
+
+ AC_MSG_RESULT([$ace_setrlimit_enum])
+
+if test -n "$ace_setrlimit_enum"; then
+ AC_DEFINE_UNQUOTED(ACE_HAS_RLIMIT_RESOURCE_ENUM, $ace_setrlimit_enum)
+fi
+
+ rm -rf conftest*
+
+dnl Do not remove this parenthesis --> )
+dnl It's only purpose to keep Emacs from getting confused about mismatched
+dnl parentheses.
+ ],
+ [
+ AC_MSG_RESULT([no])
+ ])
+
+fi dnl test "$ac_cv_func_setrlimit" = yes
+])
+
+dnl Check if getrusage() takes an enum as 1st argument
+dnl Usage: ACE_CHECK_GETRUSAGE_ENUM
+AC_DEFUN(ACE_CHECK_GETRUSAGE_ENUM, dnl
+[
+if test "$ac_cv_func_getrusage" = yes; then
+ AC_MSG_CHECKING([if getrusage() takes an enum as 1st argument])
+ AC_EGREP_HEADER([getrusage.*\(.*[^,]*enum], sys/resource.h,
+ [
+ cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <sys/resource.h>
+EOF
+
+changequote(, )dnl
+dnl Here we attempt to determine the type of the first argument of
+dnl getrusage from its prototype. It should either be an int or an
+dnl enum. If it is an enum, determine the enum type.
+ ace_rusage_who=`eval "$ac_cpp conftest.$ac_ext" | \
+ egrep 'getrusage.*\(.*[^,]*enum' | \
+ sed -e 's/^.*getrusage.*(.*enum//' -e 's/[^ ]*,.*$//'`
+changequote([, ])dnl
+
+ ace_rusage_who="enum $ace_rusage_who"
+
+ AC_MSG_RESULT([$ace_rusage_who])
+
+if test -n "$ace_rusage_who"; then
+ AC_DEFINE_UNQUOTED(ACE_HAS_RUSAGE_WHO_ENUM, $ace_rusage_who)
+fi
+
+ rm -rf conftest*
+
+dnl Do not remove this parenthesis --> )
+dnl It's only purpose to keep Emacs from getting confused about mismatched
+dnl parentheses.
+ ],
+ [
+ AC_MSG_RESULT([no])
+ ])
+
+fi dnl test "$ac_cv_func_getrusage" = yes
+])
+
dnl checks for structures
dnl checks for system services
@@ -511,3 +607,42 @@ $1();
#endif
],[$2],[$3])
])
+
+AC_DEFUN(ACE_SYS_RESTARTABLE_SYSCALLS,
+[AC_REQUIRE([AC_HEADER_SYS_WAIT])
+AC_CHECK_HEADERS(unistd.h)
+AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls,
+[AC_TRY_RUN(
+[/* Exit 0 (true) if wait returns something other than -1,
+ i.e. the pid of the child, which means that wait was restarted
+ after getting the signal. */
+#include <sys/types.h>
+#include <signal.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+/* Some platforms explicitly require an extern "C" signal handler
+ when using C++. */
+#ifdef __cplusplus
+extern "C"
+#endif
+void ucatch (int) { }
+
+main () {
+ int i = fork (), status;
+ if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); }
+ signal (SIGINT, ucatch);
+ status = wait(&i);
+ if (status == -1) wait(&i);
+ exit (status == -1);
+}
+], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)])
+if test $ac_cv_sys_restartable_syscalls = yes; then
+ AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS)
+fi
+])
+