diff options
| author | Glenn Morris | 2013-07-26 21:18:21 -0400 |
|---|---|---|
| committer | Glenn Morris | 2013-07-26 21:18:21 -0400 |
| commit | 885e792c90bd0e34e017d3913b8453f5bbfdf1fe (patch) | |
| tree | dc7f015434b80b1e70291a9ef15ead4042518e83 | |
| parent | d85c4d508105431699fc200135a14bfa7d86c0d7 (diff) | |
| download | emacs-885e792c90bd0e34e017d3913b8453f5bbfdf1fe.tar.gz emacs-885e792c90bd0e34e017d3913b8453f5bbfdf1fe.zip | |
* configure.ac: Extend the --with-sound option
to allow specification of OSS or ALSA (see bug#14812#64).
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | configure.ac | 86 |
2 files changed, 62 insertions, 29 deletions
| @@ -1,3 +1,8 @@ | |||
| 1 | 2013-07-27 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * configure.ac: Extend the --with-sound option to allow | ||
| 4 | specification of OSS or ALSA (see bug#14812#64). | ||
| 5 | |||
| 1 | 2013-07-25 Glenn Morris <rgm@gnu.org> | 6 | 2013-07-25 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * info/dir: Add ido. | 8 | * info/dir: Add ido. |
diff --git a/configure.ac b/configure.ac index b79f3e005dc..d8557f29898 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -141,7 +141,18 @@ AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], | |||
| 141 | [string giving default POP mail host])], | 141 | [string giving default POP mail host])], |
| 142 | AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.])) | 142 | AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.])) |
| 143 | 143 | ||
| 144 | OPTION_DEFAULT_ON([sound],[don't compile with sound support]) | 144 | AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE], |
| 145 | [compile with sound support (VALUE one of: yes, ossaudio, alsa, no; | ||
| 146 | default yes). Only for GNU/Linux, FreeBSD, NetBSD, MinGW.])], | ||
| 147 | [ case "${withval}" in | ||
| 148 | yes|no|ossaudio|alsa) val=$withval ;; | ||
| 149 | *) AC_MSG_ERROR([`--with-sound=$withval' is invalid; | ||
| 150 | this option's value should be `yes', `no', `ossaudio', or `alsa'.]) | ||
| 151 | ;; | ||
| 152 | esac | ||
| 153 | with_sound=$val | ||
| 154 | ], | ||
| 155 | [with_sound=$with_features]) | ||
| 145 | 156 | ||
| 146 | dnl FIXME currently it is not the last. | 157 | dnl FIXME currently it is not the last. |
| 147 | dnl This should be the last --with option, because --with-x is | 158 | dnl This should be the last --with option, because --with-x is |
| @@ -1253,6 +1264,7 @@ AC_DEFUN([PKG_CHECK_MODULES], [ | |||
| 1253 | fi | 1264 | fi |
| 1254 | ]) | 1265 | ]) |
| 1255 | 1266 | ||
| 1267 | HAVE_SOUND=no | ||
| 1256 | if test "${with_sound}" != "no"; then | 1268 | if test "${with_sound}" != "no"; then |
| 1257 | # Sound support for GNU/Linux, the free BSDs, and MinGW. | 1269 | # Sound support for GNU/Linux, the free BSDs, and MinGW. |
| 1258 | AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h], | 1270 | AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h], |
| @@ -1262,47 +1274,61 @@ if test "${with_sound}" != "no"; then | |||
| 1262 | #include <windows.h> | 1274 | #include <windows.h> |
| 1263 | #endif | 1275 | #endif |
| 1264 | ]) | 1276 | ]) |
| 1265 | # Emulation library used on NetBSD. | 1277 | if test "${with_sound}" = "ossaudio" || test "${with_sound}" = "yes"; then |
| 1266 | AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) | 1278 | # Emulation library used on NetBSD. |
| 1279 | AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) | ||
| 1280 | test "${with_sound}" = "ossaudio" && test -z "$LIBSOUND" && \ | ||
| 1281 | AC_MSG_ERROR([ossaudio sound support requested but not found.]) | ||
| 1282 | dnl FIXME? If we did find ossaudio, should we set with_sound=ossaudio? | ||
| 1283 | dnl Traditionally, we go on to check for alsa too. Does that make sense? | ||
| 1284 | fi | ||
| 1267 | AC_SUBST(LIBSOUND) | 1285 | AC_SUBST(LIBSOUND) |
| 1268 | 1286 | ||
| 1269 | ALSA_REQUIRED=1.0.0 | 1287 | if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then |
| 1270 | ALSA_MODULES="alsa >= $ALSA_REQUIRED" | 1288 | ALSA_REQUIRED=1.0.0 |
| 1271 | PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no) | 1289 | ALSA_MODULES="alsa >= $ALSA_REQUIRED" |
| 1272 | if test $HAVE_ALSA = yes; then | 1290 | PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no) |
| 1273 | SAVE_CFLAGS="$CFLAGS" | 1291 | if test $HAVE_ALSA = yes; then |
| 1274 | SAVE_LIBS="$LIBS" | 1292 | SAVE_CFLAGS="$CFLAGS" |
| 1275 | CFLAGS="$ALSA_CFLAGS $CFLAGS" | 1293 | SAVE_LIBS="$LIBS" |
| 1276 | LIBS="$ALSA_LIBS $LIBS" | 1294 | CFLAGS="$ALSA_CFLAGS $CFLAGS" |
| 1277 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])], | 1295 | LIBS="$ALSA_LIBS $LIBS" |
| 1278 | emacs_alsa_normal=yes, | 1296 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <asoundlib.h>]], [[snd_lib_error_set_handler (0);]])], |
| 1279 | emacs_alsa_normal=no) | 1297 | emacs_alsa_normal=yes, |
| 1280 | if test "$emacs_alsa_normal" != yes; then | 1298 | emacs_alsa_normal=no) |
| 1281 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]], | 1299 | if test "$emacs_alsa_normal" != yes; then |
| 1282 | [[snd_lib_error_set_handler (0);]])], | 1300 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <alsa/asoundlib.h>]], |
| 1283 | emacs_alsa_subdir=yes, | 1301 | [[snd_lib_error_set_handler (0);]])], |
| 1284 | emacs_alsa_subdir=no) | 1302 | emacs_alsa_subdir=yes, |
| 1285 | if test "$emacs_alsa_subdir" != yes; then | 1303 | emacs_alsa_subdir=no) |
| 1286 | AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.]) | 1304 | if test "$emacs_alsa_subdir" != yes; then |
| 1305 | AC_MSG_ERROR([pkg-config found alsa, but it does not compile. See config.log for error messages.]) | ||
| 1306 | fi | ||
| 1307 | ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE" | ||
| 1287 | fi | 1308 | fi |
| 1288 | ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE" | ||
| 1289 | fi | ||
| 1290 | 1309 | ||
| 1291 | CFLAGS="$SAVE_CFLAGS" | 1310 | CFLAGS="$SAVE_CFLAGS" |
| 1292 | LIBS="$SAVE_LIBS" | 1311 | LIBS="$SAVE_LIBS" |
| 1293 | LIBSOUND="$LIBSOUND $ALSA_LIBS" | 1312 | LIBSOUND="$LIBSOUND $ALSA_LIBS" |
| 1294 | CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" | 1313 | CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" |
| 1295 | AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.]) | 1314 | AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.]) |
| 1296 | fi | 1315 | elif test "${with_sound}" = "alsa"; then |
| 1316 | AC_MSG_ERROR([ALSA sound support requested but not found.]) | ||
| 1317 | fi | ||
| 1318 | fi dnl with_sound = alsa|yes | ||
| 1297 | 1319 | ||
| 1298 | dnl Define HAVE_SOUND if we have sound support. We know it works and | 1320 | dnl Define HAVE_SOUND if we have sound support. We know it works and |
| 1299 | dnl compiles only on the specified platforms. For others, it | 1321 | dnl compiles only on the specified platforms. For others, it |
| 1300 | dnl probably doesn't make sense to try. | 1322 | dnl probably doesn't make sense to try. |
| 1323 | dnl FIXME So surely we should bypass this whole section if not using | ||
| 1324 | dnl one of these platforms? | ||
| 1301 | if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then | 1325 | if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then |
| 1302 | case "$opsys" in | 1326 | case "$opsys" in |
| 1303 | dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ | 1327 | dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ |
| 1328 | dnl Adjust the --with-sound help text if you change this. | ||
| 1304 | gnu-linux|freebsd|netbsd|mingw32) | 1329 | gnu-linux|freebsd|netbsd|mingw32) |
| 1305 | AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) | 1330 | AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) |
| 1331 | HAVE_SOUND=yes | ||
| 1306 | ;; | 1332 | ;; |
| 1307 | esac | 1333 | esac |
| 1308 | fi | 1334 | fi |
| @@ -4749,6 +4775,8 @@ echo " Does Emacs use -lpng? ${HAVE_PNG}" | |||
| 4749 | echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" | 4775 | echo " Does Emacs use -lrsvg-2? ${HAVE_RSVG}" |
| 4750 | echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" | 4776 | echo " Does Emacs use imagemagick? ${HAVE_IMAGEMAGICK}" |
| 4751 | 4777 | ||
| 4778 | echo " Does Emacs support sound? ${HAVE_SOUND}" | ||
| 4779 | |||
| 4752 | echo " Does Emacs use -lgpm? ${HAVE_GPM}" | 4780 | echo " Does Emacs use -lgpm? ${HAVE_GPM}" |
| 4753 | echo " Does Emacs use -ldbus? ${HAVE_DBUS}" | 4781 | echo " Does Emacs use -ldbus? ${HAVE_DBUS}" |
| 4754 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" | 4782 | echo " Does Emacs use -lgconf? ${HAVE_GCONF}" |