ref: 09fde33f4e4d8c5c0163c42230e84ff8c9016afb
parent: 56c3897f605dbfbd3db55f46866275823c9ba4bd
author: David Seifert <soap@gentoo.org>
date: Sat Apr 21 08:49:45 EDT 2018
Disable examples when alsa/libsndfile are not present
--- a/Makefile.am
+++ b/Makefile.am
@@ -57,6 +57,8 @@
# examples/ #
#############
+if HAVE_LIBSNDFILE
+if HAVE_LIBALSA
noinst_PROGRAMS = examples/varispeed-play examples/timewarp-file
examples_varispeed_play_SOURCES = examples/varispeed-play.c examples/audio_out.c examples/audio_out.h
@@ -66,6 +68,8 @@
examples_timewarp_file_SOURCES = examples/timewarp-file.c
examples_timewarp_file_CFLAGS = $(SNDFILE_CFLAGS) $(ALSA_CFLAGS)
examples_timewarp_file_LDADD = src/libsamplerate.la $(SNDFILE_LIBS) $(ALSA_LIBS)
+endif
+endif
##########
# tests/ #
@@ -146,6 +150,10 @@
tests_multichan_throughput_test_CFLAGS = $(FFTW3_CFLAGS)
tests_multichan_throughput_test_LDADD = src/libsamplerate.la $(FFTW3_LIBS)
+if HAVE_LIBSNDFILE
+check_PROGRAMS += tests/src-evaluate
+
tests_src_evaluate_SOURCES = tests/src-evaluate.c tests/calc_snr.c tests/util.c
tests_src_evaluate_CFLAGS = $(SNDFILE_CFLAGS) $(FFTW3_CFLAGS)
tests_src_evaluate_LDADD = $(SNDFILE_LIBS) $(FFTW3_LIBS)
+endif
--- a/configure.ac
+++ b/configure.ac
@@ -199,6 +199,7 @@
])
])
])
+AM_CONDITIONAL([HAVE_LIBALSA], [test "x$enable_alsa" = "xyes"])
dnl ====================================================================================
dnl Check for libfftw3 which is required for the test and example programs.