add configure options to disable optional features

master
Adrian Rossiter 6 years ago
parent f60c79cab1
commit 87d150fb23
  1. 203
      configure.ac

@ -77,63 +77,94 @@ AC_CHECK_HEADER([alloca.h], [CPPFLAGS="$CPPFLAGS -DHAVE_ALLOCA_H"])
dnl ###################### dnl ######################
dnl checking for alsa dev dnl checking for alsa dev
dnl ###################### dnl ######################
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no) AC_ARG_ENABLE([input_alsa],
if [[ $have_alsa = "yes" ]] ; then AS_HELP_STRING([--disable-input-alsa],
LIBS="$LIBS -lasound" [do not include support for input from alsa streams])
CPPFLAGS="$CPPFLAGS -DALSA" )
fi
if [[ $have_alsa = "no" ]] ; then AS_IF([test "x$enable_input_alsa" != "xno"], [
AC_MSG_NOTICE([WARNING: No alsa dev files found building without alsa support]) AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
fi if [[ $have_alsa = "yes" ]] ; then
LIBS="$LIBS -lasound"
CPPFLAGS="$CPPFLAGS -DALSA"
fi
if [[ $have_alsa = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No alsa dev files found building without alsa support])
fi],
[have_alsa=no]
)
AM_CONDITIONAL([ALSA], [test x$have_alsa = xyes]) AM_CONDITIONAL([ALSA], [test "x$have_alsa" = "xyes"])
dnl ###################### dnl ######################
dnl checking for pulse dev dnl checking for pulse dev
dnl ###################### dnl ######################
AC_CHECK_LIB(pulse-simple, pa_simple_new, have_pulse=yes, have_pulse=no) AC_ARG_ENABLE([input_pulse],
if [[ $have_pulse = "yes" ]] ; then AS_HELP_STRING([--disable-input-pulse],
LIBS="$LIBS -lpulse-simple -lpulse" [do not include support for input from pulseaudio])
CPPFLAGS="$CPPFLAGS -DPULSE" )
fi
if [[ $have_pulse = "no" ]] ; then AS_IF([test "x$enable_input_pulse" != "xno"], [
AC_MSG_NOTICE([WARNING: No pusleaudio dev files found building without pulseaudio support]) AC_CHECK_LIB(pulse-simple, pa_simple_new, have_pulse=yes, have_pulse=no)
fi if [[ $have_pulse = "yes" ]] ; then
LIBS="$LIBS -lpulse-simple -lpulse"
CPPFLAGS="$CPPFLAGS -DPULSE"
fi
if [[ $have_pulse = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No pusleaudio dev files found building without pulseaudio support])
fi],
[have_pulse=no]
)
AM_CONDITIONAL([PULSE], [test x$have_pulse = xyes]) AM_CONDITIONAL([PULSE], [test "x$have_pulse" = "xyes"])
dnl ###################### dnl ######################
dnl checking for portaudio dev dnl checking for portaudio dev
dnl ###################### dnl ######################
AC_CHECK_LIB(portaudio, Pa_Initialize, have_portaudio=yes, have_portaudio=no) AC_ARG_ENABLE([input_portaudio],
if [[ $have_portaudio = "yes" ]] ; then AS_HELP_STRING([--disable-input-portaudio],
LIBS="$LIBS -lportaudio" [do not include support for input from portaudio])
CPPFLAGS="$CPPFLAGS -DPORTAUDIO" )
fi
if [[ $have_portaudio = "no" ]] ; then AS_IF([test "x$enable_input_portaudio" != "xno"], [
AC_MSG_NOTICE([WARNING: No portaudio dev files found building without portaudio support]) AC_CHECK_LIB(portaudio, Pa_Initialize, have_portaudio=yes, have_portaudio=no)
fi if [[ $have_portaudio = "yes" ]] ; then
LIBS="$LIBS -lportaudio"
CPPFLAGS="$CPPFLAGS -DPORTAUDIO"
fi
if [[ $have_portaudio = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No portaudio dev files found building without portaudio support])
fi],
[have_portaudio=no]
)
AM_CONDITIONAL([PORTAUDIO], [test x$have_portaudio = xyes]) AM_CONDITIONAL([PORTAUDIO], [test "x$have_portaudio" = "xyes"])
dnl ###################### dnl ######################
dnl checking for sndio dev dnl checking for sndio dev
dnl ###################### dnl ######################
AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no) AC_ARG_ENABLE([input_sndio],
if [[ $have_sndio = "yes" ]] ; then AS_HELP_STRING([--disable-input-sndio],
LIBS="$LIBS -lsndio" [do not include support for input from sndio])
CPPFLAGS="$CPPFLAGS -DSNDIO" )
fi
if [[ $have_sndio = "no" ]] ; then AS_IF([test "x$enable_input_sndio" != "xno"], [
AC_MSG_NOTICE([WARNING: No sndio dev files found building without sndio support]) AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
fi if [[ $have_sndio = "yes" ]] ; then
LIBS="$LIBS -lsndio"
CPPFLAGS="$CPPFLAGS -DSNDIO"
fi
if [[ $have_sndio = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No sndio dev files found building without sndio support])
fi],
[have_portaudio=no]
)
AM_CONDITIONAL([SNDIO], [test x$have_sndio = xyes]) AM_CONDITIONAL([SNDIO], [test "x$have_sndio" = "xyes"])
dnl ###################### dnl ######################
dnl checking for math lib dnl checking for math lib
@ -163,57 +194,77 @@ AC_CHECK_LIB(fftw3,fftw_execute, have_fftw=yes, have_fftw=no)
dnl ###################### dnl ######################
dnl checking for ncursesw dnl checking for ncursesw
dnl ###################### dnl ######################
curses_config_bin="ncursesw6-config ncursesw5-config" AC_ARG_ENABLE([output_ncurses],
AS_HELP_STRING([--disable-output-ncurses],
[do not include support for output with ncurses])
)
AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin) AS_IF([test "x$enable_output_ncurses" != "xno"], [
curses_config_bin="ncursesw6-config ncursesw5-config"
AC_CHECK_LIB(ncursesw, initscr, AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin)
curses_lib=ncursesw
) AC_CHECK_LIB(ncursesw, initscr,
curses_lib=ncursesw
)
AC_CHECK_LIB($curses_lib, initscr,
if test "$CURSES_CONFIG" = "" ; then
LIBS="$LIBS -l$curses_lib"
CPPFLAGS="$CPPFLAGS -DNCURSES"
fi
if test "$CURSES_CONFIG" != "" ; then
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags` -DNCURSES"
LIBS="$LIBS `$CURSES_CONFIG --libs`"
fi
AC_CHECK_LIB($curses_lib, initscr, AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
if test "$CURSES_CONFIG" = "" ; then have_ncurses=yes,
LIBS="$LIBS -l$curses_lib"
CPPFLAGS="$CPPFLAGS -DNCURSES" AC_MSG_NOTICE([WARNING: building without ncursesw support ncursesw is recomended!])
fi have_ncurses=no
if test "$CURSES_CONFIG" != "" ; then )],
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags` -DNCURSES" [have_ncurses=no]
LIBS="$LIBS `$CURSES_CONFIG --libs`" )
fi
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
AM_CONDITIONAL([NCURSES], [true])
,
AC_MSG_NOTICE([WARNING: building without ncursesw support ncursesw is recomended!])
AM_CONDITIONAL([NCURSES], [false])
)
AM_CONDITIONAL([NCURSES], [test "x$have_ncurses" = "xyes"])
dnl ###################### dnl ######################
dnl checking for system iniparser dnl checking for system iniparser
dnl ###################### dnl ######################
AC_SEARCH_LIBS([iniparser_load], [iniparser], [ AC_ARG_ENABLE([system_iniparser],
AC_CHECK_HEADERS([iniparser.h], [have_system_iniparser=yes]) AS_HELP_STRING([--disable-system-iniparser],
]) [do not use system iniparser library (use bundled iniparser library)])
)
AS_IF([test "x$enable_system_iniparser" != "xno"], [
AC_SEARCH_LIBS([iniparser_load], [iniparser], [
AC_CHECK_HEADERS([iniparser.h], [have_system_iniparser=yes])
])
],
[have_system_iniparser=no]
)
AM_CONDITIONAL([SYSTEM_LIBINIPARSER], [test "x$have_system_iniparser" = "xyes"]) AM_CONDITIONAL([SYSTEM_LIBINIPARSER], [test "x$have_system_iniparser" = "xyes"])
if test "x$have_system_iniparser" = "xyes"; then
AC_SUBST(SYSTEM_LIBINIPARSER, 1) if test "x$have_system_iniparser" = "xyes"; then
AC_MSG_NOTICE([Using installed iniparser]) AC_SUBST(SYSTEM_LIBINIPARSER, 1)
LIBS="$LIBS -liniparser" AC_MSG_NOTICE([Using installed iniparser])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iniparser.h>]], LIBS="$LIBS -liniparser"
[[dictionary* ini; AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iniparser.h>]],
const char *keys[3]; [[dictionary* ini;
iniparser_getseckeys(ini, "eq", keys);]])], const char *keys[3];
[AC_MSG_RESULT(iniparser > 3.2 test OK)], iniparser_getseckeys(ini, "eq", keys);]])],
[AC_MSG_RESULT(iniparser > 3.2 test failed falling back to legacy iniparser mode) [AC_MSG_RESULT(iniparser > 3.2 test OK)],
CPPFLAGS="$CPPFLAGS -DLEGACYINIPARSER"]) [AC_MSG_RESULT(iniparser > 3.2 test failed falling back to legacy iniparser mode)
CPPFLAGS="$CPPFLAGS -DLEGACYINIPARSER"])
else else
AC_SUBST(SYSTEM_LIBINIPARSER, 0) AC_SUBST(SYSTEM_LIBINIPARSER, 0)
AC_CONFIG_FILES(iniparser/Makefile) AC_CONFIG_FILES(iniparser/Makefile)
AC_MSG_NOTICE([Building iniparser]) AC_MSG_NOTICE([Building iniparser])
fi fi
dnl ############################ dnl ############################

Loading…
Cancel
Save