558 | | dnl Check for SSL. |
559 | | dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found |
560 | | dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. |
561 | | dnl Checks main header files of SSL. |
562 | | dnl |
563 | | AC_DEFUN([ACX_WITH_SSL], |
564 | | [ |
565 | | AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], |
566 | | [enable SSL (will check /usr/local/ssl |
567 | | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ |
568 | | ],[ |
569 | | withval="yes" |
570 | | ]) |
571 | | if test x_$withval = x_no; then |
572 | | AC_MSG_ERROR([Need SSL library to do digital signature cryptography]) |
573 | | fi |
| 563 | dnl Common code for both ACX_WITH_SSL and ACX_WITH_SSL_OPTIONAL |
| 564 | dnl Takes one argument; the withval checked in those 2 functions |
| 565 | dnl sets up the environment for the given openssl path |
| 566 | AC_DEFUN([ACX_SSL_CHECKS], [ |
| 567 | withval=$1 |
599 | | ACX_RUNTIME_PATH_ADD([$ssldir/lib]) |
600 | | fi |
601 | | |
602 | | AC_MSG_CHECKING([for HMAC_CTX_init in -lcrypto]) |
603 | | LIBS="$LIBS -lcrypto" |
604 | | AC_TRY_LINK(, [ |
605 | | int HMAC_CTX_init(void); |
606 | | (void)HMAC_CTX_init(); |
607 | | ], [ |
608 | | AC_MSG_RESULT(yes) |
609 | | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
610 | | [If you have HMAC_CTX_init]) |
611 | | ], [ |
612 | | AC_MSG_RESULT(no) |
613 | | # check if -lwsock32 or -lgdi32 are needed. |
614 | | BAKLIBS="$LIBS" |
615 | | LIBS="$LIBS -lgdi32" |
616 | | AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) |
617 | | AC_TRY_LINK([], [ |
618 | | int HMAC_CTX_init(void); |
619 | | (void)HMAC_CTX_init(); |
620 | | ],[ |
621 | | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
622 | | [If you have HMAC_CTX_init]) |
623 | | AC_MSG_RESULT(yes) |
624 | | ],[ |
625 | | AC_MSG_RESULT(no) |
626 | | LIBS="$BAKLIBS" |
627 | | LIBS="$LIBS -ldl" |
628 | | AC_MSG_CHECKING([if -lcrypto needs -ldl]) |
629 | | AC_TRY_LINK([], [ |
630 | | int HMAC_CTX_init(void); |
631 | | (void)HMAC_CTX_init(); |
632 | | ],[ |
633 | | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
634 | | [If you have HMAC_CTX_init]) |
635 | | AC_MSG_RESULT(yes) |
636 | | ],[ |
637 | | AC_MSG_RESULT(no) |
| 593 | ACX_RUNTIME_PATH_ADD([$ssldir/lib]) |
| 594 | fi |
| 595 | |
| 596 | AC_MSG_CHECKING([for HMAC_CTX_init in -lcrypto]) |
| 597 | LIBS="$LIBS -lcrypto" |
| 598 | AC_TRY_LINK(, [ |
| 599 | int HMAC_CTX_init(void); |
| 600 | (void)HMAC_CTX_init(); |
| 601 | ], [ |
| 602 | AC_MSG_RESULT(yes) |
| 603 | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
| 604 | [If you have HMAC_CTX_init]) |
| 605 | ], [ |
| 606 | AC_MSG_RESULT(no) |
| 607 | # check if -lwsock32 or -lgdi32 are needed. |
| 608 | BAKLIBS="$LIBS" |
| 609 | LIBS="$LIBS -lgdi32" |
| 610 | AC_MSG_CHECKING([if -lcrypto needs -lgdi32]) |
| 611 | AC_TRY_LINK([], [ |
| 612 | int HMAC_CTX_init(void); |
| 613 | (void)HMAC_CTX_init(); |
| 614 | ],[ |
| 615 | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
| 616 | [If you have HMAC_CTX_init]) |
| 617 | AC_MSG_RESULT(yes) |
| 618 | ],[ |
| 619 | AC_MSG_RESULT(no) |
| 620 | LIBS="$BAKLIBS" |
| 621 | LIBS="$LIBS -ldl" |
| 622 | AC_MSG_CHECKING([if -lcrypto needs -ldl]) |
| 623 | AC_TRY_LINK([], [ |
| 624 | int HMAC_CTX_init(void); |
| 625 | (void)HMAC_CTX_init(); |
| 626 | ],[ |
| 627 | AC_DEFINE([HAVE_HMAC_CTX_INIT], 1, |
| 628 | [If you have HMAC_CTX_init]) |
| 629 | AC_MSG_RESULT(yes) |
| 630 | ],[ |
| 631 | AC_MSG_RESULT(no) |
| 643 | ])dnl End of ACX_SSL_CHECKS |
| 644 | |
| 645 | dnl Check for SSL, where SSL is mandatory |
| 646 | dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found |
| 647 | dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. |
| 648 | dnl Checks main header files of SSL. |
| 649 | dnl |
| 650 | AC_DEFUN([ACX_WITH_SSL], |
| 651 | [ |
| 652 | AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], |
| 653 | [enable SSL (will check /usr/local/ssl |
| 654 | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ |
| 655 | ],[ |
| 656 | withval="yes" |
| 657 | ]) |
| 658 | if test x_$withval = x_no; then |
| 659 | AC_MSG_ERROR([Need SSL library to do digital signature cryptography]) |
| 660 | fi |
| 661 | ACX_SSL_CHECKS($withval) |
| 664 | dnl Check for SSL, where ssl is optional (--without-ssl is allowed) |
| 665 | dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found |
| 666 | dnl Setup of CPPFLAGS, CFLAGS. Adds -lcrypto to LIBS. |
| 667 | dnl Checks main header files of SSL. |
| 668 | dnl |
| 669 | AC_DEFUN([ACX_WITH_SSL_OPTIONAL], |
| 670 | [ |
| 671 | AC_ARG_WITH(ssl, AC_HELP_STRING([--with-ssl=pathname], |
| 672 | [enable SSL (will check /usr/local/ssl |
| 673 | /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[ |
| 674 | ],[ |
| 675 | withval="yes" |
| 676 | ]) |
| 677 | ACX_SSL_CHECKS($withval) |
| 678 | ])dnl End of ACX_WITH_SSL_OPTIONAL |
| 679 | |