1 # Configure paths for libogg
2 # Jack Moffitt <jack@icecast.org> 10-21-2000
3 # Shamelessly stolen from Owen Taylor and Manish Singh
5 dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
6 dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
8 AC_DEFUN([XIPH_PATH_OGG],
10 dnl Get the cflags and libraries
12 AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
13 AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
14 AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
15 AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
17 if test "x$ogg_libraries" != "x" ; then
18 OGG_LIBS="-L$ogg_libraries"
19 elif test "x$ogg_prefix" != "x" ; then
20 OGG_LIBS="-L$ogg_prefix/lib"
21 elif test "x$prefix" != "xNONE" ; then
22 OGG_LIBS="-L$prefix/lib"
25 OGG_LIBS="$OGG_LIBS -logg"
27 if test "x$ogg_includes" != "x" ; then
28 OGG_CFLAGS="-I$ogg_includes"
29 elif test "x$ogg_prefix" != "x" ; then
30 OGG_CFLAGS="-I$ogg_prefix/include"
31 elif test "x$prefix" != "xNONE"; then
32 OGG_CFLAGS="-I$prefix/include"
35 AC_MSG_CHECKING(for Ogg)
39 if test "x$enable_oggtest" = "xyes" ; then
40 ac_save_CFLAGS="$CFLAGS"
42 CFLAGS="$CFLAGS $OGG_CFLAGS"
43 LIBS="$LIBS $OGG_LIBS"
45 dnl Now check if the installed Ogg is sufficiently new.
56 system("touch conf.oggtest");
60 ],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
61 CFLAGS="$ac_save_CFLAGS"
65 if test "x$no_ogg" = "x" ; then
67 ifelse([$1], , :, [$1])
70 if test -f conf.oggtest ; then
73 echo "*** Could not run Ogg test program, checking why..."
74 CFLAGS="$CFLAGS $OGG_CFLAGS"
75 LIBS="$LIBS $OGG_LIBS"
80 [ echo "*** The test program compiled, but did not run. This usually means"
81 echo "*** that the run-time linker is not finding Ogg or finding the wrong"
82 echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
83 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
84 echo "*** to the installed location Also, make sure you have run ldconfig if that"
85 echo "*** is required on your system"
87 echo "*** If you have an old version installed, it is best to remove it, although"
88 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
89 [ echo "*** The test program failed to compile or link. See the file config.log for the"
90 echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
91 echo "*** or that you have moved Ogg since it was installed." ])
92 CFLAGS="$ac_save_CFLAGS"
97 ifelse([$2], , :, [$2])