197 | | # Checks for libraries. |
198 | | # Check for SSL, original taken from |
199 | | # http://www.gnu.org/software/ac-archive/htmldoc/check_ssl.html and |
200 | | # modified for NSD and |
201 | | # copied again for use in ldns |
202 | | AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], |
203 | | [enable SSL (will check /usr/local/ssl |
204 | | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr/sfw /usr)]),[ |
205 | | ],[ |
206 | | withval="yes" |
207 | | if test x_$withval != x_no; then |
208 | | AC_MSG_CHECKING(for SSL) |
209 | | if test x_$withval = x_ -o x_$withval = x_yes; then |
210 | | withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr/sfw /usr" |
211 | | fi |
212 | | for dir in $withval; do |
213 | | ssldir="$dir" |
214 | | if test -f "$dir/include/openssl/ssl.h"; then |
215 | | found_ssl="yes"; |
216 | | AC_DEFINE_UNQUOTED([HAVE_SSL], [], [Define if you have the SSL libraries installed.]) |
217 | | CPPFLAGS="$CPPFLAGS -I$ssldir/include"; |
218 | | break; |
219 | | fi |
220 | | done |
221 | | if test x_$found_ssl != x_yes; then |
222 | | AC_MSG_ERROR(Cannot find the SSL libraries in $withval) |
223 | | else |
224 | | AC_MSG_RESULT(found in $ssldir) |
225 | | HAVE_SSL=yes |
226 | | LDFLAGS="$LDFLAGS -L$ssldir/lib"; |
227 | | if test "x$enable_rpath" = xyes; then |
228 | | RUNTIME_PATH="$RUNTIME_PATH -R$ssldir/lib" |
229 | | fi |
230 | | AC_MSG_CHECKING([for HMAC_CTX_init in -lcrypto]) |
231 | | LIBS="$LIBS -lcrypto" |
232 | | AC_TRY_LINK(, [ |
233 | | int HMAC_CTX_init(void); |
234 | | (void)HMAC_CTX_init(); |
235 | | ], [ |
236 | | AC_MSG_RESULT(yes) |
237 | | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
238 | | [If you have HMAC_CTX_init]) |
239 | | ], [ |
240 | | AC_MSG_RESULT(no) |
241 | | # check if -lwsock32 or -lgdi32 are needed. |
242 | | LIBS="$LIBS -lgdi32 -lws2_32" |
243 | | AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) |
244 | | AC_TRY_LINK([], [ |
245 | | int HMAC_CTX_init(void); |
246 | | (void)HMAC_CTX_init(); |
247 | | ],[ |
248 | | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
249 | | [If you have HMAC_CTX_init]) |
250 | | AC_MSG_RESULT(yes) |
251 | | ],[ |
252 | | AC_MSG_RESULT(no) |
253 | | AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or |
254 | | higher is required]) |
255 | | ]) |
256 | | ]) |
257 | | fi |
258 | | AC_SUBST(HAVE_SSL) |
259 | | AC_SUBST(RUNTIME_PATH) |
260 | | fi |
261 | | ]) |
| 198 | ACX_WITH_SSL_OPTIONAL |