Made OpenSSL not mandatory. Don't build examples if OpenSSL is not found.

Spdylay library itself does not depend on OpenSSL. The example programs
in examples directory do. Spdylay library should be built without
OpenSSL.
This commit is contained in:
Tatsuhiro Tsujikawa 2012-03-29 02:13:33 +09:00
parent efebc1e1af
commit 8251fa1315
3 changed files with 23 additions and 2 deletions

View File

@ -88,7 +88,16 @@ fi
AM_CONDITIONAL([HAVE_CUNIT], [ test "x${have_cunit}" = "xyes" ])
# openssl (for examples)
PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1])
PKG_CHECK_MODULES([OPENSSL], [openssl >= 1.0.1],
[have_openssl=yes], [have_openssl=no])
if test "x${have_openssl}" = "xno"; then
AC_MSG_NOTICE($OPENSSL_PKG_ERRORS)
AC_MSG_NOTICE([The example programs will not be built.])
fi
# The example programs depend on OpenSSL
enable_examples=$have_openssl
AM_CONDITIONAL([ENABLE_EXAMPLES], [ test "x${enable_examples}" = "xyes" ])
# Checks for header files.
AC_CHECK_HEADERS([ \
@ -152,4 +161,6 @@ AC_MSG_NOTICE([summary of build options:
CFlags: ${CFLAGS}
Library types: Shared=${enable_shared}, Static=${enable_static}
CUnit: ${have_cunit}
OpenSSL: ${have_openssl}
Examples: ${enable_examples}
])

View File

@ -21,6 +21,8 @@
# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
if ENABLE_EXAMPLES
AM_CFLAGS = -Wall
AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \
@OPENSSL_CFLAGS@ @DEFS@
@ -63,3 +65,5 @@ spdynative_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \
${SPDY_SERVER_OBJECTS} ${SPDY_SERVER_HFILES} \
spdy.h spdynative.cc
endif # HAVE_STDCXX_11
endif # ENABLE_EXAMPLES

View File

@ -40,6 +40,12 @@ main_LDFLAGS = -static @CUNIT_LIBS@
AM_CFLAGS = -Wall -g -O2 -I${top_srcdir}/lib -I${top_srcdir}/lib/includes -I${top_builddir}/lib/includes \
@CUNIT_CFLAGS@ @DEFS@
TESTS = main end_to_end.py
TESTS = main
if ENABLE_EXAMPLES
TESTS += end_to_end.py
endif # ENABLE_EXAMPLES
endif # HAVE_CUNIT