changeset 277:6d355f1b7eaf

* Patch from Richard Ash to make building the host optional, so you can at least build the SDK even if you don't have libsndfile
author cannam
date Thu, 12 Feb 2009 12:01:58 +0000
parents e03f9d0a8dc4
children bdedb6114fc6
files Makefile.in configure.ac
diffstat 2 files changed, 23 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Thu Feb 12 12:00:37 2009 +0000
+++ b/Makefile.in	Thu Feb 12 12:01:58 2009 +0000
@@ -34,7 +34,7 @@
 #   clean     -- remove binary targets
 #   distclean -- remove all targets
 #
-default:	all
+default: @TARGETS@
 
 # Compile flags
 #
--- a/configure.ac	Thu Feb 12 12:00:37 2009 +0000
+++ b/configure.ac	Thu Feb 12 12:01:58 2009 +0000
@@ -14,7 +14,28 @@
 
 AC_SEARCH_LIBS([dlopen],[dl])
 
-PKG_CHECK_MODULES([SNDFILE],[sndfile])
+dnl See if the user wants to build programs, or just the SDK
+AC_ARG_ENABLE(programs,	[AS_HELP_STRING([--enable-programs],
+	[enable building of example host and RDF generator [default=yes]])],
+	PROGS_ARGUMENT=$enableval,
+	PROGS_ARGUMENT="yes")
+
+dnl if the user wants progs, then we need to check for libsndfile
+if test "x$PROGS_ARGUMENT" = "xyes" ; then 
+	PKG_CHECK_MODULES([SNDFILE],[sndfile], 
+					  have_sndfile="yes", have_sndfile="no")
+	if test "x$have_sndfile" = "xyes" ; then
+		dnl all good, build everything
+		TARGETS="sdk plugins host rdfgen test"
+	else
+		dnl no libsndfile - can't build host!
+		AC_MSG_ERROR([libsndfile not found - cannot build example Vamp host!])
+	fi
+else
+	dnl user didn't want programs - so we won't build them
+	TARGETS="sdk plugins"
+fi
+
 AC_SUBST(SNDFILE_CFLAGS)
 AC_SUBST(SNDFILE_LIBS)