Blame configure.ac

Packit Service a9274b
dnl Process this file with autoconf to produce a configure script.
Packit Service a9274b
AC_PREREQ(2.59)
Packit Service a9274b
AC_INIT(alsa-utils, 1.2.4)
Packit Service a9274b
AC_CONFIG_SRCDIR([aplay/aplay.c])
Packit Service a9274b
AC_PREFIX_DEFAULT(/usr)
Packit Service a9274b
AM_INIT_AUTOMAKE
Packit Service a9274b
Packit Service a9274b
AM_MAINTAINER_MODE([enable])
Packit Service a9274b
Packit Service a9274b
AM_GNU_GETTEXT([external])
Packit Service a9274b
AM_GNU_GETTEXT_VERSION([0.19.8])
Packit Service a9274b
Packit Service a9274b
dnl Checks for programs.
Packit Service a9274b
Packit Service a9274b
AC_PROG_CC
Packit Service a9274b
dnl AC_PROG_CXX
Packit Service a9274b
AC_PROG_INSTALL
Packit Service a9274b
AC_PROG_MKDIR_P
Packit Service a9274b
AC_PROG_LN_S
Packit Service a9274b
AC_PROG_SED
Packit Service a9274b
PKG_PROG_PKG_CONFIG
Packit Service a9274b
AM_PATH_ALSA(1.0.27)
Packit Service a9274b
if test "x$enable_alsatest" = "xyes"; then
Packit Service a9274b
AC_CHECK_FUNC([snd_ctl_elem_add_enumerated],
Packit Service a9274b
	      , [AC_ERROR([No user enum control support in alsa-lib])])
Packit Service a9274b
fi
Packit Service a9274b
Packit Service a9274b
dnl Check components
Packit Service a9274b
AC_CHECK_HEADERS([alsa/pcm.h], [have_pcm="yes"], [have_pcm="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([alsa/mixer.h], [have_mixer="yes"], [have_mixer="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([alsa/rawmidi.h], [have_rawmidi="yes"], [have_rawmidi="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([alsa/seq.h], [have_seq="yes"], [have_seq="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([alsa/use-case.h], [have_ucm="yes"], [have_ucm="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([alsa/topology.h], [have_topology="yes"], [have_topology="no"],
Packit Service a9274b
  [#include <alsa/asoundlib.h>])
Packit Service a9274b
AC_CHECK_HEADERS([samplerate.h], [have_samplerate="yes"], [have_samplerate="no"],
Packit Service a9274b
  [#include <samplerate.h>])
Packit Service a9274b
Packit Service a9274b
AC_CHECK_LIB([asound], [snd_seq_client_info_get_card], [HAVE_SEQ_CLIENT_INFO_GET_CARD="yes"])
Packit Service a9274b
if test "$HAVE_SEQ_CLIENT_INFO_GET_CARD" = "yes" ; then
Packit Service a9274b
    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_CARD], 1, [alsa-lib supports snd_seq_client_info_get_card])
Packit Service a9274b
fi
Packit Service a9274b
AC_CHECK_LIB([asound], [snd_seq_client_info_get_pid], [HAVE_SEQ_CLIENT_INFO_GET_PID="yes"])
Packit Service a9274b
if test "$HAVE_SEQ_CLIENT_INFO_GET_PID" = "yes" ; then
Packit Service a9274b
    AC_DEFINE([HAVE_SEQ_CLIENT_INFO_GET_PID], 1, [alsa-lib supports snd_seq_client_info_get_pid])
Packit Service a9274b
fi
Packit Service a9274b
AC_CHECK_LIB([atopology], [snd_tplg_save], [have_topology="yes"], [have_topology="no"])
Packit Service a9274b
Packit Service a9274b
#
Packit Service a9274b
# NOTE: The library 'libffado' (at least v2.4.1) executes ctor/dtor of instances
Packit Service a9274b
# for some objects in startup/finish routines of C runtime. As a result, it
Packit Service a9274b
# outputs some superfluos messages. Furthermore, it brings much memory leak
Packit Service a9274b
# internally. Totally, libffado support is not recommended at all in usual
Packit Service a9274b
# purposes except for technical preview.
Packit Service a9274b
#
Packit Service a9274b
AC_CHECK_LIB([ffado], [ffado_streaming_init], [have_ffado="yes"], [have_ffado="no"])
Packit Service a9274b
AS_IF([test x"$have_ffado" = xyes],
Packit Service a9274b
      [AC_DEFINE([WITH_FFADO], [1], [Define if FFADO library is available])])
Packit Service a9274b
Packit Service a9274b
AM_CONDITIONAL(HAVE_PCM, test "$have_pcm" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_MIXER, test "$have_mixer" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_RAWMIDI, test "$have_rawmidi" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_SEQ, test "$have_seq" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_UCM, test "$have_ucm" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_TOPOLOGY, test "$have_topology" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_SAMPLERATE, test "$have_samplerate" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_FFADO, test "$have_ffado" = "yes")
Packit Service a9274b
Packit Service a9274b
dnl Use tinyalsa
Packit Service a9274b
alsabat_backend_tiny=
Packit Service a9274b
AC_ARG_ENABLE(alsabat_backend_tiny,
Packit Service a9274b
    AS_HELP_STRING([--enable-alsabat-backend-tiny], [Use tinyalsa for alsabat backend]),
Packit Service a9274b
    [case "${enableval}" in
Packit Service a9274b
      yes) alsabat_backend_tiny=true ;;
Packit Service a9274b
      no) alsabat_backend_tiny=false ;;
Packit Service a9274b
      *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsabat-backend-tiny) ;;
Packit Service a9274b
    esac],[alsabat_backend_tiny=false])
Packit Service a9274b
Packit Service a9274b
dnl Disable bat
Packit Service a9274b
bat=
Packit Service a9274b
if test "$have_pcm" = "yes"; then
Packit Service a9274b
AC_ARG_ENABLE(bat,
Packit Service a9274b
     AS_HELP_STRING([--disable-bat], [Disable bat compilation]),
Packit Service a9274b
     [case "${enableval}" in
Packit Service a9274b
       yes) bat=true ;;
Packit Service a9274b
       no)  bat=false ;;
Packit Service a9274b
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-bat) ;;
Packit Service a9274b
     esac],[bat=true])
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(BAT, test x$bat = xtrue)
Packit Service a9274b
Packit Service a9274b
if test x$bat = xtrue; then
Packit Service a9274b
Packit Service a9274b
  saved_CFLAGS="$CFLAGS"
Packit Service a9274b
  saved_LDFLAGS="$LDFLAGS"
Packit Service a9274b
  saved_LIBS="$LIBS"
Packit Service a9274b
  FFTW_INC=""
Packit Service a9274b
  FFTW_LIB=""
Packit Service a9274b
  FFTW_CFLAGS=""
Packit Service a9274b
  dnl Check for libfftw3
Packit Service a9274b
  have_libfftw3="yes"
Packit Service a9274b
  AC_CHECK_LIB([fftw3f], [fftwf_malloc], , [have_libfftw3="no"])
Packit Service a9274b
  dnl Check for libtinyalsa
Packit Service a9274b
  have_libtinyalsa=
Packit Service a9274b
  if test x$alsabat_backend_tiny = xtrue; then
Packit Service a9274b
    have_libtinyalsa="yes"
Packit Service a9274b
    AC_CHECK_LIB([tinyalsa], [pcm_open], , [have_libtinyalsa="no"])
Packit Service a9274b
  fi
Packit Service a9274b
  AC_CHECK_LIB([m], [sqrtf], , [AC_MSG_ERROR([Error: Need sqrtf])])
Packit Service a9274b
  AC_CHECK_LIB([pthread], [pthread_create], , [AC_MSG_ERROR([Error: need PTHREAD library])])
Packit Service a9274b
  FFTW_CFLAGS="$CFLAGS"
Packit Service a9274b
  FFTW_LIB="$LIBS"
Packit Service a9274b
  CFLAGS="$saved_CFLAGS"
Packit Service a9274b
  LDFLAGS="$saved_LDFLAGS"
Packit Service a9274b
  LIBS="$saved_LIBS"
Packit Service a9274b
  AC_SUBST(FFTW_INC)
Packit Service a9274b
  AC_SUBST(FFTW_LIB)
Packit Service a9274b
  AC_SUBST(FFTW_CFLAGS)
Packit Service a9274b
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(HAVE_LIBFFTW3, test "$have_libfftw3" = "yes")
Packit Service a9274b
AM_CONDITIONAL(HAVE_LIBTINYALSA, test "$have_libtinyalsa" = "yes")
Packit Service a9274b
Packit Service a9274b
dnl Check for librt
Packit Service a9274b
LIBRT=""
Packit Service a9274b
AC_MSG_CHECKING(for librt)
Packit Service a9274b
AC_ARG_WITH(librt,
Packit Service a9274b
  AS_HELP_STRING([--with-librt], [Use librt for monotonic clock (default = yes)]),
Packit Service a9274b
  [ have_librt="$withval" ], [ have_librt="yes" ])
Packit Service a9274b
if test "$have_librt" = "yes"; then
Packit Service a9274b
  AC_CHECK_LIB([rt], [clock_gettime], [HAVE_LIBRT="yes"])
Packit Service a9274b
  if test "$HAVE_LIBRT" = "yes" ; then
Packit Service a9274b
    LIBRT="-lrt"
Packit Service a9274b
    AC_DEFINE([HAVE_LIBRT], 1, [Have librt])
Packit Service a9274b
    AC_DEFINE([HAVE_CLOCK_GETTIME], 1, [Have clock gettime])
Packit Service a9274b
  fi
Packit Service a9274b
else
Packit Service a9274b
  AC_MSG_RESULT(no)
Packit Service a9274b
fi
Packit Service a9274b
Packit Service a9274b
dnl Disable alsamixer
Packit Service a9274b
CURSESINC=""
Packit Service a9274b
CURSESLIB=""
Packit Service a9274b
CURSES_CFLAGS=""
Packit Service a9274b
alsamixer=
Packit Service a9274b
if test "$have_mixer" = "yes"; then
Packit Service a9274b
AC_ARG_ENABLE(alsamixer,
Packit Service a9274b
     AS_HELP_STRING([--disable-alsamixer], [Disable alsamixer compilation]),
Packit Service a9274b
     [case "${enableval}" in
Packit Service a9274b
       yes) alsamixer=true ;;
Packit Service a9274b
       no)  alsamixer=false ;;
Packit Service a9274b
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;;
Packit Service a9274b
     esac],[alsamixer=true])
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
Packit Service a9274b
Packit Service a9274b
dnl Disable alsaconf
Packit Service a9274b
AC_ARG_ENABLE(alsaconf,
Packit Service a9274b
     AS_HELP_STRING([--disable-alsaconf], [Disable alsaconf packaging]),
Packit Service a9274b
     [case "${enableval}" in
Packit Service a9274b
       yes) alsaconf=true ;;
Packit Service a9274b
       no)  alsaconf=false ;;
Packit Service a9274b
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsaconf) ;;
Packit Service a9274b
     esac],[alsaconf=true])
Packit Service a9274b
AM_CONDITIONAL(ALSACONF, test x$alsaconf = xtrue)
Packit Service a9274b
Packit Service a9274b
dnl Disable alsaloop
Packit Service a9274b
AC_ARG_ENABLE(alsaloop,
Packit Service a9274b
     AS_HELP_STRING([--disable-alsaloop], [Disable alsaloop packaging]),
Packit Service a9274b
     [case "${enableval}" in
Packit Service a9274b
       yes) alsaloop=true ;;
Packit Service a9274b
       no)  alsaloop=false ;;
Packit Service a9274b
       *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsaloop) ;;
Packit Service a9274b
     esac],[alsaloop=true])
Packit Service a9274b
AM_CONDITIONAL(ALSALOOP, test x$alsaloop = xtrue)
Packit Service a9274b
Packit Service a9274b
xmlto_available=""
Packit Service a9274b
AC_ARG_ENABLE(xmlto,
Packit Service a9274b
 AS_HELP_STRING([--disable-xmlto], [Disable man page creation via xmlto]),
Packit Service a9274b
 xmlto="$enableval", xmlto="yes")
Packit Service a9274b
if test "$xmlto" = "yes"; then
Packit Service a9274b
  AC_CHECK_PROG([xmlto_available], [xmlto], [yes])
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(USE_XMLTO, test x"$xmlto_available" = xyes)
Packit Service a9274b
Packit Service a9274b
rst2man_available=""
Packit Service a9274b
AC_ARG_ENABLE(rst2man,
Packit Service a9274b
 AS_HELP_STRING([--disable-rst2man], [Disable man page creation via rst2man]),
Packit Service a9274b
 rst2man="$enableval", rst2man="yes")
Packit Service a9274b
if test "$rst2man" = "yes"; then
Packit Service a9274b
  AC_CHECK_PROG([rst2man_available], [rst2man], [yes])
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(USE_RST2MAN, test x"$rst2man_available" = xyes)
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH(
Packit Service a9274b
        [udev-rules-dir],
Packit Service a9274b
        AS_HELP_STRING([--with-udev-rules-dir=DIR],[Directory where to install udev rules to (default=auto)]),
Packit Service a9274b
        [udevrulesdir="$withval"],
Packit Service a9274b
        [udevdir=$($PKG_CONFIG udev --variable=udevdir)
Packit Service a9274b
        if test "x$udevdir" = "x"; then
Packit Service a9274b
            udevrulesdir="/lib/udev/rules.d"
Packit Service a9274b
        else
Packit Service a9274b
            udevrulesdir="$udevdir/rules.d"
Packit Service a9274b
        fi])
Packit Service a9274b
AC_SUBST(udevrulesdir)
Packit Service a9274b
Packit Service a9274b
dnl Checks for header files.
Packit Service a9274b
AC_HEADER_STDC
Packit Service a9274b
if test x$alsamixer = xtrue; then
Packit Service a9274b
  AC_ARG_WITH(curses,
Packit Service a9274b
    AS_HELP_STRING([--with-curses=libname], [Specify the curses library to use (default=auto)]),
Packit Service a9274b
    curseslib="$withval",
Packit Service a9274b
    curseslib="auto")
Packit Service a9274b
  CURSESLIBDIR=""
Packit Service a9274b
  NCURSESLIBSUFFIX=""
Packit Service a9274b
  CURSES_NLS="no"
Packit Service a9274b
  if test "$curseslib" = "ncursesw" -o \( "$curseslib" = "auto" -a "$USE_NLS" = "yes" \); then
Packit Service a9274b
    dnl First try out pkg-config, then fall back to old config scripts.
Packit Service a9274b
    PKG_CHECK_MODULES([NCURSESW], [ncursesw], [
Packit Service a9274b
        CURSESINC="<ncurses.h>"
Packit Service a9274b
        CURSESLIB="${NCURSESW_LIBS}"
Packit Service a9274b
        CURSESLIBDIR=
Packit Service a9274b
        CURSES_CFLAGS="${NCURSESW_CFLAGS}"
Packit Service a9274b
        curseslib="ncursesw"
Packit Service a9274b
      ], [
Packit Service a9274b
        AC_CHECK_PROG([ncursesw5_config], [ncursesw5-config], [yes])
Packit Service a9274b
        if test "$ncursesw5_config" = "yes"; then
Packit Service a9274b
          CURSESINC="<ncurses.h>"
Packit Service a9274b
          CURSESLIB=`ncursesw5-config --libs`
Packit Service a9274b
          CURSESLIBDIR=`ncursesw5-config --libdir`
Packit Service a9274b
          CURSES_CFLAGS=`ncursesw5-config --cflags`
Packit Service a9274b
          curseslib="ncursesw"
Packit Service a9274b
        else
Packit Service a9274b
          AC_CHECK_LIB(ncursesw, initscr,
Packit Service a9274b
                     [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncursesw'; curseslib="ncursesw"])
Packit Service a9274b
        fi
Packit Service a9274b
      ])
Packit Service a9274b
    if test -n "$CURSESINC"; then
Packit Service a9274b
      NCURSESLIBSUFFIX="w"
Packit Service a9274b
      CURSES_NLS="yes"
Packit Service a9274b
    fi
Packit Service a9274b
  fi
Packit Service a9274b
  if test "$curseslib" = "ncurses" -o "$curseslib" = "auto"; then
Packit Service a9274b
    dnl First try out pkg-config, then fall back to old config scripts.
Packit Service a9274b
    PKG_CHECK_MODULES([NCURSES], [ncurses], [
Packit Service a9274b
        CURSESINC="<ncurses.h>"
Packit Service a9274b
        CURSESLIB="${NCURSES_LIBS}"
Packit Service a9274b
        CURSESLIBDIR=
Packit Service a9274b
        CURSES_CFLAGS="${NCURSES_CFLAGS}"
Packit Service a9274b
        curseslib="ncurses"
Packit Service a9274b
      ], [
Packit Service a9274b
        AC_CHECK_PROG([ncurses5_config], [ncurses5-config], [yes])
Packit Service a9274b
        if test "$ncurses5_config" = "yes"; then
Packit Service a9274b
          CURSESINC="<ncurses.h>"
Packit Service a9274b
          CURSESLIB=`ncurses5-config --libs`
Packit Service a9274b
          CURSESLIBDIR=`ncurses5-config --libdir`
Packit Service a9274b
          CURSES_CFLAGS=`ncurses5-config --cflags`
Packit Service a9274b
          curseslib="ncurses"
Packit Service a9274b
        else
Packit Service a9274b
          AC_CHECK_LIB(ncurses, initscr,
Packit Service a9274b
                     [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncurses'; curseslib="ncurses"])
Packit Service a9274b
        fi
Packit Service a9274b
      ])
Packit Service a9274b
  fi
Packit Service a9274b
  if test "$curseslib" = "curses" -o "$curseslib" = "auto"; then
Packit Service a9274b
    AC_CHECK_LIB(curses, initscr,
Packit Service a9274b
                 [ CURSESINC='<curses.h>'; CURSESLIB='-lcurses'; curseslib="curses"])
Packit Service a9274b
  fi
Packit Service a9274b
  if test -z "$CURSESINC"; then
Packit Service a9274b
     AC_MSG_ERROR(this packages requires a curses library)
Packit Service a9274b
  fi
Packit Service a9274b
Packit Service a9274b
  AC_MSG_CHECKING([for curses library])
Packit Service a9274b
  AC_MSG_RESULT([$curseslib])
Packit Service a9274b
  AC_MSG_CHECKING([for curses header name])
Packit Service a9274b
  AC_MSG_RESULT([$CURSESINC])
Packit Service a9274b
  AC_MSG_CHECKING([for curses compiler flags])
Packit Service a9274b
  AC_MSG_RESULT([$CURSES_CFLAGS])
Packit Service a9274b
Packit Service a9274b
  dnl CURSESLIBS might have the library path at the beginning.  If so, we cut it
Packit Service a9274b
  dnl off so that we can insert the other curses libraries before the ncurses
Packit Service a9274b
  dnl library but after the library path (which is later again prepended below).
Packit Service a9274b
  if test -n "$CURSESLIBDIR"; then
Packit Service a9274b
    if test "-L$CURSESLIBDIR " = "$(echo $CURSESLIB | cut -c-$((${#CURSESLIBDIR}+3)) )"; then
Packit Service a9274b
      CURSESLIB="$(echo $CURSESLIB | cut -c$((${#CURSESLIBDIR}+4))-)"
Packit Service a9274b
    fi
Packit Service a9274b
  fi
Packit Service a9274b
Packit Service a9274b
  saved_CFLAGS="$CFLAGS"
Packit Service a9274b
  saved_LDFLAGS="$LDFLAGS"
Packit Service a9274b
  saved_LIBS="$LIBS"
Packit Service a9274b
  CFLAGS="$CFLAGS $CURSES_CFLAGS"
Packit Service a9274b
  if test -n "$CURSESLIBDIR"; then
Packit Service a9274b
    LDFLAGS="$LDFLAGS -L$CURSESLIBDIR"
Packit Service a9274b
  fi
Packit Service a9274b
  LIBS="$CURSESLIB $LIBS"
Packit Service a9274b
Packit Service a9274b
  AC_TRY_LINK([#include <panel.h>], [set_escdelay(100);],[HAVE_CURSES_ESCDELAY="yes"])
Packit Service a9274b
  if test "$HAVE_CURSES_ESCDELAY" = "yes"; then
Packit Service a9274b
    AC_DEFINE([HAVE_CURSES_ESCDELAY], 1, [Have curses set_escdelay])
Packit Service a9274b
  fi
Packit Service a9274b
Packit Service a9274b
  if test "$USE_NLS" = "yes"; then
Packit Service a9274b
    AC_MSG_CHECKING([for curses NLS support])
Packit Service a9274b
    dnl In theory, a single-byte curses works just fine in ISO 8859-* locales.
Packit Service a9274b
    dnl In practice, however, everybody uses UTF-8 nowadays, so we'd better
Packit Service a9274b
    dnl check for wide-character support.
Packit Service a9274b
    dnl For ncurses/ncursesw, CURSES_NLS was already set above.
Packit Service a9274b
    if test "$curseslib" = "curses"; then
Packit Service a9274b
      AC_TRY_LINK([
Packit Service a9274b
          #define _XOPEN_SOURCE 1
Packit Service a9274b
          #define _XOPEN_SOURCE_EXTENDED 1
Packit Service a9274b
          #include <curses.h>
Packit Service a9274b
        ], [
Packit Service a9274b
          cchar_t wc;
Packit Service a9274b
          setcchar(&wc, L"x", A_NORMAL, 0, 0);
Packit Service a9274b
        ],
Packit Service a9274b
        [CURSES_NLS="yes"])
Packit Service a9274b
    fi
Packit Service a9274b
    AC_MSG_RESULT([$CURSES_NLS])
Packit Service a9274b
    if test "$CURSES_NLS" = "yes"; then
Packit Service a9274b
      AC_DEFINE([ENABLE_NLS_IN_CURSES], [1],
Packit Service a9274b
                [Define if curses-based programs can show translated messages.])
Packit Service a9274b
    fi
Packit Service a9274b
  fi
Packit Service a9274b
Packit Service a9274b
  AC_CHECK_HEADERS([panel.h menu.h form.h], [],
Packit Service a9274b
                   [AC_MSG_ERROR([required curses helper header not found])])
Packit Service a9274b
  AC_CHECK_LIB([panel$NCURSESLIBSUFFIX], [new_panel],
Packit Service a9274b
               [CURSESLIB="-lpanel$NCURSESLIBSUFFIX $CURSESLIB"],
Packit Service a9274b
               [AC_MSG_ERROR([panel$NCURSESLIBSUFFIX library not found])])
Packit Service a9274b
  AC_CHECK_LIB([menu$NCURSESLIBSUFFIX], [new_menu],
Packit Service a9274b
               [CURSESLIB="-lmenu$NCURSESLIBSUFFIX $CURSESLIB"],
Packit Service a9274b
               [AC_MSG_ERROR([menu$NCURSESLIBSUFFIX library not found])])
Packit Service a9274b
  AC_CHECK_LIB([form$NCURSESLIBSUFFIX], [new_form],
Packit Service a9274b
               [CURSESLIB="-lform$NCURSESLIBSUFFIX $CURSESLIB"],
Packit Service a9274b
               [AC_MSG_ERROR([form$NCURSESLIBSUFFIX library not found])])
Packit Service a9274b
Packit Service a9274b
  CFLAGS="$saved_CFLAGS"
Packit Service a9274b
  LDFLAGS="$saved_LDFLAGS"
Packit Service a9274b
  LIBS="$saved_LIBS"
Packit Service a9274b
Packit Service a9274b
  if test -n "$CURSESLIBDIR"; then
Packit Service a9274b
    CURSESLIB="-L$CURSESLIBDIR $CURSESLIB"
Packit Service a9274b
  fi
Packit Service a9274b
Packit Service a9274b
  AC_MSG_CHECKING([for curses linker flags])
Packit Service a9274b
  AC_MSG_RESULT([$CURSESLIB])
Packit Service a9274b
fi
Packit Service a9274b
Packit Service a9274b
AC_SUBST(CURSESINC)
Packit Service a9274b
AC_SUBST(CURSESLIB)
Packit Service a9274b
AC_SUBST(CURSES_CFLAGS)
Packit Service a9274b
Packit Service a9274b
test "x$prefix" = xNONE && prefix=$ac_default_prefix
Packit Service a9274b
Packit Service a9274b
eval dir="$datadir"
Packit Service a9274b
case "$dir" in
Packit Service a9274b
/*) ;;
Packit Service a9274b
*) dir="$prefix/share"
Packit Service a9274b
esac
Packit Service a9274b
Packit Service a9274b
soundsdir="$dir/sounds/alsa"
Packit Service a9274b
AC_DEFINE_UNQUOTED(SOUNDSDIR, "$soundsdir", [directory containing sample data])
Packit Service a9274b
Packit Service a9274b
mydatadir="$dir/alsa"
Packit Service a9274b
AC_DEFINE_UNQUOTED(DATADIR, "$mydatadir", [directory containing alsa configuration])
Packit Service a9274b
AC_SUBST(mydatadir)
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH(testsound,
Packit Service a9274b
  AS_HELP_STRING([--with-testsound=file], [give the path of test sound file for alsaconf]),
Packit Service a9274b
  TESTSOUND="$withval",
Packit Service a9274b
  TESTSOUND="$dir/test.wav")
Packit Service a9274b
AC_SUBST(TESTSOUND)
Packit Service a9274b
Packit Service a9274b
AC_CONFIG_HEADERS(include/aconfig.h)
Packit Service a9274b
Packit Service a9274b
dnl Checks for typedefs, structures, and compiler characteristics.
Packit Service a9274b
AC_C_CONST
Packit Service a9274b
AC_C_INLINE
Packit Service a9274b
AC_HEADER_TIME
Packit Service a9274b
Packit Service a9274b
dnl Checks for library functions.
Packit Service a9274b
AC_PROG_GCC_TRADITIONAL
Packit Service a9274b
Packit Service a9274b
dnl Enable largefile support
Packit Service a9274b
AC_SYS_LARGEFILE
Packit Service a9274b
Packit Service a9274b
SAVE_UTIL_VERSION
Packit Service a9274b
Packit Service a9274b
AC_SUBST(LIBRT)
Packit Service a9274b
Packit Service a9274b
dnl Check for systemd
Packit Service a9274b
PKG_CHECK_MODULES(SYSTEMD, [systemd >= 18],
Packit Service a9274b
        [have_min_systemd="yes"],
Packit Service a9274b
        [have_min_systemd="no"])
Packit Service a9274b
AC_ARG_WITH([systemdsystemunitdir],
Packit Service a9274b
        AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
Packit Service a9274b
        [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
Packit Service a9274b
if test "x$with_systemdsystemunitdir" != xno; then
Packit Service a9274b
        AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
Packit Service a9274b
fi
Packit Service a9274b
AM_CONDITIONAL(HAVE_SYSTEMD, [test "$have_min_systemd" = "yes" \
Packit Service a9274b
        -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH([asound-state-dir],
Packit Service a9274b
        AS_HELP_STRING([--with-asound-state-dir=DIR], [Directory to place asound.state file in]),
Packit Service a9274b
        [ASOUND_STATE_DIR="$withval"],
Packit Service a9274b
        [ASOUND_STATE_DIR="/var/lib/alsa"])
Packit Service a9274b
AC_SUBST(ASOUND_STATE_DIR)
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH([alsactl-lock-dir],
Packit Service a9274b
        AS_HELP_STRING([--with-alsactl-lock-dir=DIR], [Directory to place lock files in]),
Packit Service a9274b
        [ASOUND_LOCK_DIR="$withval"],
Packit Service a9274b
        [ASOUND_LOCK_DIR="/var/lock"])
Packit Service a9274b
AC_SUBST(ASOUND_LOCK_DIR)
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH([alsactl-pidfile-dir],
Packit Service a9274b
        AS_HELP_STRING([--with-alsactl-pidfile-dir=DIR], [Directory to place alsactl.pid file in]),
Packit Service a9274b
        [ALSACTL_PIDFILE_DIR="$withval"],
Packit Service a9274b
        [ALSACTL_PIDFILE_DIR="/var/run"])
Packit Service a9274b
AC_SUBST(ALSACTL_PIDFILE_DIR)
Packit Service a9274b
Packit Service a9274b
AC_ARG_WITH([alsactl-daemonswitch],
Packit Service a9274b
        AS_HELP_STRING([--with-alsactl-daemonswitch=FILE], [File to test for the daemon mode]),
Packit Service a9274b
        [ALSACTL_DAEMONSWITCH="$withval"],
Packit Service a9274b
        [ALSACTL_DAEMONSWITCH="/etc/alsa/state-daemon.conf"])
Packit Service a9274b
AC_SUBST(ALSACTL_DAEMONSWITCH)
Packit Service a9274b
Packit Service a9274b
AC_OUTPUT(Makefile alsactl/Makefile alsactl/init/Makefile \
Packit Service a9274b
	  alsamixer/Makefile amidi/Makefile amixer/Makefile \
Packit Service a9274b
	  m4/Makefile po/Makefile.in \
Packit Service a9274b
	  alsaconf/alsaconf alsaconf/Makefile \
Packit Service a9274b
	  alsaconf/po/Makefile \
Packit Service a9274b
	  alsaucm/Makefile topology/Makefile \
Packit Service a9274b
	  bat/Makefile bat/tests/Makefile bat/tests/asound_state/Makefile \
Packit Service a9274b
	  aplay/Makefile include/Makefile iecset/Makefile utils/Makefile \
Packit Service a9274b
	  utils/alsa-utils.spec seq/Makefile seq/aconnect/Makefile \
Packit Service a9274b
	  seq/aplaymidi/Makefile seq/aseqdump/Makefile seq/aseqnet/Makefile \
Packit Service a9274b
	  speaker-test/Makefile speaker-test/samples/Makefile \
Packit Service a9274b
	  alsaloop/Makefile alsa-info/Makefile \
Packit Service a9274b
	  axfer/Makefile axfer/test/Makefile)