comparison configure.in @ 70713:2b8661046f9e

* configure.in: Add check for ALSA.
author Jan Djärv <jan.h.d@swipnet.se>
date Thu, 18 May 2006 16:58:16 +0000
parents fd7f83c9079e
children 3708db32ecd4 ab6ab63755f7 a8190f7e546e
comparison
equal deleted inserted replaced
70712:070ab453b31f 70713:2b8661046f9e
1478 AC_CONFIG_LIBOBJ_DIR(src) 1478 AC_CONFIG_LIBOBJ_DIR(src)
1479 1479
1480 dnl Do this early because it can frob feature test macros for Unix-98 &c. 1480 dnl Do this early because it can frob feature test macros for Unix-98 &c.
1481 AC_SYS_LARGEFILE 1481 AC_SYS_LARGEFILE
1482 1482
1483
1484 dnl This function defintion taken from Gnome 2.0
1485 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1486 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1487 dnl also defines GSTUFF_PKG_ERRORS on error
1488 AC_DEFUN([PKG_CHECK_MODULES], [
1489 succeeded=no
1490
1491 if test -z "$PKG_CONFIG"; then
1492 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1493 fi
1494
1495 if test "$PKG_CONFIG" = "no" ; then
1496 ifelse([$4], , [AC_MSG_ERROR([
1497 *** The pkg-config script could not be found. Make sure it is in your path, or give the full path to pkg-config with the PKG_CONFIG environment variable or --with-pkg-config-prog. Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config.])], [$4])
1498 else
1499 PKG_CONFIG_MIN_VERSION=0.9.0
1500 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1501 AC_MSG_CHECKING(for $2)
1502
1503 if $PKG_CONFIG --exists "$2" ; then
1504 AC_MSG_RESULT(yes)
1505 succeeded=yes
1506
1507 AC_MSG_CHECKING($1_CFLAGS)
1508 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1509 AC_MSG_RESULT($$1_CFLAGS)
1510
1511 AC_MSG_CHECKING($1_LIBS)
1512 $1_LIBS=`$PKG_CONFIG --libs "$2"`
1513 AC_MSG_RESULT($$1_LIBS)
1514 else
1515 AC_MSG_RESULT(no)
1516 $1_CFLAGS=""
1517 $1_LIBS=""
1518 ## If we have a custom action on failure, don't print errors, but
1519 ## do set a variable so people can do so.
1520 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1521 ifelse([$4], ,echo $$1_PKG_ERRORS,)
1522 fi
1523
1524 AC_SUBST($1_CFLAGS)
1525 AC_SUBST($1_LIBS)
1526 else
1527 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1528 echo "*** See http://www.freedesktop.org/software/pkgconfig"
1529 fi
1530 fi
1531
1532 if test $succeeded = yes; then
1533 ifelse([$3], , :, [$3])
1534 else
1535 ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4])
1536 fi
1537 ])
1538
1539
1483 if test "${with_sound}" != "no"; then 1540 if test "${with_sound}" != "no"; then
1484 # Sound support for GNU/Linux and the free BSDs. 1541 # Sound support for GNU/Linux and the free BSDs.
1485 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h) 1542 AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
1486 # Emulation library used on NetBSD. 1543 # Emulation library used on NetBSD.
1487 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) 1544 AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
1488 AC_SUBST(LIBSOUND) 1545 AC_SUBST(LIBSOUND)
1546
1547 ALSA_REQUIRED=1.0.0
1548 ALSA_MODULES="alsa >= $ALSA_REQUIRED"
1549 dnl Check if --with-pkg-config-prog has been given.
1550 if test "X${with_pkg_config_prog}" != X; then
1551 PKG_CONFIG="${with_pkg_config_prog}"
1552 fi
1553 PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
1554 if test $HAVE_ALSA = yes; then
1555 LIBSOUND="$LIBSOUND $ALSA_LIBS"
1556 CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
1557 AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
1558 fi
1559 AC_SUBST(CFLAGS_SOUND)
1489 fi 1560 fi
1490 1561
1491 dnl checks for header files 1562 dnl checks for header files
1492 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \ 1563 AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
1493 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \ 1564 linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
1940 else 2011 else
1941 HAVE_X11R5=no 2012 HAVE_X11R5=no
1942 AC_MSG_RESULT(before 5) 2013 AC_MSG_RESULT(before 5)
1943 fi 2014 fi
1944 fi 2015 fi
1945
1946 dnl This function defintion taken from Gnome 2.0
1947 dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
1948 dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
1949 dnl also defines GSTUFF_PKG_ERRORS on error
1950 AC_DEFUN([PKG_CHECK_MODULES], [
1951 succeeded=no
1952
1953 if test -z "$PKG_CONFIG"; then
1954 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
1955 fi
1956
1957 if test "$PKG_CONFIG" = "no" ; then
1958 echo "*** The pkg-config script could not be found. Make sure it is"
1959 echo "*** in your path, or give the full path to pkg-config with"
1960 echo "*** the PKG_CONFIG environment variable or --with-pkg-config-prog."
1961 echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
1962 else
1963 PKG_CONFIG_MIN_VERSION=0.9.0
1964 if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
1965 AC_MSG_CHECKING(for $2)
1966
1967 if $PKG_CONFIG --exists "$2" ; then
1968 AC_MSG_RESULT(yes)
1969 succeeded=yes
1970
1971 AC_MSG_CHECKING($1_CFLAGS)
1972 $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
1973 AC_MSG_RESULT($$1_CFLAGS)
1974
1975 AC_MSG_CHECKING($1_LIBS)
1976 $1_LIBS=`$PKG_CONFIG --libs "$2"`
1977 AC_MSG_RESULT($$1_LIBS)
1978 else
1979 $1_CFLAGS=""
1980 $1_LIBS=""
1981 ## If we have a custom action on failure, don't print errors, but
1982 ## do set a variable so people can do so.
1983 $1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
1984 ifelse([$4], ,echo $$1_PKG_ERRORS,)
1985 fi
1986
1987 AC_SUBST($1_CFLAGS)
1988 AC_SUBST($1_LIBS)
1989 else
1990 echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
1991 echo "*** See http://www.freedesktop.org/software/pkgconfig"
1992 fi
1993 fi
1994
1995 if test $succeeded = yes; then
1996 ifelse([$3], , :, [$3])
1997 else
1998 ifelse([$4], , [AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.])], [$4])
1999 fi
2000 ])
2001 2016
2002 HAVE_GTK=no 2017 HAVE_GTK=no
2003 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then 2018 if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
2004 if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then 2019 if test "$USE_X_TOOLKIT" != "none" && test "$USE_X_TOOLKIT" != "maybe"; then
2005 AC_MSG_ERROR([Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}]); 2020 AC_MSG_ERROR([Conflicting options, --with-gtk is incompatible with --with-x-toolkit=${with_x_toolkit}]);
2915 #define HAVE_SOUND 1 2930 #define HAVE_SOUND 1
2916 #endif 2931 #endif
2917 #ifdef HAVE_SOUNDCARD_H 2932 #ifdef HAVE_SOUNDCARD_H
2918 #define HAVE_SOUND 1 2933 #define HAVE_SOUND 1
2919 #endif 2934 #endif
2935 #ifdef HAVE_ALSA
2936 #define HAVE_SOUND 1
2937 #endif
2920 #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */ 2938 #endif /* __FreeBSD__ || __NetBSD__ || __linux__ */
2921 2939
2922 /* If using GNU, then support inline function declarations. */ 2940 /* If using GNU, then support inline function declarations. */
2923 /* Don't try to switch on inline handling as detected by AC_C_INLINE 2941 /* Don't try to switch on inline handling as detected by AC_C_INLINE
2924 generally, because even if non-gcc compilers accept `inline', they 2942 generally, because even if non-gcc compilers accept `inline', they