Commit 885e792c authored by Glenn Morris's avatar Glenn Morris
Browse files

* configure.ac: Extend the --with-sound option

to allow specification of OSS or ALSA (see bug#14812#64).
parent d85c4d50
2013-07-27 Glenn Morris <rgm@gnu.org>
* configure.ac: Extend the --with-sound option to allow
specification of OSS or ALSA (see bug#14812#64).
2013-07-25 Glenn Morris <rgm@gnu.org> 2013-07-25 Glenn Morris <rgm@gnu.org>
* info/dir: Add ido. * info/dir: Add ido.
......
...@@ -141,7 +141,18 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], ...@@ -141,7 +141,18 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME],
[string giving default POP mail host])], [string giving default POP mail host])],
AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.])) AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.]))
OPTION_DEFAULT_ON([sound],[don't compile with sound support]) AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE],
[compile with sound support (VALUE one of: yes, ossaudio, alsa, no;
default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW.])],
[ case "${withval}" in
yes|no|ossaudio|alsa) val=$withval ;;
*) AC_MSG_ERROR([`--with-sound=$withval' is invalid;
this option's value should be `yes', `no', `ossaudio', or `alsa'.])
;;
esac
with_sound=$val
],
[with_sound=$with_features])
dnl FIXME currently it is not the last. dnl FIXME currently it is not the last.
dnl This should be the last --with option, because --with-x is dnl This should be the last --with option, because --with-x is
...@@ -1253,6 +1264,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [ ...@@ -1253,6 +1264,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [
fi fi
]) ])
HAVE_SOUND=no
if test "${with_sound}" != "no"; then if test "${with_sound}" != "no"; then
# Sound support for GNU/Linux, the free BSDs, and MinGW. # Sound support for GNU/Linux, the free BSDs, and MinGW.
AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h], AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h],
...@@ -1262,47 +1274,61 @@ if test "${with_sound}" != "no"; then ...@@ -1262,47 +1274,61 @@ if test "${with_sound}" != "no"; then
#include <windows.h> #include <windows.h>
#endif #endif
]) ])
# Emulation library used on NetBSD. if test "${with_sound}" = "ossaudio" || test "${with_sound}" = "yes"; then
AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) # Emulation library used on NetBSD.
AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
test "${with_sound}" = "ossaudio" && test -z "$LIBSOUND" && \
AC_MSG_ERROR([ossaudio sound support requested but not found.])
dnl FIXME? If we did find ossaudio, should we set with_sound=ossaudio?
dnl Traditionally, we go on to check for alsa too. Does that make sense?
fi
AC_SUBST(LIBSOUND) AC_SUBST(LIBSOUND)
ALSA_REQUIRED=1.0.0 if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then
ALSA_MODULES="alsa >= $ALSA_REQUIRED" ALSA_REQUIRED=1.0.0
PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no) ALSA_MODULES="alsa >= $ALSA_REQUIRED"
if test $HAVE_ALSA = yes; then PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
SAVE_CFLAGS="$CFLAGS" if test $HAVE_ALSA = yes; then
SAVE_LIBS="$LIBS" SAVE_CFLAGS="$CFLAGS"
CFLAGS="$ALSA_CFLAGS $CFLAGS" SAVE_LIBS="$LIBS"
LIBS="$ALSA_LIBS $LIBS" CFLAGS="$ALSA_CFLAGS $CFLAGS"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])], LIBS="$ALSA_LIBS $LIBS"
emacs_alsa_normal=yes, AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])],
emacs_alsa_normal=no) emacs_alsa_normal=yes,
if test "$emacs_alsa_normal" != yes; then emacs_alsa_normal=no)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]], if test "$emacs_alsa_normal" != yes; then
[[snd_lib_error_set_handler (0);]])], AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]],
emacs_alsa_subdir=yes, [[snd_lib_error_set_handler (0);]])],
emacs_alsa_subdir=no) emacs_alsa_subdir=yes,
if test "$emacs_alsa_subdir" != yes; then emacs_alsa_subdir=no)
AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.]) if test "$emacs_alsa_subdir" != yes; then
AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.])
fi
ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
fi fi
ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
fi
CFLAGS="$SAVE_CFLAGS" CFLAGS="$SAVE_CFLAGS"
LIBS="$SAVE_LIBS" LIBS="$SAVE_LIBS"
LIBSOUND="$LIBSOUND $ALSA_LIBS" LIBSOUND="$LIBSOUND $ALSA_LIBS"
CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.]) AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
fi elif test "${with_sound}" = "alsa"; then
AC_MSG_ERROR([ALSA sound support requested but not found.])
fi
fi dnl with_sound = alsa|yes
dnl Define HAVE_SOUND if we have sound support. We know it works and dnl Define HAVE_SOUND if we have sound support. We know it works and
dnl compiles only on the specified platforms. For others, it dnl compiles only on the specified platforms. For others, it
dnl probably doesn't make sense to try. dnl probably doesn't make sense to try.
dnl FIXME So surely we should bypass this whole section if not using
dnl one of these platforms?
if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
case "$opsys" in case "$opsys" in
dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__
dnl Adjust the --with-sound help text if you change this.
gnu-linux|freebsd|netbsd|mingw32) gnu-linux|freebsd|netbsd|mingw32)
AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.])
HAVE_SOUND=yes
;; ;;
esac esac
fi fi
...@@ -4749,6 +4775,8 @@ echo " Does Emacs use -lpng? ${HAVE_PNG}" ...@@ -4749,6 +4775,8 @@ echo " Does Emacs use -lpng? ${HAVE_PNG}"
echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}"
echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}"
echo " Does Emacs support sound? ${HAVE_SOUND}"
echo " Does Emacs use -lgpm? ${HAVE_GPM}" echo " Does Emacs use -lgpm? ${HAVE_GPM}"
echo " Does Emacs use -ldbus? ${HAVE_DBUS}" echo " Does Emacs use -ldbus? ${HAVE_DBUS}"
echo " Does Emacs use -lgconf? ${HAVE_GCONF}" echo " Does Emacs use -lgconf? ${HAVE_GCONF}"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment