]> git.sur5r.net Git - bacula/bacula/blob - bacula/autoconf/bacula-macros/os.m4
- Create French and Italian translation files (fr.po, it.po).
[bacula/bacula] / bacula / autoconf / bacula-macros / os.m4
1 dnl Check type of signal routines (posix, 4.2bsd, 4.1bsd or v7)
2 AC_DEFUN(SIGNAL_CHECK,
3 [AC_REQUIRE([AC_TYPE_SIGNAL])
4 AC_MSG_CHECKING(for type of signal functions)
5 AC_CACHE_VAL(bash_cv_signal_vintage,
6 [
7   AC_TRY_LINK([#include <signal.h>],[
8     sigset_t ss;
9     struct sigaction sa;
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,
14   [
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,
19     [
20       AC_TRY_LINK([
21         #include <signal.h>
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
27     )]
28   )]
29 )
30 ])
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)
38 fi
39 ])
40
41 AC_DEFUN(BA_CONDITIONAL,
42 [AC_SUBST($1_TRUE)
43 AC_SUBST($1_FALSE)
44 if $2; then
45   $1_TRUE=
46   $1_FALSE='#'
47 else
48   $1_TRUE='#'
49   $1_FALSE=
50 fi])
51
52
53 AC_DEFUN(BA_CHECK_OPSYS,
54 [
55 AC_CYGWIN
56 if test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
57 then
58         BA_CONDITIONAL(HAVE_SUN_OS, $TRUEPRG)
59         AC_DEFINE(HAVE_SUN_OS)
60 else
61         BA_CONDITIONAL(HAVE_SUN_OS, $FALSEPRG)
62 fi
63
64 if test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
65 then
66         BA_CONDITIONAL(HAVE_OSF1_OS, $TRUEPRG)
67         AC_DEFINE(HAVE_OSF1_OS)
68 else
69         BA_CONDITIONAL(HAVE_OSF1_OS, $FALSEPRG)
70 fi
71
72 if test $HAVE_UNAME=yes -a x`uname -s` = xAIX
73 then
74         BA_CONDITIONAL(HAVE_AIX_OS, $TRUEPRG)
75         AC_DEFINE(HAVE_AIX_OS)
76 else
77         BA_CONDITIONAL(HAVE_AIX_OS, $FALSEPRG)
78 fi
79
80 if test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
81 then
82         BA_CONDITIONAL(HAVE_HPUX_OS, $TRUEPRG)
83         AC_DEFINE(HAVE_HPUX_OS)
84 else
85         BA_CONDITIONAL(HAVE_HPUX_OS, $FALSEPRG)
86 fi
87
88 if test $HAVE_UNAME=yes -a x`uname -s` = xLinux
89 then
90         BA_CONDITIONAL(HAVE_LINUX_OS, $TRUEPRG)
91         AC_DEFINE(HAVE_LINUX_OS)
92 else
93         BA_CONDITIONAL(HAVE_LINUX_OS, $FALSEPRG)
94 fi
95
96 if test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
97 then
98         BA_CONDITIONAL(HAVE_FREEBSD_OS, $TRUEPRG)
99         AC_DEFINE(HAVE_FREEBSD_OS)
100 else
101         BA_CONDITIONAL(HAVE_FREEBSD_OS, $FALSEPRG)
102 fi
103
104 if test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
105 then
106         BA_CONDITIONAL(HAVE_NETBSD_OS, $TRUEPRG)
107         AC_DEFINE(HAVE_NETBSD_OS)
108 else
109         BA_CONDITIONAL(HAVE_NETBSD_OS, $FALSEPRG)
110 fi
111
112 if test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
113 then
114         BA_CONDITIONAL(HAVE_OPENBSD_OS, $TRUEPRG)
115         AC_DEFINE(HAVE_OPENBSD_OS)
116 else
117         BA_CONDITIONAL(HAVE_OPENBSD_OS, $FALSEPRG)
118 fi
119
120 if test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
121 then
122         BA_CONDITIONAL(HAVE_BSDI_OS, $TRUEPRG)
123         AC_DEFINE(HAVE_BSDI_OS)
124 else
125         BA_CONDITIONAL(HAVE_BSDI_OS, $FALSEPRG)
126 fi
127
128 if test $HAVE_UNAME=yes -a x`uname -s` = xSGI
129 then
130         BA_CONDITIONAL(HAVE_SGI_OS, $TRUEPRG)
131         AC_DEFINE(HAVE_SGI_OS)
132 else
133         BA_CONDITIONAL(HAVE_SGI_OS, $FALSEPRG)
134 fi
135
136 if test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
137 then
138         BA_CONDITIONAL(HAVE_IRIX_OS, $TRUEPRG)
139         AC_DEFINE(HAVE_IRIX_OS)
140 else
141         BA_CONDITIONAL(HAVE_IRIX_OS, $FALSEPRG)
142 fi
143
144 if test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
145 then
146     AM_CONDITIONAL(HAVE_DARWIN_OS, $TRUEPRG)
147     AC_DEFINE(HAVE_DARWIN_OS)
148 else
149     AM_CONDITIONAL(HAVE_DARWIN_OS, $FALSEPRG)
150 fi
151 ])
152
153 AC_DEFUN(BA_CHECK_OPSYS_DISTNAME,
154 [AC_MSG_CHECKING(for Operating System Distribution)
155 if test "x$DISTNAME" != "x"
156 then
157         echo "distname set to $DISTNAME"
158 elif test $HAVE_UNAME=yes -a x`uname -s` = xOSF1
159 then
160         DISTNAME=alpha
161 elif test $HAVE_UNAME=yes -a x`uname -s` = xAIX
162 then
163         DISTNAME=aix
164 elif test $HAVE_UNAME=yes -a x`uname -s` = xHP-UX
165 then
166         DISTNAME=hpux
167 elif test $HAVE_UNAME=yes -a x`uname -s` = xSunOS
168 then
169         DISTNAME=solaris
170 elif test $HAVE_UNAME=yes -a x`uname -s` = xFreeBSD
171 then
172         DISTNAME=freebsd
173 elif test $HAVE_UNAME=yes -a x`uname -s` = xNetBSD
174 then
175         DISTNAME=netbsd
176 elif test $HAVE_UNAME=yes -a x`uname -s` = xOpenBSD
177 then
178         DISTNAME=openbsd
179 elif test $HAVE_UNAME=yes -a x`uname -s` = xIRIX
180 then
181         DISTNAME=irix
182 elif test $HAVE_UNAME=yes -a x`uname -s` = xBSD/OS
183 then
184         DISTNAME=bsdi
185 elif test -f /etc/SuSE-release
186 then
187         DISTNAME=suse
188 elif test -d /etc/SuSEconfig
189 then
190         DISTNAME=suse5
191 elif test -f /etc/mandrake-release
192 then
193         DISTNAME=mandrake
194 elif test -f /etc/whitebox-release
195 then
196        DISTNAME=redhat
197 elif test -f /etc/redhat-release
198 then
199         DISTNAME=redhat
200 elif test -f /etc/gentoo-release
201 then
202         DISTNAME=gentoo
203 elif test -f /etc/debian_version
204 then
205         DISTNAME=debian
206 elif test -f /etc/slackware-version
207 then
208         DISTNAME=slackware
209 elif test $HAVE_UNAME=yes -a x`uname -s` = xDarwin
210 then
211     DISTNAME=darwin
212 elif test -f /etc/engarde-version
213 then
214         DISTNAME=engarde
215 elif test "$CYGWIN" = yes
216 then
217         DISTNAME=cygwin
218         AC_DEFINE(HAVE_CYGWIN)
219 else
220         DISTNAME=unknown
221 fi
222 AC_MSG_RESULT(done)
223 ])