1
# Configure paths for libOggFLAC
4
dnl AM_PATH_LIBOGGFLAC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
5
dnl Test for libOggFLAC, and define LIBOGGFLAC_CFLAGS and LIBOGGFLAC_LIBS
7
AC_DEFUN(AM_PATH_LIBOGGFLAC,
9
dnl Get the cflags and libraries
11
AC_ARG_WITH(libOggFLAC,[ --with-libOggFLAC=PFX Prefix where libOggFLAC is installed (optional)], libOggFLAC_prefix="$withval", libOggFLAC_prefix="")
12
AC_ARG_WITH(libOggFLAC-libraries,[ --with-libOggFLAC-libraries=DIR Directory where libOggFLAC library is installed (optional)], libOggFLAC_libraries="$withval", libOggFLAC_libraries="")
13
AC_ARG_WITH(libOggFLAC-includes,[ --with-libOggFLAC-includes=DIR Directory where libOggFLAC header files are installed (optional)], libOggFLAC_includes="$withval", libOggFLAC_includes="")
14
AC_ARG_ENABLE(libOggFLACtest, [ --disable-libOggFLACtest Do not try to compile and run a test libOggFLAC program],, enable_libOggFLACtest=yes)
16
if test "x$libOggFLAC_libraries" != "x" ; then
17
LIBOGGFLAC_LIBS="-L$libOggFLAC_libraries"
18
elif test "x$libOggFLAC_prefix" != "x" ; then
19
LIBOGGFLAC_LIBS="-L$libOggFLAC_prefix/lib"
20
elif test "x$prefix" != "xNONE" ; then
21
LIBOGGFLAC_LIBS="-L$prefix/lib"
24
LIBOGGFLAC_LIBS="$LIBOGGFLAC_LIBS -lOggFLAC -lFLAC -lm"
26
if test "x$libOggFLAC_includes" != "x" ; then
27
LIBOGGFLAC_CFLAGS="-I$libOggFLAC_includes"
28
elif test "x$libOggFLAC_prefix" != "x" ; then
29
LIBOGGFLAC_CFLAGS="-I$libOggFLAC_prefix/include"
30
elif test "$prefix" != "xNONE"; then
31
LIBOGGFLAC_CFLAGS="-I$prefix/include"
34
AC_MSG_CHECKING(for libOggFLAC)
38
if test "x$enable_libOggFLACtest" = "xyes" ; then
39
ac_save_CFLAGS="$CFLAGS"
40
ac_save_CXXFLAGS="$CXXFLAGS"
42
CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
43
CXXFLAGS="$CXXFLAGS $LIBOGGFLAC_CFLAGS"
44
LIBS="$LIBS $LIBOGGFLAC_LIBS"
46
dnl Now check if the installed libOggFLAC is sufficiently new.
48
rm -f conf.libOggFLACtest
53
#include <OggFLAC/stream_decoder.h>
57
system("touch conf.libOggFLACtest");
61
],, no_libOggFLAC=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
62
CFLAGS="$ac_save_CFLAGS"
66
if test "x$no_libOggFLAC" = "x" ; then
68
ifelse([$1], , :, [$1])
71
if test -f conf.libOggFLACtest ; then
74
echo "*** Could not run libOggFLAC test program, checking why..."
75
CFLAGS="$CFLAGS $LIBOGGFLAC_CFLAGS"
76
LIBS="$LIBS $LIBOGGFLAC_LIBS"
79
#include <OggFLAC/stream_decoder.h>
81
[ echo "*** The test program compiled, but did not run. This usually means"
82
echo "*** that the run-time linker is not finding libOggFLAC or finding the wrong"
83
echo "*** version of libOggFLAC. If it is not finding libOggFLAC, you'll need to set your"
84
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
85
echo "*** to the installed location Also, make sure you have run ldconfig if that"
86
echo "*** is required on your system"
88
echo "*** If you have an old version installed, it is best to remove it, although"
89
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
90
[ echo "*** The test program failed to compile or link. See the file config.log for the"
91
echo "*** exact error that occured. This usually means libOggFLAC was incorrectly installed"
92
echo "*** or that you have moved libOggFLAC since it was installed. In the latter case, you"
93
echo "*** may want to edit the libOggFLAC-config script: $LIBOGGFLAC_CONFIG" ])
94
CFLAGS="$ac_save_CFLAGS"
99
ifelse([$2], , :, [$2])
101
AC_SUBST(LIBOGGFLAC_CFLAGS)
102
AC_SUBST(LIBOGGFLAC_LIBS)
103
rm -f conf.libOggFLACtest