2 # all .m4 files needed that might not be installed go here
5 # Configure paths for libogg
6 # Jack Moffitt <jack@icecast.org> 10-21-2000
7 # Shamelessly stolen from Owen Taylor and Manish Singh
9 dnl AM_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
10 dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
14 dnl Get the cflags and libraries
16 AC_ARG_WITH(ogg-prefix,[ --with-ogg-prefix=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
17 AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
19 if test x$ogg_prefix != x ; then
20 ogg_args="$ogg_args --prefix=$ogg_prefix"
21 OGG_CFLAGS="-I$ogg_prefix/include"
22 OGG_LIBS="-L$ogg_prefix/lib"
25 OGG_LIBS="$OGG_LIBS -logg"
27 AC_MSG_CHECKING(for Ogg)
31 if test "x$enable_oggtest" = "xyes" ; then
32 ac_save_CFLAGS="$CFLAGS"
34 CFLAGS="$CFLAGS $OGG_CFLAGS"
35 LIBS="$LIBS $OGG_LIBS"
37 dnl Now check if the installed Ogg is sufficiently new.
48 system("touch conf.oggtest");
52 ],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
53 CFLAGS="$ac_save_CFLAGS"
57 if test "x$no_ogg" = x ; then
59 ifelse([$1], , :, [$1])
62 if test -f conf.oggtest ; then
65 echo "*** Could not run Ogg test program, checking why..."
66 CFLAGS="$CFLAGS $OGG_CFLAGS"
67 LIBS="$LIBS $OGG_LIBS"
72 [ echo "*** The test program compiled, but did not run. This usually means"
73 echo "*** that the run-time linker is not finding Ogg or finding the wrong"
74 echo "*** version of Ogg. If it is not finding Ogg, you'll need to set your"
75 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
76 echo "*** to the installed location Also, make sure you have run ldconfig if that"
77 echo "*** is required on your system"
79 echo "*** If you have an old version installed, it is best to remove it, although"
80 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
81 [ echo "*** The test program failed to compile or link. See the file config.log for the"
82 echo "*** exact error that occured. This usually means Ogg was incorrectly installed"
83 echo "*** or that you have moved Ogg since it was installed. In the latter case, you"
84 echo "*** may want to edit the ogg-config script: $OGG_CONFIG" ])
85 CFLAGS="$ac_save_CFLAGS"
90 ifelse([$2], , :, [$2])