1 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
3 [AC_REQUIRE([AC_TYPE_SIGNAL])
4 AC_MSG_CHECKING(for type of signal functions)
5 AC_CACHE_VAL(bash_cv_signal_vintage,
7 AC_TRY_LINK([#include <signal.h>],[
10 sigemptyset(&ss); sigsuspend(&ss);
11 sigaction(SIGINT, &sa, (struct sigaction *) 0);
12 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
13 ], bash_cv_signal_vintage=posix,
15 AC_TRY_LINK([#include <signal.h>], [
16 int mask = sigmask(SIGINT);
17 sigsetmask(mask); sigblock(mask); sigpause(mask);
18 ], bash_cv_signal_vintage=4.2bsd,
22 RETSIGTYPE foo() { }], [
23 int mask = sigmask(SIGINT);
24 sigset(SIGINT, foo); sigrelse(SIGINT);
25 sighold(SIGINT); sigpause(SIGINT);
26 ], bash_cv_signal_vintage=svr3, bash_cv_signal_vintage=v7
31 AC_MSG_RESULT($bash_cv_signal_vintage)
32 if test "$bash_cv_signal_vintage" = posix; then
33 AC_DEFINE(HAVE_POSIX_SIGNALS)
34 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
35 AC_DEFINE(HAVE_BSD_SIGNALS)
36 elif test "$bash_cv_signal_vintage" = svr3; then
37 AC_DEFINE(HAVE_USG_SIGHOLD)
41 AC_DEFUN(BA_CONDITIONAL,
53 AC_DEFUN(BA_CHECK_OPSYS,
56 if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
58 BA_CONDITIONAL(HAVE_SUN_OS, $TRUEPRG)
59 AC_DEFINE(HAVE_SUN_OS)
61 BA_CONDITIONAL(HAVE_SUN_OS, $FALSEPRG)
64 if test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
66 BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG)
67 AC_DEFINE(HAVE_OSF1_OS)
69 BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG)
72 if test $HAVE_UNAME=yes -a x`uname -s` = xAIX
74 BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG)
75 AC_DEFINE(HAVE_AIX_OS)
77 BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG)
80 if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
82 BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG)
83 AC_DEFINE(HAVE_HPUX_OS)
85 BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG)
88 if test $HAVE_UNAME=yes -a x`uname -s` = xLinux
90 BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG)
91 AC_DEFINE(HAVE_LINUX_OS)
93 BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
96 if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
98 BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
99 AC_DEFINE(HAVE_FREEBSD_OS)
101 BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG)
104 if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
106 BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG)
107 AC_DEFINE(HAVE_NETBSD_OS)
109 BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG)
112 if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
114 BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG)
115 AC_DEFINE(HAVE_OPENBSD_OS)
117 BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG)
120 if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
122 BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG)
123 AC_DEFINE(HAVE_BSDI_OS)
125 BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG)
128 if test $HAVE_UNAME=yes -a x`uname -s` = xSGI
130 BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG)
131 AC_DEFINE(HAVE_SGI_OS)
133 BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
136 if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
138 BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
139 AC_DEFINE(HAVE_IRIX_OS)
141 BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
144 if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
146 AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG)
147 AC_DEFINE(HAVE_DARWIN_OS)
149 AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG)
153 AC_DEFUN(BA_CHECK_OPSYS_DISTNAME,
154 [AC_MSG_CHECKING(for Operating System Distribution)
155 if test "x$DISTNAME" != "x"
157 echo "distname set to $DISTNAME"
158 elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
161 elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX
164 elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
167 elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
170 elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
173 elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
176 elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
179 elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
182 elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
185 elif test -f /etc/SuSE-release
188 elif test -d /etc/SuSEconfig
191 elif test -f /etc/mandrake-release
194 elif test -f /etc/whitebox-release
197 elif test -f /etc/redhat-release
200 elif test -f /etc/gentoo-release
203 elif test -f /etc/debian_version
206 elif test -f /etc/slackware-version
209 elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
212 elif test -f /etc/engarde-version
215 elif test "$CYGWIN" = yes
218 AC_DEFINE(HAVE_CYGWIN)