add configure options to disable optional features

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

@ -77,23 +77,36 @@ 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],
AS_HELP_STRING([--disable-input-alsa],
[do not include support for input from alsa streams])
)
AS_IF([test "x$enable_input_alsa" != "xno"], [
AC_CHECK_LIB(asound, snd_pcm_open, have_alsa=yes, have_alsa=no)
if [[ $have_alsa = "yes" ]] ; then if [[ $have_alsa = "yes" ]] ; then
LIBS="$LIBS -lasound" LIBS="$LIBS -lasound"
CPPFLAGS="$CPPFLAGS -DALSA" CPPFLAGS="$CPPFLAGS -DALSA"
fi fi
if [[ $have_alsa = "no" ]] ; then if [[ $have_alsa = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No alsa dev files found building without alsa support]) AC_MSG_NOTICE([WARNING: No alsa dev files found building without alsa support])
fi 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],
AS_HELP_STRING([--disable-input-pulse],
[do not include support for input from pulseaudio])
)
AS_IF([test "x$enable_input_pulse" != "xno"], [
AC_CHECK_LIB(pulse-simple, pa_simple_new, have_pulse=yes, have_pulse=no)
if [[ $have_pulse = "yes" ]] ; then if [[ $have_pulse = "yes" ]] ; then
LIBS="$LIBS -lpulse-simple -lpulse" LIBS="$LIBS -lpulse-simple -lpulse"
CPPFLAGS="$CPPFLAGS -DPULSE" CPPFLAGS="$CPPFLAGS -DPULSE"
@ -101,14 +114,22 @@ AC_CHECK_LIB(pulse-simple, pa_simple_new, have_pulse=yes, have_pulse=no)
if [[ $have_pulse = "no" ]] ; then if [[ $have_pulse = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No pusleaudio dev files found building without pulseaudio support]) AC_MSG_NOTICE([WARNING: No pusleaudio dev files found building without pulseaudio support])
fi 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],
AS_HELP_STRING([--disable-input-portaudio],
[do not include support for input from portaudio])
)
AS_IF([test "x$enable_input_portaudio" != "xno"], [
AC_CHECK_LIB(portaudio, Pa_Initialize, have_portaudio=yes, have_portaudio=no)
if [[ $have_portaudio = "yes" ]] ; then if [[ $have_portaudio = "yes" ]] ; then
LIBS="$LIBS -lportaudio" LIBS="$LIBS -lportaudio"
CPPFLAGS="$CPPFLAGS -DPORTAUDIO" CPPFLAGS="$CPPFLAGS -DPORTAUDIO"
@ -116,14 +137,22 @@ AC_CHECK_LIB(portaudio, Pa_Initialize, have_portaudio=yes, have_portaudio=no)
if [[ $have_portaudio = "no" ]] ; then if [[ $have_portaudio = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No portaudio dev files found building without portaudio support]) AC_MSG_NOTICE([WARNING: No portaudio dev files found building without portaudio support])
fi 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],
AS_HELP_STRING([--disable-input-sndio],
[do not include support for input from sndio])
)
AS_IF([test "x$enable_input_sndio" != "xno"], [
AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
if [[ $have_sndio = "yes" ]] ; then if [[ $have_sndio = "yes" ]] ; then
LIBS="$LIBS -lsndio" LIBS="$LIBS -lsndio"
CPPFLAGS="$CPPFLAGS -DSNDIO" CPPFLAGS="$CPPFLAGS -DSNDIO"
@ -131,9 +160,11 @@ AC_CHECK_LIB(sndio, sio_open, have_sndio=yes, have_sndio=no)
if [[ $have_sndio = "no" ]] ; then if [[ $have_sndio = "no" ]] ; then
AC_MSG_NOTICE([WARNING: No sndio dev files found building without sndio support]) AC_MSG_NOTICE([WARNING: No sndio dev files found building without sndio support])
fi 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,15 +194,21 @@ 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])
)
AS_IF([test "x$enable_output_ncurses" != "xno"], [
curses_config_bin="ncursesw6-config ncursesw5-config"
AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin) AC_PATH_PROGS(CURSES_CONFIG, $curses_config_bin)
AC_CHECK_LIB(ncursesw, initscr, AC_CHECK_LIB(ncursesw, initscr,
curses_lib=ncursesw curses_lib=ncursesw
) )
AC_CHECK_LIB($curses_lib, initscr, AC_CHECK_LIB($curses_lib, initscr,
if test "$CURSES_CONFIG" = "" ; then if test "$CURSES_CONFIG" = "" ; then
LIBS="$LIBS -l$curses_lib" LIBS="$LIBS -l$curses_lib"
CPPFLAGS="$CPPFLAGS -DNCURSES" CPPFLAGS="$CPPFLAGS -DNCURSES"
@ -180,24 +217,39 @@ AC_CHECK_LIB($curses_lib, initscr,
CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags` -DNCURSES" CPPFLAGS="$CPPFLAGS `$CURSES_CONFIG --cflags` -DNCURSES"
LIBS="$LIBS `$CURSES_CONFIG --libs`" LIBS="$LIBS `$CURSES_CONFIG --libs`"
fi fi
AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header])) AC_CHECK_HEADERS([curses.h], , AC_MSG_ERROR([missing curses.h header]))
AM_CONDITIONAL([NCURSES], [true]) have_ncurses=yes,
,
AC_MSG_NOTICE([WARNING: building without ncursesw support ncursesw is recomended!]) AC_MSG_NOTICE([WARNING: building without ncursesw support ncursesw is recomended!])
AM_CONDITIONAL([NCURSES], [false]) have_ncurses=no
) )],
[have_ncurses=no]
)
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],
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]) 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
if test "x$have_system_iniparser" = "xyes"; then
AC_SUBST(SYSTEM_LIBINIPARSER, 1) AC_SUBST(SYSTEM_LIBINIPARSER, 1)
AC_MSG_NOTICE([Using installed iniparser]) AC_MSG_NOTICE([Using installed iniparser])
LIBS="$LIBS -liniparser" LIBS="$LIBS -liniparser"
@ -208,12 +260,11 @@ AM_CONDITIONAL([SYSTEM_LIBINIPARSER], [test "x$have_system_iniparser" = "xyes"])
[AC_MSG_RESULT(iniparser > 3.2 test OK)], [AC_MSG_RESULT(iniparser > 3.2 test OK)],
[AC_MSG_RESULT(iniparser > 3.2 test failed falling back to legacy iniparser mode) [AC_MSG_RESULT(iniparser > 3.2 test failed falling back to legacy iniparser mode)
CPPFLAGS="$CPPFLAGS -DLEGACYINIPARSER"]) 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