2 # Configure paths for libao
3 # Jack Moffitt <jack@icecast.org> 10-21-2000
4 # Shamelessly stolen from Owen Taylor and Manish Singh
6 dnl XIPH_PATH_AO([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
7 dnl Test for libao, and define AO_CFLAGS and AO_LIBS
9 AC_DEFUN([XIPH_PATH_AO],
11 dnl Get the cflags and libraries
13 AC_ARG_WITH(ao,[ --with-ao=PFX Prefix where libao is installed (optional)], ao_prefix="$withval", ao_prefix="")
14 AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao library is installed (optional)], ao_libraries="$withval", ao_libraries="")
15 AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
16 AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes)
19 if test "x$ao_libraries" != "x" ; then
20 AO_LIBS="-L$ao_libraries"
21 elif test "x$ao_prefix" != "x"; then
22 AO_LIBS="-L$ao_prefix/lib"
23 elif test "x$prefix" != "xNONE"; then
24 AO_LIBS="-L$prefix/lib"
27 if test "x$ao_includes" != "x" ; then
28 AO_CFLAGS="-I$ao_includes"
29 elif test "x$ao_prefix" != "x"; then
30 AO_CFLAGS="-I$ao_prefix/include"
31 elif test "x$prefix" != "xNONE"; then
32 AO_CFLAGS="-I$prefix/include"
35 # see where dl* and friends live
36 AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
37 AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
38 AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
39 your system may not be supported.])
43 AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
45 AC_MSG_CHECKING(for ao)
49 if test "x$enable_aotest" = "xyes" ; then
50 ac_save_CFLAGS="$CFLAGS"
52 CFLAGS="$CFLAGS $AO_CFLAGS"
55 dnl Now check if the installed ao is sufficiently new.
66 system("touch conf.aotest");
70 ],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
71 CFLAGS="$ac_save_CFLAGS"
75 if test "x$no_ao" = "x" ; then
77 ifelse([$1], , :, [$1])
80 if test -f conf.aotest ; then
83 echo "*** Could not run ao test program, checking why..."
84 CFLAGS="$CFLAGS $AO_CFLAGS"
90 [ echo "*** The test program compiled, but did not run. This usually means"
91 echo "*** that the run-time linker is not finding ao or finding the wrong"
92 echo "*** version of ao. If it is not finding ao, you'll need to set your"
93 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
94 echo "*** to the installed location Also, make sure you have run ldconfig if that"
95 echo "*** is required on your system"
97 echo "*** If you have an old version installed, it is best to remove it, although"
98 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
99 [ echo "*** The test program failed to compile or link. See the file config.log for the"
100 echo "*** exact error that occured. This usually means ao was incorrectly installed"
101 echo "*** or that you have moved ao since it was installed." ])
102 CFLAGS="$ac_save_CFLAGS"
107 ifelse([$2], , :, [$2])