From 139bcbf9aef5423d9f34acd5f129ead7cd6de989 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Sat, 17 Mar 2012 05:36:42 -0400 Subject: [PATCH] configure.ac: Add --enable-{client,server,examples} These default respectively to yes, yes, no. --- configure.ac | 18 ++++++++++++++++++ man/Makefile.am | 10 +++++++++- scripts/Makefile.am | 4 +++- src/examples/Makefile.am | 4 +++- src/frontend/Makefile.am | 10 +++++++++- 5 files changed, 42 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 49eb146..898ac7b 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,24 @@ AC_ARG_ENABLE([compile-warnings], AC_SUBST([WARNING_CXXFLAGS]) AC_SUBST([PICKY_CXXFLAGS]) +AC_ARG_ENABLE([client], + [AS_HELP_STRING([--enable-client], [Build the mosh-client program @<:@yes@:>@])], + [build_client="$enableval"], + [build_client="yes"]) +AM_CONDITIONAL([BUILD_CLIENT], [test x"$build_client" != xno]) + +AC_ARG_ENABLE([server], + [AS_HELP_STRING([--enable-server], [Build the mosh-server program @<:@yes@:>@])], + [build_server="$enableval"], + [build_server="yes"]) +AM_CONDITIONAL([BUILD_SERVER], [test x"$build_server" != xno]) + +AC_ARG_ENABLE([examples], + [AS_HELP_STRING([--enable-examples], [Build the miscellaneous programs in src/examples @<:@no@:>@])], + [build_examples="$enableval"], + [build_examples="no"]) +AM_CONDITIONAL([BUILD_EXAMPLES], [test x"$build_examples" != xno]) + # Checks for libraries. AC_SEARCH_LIBS([utempter_remove_added_record], [utempter], [AC_DEFINE([HAVE_UTEMPTER], [1], diff --git a/man/Makefile.am b/man/Makefile.am index ca7bff6..53c8640 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -1 +1,9 @@ -dist_man_MANS = mosh.1 mosh-client.1 mosh-server.1 +dist_man_MANS = + +if BUILD_CLIENT + dist_man_MANS += mosh.1 mosh-client.1 +endif + +if BUILD_SERVER + dist_man_MANS += mosh-server.1 +endif diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 21eaf27..b66566b 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -1 +1,3 @@ -dist_bin_SCRIPTS = mosh +if BUILD_CLIENT + dist_bin_SCRIPTS = mosh +endif diff --git a/src/examples/Makefile.am b/src/examples/Makefile.am index e11cfa6..47b4bbd 100644 --- a/src/examples/Makefile.am +++ b/src/examples/Makefile.am @@ -1,7 +1,9 @@ AM_CPPFLAGS = $(protobuf_CFLAGS) AM_CXXFLAGS = $(WARNING_CXXFLAGS) $(PICKY_CXXFLAGS) -fno-default-inline -pipe -noinst_PROGRAMS = encrypt decrypt ntester parse termemu benchmark +if BUILD_EXAMPLES + noinst_PROGRAMS = encrypt decrypt ntester parse termemu benchmark +endif encrypt_SOURCES = encrypt.cc encrypt_CPPFLAGS = -I$(srcdir)/../crypto diff --git a/src/frontend/Makefile.am b/src/frontend/Makefile.am index 1affc12..7591c96 100644 --- a/src/frontend/Makefile.am +++ b/src/frontend/Makefile.am @@ -9,7 +9,15 @@ else LDADD += $(STDDJB_LDFLAGS) endif -bin_PROGRAMS = mosh-client mosh-server +bin_PROGRAMS = + +if BUILD_CLIENT + bin_PROGRAMS += mosh-client +endif + +if BUILD_SERVER + bin_PROGRAMS += mosh-server +endif mosh_client_SOURCES = mosh-client.cc stmclient.cc stmclient.h terminaloverlay.cc terminaloverlay.h mosh_server_SOURCES = mosh-server.cc