OSDN Git Service

added speaker-test utility by James Courtier-Dutton <James@superbug.demon.co.uk>
[android-x86/external-alsa-utils.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_PREREQ(2.53)
3 AC_INIT(alsamixer/alsamixer.c)
4 AC_PREFIX_DEFAULT(/usr)
5 AM_INIT_AUTOMAKE(alsa-utils, 1.0.4)
6
7 dnl Checks for programs.
8
9 dnl try to gues cross-compiler if not set
10 if test "x$target" != "x$host" -a -z "`echo $CC | grep -e '-gcc'`";
11 then
12   AC_MSG_CHECKING(for cross-compiler)
13
14   which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
15   which ${target_cpu}-${target_os}-gcc >/dev/null 2>&1 \
16   && CC=${target_cpu}-${target-os}-gcc
17   which ${target_cpu}-${target_vendor}-${target_os}-gcc >/dev/null 2>&1 \
18   && CC=${target_cpu}-${target_vendor}-${target_os}-gcc
19
20   AC_MSG_RESULT($CC)
21 fi
22
23 AC_PROG_CC
24 dnl AC_PROG_CXX
25 AC_PROG_INSTALL
26 AC_PROG_LN_S
27 AM_PATH_ALSA(0.9.0)
28
29 AC_ARG_ENABLE(alsamixer,
30      [  --disable-alsamixer     Disable alsamixer compilation],
31      [case "${enableval}" in
32        yes) alsamixer=true ;;
33        no)  alsamixer=false ;;
34        *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsamixer) ;;
35      esac],[alsamixer=true])
36 AM_CONDITIONAL(ALSAMIXER, test x$alsamixer = xtrue)
37
38 dnl Checks for header files.
39 AC_HEADER_STDC
40 if test x$alsamixer = xtrue; then
41   AC_ARG_WITH(curses,
42     [  --with-curses libname   Specify the curses library to use (default=auto)],
43     curseslib="$withval",
44     curseslib="auto")
45   if test "$curseslib" = "ncursesw"; then
46     AC_CHECK_LIB(ncursesw, initscr, 
47                  [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncursesw'; curseslib="ncursesw"])
48   fi
49   if test "$curseslib" = "ncurses" -o "$curseslib" = "auto"; then
50     AC_CHECK_LIB(ncurses, initscr, 
51                  [ CURSESINC='<ncurses.h>'; CURSESLIB='-lncurses'; curseslib="ncurses"])
52   fi
53   if test "$curseslib" = "curses" -o "$curseslib" = "auto"; then
54     AC_CHECK_LIB(curses, initscr, 
55                  [ CURSESINC='<curses.h>'; CURSESLIB='-lcurses'; curseslib="curses"])
56   fi
57   if test -z "$CURSESINC"; then
58      AC_MSG_ERROR(this packages requires a curses library)
59   fi
60 fi
61
62 AC_SUBST(CURSESINC)
63 AC_SUBST(CURSESLIB)
64
65 AC_ARG_WITH(testsound,
66   [  --with-testsound=file        give the path of test sound file for alsaconf],
67   TESTSOUND="$withval",
68   TESTSOUND="/usr/share/sounds/alsa/test.wav")
69 AC_SUBST(TESTSOUND)
70
71 AM_CONFIG_HEADER(include/aconfig.h)
72
73 dnl Checks for typedefs, structures, and compiler characteristics.
74 AC_C_CONST
75 AC_C_INLINE
76 AC_HEADER_TIME
77
78 dnl Checks for library functions.
79 AC_PROG_GCC_TRADITIONAL
80
81 SAVE_UTIL_VERSION
82
83 AC_OUTPUT(Makefile alsactl/Makefile alsamixer/Makefile amidi/Makefile amixer/Makefile \
84           alsaconf/alsaconf alsaconf/Makefile \
85           aplay/Makefile include/Makefile iecset/Makefile utils/Makefile \
86           utils/alsa-utils.spec seq/Makefile seq/aconnect/Makefile \
87           seq/aplaymidi/Makefile seq/aseqnet/Makefile \
88           speaker-test/Makefile)