From bc352dfba9f344ce60de70bfd374e809f614aee3 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Tue, 27 Oct 2015 17:15:58 +0100 Subject: [PATCH] bat: don't link all binaries with fftw library, add missing header Signed-off-by: Jaroslav Kysela --- bat/Makefile.am | 5 ++++- configure.ac | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/bat/Makefile.am b/bat/Makefile.am index 3a76d7f..c0b5966 100644 --- a/bat/Makefile.am +++ b/bat/Makefile.am @@ -11,7 +11,10 @@ bat_SOURCES = \ convert.c \ alsa.c +noinst_HEADERS = \ + common.h + AM_CPPFLAGS = \ -Wall -I$(top_srcdir)/include -bat_LDADD = -lasound +bat_LDADD = @FFTW_LIB@ diff --git a/configure.ac b/configure.ac index 25f9d77..cbeb196 100644 --- a/configure.ac +++ b/configure.ac @@ -64,9 +64,23 @@ AM_CONDITIONAL(BAT, test x$bat = xtrue) if test x$bat = xtrue; then + saved_CFLAGS="$CFLAGS" + saved_LDFLAGS="$LDFLAGS" + saved_LIBS="$LIBS" + FFTW_INC="" + FFTW_LIB="" + FFTW_CFLAGS="" AC_CHECK_LIB([fftw3], [fftw_malloc], , [AC_MSG_ERROR([Error: need FFTW3 library])]) AC_CHECK_LIB([m], [sqrtf], , [AC_MSG_ERROR([Error: Need sqrtf])]) AC_CHECK_LIB([pthread], [pthread_create], , [AC_MSG_ERROR([Error: need PTHREAD library])]) + FFTW_CFLAGS="$CFLAGS" + FFTW_LIB="$LIBS" + CFLAGS="$saved_CFLAGS" + LDFLAGS="$saved_LDFLAGS" + LIBS="$saved_LIBS" + AC_SUBST(FFTW_INC) + AC_SUBST(FFTW_LIB) + AC_SUBST(FFTW_CFLAGS) fi