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` = xOSF1
67 BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG)
68 AC_DEFINE(HAVE_OSF1_OS)
70 BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG)
73 if test $HAVE_UNAME=yes -a x`uname -s` = xAIX
75 BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG)
76 AC_DEFINE(HAVE_AIX_OS)
78 BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG)
81 if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
83 BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG)
84 AC_DEFINE(HAVE_HPUX_OS)
86 BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG)
89 if test $HAVE_UNAME=yes -a x`uname -s` = xLinux
91 BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG)
92 AC_DEFINE(HAVE_LINUX_OS)
94 BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
97 if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
99 BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
100 AC_DEFINE(HAVE_FREEBSD_OS)
102 BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG)
105 if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
107 BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG)
108 AC_DEFINE(HAVE_NETBSD_OS)
110 BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG)
113 if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
115 BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG)
116 AC_DEFINE(HAVE_OPENBSD_OS)
118 BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG)
121 if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
123 BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG)
124 AC_DEFINE(HAVE_BSDI_OS)
126 BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG)
129 if test $HAVE_UNAME=yes -a x`uname -s` = xSGI
131 BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG)
132 AC_DEFINE(HAVE_SGI_OS)
134 BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
137 if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX -o x`uname -s` = xIRIX64
139 BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
140 AC_DEFINE(HAVE_IRIX_OS)
142 BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
145 if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
147 AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG)
148 AC_DEFINE(HAVE_DARWIN_OS)
150 AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG)
154 AC_DEFUN([BA_CHECK_OPSYS_DISTNAME],
155 [AC_MSG_CHECKING(for Operating System Distribution)
156 if test "x$DISTNAME" != "x"
158 echo "distname set to $DISTNAME"
159 elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
162 elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX
165 elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
168 elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
171 elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
174 elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
177 elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
180 elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
183 elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
186 elif test -f /etc/SuSE-release
189 elif test -d /etc/SuSEconfig
192 elif test -f /etc/mandrake-release
195 elif test -f /etc/whitebox-release
198 elif test -f /etc/redhat-release
201 elif test -f /etc/gentoo-release
204 elif test -f /etc/debian_version
207 elif test -f /etc/slackware-version
210 elif test x$host_vendor = xapple
213 elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
216 elif test -f /etc/engarde-version
219 elif test "$CYGWIN" = yes
222 AC_DEFINE(HAVE_CYGWIN)