Skip to content

Commit

Permalink
Allow building with libcrypto not in the default directory.
Browse files Browse the repository at this point in the history
Add support for an argument to --with-crypto, so that if you have one
version of libcrypto installed under /usr and another version installed
under /usr/local, you can force tcpdump to be built with the /usr/local
version.

Also, refer both to OpenSSL and libressl in comments and messages.
  • Loading branch information
guyharris committed Jul 14, 2016
1 parent aa50abd commit 119ee49
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
29 changes: 24 additions & 5 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,8 @@ Optional Packages:
--with-sandbox-capsicum use Capsicum security functions [default=yes, if
available]
--with-system-libpcap don't use local pcap library
--with-crypto use OpenSSL libcrypto [default=yes, if available]
--with-crypto[=DIR] use OpenSSL/libressl libcrypto (located in directory
DIR, if specified) [default=yes, if available]
--with-cap-ng use libcap-ng [default=yes, if available]
Some influential environment variables:
Expand Down Expand Up @@ -7951,9 +7952,9 @@ $as_echo "#define LBL_ALIGN 1" >>confdefs.h
fi
# Check for OpenSSL libcrypto
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL libcrypto" >&5
$as_echo_n "checking whether to use OpenSSL libcrypto... " >&6; }
# Check for OpenSSL/libressl libcrypto
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use OpenSSL/libressl libcrypto" >&5
$as_echo_n "checking whether to use OpenSSL/libressl libcrypto... " >&6; }
# Specify location for both includes and libraries.
want_libcrypto=ifavailable
Expand All @@ -7962,20 +7963,38 @@ if test "${with_crypto+set}" = set; then :
withval=$with_crypto;
if test $withval = no
then
# User doesn't want to link with libcrypto.
want_libcrypto=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
elif test $withval = yes
then
# User wants to link with libcrypto but hasn't specified
# a directory.
want_libcrypto=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
# User wants to link with libcrypto and has specified
# a directory, so use the provided value.
want_libcrypto=yes
libcrypto_root=$withval
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, using the version installed in $withval" >&5
$as_echo "yes, using the version installed in $withval" >&6; }
#
# Put the subdirectories of the libcrypto root directory
# at the front of the header and library search path.
#
CFLAGS="-I$withval/include $CFLAGS"
LIBS="-L$withval/lib $LIBS"
fi
else
#
# Use libcrypto if it's present, otherwise don't.
# Use libcrypto if it's present, otherwise don't; no directory
# was specified.
#
want_libcrypto=ifavailable
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, if available" >&5
Expand Down
27 changes: 22 additions & 5 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -881,26 +881,43 @@ AC_LBL_SOCKADDR_SA_LEN

AC_LBL_UNALIGNED_ACCESS

# Check for OpenSSL libcrypto
AC_MSG_CHECKING(whether to use OpenSSL libcrypto)
# Check for OpenSSL/libressl libcrypto
AC_MSG_CHECKING(whether to use OpenSSL/libressl libcrypto)
# Specify location for both includes and libraries.
want_libcrypto=ifavailable
AC_ARG_WITH(crypto,
AS_HELP_STRING([--with-crypto],
[use OpenSSL libcrypto @<:@default=yes, if available@:>@]),
AS_HELP_STRING([--with-crypto]@<:@=DIR@:>@,
[use OpenSSL/libressl libcrypto (located in directory DIR, if specified) @<:@default=yes, if available@:>@]),
[
if test $withval = no
then
# User doesn't want to link with libcrypto.
want_libcrypto=no
AC_MSG_RESULT(no)
elif test $withval = yes
then
# User wants to link with libcrypto but hasn't specified
# a directory.
want_libcrypto=yes
AC_MSG_RESULT(yes)
else
# User wants to link with libcrypto and has specified
# a directory, so use the provided value.
want_libcrypto=yes
libcrypto_root=$withval
AC_MSG_RESULT([yes, using the version installed in $withval])

#
# Put the subdirectories of the libcrypto root directory
# at the front of the header and library search path.
#
CFLAGS="-I$withval/include $CFLAGS"
LIBS="-L$withval/lib $LIBS"
fi
],[
#
# Use libcrypto if it's present, otherwise don't.
# Use libcrypto if it's present, otherwise don't; no directory
# was specified.
#
want_libcrypto=ifavailable
AC_MSG_RESULT([yes, if available])
Expand Down

0 comments on commit 119ee49

Please sign in to comment.