Skip to content

Commit 036fa9c

Browse files
committed
autotools: don't link with -lcrypto twice.
In case some other library with which we're linking - for example, a version of libpcap that has rpcap-over-TLS support? - is causing us to link with libcrypto, don't look for libcrypto ourselves.
1 parent 6318156 commit 036fa9c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

configure.ac

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -857,6 +857,26 @@ AC_ARG_WITH(crypto,
857857
want_libcrypto=ifavailable
858858
AC_MSG_RESULT([yes, if available])
859859
])
860+
if test "$want_libcrypto" != "no"; then
861+
#
862+
# Do we already *have* libcrypto, e.g. if we're using a
863+
# version of libpcap that has rpcap-over-TLS support?
864+
#
865+
AC_MSG_CHECKING([whether we're already linking with libcrypto])
866+
if $EGREP -s -q -e '-lcrypto|libcrypto' <<EOF
867+
$LIBS
868+
EOF
869+
then
870+
#
871+
# Yes; we already *have* libcrypto, don't
872+
# look for another one.
873+
#
874+
AC_MSG_RESULT([yes])
875+
want_libcrypto=no
876+
else
877+
AC_MSG_RESULT([no])
878+
fi
879+
fi
860880
if test "$want_libcrypto" != "no"; then
861881
#
862882
# Were we told where to look for libcrypto?

0 commit comments

Comments
 (0)