bat: don't link all binaries with fftw library, add missing header

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2015-10-27 17:15:58 +01:00
parent 9b757e3a64
commit bc352dfba9
2 changed files with 18 additions and 1 deletions

View file

@ -11,7 +11,10 @@ bat_SOURCES = \
convert.c \ convert.c \
alsa.c alsa.c
noinst_HEADERS = \
common.h
AM_CPPFLAGS = \ AM_CPPFLAGS = \
-Wall -I$(top_srcdir)/include -Wall -I$(top_srcdir)/include
bat_LDADD = -lasound bat_LDADD = @FFTW_LIB@

View file

@ -64,9 +64,23 @@ AM_CONDITIONAL(BAT, test x$bat = xtrue)
if test x$bat = xtrue; then 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([fftw3], [fftw_malloc], , [AC_MSG_ERROR([Error: need FFTW3 library])])
AC_CHECK_LIB([m], [sqrtf], , [AC_MSG_ERROR([Error: Need sqrtf])]) AC_CHECK_LIB([m], [sqrtf], , [AC_MSG_ERROR([Error: Need sqrtf])])
AC_CHECK_LIB([pthread], [pthread_create], , [AC_MSG_ERROR([Error: need PTHREAD library])]) 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 fi