2 # all .m4 files needed that might not be installed go here
4 # Configure paths for libogg
5 # Jack Moffitt <jack@icecast.org> 10-21-2000
6 # Shamelessly stolen from Owen Taylor and Manish Singh
8 dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
9 dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
11 AC_DEFUN([XIPH_PATH_OGG],
13 dnl Get the cflags and libraries
15 AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
16 AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
17 AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
18 AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
20 if test "x$ogg_libraries" != "x" ; then
21 OGG_LIBS="-L$ogg_libraries"
22 elif test "x$ogg_prefix" != "x" ; then
23 OGG_LIBS="-L$ogg_prefix/lib"
24 elif test "x$prefix" != "xNONE" ; then
25 OGG_LIBS="-L$prefix/lib"
28 OGG_LIBS="$OGG_LIBS -logg"
30 if test "x$ogg_includes" != "x" ; then
31 OGG_CFLAGS="-I$ogg_includes"
32 elif test "x$ogg_prefix" != "x" ; then
33 OGG_CFLAGS="-I$ogg_prefix/include"
34 elif test "x$prefix" != "xNONE"; then
35 OGG_CFLAGS="-I$prefix/include"
38 AC_MSG_CHECKING(for Ogg)
42 if test "x$enable_oggtest" = "xyes" ; then
43 ac_save_CFLAGS="$CFLAGS"
45 CFLAGS="$CFLAGS $OGG_CFLAGS"
46 LIBS="$LIBS $OGG_LIBS"
48 dnl Now check if the installed Ogg is sufficiently new.
59 system("touch conf.oggtest");
63 ],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
64 CFLAGS="$ac_save_CFLAGS"
68 if test "x$no_ogg" = "x" ; then
70 ifelse([$1], , :, [$1])
73 if test -f conf.oggtest ; then
76 echo "*** Could not run Ogg test program, checking why..."
77 CFLAGS="$CFLAGS $OGG_CFLAGS"
78 LIBS="$LIBS $OGG_LIBS"
83 [ echo "*** The test program compiled, but did not run. This usually means"
84 echo "*** that the run-time linker is not finding Ogg or finding the wrong"
85 echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
86 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
87 echo "*** to the installed location Also, make sure you have run ldconfig if that"
88 echo "*** is required on your system"
90 echo "*** If you have an old version installed, it is best to remove it, although"
91 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
92 [ echo "*** The test program failed to compile or link. See the file config.log for the"
93 echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
94 echo "*** or that you have moved Ogg since it was installed. In the latter case, you"
95 echo "*** may want to edit the ogg-config script: $OGG_CONFIG" ])
96 CFLAGS="$ac_save_CFLAGS"
101 ifelse([$2], , :, [$2])