]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Allow building with libcrypto not in the default directory.
authorGuy Harris <[email protected]>
Thu, 14 Jul 2016 00:23:59 +0000 (17:23 -0700)
committerGuy Harris <[email protected]>
Thu, 14 Jul 2016 00:24:15 +0000 (17:24 -0700)
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.

configure
configure.in

index aab7239a1671d52bd8a74687f69e9c62de39967a..a5c1026a69e3192e0130e0d620e363c6d48a8338 100755 (executable)
--- a/configure
+++ b/configure
@@ -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:
@@ -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
 
@@ -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
index 22ecee6fccb789886626849ca4098675e4b6e27a..d7484ede34bfe34b9982eec63b8335d91568db1f 100644 (file)
@@ -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])