|
229 | 229 | AC_MSG_ERROR(no strlcpy/strlcat found)
|
230 | 230 | fi
|
231 | 231 |
|
| 232 | +AC_SUBST(STRL_LIBS) |
| 233 | + |
232 | 234 | AC_CHECK_HEADERS([strl.h], [strl_h_found="yes"])
|
233 | 235 | if test x"$strl_h_found" != x"yes"
|
234 | 236 | then
|
|
259 | 261 | if test x"$strl_h_found" = x"yes" -a x"$bsdstrl_h_found" = x"no"
|
260 | 262 | then
|
261 | 263 | AC_DEFINE([USE_STRL_H], 1,
|
262 |
| - [Define to 1 if you need to include <strl.h> to get the `strlcat()' and `strlcpy()' functions.]) |
| 264 | + [Define to 1 if you need to include <strl.h> to get the strlcat() and strlcpy() functions.]) |
263 | 265 | fi
|
264 | 266 |
|
265 | 267 | if test x"$bsdstrl_h_found" = x"yes"
|
266 | 268 | then
|
267 | 269 | AC_DEFINE([USE_BSD_H], 1,
|
268 |
| - [Define to 1 if you need to include <bsd/string.h> to get the `strlcat()' and `strlcpy()' functions.]) |
| 270 | + [Define to 1 if you need to include <bsd/string.h> to get the strlcat() and strlcpy() functions.]) |
269 | 271 | fi
|
270 | 272 |
|
271 | 273 | #
|
@@ -531,125 +533,9 @@ AM_CONDITIONAL([DEBUG], [test x"$enable_debug" = x"yes"])
|
531 | 533 | # OpenSSL
|
532 | 534 | #
|
533 | 535 |
|
534 |
| -AC_ARG_WITH([openssl], |
535 |
| - AS_HELP_STRING([--with-openssl], |
536 |
| - [location of OpenSSL includes and library]), |
537 |
| - [sslpath="$withval"], [sslpath="auto"]) |
538 |
| - |
539 |
| -openssl_found="no" |
540 |
| - |
541 |
| -if test \( "$sslpath" = "auto" -o x"$sslpath" = x"yes" \) -a x"$PKG_CONFIG" != x"" |
542 |
| -then |
543 |
| - PKG_CHECK_MODULES([LIBCRYPTO], [openssl >= 1.0.0], |
544 |
| - [openssl_found="yes"], |
545 |
| - [openssl_found="no" |
546 |
| - AC_MSG_WARN([pkg-config for openssl not found, trying manual search...]) |
547 |
| - ]) |
548 |
| -elif test "$sslpath" != "auto" -a x"$sslpath" != x"yes" |
549 |
| -then |
550 |
| - AC_MSG_CHECKING([for OpenSSL includes]) |
551 |
| - if test -f $sslpath/include/openssl/opensslv.h |
552 |
| - then |
553 |
| - LIBCRYPTO_CPPFLAGS="-I$sslpath/include" |
554 |
| - LIBCRYPTO_CFLAGS="" |
555 |
| - LIBCRYPTO_LIBDIRS="-L$sslpath/lib" |
556 |
| - LIBCRYPTO_LIBS="-lssl -lcrypto" |
557 |
| - openssl_found=yes |
558 |
| - AC_MSG_RESULT([$sslpath]) |
559 |
| - else |
560 |
| - AC_MSG_RESULT([no]) |
561 |
| - fi |
562 |
| -fi |
563 |
| - |
564 |
| -if test x"$openssl_found" = x"no" |
565 |
| -then |
566 |
| - AC_MSG_CHECKING([for OpenSSL library and includes]) |
567 |
| - ssldirs="/usr/local/ssl /usr/local /usr/sfw /opt/local /usr" |
568 |
| - if test "$sslpath" = "auto" -o "$sslpath" = "yes" |
569 |
| - then |
570 |
| - for d in $ssldirs |
571 |
| - do |
572 |
| - if test -f $d/include/openssl/opensslv.h |
573 |
| - then |
574 |
| - sslpath=$d |
575 |
| - openssl_found=yes |
576 |
| - break |
577 |
| - fi |
578 |
| - done |
579 |
| - fi |
580 |
| - case "$sslpath" in |
581 |
| - no) |
582 |
| - AC_MSG_ERROR([OpenSSL is required]) |
583 |
| - ;; |
584 |
| - auto) |
585 |
| - AC_MSG_ERROR([OpenSSL not found]) |
586 |
| - ;; |
587 |
| - */*) |
588 |
| - AC_MSG_RESULT([$sslpath]) |
589 |
| - ;; |
590 |
| - *) |
591 |
| - AC_MSG_ERROR([OpenSSL not found]) |
592 |
| - ;; |
593 |
| - esac |
594 |
| - LIBCRYPTO_CPPFLAGS="-I$sslpath/include" |
595 |
| - LIBCRYPTO_CFLAGS="" |
596 |
| - LIBCRYPTO_LIBDIRS="-L$sslpath/lib" |
597 |
| - LIBCRYPTO_LIBS="-lssl -lcrypto" |
598 |
| -fi |
599 |
| - |
600 |
| -if test x"$openssl_found" = x"yes" |
601 |
| -then |
602 |
| - saved_CFLAGS="$CFLAGS" |
603 |
| - saved_CPPFLAGS="$CPPFLAGS" |
604 |
| - saved_LDFLAGS="$LDFLAGS" |
605 |
| - saved_LIBS="$LIBS" |
606 |
| - |
607 |
| - LIBS="$outer_LIBS $LIBCRYPTO_LIBS $saved_LIBS" |
608 |
| - CPPFLAGS="$LIBCRYPTO_CPPFLAGS $saved_CPPFLAGS" |
609 |
| - CFLAGS="$LIBCRYPTO_CFLAGS $saved_CFLAGS" |
610 |
| - LDFLAGS="$outer_LDFLAGS $LIBCRYPTO_LIBDIRS $saved_LDFLAGS" |
611 |
| - |
612 |
| - AC_CHECK_HEADERS([openssl/bio.h openssl/conf.h openssl/crypto.h openssl/err.h openssl/evp.h openssl/md5.h openssl/opensslv.h openssl/pem.h openssl/rsa.h openssl/sha.h openssl/ssl.h], , |
613 |
| - AC_MSG_ERROR([required OpenSSL header not found])) |
614 |
| - |
615 |
| - # -ldl is needed to assist with compilation of static openssl libraries. |
616 |
| - # It appears to need dl for opening engine plugins. It fails at load |
617 |
| - # time It also fails to build on FreeBSD if enabled by default. |
618 |
| - AC_SEARCH_LIBS([ERR_peek_error], [crypto], , |
619 |
| - AC_MSG_ERROR([libcrypto not found])) |
620 |
| - |
621 |
| - AC_SEARCH_LIBS([SSL_new], [ssl], , |
622 |
| - [ |
623 |
| - if test x"$enable_shared" = x"yes" |
624 |
| - then |
625 |
| - AC_MSG_ERROR([Cannot build shared openarc |
626 |
| - against static openssl libraries. |
627 |
| - Configure with --disable-shared |
628 |
| - to get this working or obtain a |
629 |
| - shared libssl library for |
630 |
| - openarc to use.]) |
631 |
| - fi |
632 |
| -
|
633 |
| - # avoid caching issue - last result of SSL_new |
634 |
| - # shouldn't be cached for this next check |
635 |
| - unset ac_cv_search_SSL_new |
636 |
| - LIBCRYPTO_LIBS="$LIBCRYPTO_LIBS -ldl" |
637 |
| - AC_SEARCH_LIBS([SSL_new], [ssl], , |
638 |
| - AC_MSG_ERROR([libssl not found]), [-ldl]) |
639 |
| - ] |
640 |
| - ) |
641 |
| - |
642 |
| - CFLAGS="$saved_CFLAGS" |
643 |
| - CPPFLAGS="$saved_CPPFLAGS" |
644 |
| - LDFLAGS="$saved_LDFLAGS" |
645 |
| - LIBS="$saved_LIBS" |
646 |
| - |
647 |
| -fi |
648 |
| - |
649 |
| -AC_SUBST(LIBCRYPTO_CFLAGS) |
650 |
| -AC_SUBST(LIBCRYPTO_CPPFLAGS) |
651 |
| -AC_SUBST(LIBCRYPTO_LIBDIRS) |
652 |
| -AC_SUBST(LIBCRYPTO_LIBS) |
| 536 | +PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.0]) |
| 537 | +AC_SUBST(OPENSSL_CFLAGS) |
| 538 | +AC_SUBST(OPENSSL_LIBS) |
653 | 539 |
|
654 | 540 | #
|
655 | 541 | # libmilter
|
@@ -777,92 +663,22 @@ AC_SUBST(LIBMILTER_LIBS)
|
777 | 663 | # header filtering requires libjansson
|
778 | 664 | #
|
779 | 665 |
|
780 |
| -AC_ARG_WITH([libjansson], |
781 |
| - AS_HELP_STRING([--with-libjansson], |
782 |
| - [location of jansson includes and library]), |
783 |
| - [janssonpath="$withval"], [janssonpath="auto"]) |
| 666 | +AC_ARG_WITH([libjansson], AS_HELP_STRING([--with-libjansson], [use Jansson for header field checks])) |
784 | 667 |
|
785 |
| -LIBJANSSON_CPPFLAGS="" |
786 |
| -LIBJANSSON_LDFLAGS="" |
787 |
| -LIBJANSSON_LIBS="" |
788 |
| - |
789 |
| -jansson_found="no" |
790 |
| -if test \( x"$janssonpath" = x"auto" -o x"$janssonpath" = x"yes" \) -a \ |
791 |
| - x"$PKG_CONFIG" != x"" |
792 |
| -then |
793 |
| - PKG_CHECK_MODULES([LIBJANSSON], [jansson >= 2.2.1], |
794 |
| - [ |
795 |
| - jansson_found="yes" |
796 |
| - LIBJANSSON_CPPFLAGS="$LIBJANSSON_CFLAGS" |
797 |
| - LIBJANSSON_LIBS="$LIBJANSSON_LIBS" |
798 |
| - ], |
799 |
| - [ |
800 |
| - jansson_found="no" |
801 |
| - AC_MSG_WARN([pkg-config for libjansson not found, trying manual |
802 |
| - search...]) |
803 |
| - ]) |
804 |
| -fi |
| 668 | +AS_IF( |
| 669 | + [test "x$enable_filter" != xno -a "x$with_libjansson" != xno], |
| 670 | + [ |
| 671 | + PKG_CHECK_MODULES( |
| 672 | + [LIBJANSSON], |
| 673 | + [jansson >= 2.2.1], |
| 674 | + [AC_DEFINE([USE_JANSSON], [1], [use Jansson for header field checks])] |
| 675 | + ) |
| 676 | + ] |
| 677 | +) |
805 | 678 |
|
806 |
| -if test x"$janssonpath" != x"no" -a x"$jansson_found" = x"no" |
807 |
| -then |
808 |
| - AC_MSG_CHECKING([for libjansson]) |
809 |
| - if test x"$janssonpath" != x"auto" -a x"$janssonpath" != x"yes" |
810 |
| - then |
811 |
| - if test -f $janssonpath/include/jansson.h |
812 |
| - then |
813 |
| - AC_MSG_RESULT($janssonpath) |
814 |
| - jansson_found="yes" |
815 |
| - LIBJANSSON_CPPFLAGS="-I$janssonpath/include" |
816 |
| - LIBJANSSON_LDFLAGS="-L$janssonpath/lib" |
817 |
| - LIBJANSSON_LIBS="-ljansson" |
818 |
| - else |
819 |
| - AC_MSG_ERROR(not found at $janssonpath) |
820 |
| - fi |
821 |
| - else |
822 |
| - janssondirs="/usr /usr/local" |
823 |
| - for d in $janssondirs |
824 |
| - do |
825 |
| - if test -f $d/include/jansson.h |
826 |
| - then |
827 |
| - janssonpath=$d |
828 |
| - AC_MSG_RESULT($d) |
829 |
| - jansson_found="yes" |
830 |
| - LIBJANSSON_CPPFLAGS="-I$janssonpath/include" |
831 |
| - LIBJANSSON_LDFLAGS="-L$janssonpath/lib" |
832 |
| - LIBJANSSON_LIBS="-ljansson" |
833 |
| - break |
834 |
| - fi |
835 |
| - done |
836 |
| - fi |
837 |
| - if test x"$jansson_found" != x"yes" |
838 |
| - then |
839 |
| - AC_MSG_RESULT([no]) |
840 |
| - fi |
841 |
| -fi |
842 |
| -AC_SUBST(LIBJANSSON_CPPFLAGS) |
843 |
| -AC_SUBST(LIBJANSSON_LDFLAGS) |
| 679 | +AC_SUBST(LIBJANSSON_CFLAGS) |
844 | 680 | AC_SUBST(LIBJANSSON_LIBS)
|
845 |
| -AM_CONDITIONAL(JANSSON, test x"$LIBJANSSON_LIBS" != x"") |
846 |
| - |
847 |
| -if test x"$jansson_found" == x"yes" |
848 |
| -then |
849 |
| - AC_DEFINE(USE_JANSSON, 1, [use libjansson to provide header field checks]) |
850 |
| -fi |
851 |
| - |
852 |
| -# This (below) is just for the pkg-config file openarc.pc.in |
853 |
| -LIBOPENARC_LIBS_PKG="$LIBOPENARC_LIBS" |
854 |
| -LIBOPENARC_INC="$LIBCRYPTO_CPPFLAGS $LIBCRYPTO_CFLAGS $LIBTRE_CPPFLAGS" |
855 |
| - |
856 |
| -if test x"$USE_DB_LIBOPENARC_TRUE" = x"" |
857 |
| -then |
858 |
| - LIBOPENARC_INC="$LIBOPENARC_INC $LIBDB_INCDIRS" |
859 |
| - LIBOPENARC_LIBS_PKG="$LIBOPENARC_LIBS_PKG $LIBDB_LIBS" |
860 |
| - LIBOPENARC_LIBS="$LIBOPENARC_LIBS $LIBDB_LIBS" |
861 |
| -fi |
862 | 681 |
|
863 |
| -AC_SUBST(LIBOPENARC_LIBS) |
864 |
| -AC_SUBST(LIBOPENARC_LIBS_PKG) |
865 |
| -AC_SUBST(LIBOPENARC_INC) |
866 | 682 |
|
867 | 683 | AC_DEFINE_UNQUOTED([LIBOPENARC_FEATURE_STRING], "$LIBOPENARC_FEATURE_STRING",
|
868 | 684 | [Feature string for printing])
|
|
0 commit comments