Commit 6e7e4225 authored by Brendan Cully 's avatar Brendan Cully

Pay attention to $ao_prefix = "yes" and "no" (closes #283)

Really a five line diff but I had to reindent everything because it's all
wrappen in a new conditional.

svn path=/trunk/vorbis-tools/; revision=4277
parent 32c99c82
......@@ -235,42 +235,43 @@ AC_ARG_WITH(ao-libraries,[ --with-ao-libraries=DIR Directory where libao libr
AC_ARG_WITH(ao-includes,[ --with-ao-includes=DIR Directory where libao header files are installed (optional)], ao_includes="$withval", ao_includes="")
AC_ARG_ENABLE(aotest, [ --disable-aotest Do not try to compile and run a test ao program],, enable_aotest=yes)
if test "x$ao_prefix" != "xno"
then
if test "x$ao_libraries" != "x" ; then
AO_LIBS="-L$ao_libraries"
elif test "x$ao_prefix" != "x" -a "x$ao_prefix" != "xyes"; then
AO_LIBS="-L$ao_prefix/lib"
elif test "x$prefix" != "xNONE"; then
AO_LIBS="-L$prefix/lib"
fi
if test "x$ao_libraries" != "x" ; then
AO_LIBS="-L$ao_libraries"
elif test "x$ao_prefix" != "x"; then
AO_LIBS="-L$ao_prefix/lib"
elif test "x$prefix" != "xNONE"; then
AO_LIBS="-L$prefix/lib"
fi
if test "x$ao_includes" != "x" ; then
AO_CFLAGS="-I$ao_includes"
elif test "x$ao_prefix" != "x"; then
AO_CFLAGS="-I$ao_prefix/include"
elif test "x$prefix" != "xNONE"; then
AO_CFLAGS="-I$prefix/include"
fi
if test "x$ao_includes" != "x" ; then
AO_CFLAGS="-I$ao_includes"
elif test "x$ao_prefix" != "x" -a "x$ao_prefix" != "xyes"; then
AO_CFLAGS="-I$ao_prefix/include"
elif test "x$prefix" != "xNONE"; then
AO_CFLAGS="-I$prefix/include"
fi
# see where dl* and friends live
AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
your system may not be supported.])
# see where dl* and friends live
AC_CHECK_FUNCS(dlopen, [AO_DL_LIBS=""], [
AC_CHECK_LIB(dl, dlopen, [AO_DL_LIBS="-ldl"], [
AC_MSG_WARN([could not find dlopen() needed by libao sound drivers
your system may not be supported.])
])
])
])
AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
AO_LIBS="$AO_LIBS -lao $AO_DL_LIBS"
AC_MSG_CHECKING(for ao)
no_ao=""
AC_MSG_CHECKING(for ao)
no_ao=""
if test "x$enable_aotest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $AO_CFLAGS"
LIBS="$LIBS $AO_LIBS"
if test "x$enable_aotest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $AO_CFLAGS"
LIBS="$LIBS $AO_LIBS"
dnl
dnl Now check if the installed ao is sufficiently new.
dnl
......@@ -290,45 +291,46 @@ int main ()
],, no_ao=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_ao" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.aotest ; then
:
else
echo "*** Could not run ao test program, checking why..."
CFLAGS="$CFLAGS $AO_CFLAGS"
LIBS="$LIBS $AO_LIBS"
if test "x$no_ao" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.aotest ; then
:
else
echo "*** Could not run ao test program, checking why..."
CFLAGS="$CFLAGS $AO_CFLAGS"
LIBS="$LIBS $AO_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <ao/ao.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding ao or finding the wrong"
echo "*** version of ao. If it is not finding ao, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means ao was incorrectly installed"
echo "*** or that you have moved ao since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
AO_CFLAGS=""
AO_LIBS=""
ifelse([$2], , :, [$2])
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding ao or finding the wrong"
echo "*** version of ao. If it is not finding ao, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means ao was incorrectly installed"
echo "*** or that you have moved ao since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
AO_CFLAGS=""
AO_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(AO_CFLAGS)
AC_SUBST(AO_LIBS)
rm -f conf.aotest
fi
AC_SUBST(AO_CFLAGS)
AC_SUBST(AO_LIBS)
rm -f conf.aotest
])
dnl This macros shamelessly stolen from
......
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