From: Andre Noll <maan@systemlinux.org>
Date: Thu, 29 Aug 2013 21:42:43 +0000 (+0000)
Subject: build: Make audiod optional.
X-Git-Tag: v0.5.1~1^2~61
X-Git-Url: https://git.tuebingen.mpg.de/?a=commitdiff_plain;h=f233531e831e2616f9bfea8e825f0e5d3a2699c6;p=paraslash.git

build: Make audiod optional.

The previous two commits made para_server and para_client depend
on crypto support. This patch does the same thing for para_audiod.
It adds a section that sets $build_audiod to yes or no, depending
on whether a crypto library was detected. This clears the path to
making crypto support optional.
---

diff --git a/configure.ac b/configure.ac
index a6fc62af..e004eaf1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,7 +92,7 @@ AC_CHECK_FUNCS([atexit dup2 memchr memmove memset \
 AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
 
 
-executables="recv filter audioc write afh audiod play"
+executables="recv filter audioc write afh play"
 audio_format_handlers="mp3 wma"
 
 recv_cmdline_objs="add_cmdline(recv http_recv dccp_recv udp_recv afh_recv)"
@@ -123,15 +123,6 @@ audioc_errlist_objs="
 "
 audioc_ldflags=""
 
-audiod_cmdline_objs="add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
-audiod_errlist_objs="audiod signal string daemon stat net crypt_common sideband
-	time grab_client filter_common wav_filter compress_filter amp_filter http_recv dccp_recv
-	recv_common fd sched write_common file_write audiod_command fecdec_filter
-	client_common ggo udp_recv color fec prebuffer_filter version
-	bitstream imdct wma_common wmadec_filter buffer_tree"
-audiod_ldflags="-lm"
-audiod_audio_formats="wma"
-
 afh_cmdline_objs="add_cmdline(afh)"
 afh_errlist_objs="afh string fd mp3_afh afh_common time wma_afh wma_common
 	version ggo"
@@ -1178,6 +1169,54 @@ if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
 else
 	build_client="no"
 fi
+############################################################# audiod
+if test "$have_openssl" = "yes" -o "$have_gcrypt" = "yes"; then
+	build_audiod="yes"
+	executables="$executables audiod"
+	audiod_cmdline_objs="$audiod_cmdline_objs
+		add_cmdline(audiod compress_filter http_recv dccp_recv file_write client amp_filter udp_recv prebuffer_filter)"
+	audiod_errlist_objs="$audiod_errlist_objs
+		audiod
+		signal
+		string
+		daemon
+		stat
+		net
+		crypt_common
+		sideband
+		time
+		grab_client
+		filter_common
+		wav_filter
+		compress_filter
+		amp_filter
+		http_recv
+		dccp_recv
+		recv_common
+		fd
+		sched
+		write_common
+		file_write
+		audiod_command
+		fecdec_filter
+		client_common
+		ggo
+		udp_recv
+		color
+		fec
+		prebuffer_filter
+		version
+		bitstream
+		imdct
+		wma_common
+		wmadec_filter
+		buffer_tree
+	"
+	audiod_ldflags="$audiod_ldflags -lm"
+	audiod_audio_formats="$audiod_audio_formats wma"
+else
+	build_audiod="no"
+fi
 ############################################################# error2.h
 AC_MSG_NOTICE(creating error2.h)
 
@@ -1188,7 +1227,6 @@ all_errlist_objs="
 	$audioc_errlist_objs
 	$write_errlist_objs
 	$afh_errlist_objs
-	$audiod_errlist_objs
 	$play_errlist_objs
 "
 
@@ -1205,6 +1243,9 @@ fi
 if test "$build_client" = "yes"; then
 	all_errlist_objs="$all_errlist_objs $client_errlist_objs"
 fi
+if test "$build_audiod" = "yes"; then
+	all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
+fi
 
 all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
 
@@ -1351,4 +1392,5 @@ para_server: $build_server
 para_gui: $build_gui
 para_fade: $build_fade
 para_client: $build_client
+para_audiod: $build_audiod
 ])