BUILD: add optional support for SSL via the USE_OPENSSL flag
When this flag is set, the SSL data layer is enabled.
At the moment, only the GNU makefile was touched, the other ones
make the option handling a bit tricky.
diff --git a/Makefile b/Makefile
index 73df397..e927fca 100644
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,7 @@
# USE_CRYPT_H : set it if your system requires including crypt.h
# USE_VSYSCALL : enable vsyscall on Linux x86, bypassing libc
# USE_GETADDRINFO : use getaddrinfo() to resolve IPv6 host names.
+# USE_OPENSSL : enable use of OpenSSL. Recommended, but see below.
#
# Options can be forced by specifying "USE_xxx=1" or can be disabled by using
# "USE_xxx=" (empty string).
@@ -462,6 +463,17 @@
OPTIONS_OBJS += src/dlmalloc.o
endif
+ifneq ($(USE_OPENSSL),)
+# OpenSSL is packaged in various forms and with various dependences.
+# In general -lssl is enough, but on some platforms, -lcrypto may be needed,
+# as well as -lz. Pass them in the "ADDLIB" variable if needed. Similarly,
+# use ADDINC and ADDLIB to specify -I and -L if your OpenSSL library is not
+# in the standard path.
+OPTIONS_CFLAGS += -DUSE_OPENSSL
+OPTIONS_LDFLAGS += -lssl
+OPTIONS_OBJS += src/ssl_sock.o
+endif
+
ifneq ($(USE_PCRE),)
# PCREDIR is the directory hosting include/pcre.h and lib/libpcre.*. It is
# automatically detected but can be forced if required. Forcing it to an empty