1 dnl $MirOS: contrib/code/jupp/acinclude.m4,v 1.3 2008/05/13 13:08:20 tg Exp $
4 dnl Check for properly working isblank()
6 AC_DEFUN([joe_ISBLANK],
7 [AC_CACHE_CHECK([whether isblank() works correctly with side effect expressions],
21 if test "$joe_cv_isblank" = yes; then
22 AC_DEFINE([HAVE_WORKING_ISBLANK], 1, [Define if isblank() works with expressions with side effects])
26 dnl ------------------
27 dnl Check if setpgrp must have two arguments
28 dnl autoconf-own macro is damaged for *BSD systems
29 dnl ------------------
30 AC_DEFUN([joe_SETPGRP],
31 [AC_CACHE_CHECK([whether setpgrp() takes no arguments],
32 [joe_cv_setpgrp_void],
38 /* exit succesfully if setpgrp() takes two args (*BSD systems) */
39 exit(setpgrp(0, 0) != 0);
41 [joe_cv_setpgrp_void=no],
42 [joe_cv_setpgrp_void=yes],
43 [joe_cv_setpgrp_void=yes])
45 if test "$joe_cv_setpgrp_void" = yes; then
46 AC_DEFINE([SETPGRP_VOID], 1, [Define if setpgrp() takes no arguments])
50 dnl ------------------
51 dnl Check to see if signal handlers must be reinstalled when invoked
52 dnl ------------------
53 AC_DEFUN([joe_REINSTALL_SIGHANDLERS],
54 [AC_CACHE_CHECK([whether sighandlers must be reinstalled],
55 [joe_cv_reinstall_sighandlers],
64 #ifndef HAVE_SIGHANDLER_T
65 typedef RETSIGTYPE (*sighandler_t)(int);
70 void set_signal(int signum, sighandler_t handler) {
72 struct sigaction sact;
74 sact.sa_handler = handler;
76 sigemptyset(&sact.sa_mask);
77 sigaction(signum, &sact, NULL);
81 svec.sv_handler = handler;
83 sigemptyset(&svec.sv_mask);
84 sigvec(signum, &svec, NULL);
86 signal(signum, handler);
90 RETSIGTYPE sigint(int s) {
96 set_signal(SIGINT, sigint);
97 kill((int)getpid(), SIGINT);
98 kill((int)getpid(), SIGINT);
99 /* exit succesfully if don't have to reinstall sighandler when invoked */
102 [joe_cv_reinstall_sighandlers=no],
103 [joe_cv_reinstall_sighandlers=yes],
104 [joe_cv_reinstall_sighandlers=yes])
106 if test "$joe_cv_reinstall_sighandlers" = yes; then
107 AC_DEFINE([NEED_TO_REINSTALL_SIGNAL], 1, [Define if we have to reinstall signal handler when invoked])