1 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
3 AC_DEFUN([SIGNAL_CHECK],
4 [AC_REQUIRE([AC_TYPE_SIGNAL])
5 AC_MSG_CHECKING(for type of signal functions)
6 AC_CACHE_VAL(bash_cv_signal_vintage,
8 AC_TRY_LINK([#include <signal.h>],[
11 sigemptyset(&ss); sigsuspend(&ss);
12 sigaction(SIGINT, &sa, (struct sigaction *) 0);
13 sigprocmask(SIG_BLOCK, &ss, (sigset_t *) 0);
14 ], bash_cv_signal_vintage="posix",
16 AC_TRY_LINK([#include <signal.h>], [
17 int mask = sigmask(SIGINT);
18 sigsetmask(mask); sigblock(mask); sigpause(mask);
19 ], bash_cv_signal_vintage="4.2bsd",
23 RETSIGTYPE foo() { }], [
24 int mask = sigmask(SIGINT);
25 sigset(SIGINT, foo); sigrelse(SIGINT);
26 sighold(SIGINT); sigpause(SIGINT);
27 ], bash_cv_signal_vintage="svr3", bash_cv_signal_vintage="v7"
32 AC_MSG_RESULT($bash_cv_signal_vintage)
33 if test "$bash_cv_signal_vintage" = "posix"; then
34 AC_DEFINE(HAVE_POSIX_SIGNALS)
35 elif test "$bash_cv_signal_vintage" = "4.2bsd"; then
36 AC_DEFINE(HAVE_BSD_SIGNALS)
37 elif test "$bash_cv_signal_vintage" = "svr3"; then
38 AC_DEFINE(HAVE_USG_SIGHOLD)
42 AC_DEFUN([BA_CONDITIONAL],
54 AC_DEFUN([BA_CHECK_OPSYS],
57 if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
59 BA_CONDITIONAL(HAVE_SUN_OS, $TRUEPRG)
60 AC_DEFINE(HAVE_SUN_OS)
62 BA_CONDITIONAL(HAVE_SUN_OS, $FALSEPRG)
65 if test $HAVE_UNAME=yes -a x`uname -s` = xGNU
67 BA_CONDITIONAL(HAVE_HURD_OS, $TRUEPRG)
68 AC_DEFINE(HAVE_HURD_OS)
70 BA_CONDITIONAL(HAVE_HURD_OS, $FALSEPRG)
73 if test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
75 BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG)
76 AC_DEFINE(HAVE_OSF1_OS)
78 BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG)
81 if test $HAVE_UNAME=yes -a x`uname -s` = xAIX
83 BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG)
84 AC_DEFINE(HAVE_AIX_OS)
86 BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG)
89 if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
91 BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG)
92 AC_DEFINE(HAVE_HPUX_OS)
94 BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG)
97 if test $HAVE_UNAME=yes -a x`uname -s` = xLinux
99 BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG)
100 AC_DEFINE(HAVE_LINUX_OS)
102 BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
105 if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
107 BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
108 AC_DEFINE(HAVE_FREEBSD_OS)
110 BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG)
113 if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
115 BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG)
116 AC_DEFINE(HAVE_NETBSD_OS)
118 BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG)
121 if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
123 BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG)
124 AC_DEFINE(HAVE_OPENBSD_OS)
126 BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG)
129 if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
131 BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG)
132 AC_DEFINE(HAVE_BSDI_OS)
134 BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG)
137 if test $HAVE_UNAME=yes -a x`uname -s` = xSGI
139 BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG)
140 AC_DEFINE(HAVE_SGI_OS)
142 BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
145 if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX -o x`uname -s` = xIRIX64
147 BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
148 AC_DEFINE(HAVE_IRIX_OS)
150 BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
153 if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
155 AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG)
156 AC_DEFINE(HAVE_DARWIN_OS)
158 AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG)
162 AC_DEFUN([BA_CHECK_OPSYS_DISTNAME],
163 [AC_MSG_CHECKING(for Operating System Distribution)
164 if test "x$DISTNAME" != "x"
166 echo "distname set to $DISTNAME"
167 elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
170 elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX
173 elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
176 elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
179 elif test $HAVE_UNAME=yes -a x`uname -s` = xGNU
182 elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
185 elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
188 elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
191 elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
194 elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
197 elif test -f /etc/SuSE-release
200 elif test -d /etc/SuSEconfig
203 elif test -f /etc/mandrake-release
206 elif test -f /etc/whitebox-release
209 elif test -f /etc/redhat-release
212 elif test -f /etc/gentoo-release
215 elif test -f /etc/debian_version
218 elif test -f /etc/slackware-version
221 elif test x$host_vendor = xapple
224 elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
227 elif test -f /etc/engarde-version
230 elif test -f /etc/arch-release
233 elif test "$CYGWIN" = yes
236 AC_DEFINE(HAVE_CYGWIN)