AC_INIT(foo.c) AC_ARG_WITH(ssl, [--with-ssl[=DIR] SSL crypt support (needs OpenSSL)],dnl [if test "$withval" != "no"; then AC_DEFINE(OPENSSL) OPENSSL=1 if test "$withval" != "yes"; then SSLROOT=$withval LIBS="${LIBS} -L$SSLROOT/lib" CPPFLAGS="${CPPFLAGS} -I$SSLROOT/include" fi fi], dnl Default: disable it ) AC_PROG_CC # Check OpenSSL AC_DEFUN([CF_LIB_OPENSSL], [ AC_CHECK_LIB(ssl,SSL_CTX_new, [LIBS="${LIBS} -lssl -lcrypto"], [AC_ERROR([Get the OpenSSL library (http://www.openssl.org/)])], dnl -lcrypto )]) if test "$OPENSSL" = "1"; then CF_LIB_OPENSSL fi AC_OUTPUT(Makefile)