| Line | |
|---|
| 1 | # Copyright (c) 2005-2008 David Carter <dcarter@arm4.org> and others. |
|---|
| 2 | # All rights reserved. This program and the accompanying materials |
|---|
| 3 | # are made available under the terms of the Eclipse Public License v1.0 |
|---|
| 4 | # which accompanies this distribution, and is available at |
|---|
| 5 | # http://www.eclipse.org/legal/epl-v10.html |
|---|
| 6 | |
|---|
| 7 | # Check for the MD5 headers, and which libraries need to be linked |
|---|
| 8 | |
|---|
| 9 | AC_DEFUN([__ARM4_SSL_CHECKLINK], |
|---|
| 10 | [ |
|---|
| 11 | SSL_LIBS="$1" |
|---|
| 12 | ac_save_LIBS="$LIBS" |
|---|
| 13 | LIBS="$LIBS $SSL_LIBS" |
|---|
| 14 | AC_LINK_IFELSE([ |
|---|
| 15 | #include <unistd.h> |
|---|
| 16 | #include <openssl/md5.h> |
|---|
| 17 | |
|---|
| 18 | main () |
|---|
| 19 | { |
|---|
| 20 | MD5_CTX ctx; |
|---|
| 21 | |
|---|
| 22 | MD5_Init (&ctx); |
|---|
| 23 | } |
|---|
| 24 | ], ,[SSL_LIBS=""]) |
|---|
| 25 | LIBS="$ac_save_libs" |
|---|
| 26 | AC_SUBST(SSL_LIBS) |
|---|
| 27 | ]) |
|---|
| 28 | |
|---|
| 29 | AC_DEFUN([ARM4_CHECK_SSL], |
|---|
| 30 | [ |
|---|
| 31 | arm4_md5_h=no |
|---|
| 32 | AC_CHECK_HEADER([openssl/md5.h],[arm4_md5_h=yes],,) |
|---|
| 33 | if test "$arm4_md5_h" = "yes" ; then |
|---|
| 34 | __ARM4_SSL_CHECKLINK([-lssl -lcrypto]) |
|---|
| 35 | if test "x$SSL_LIBS" = "x" ; then |
|---|
| 36 | arm4_md5_h=no |
|---|
| 37 | fi |
|---|
| 38 | fi |
|---|
| 39 | if test "x$SSL_LIBS" = x ; then |
|---|
| 40 | AC_MSG_ERROR([this platform doesn't support MD5 generation]) |
|---|
| 41 | fi |
|---|
| 42 | if test "$arm4_md5_h" = "yes" ; then |
|---|
| 43 | AC_DEFINE(HAVE_OPENSSL_MD5_H, 1, |
|---|
| 44 | [Define to 1 if you have the <openssl/md5.h> header file.]) |
|---|
| 45 | fi |
|---|
| 46 | ]) |
|---|
Note: See
TracBrowser
for help on using the repository browser.