42 |
LIBS="$pthread_libs $LIBS" |
LIBS="$pthread_libs $LIBS" |
43 |
fi |
fi |
44 |
|
|
|
# Check for ssl (take from the stunnel project) |
|
|
checkssldir() { : |
|
|
if test -f "$1/include/openssl/ssl.h"; then |
|
|
#AC_DEFINE([HAVE_OPENSSL]) |
|
|
ssldir="$1" |
|
|
return 0 |
|
|
fi |
|
|
if test -f "$1/include/ssl.h"; then |
|
|
ssldir="$1" |
|
|
return 0 |
|
|
fi |
|
|
return 1 |
|
|
} |
|
|
|
|
|
# Check for SSL directory (take from the stunnel project) |
|
|
AC_MSG_CHECKING([for SSL directory]) |
|
|
AC_ARG_WITH(ssl, |
|
|
[ --with-ssl=DIR location of installed SSL libraries/include files], |
|
|
[ |
|
|
dnl Check the specified localtion only |
|
|
checkssldir "$withval" |
|
|
], |
|
|
[ |
|
|
dnl Search default localtions of SSL library |
|
|
for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do |
|
|
for dir in $maindir $maindir/openssl $maindir/ssl; do |
|
|
checkssldir $dir && break 2 |
|
|
done |
|
|
done |
|
|
] |
|
|
) |
|
|
if test -z "$ssldir"; then |
|
|
AC_MSG_RESULT([Not found]) |
|
|
echo |
|
|
echo "Couldn't find your SSL library installation dir" |
|
|
echo "Use --with-ssl option to fix this problem" |
|
|
echo |
|
|
exit 1 |
|
|
fi |
|
|
AC_MSG_RESULT([$ssldir]) |
|
|
AC_SUBST(ssldir) |
|
|
#AC_DEFINE_UNQUOTED([ssldir], "$ssldir") |
|
|
|
|
|
# Add SSL includes and libraries |
|
|
if test "$ssldir" |
|
|
then |
|
|
CFLAGS="$CFLAGS -I$ssldir/include" |
|
|
LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto" |
|
|
fi |
|
|
|
|
|
|
|
45 |
# Checks for header files. |
# Checks for header files. |
46 |
AC_HEADER_STDC |
AC_HEADER_STDC |
47 |
AC_HEADER_SYS_WAIT |
AC_HEADER_SYS_WAIT |
85 |
AC_MSG_CHECKING([pid file location]) |
AC_MSG_CHECKING([pid file location]) |
86 |
if test -d "/var/run" |
if test -d "/var/run" |
87 |
then |
then |
88 |
AC_DEFINE([PIDDIR], "/var/run", |
piddir="/var/run" |
|
[Define to the pid storage directory.]) |
|
|
AC_MSG_RESULT([/var/run]) |
|
89 |
elif test -d "/etc" |
elif test -d "/etc" |
90 |
then |
then |
91 |
AC_DEFINE([PIDDIR], "/etc", |
piddir="/etc" |
|
[Define to the pid storage directory.]) |
|
|
AC_MSG_RESULT([/etc]) |
|
92 |
fi |
fi |
93 |
|
|
94 |
|
AC_DEFINE([PIDDIR], "$piddir", |
95 |
|
[Define to the pid storage directory.]) |
96 |
|
AC_MSG_RESULT([$piddir]) |
97 |
|
|
98 |
# Backward compatibility until we get ride of arch settings |
# Backward compatibility until we get ride of arch settings |
99 |
if test `uname` = "SunOS" |
if test `uname` = "SunOS" |
100 |
then |
then |
116 |
ARCH="LINUX" |
ARCH="LINUX" |
117 |
fi |
fi |
118 |
AC_SUBST(ARCH) |
AC_SUBST(ARCH) |
|
AC_MSG_RESULT([Architecture is ${ARCH}]) |
|
119 |
|
|
120 |
# Test for kvm libs |
# Test for kvm libs |
121 |
kvm_libs="" |
kvm_libs="" |
130 |
fi |
fi |
131 |
fi |
fi |
132 |
|
|
133 |
|
# Check for ssl (take from the stunnel project) |
134 |
|
checkssldir() { : |
135 |
|
if test -f "$1/include/openssl/ssl.h"; then |
136 |
|
AC_DEFINE([HAVE_OPENSSL], 1, [Define to 1 if you have openssl]) |
137 |
|
ssldir="$1" |
138 |
|
return 0 |
139 |
|
fi |
140 |
|
if test -f "$1/include/ssl.h"; then |
141 |
|
ssldir="$1" |
142 |
|
return 0 |
143 |
|
fi |
144 |
|
return 1 |
145 |
|
} |
146 |
|
|
147 |
|
# Check if we want to have SSL |
148 |
|
AC_MSG_CHECKING([for SSL support]) |
149 |
|
AC_ARG_WITH(ssl, |
150 |
|
[ --without-ssl Disable the use of ssl (default: enabled)], |
151 |
|
[ |
152 |
|
dnl Check the withvalue |
153 |
|
if test "x$withval" = "xno" ; then |
154 |
|
use_ssl=0 |
155 |
|
AC_MSG_RESULT([disabled]) |
156 |
|
fi |
157 |
|
if test "x$withval" = "xyes" ; then |
158 |
|
use_ssl=1 |
159 |
|
AC_MSG_RESULT([enabled]) |
160 |
|
fi |
161 |
|
], |
162 |
|
[ |
163 |
|
use_ssl=1 |
164 |
|
] |
165 |
|
) |
166 |
|
|
167 |
|
# Check for SSL directory (take from the stunnel project) |
168 |
|
if test "$use_ssl" = "1"; then |
169 |
|
AC_MSG_CHECKING([for SSL directory]) |
170 |
|
AC_ARG_WITH(ssl-dir, |
171 |
|
[ --with-ssl-dir=DIR location of installed SSL libraries/include files], |
172 |
|
[ |
173 |
|
dnl Check the specified localtion only |
174 |
|
checkssldir "$withval" |
175 |
|
], |
176 |
|
[ |
177 |
|
dnl Search default localtions of SSL library |
178 |
|
for maindir in /usr/local /usr/lib /usr/pkg /usr /var/ssl /opt; do |
179 |
|
for dir in $maindir $maindir/openssl $maindir/ssl; do |
180 |
|
checkssldir $dir && break 2 |
181 |
|
done |
182 |
|
done |
183 |
|
] |
184 |
|
) |
185 |
|
|
186 |
|
if test -z "$ssldir"; then |
187 |
|
AC_MSG_RESULT([Not found]) |
188 |
|
echo |
189 |
|
echo "Couldn't find your SSL library installation dir." |
190 |
|
echo "Use --with-ssl-dir option to fix this problem or disable the" |
191 |
|
echo "SSL support with --without-ssl" |
192 |
|
echo |
193 |
|
exit 1 |
194 |
|
fi |
195 |
|
AC_MSG_RESULT([$ssldir]) |
196 |
|
AC_SUBST(ssldir) |
197 |
|
fi |
198 |
|
|
199 |
|
#AC_DEFINE_UNQUOTED([ssldir], "$ssldir") |
200 |
|
|
201 |
|
# Add SSL includes and libraries |
202 |
|
if test "$ssldir" |
203 |
|
then |
204 |
|
CFLAGS="$CFLAGS -I$ssldir/include" |
205 |
|
LIBS="$LIBS -L$ssldir/lib -lssl -lcrypto" |
206 |
|
fi |
207 |
|
|
208 |
# Outputs |
# Outputs |
209 |
AC_CONFIG_HEADER([config.h]) |
AC_CONFIG_HEADER([config.h]) |
210 |
AC_CONFIG_FILES([Makefile]) |
AC_CONFIG_FILES([Makefile]) |
211 |
AC_OUTPUT |
AC_OUTPUT |
212 |
|
|
213 |
|
echo "" |
214 |
|
echo "monit has been configured with the following options:" |
215 |
|
|
216 |
|
echo " Architecture: ${ARCH}" |
217 |
|
if test "$use_ssl" = "1"; then |
218 |
|
echo " SSL support: enabled" |
219 |
|
echo " SSL directory: ${ssldir}" |
220 |
|
else |
221 |
|
echo " SSL support: disabled" |
222 |
|
fi |
223 |
|
echo " Compiler flags: ${CFLAGS}" |
224 |
|
echo " Linker flags: ${LIBS}" |
225 |
|
echo " pid file location: ${piddir}" |
226 |
|
echo |