From ca415a2a15b37c0415cd1ca15446df8dcfeb6401 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 10 Sep 2012 21:51:08 +0900 Subject: [PATCH] Add --enable-src configure option When --enable-src is given, the programs in src directory will be built. If --disable-src is given, those programs will not be built. If none of them are given, --enable-src is assumed. --- configure.ac | 15 +++++++++++++++ src/Makefile.am | 4 ++-- tests/Makefile.am | 4 ++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index be917e1..28f8df5 100644 --- a/configure.ac +++ b/configure.ac @@ -45,6 +45,11 @@ AC_ARG_ENABLE([maintainer-mode], [Turn on compile time warnings])], [maintainer_mode=$withval], [maintainer_mode=no]) +AC_ARG_ENABLE([src], + [AS_HELP_STRING([--enable-src], + [Build installable SPDY client/server programs in src])], + [request_src=$withval], [request_src=yes]) + AC_ARG_ENABLE([examples], [AS_HELP_STRING([--enable-examples], [Build example programs])], @@ -128,6 +133,15 @@ if test "x${have_libxml2}" = "xyes"; then fi AM_CONDITIONAL([HAVE_LIBXML2], [ test "x${have_libxml2}" = "xyes" ]) +# The src programs depend on OpenSSL +enable_src=no +if test "x${request_src}" = "xyes" && + test "x${have_openssl}" = "xyes"; then + enable_src=yes +fi + +AM_CONDITIONAL([ENABLE_SRC], [ test "x${enable_src}" = "xyes" ]) + # The example programs depend on OpenSSL enable_examples=no if test "x${request_examples}" = "xyes" && @@ -255,5 +269,6 @@ AC_MSG_NOTICE([summary of build options: OpenSSL: ${have_openssl} Libxml2: ${have_libxml2} Libevent(SSL): ${have_libevent_openssl} + Src: ${enable_src} Examples: ${enable_examples} ]) diff --git a/src/Makefile.am b/src/Makefile.am index 6cf23dc..86b9dcc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -21,7 +21,7 @@ # 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 +if ENABLE_SRC AM_CFLAGS = -Wall AM_CPPFLAGS = -Wall -I$(srcdir)/../lib/includes -I$(builddir)/../lib/includes \ @@ -92,4 +92,4 @@ shrpx_SOURCES = ${HELPER_OBJECTS} ${HELPER_HFILES} \ http-parser/http_parser.c http-parser/http_parser.h endif # HAVE_LIBEVENT_OPENSSL -endif # ENABLE_EXAMPLES +endif # ENABLE_SRC diff --git a/tests/Makefile.am b/tests/Makefile.am index 71b2395..21223d3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -54,11 +54,11 @@ AM_CFLAGS = -Wall -I${top_srcdir}/lib -I${top_srcdir}/lib/includes -I${top_build TESTS = main failmalloc -if ENABLE_EXAMPLES +if ENABLE_SRC EXTRA_DIST = end_to_end.py TESTS += end_to_end.py -endif # ENABLE_EXAMPLES +endif # ENABLE_SRC endif # HAVE_CUNIT