1 # Configure paths for libshout
2 # Jack Moffitt <jack@icecast.org> 08-06-2001
3 # Shamelessly stolen from Owen Taylor and Manish Singh
5 dnl AM_PATH_SHOUT2([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
6 dnl Test for libshout, and define SHOUT2_CFLAGS and SHOUT2_LIBS
8 AC_DEFUN(AM_PATH_SHOUT2,
10 dnl Get the cflags and libraries
12 AC_ARG_WITH(shout-prefix,[ --with-shout2-prefix=PFX Prefix where libshout2 is installed (optional)], shout2_prefix="$withval", shout2_prefix="")
13 AC_ARG_ENABLE(shout2test, [ --disable-shout2test Do not try to compile and run a test Shout2 program],, enable_shout2test=yes)
15 if test "x$shout2_prefix" != "xNONE" ; then
16 shout2_args="$shout2_args --prefix=$shout2_prefix"
17 SHOUT2_CFLAGS="-I$shout2_prefix/include"
18 SHOUT2_LIBS="-L$shout2_prefix/lib"
19 elif test "$prefix" != ""; then
20 shout2_args="$shout2_args --prefix=$prefix"
21 SHOUT2_CFLAGS="-I$prefix/include"
22 SHOUT2_LIBS="-L$prefix/lib"
25 SHOUT2_LIBS="$SHOUT2_LIBS -lshout -lpthread"
29 SHOUT2_LIBS="$SHOUT2_LIBS -lnsl -lsocket -lresolv"
32 AC_MSG_CHECKING(for Shout2)
35 if test "x$enable_shout2test" = "xyes" ; then
36 ac_save_CFLAGS="$CFLAGS"
38 CFLAGS="$CFLAGS $SHOUT2_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS"
39 LIBS="$LIBS $SHOUT2_LIBS $OGG_LIBS $VORBIS_LIBS"
41 dnl Now check if the installed Shout2 is sufficiently new.
48 #include <shout/shout.h>
52 system("touch conf.shout2test");
56 ],, no_shout2=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
57 CFLAGS="$ac_save_CFLAGS"
61 if test "x$no_shout2" = "x" ; then
63 ifelse([$1], , :, [$1])
66 if test -f conf.shout2test ; then
69 echo "*** Could not run Shout2 test program, checking why..."
70 CFLAGS="$CFLAGS $SHOUT2_CFLAGS $OGG_CFLAGS $VORBIS_CFLAGS"
71 LIBS="$LIBS $SHOUT2_LIBS $OGG_LIBS $VORBIS_LIBS"
74 #include <shout/shout.h>
76 [ echo "*** The test program compiled, but did not run. This usually means"
77 echo "*** that the run-time linker is not finding Shout2 or finding the wrong"
78 echo "*** version of Shout2. If it is not finding Shout2, you'll need to set your"
79 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
80 echo "*** to the installed location Also, make sure you have run ldconfig if that"
81 echo "*** is required on your system"
83 echo "*** If you have an old version installed, it is best to remove it, although"
84 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
85 [ echo "*** The test program failed to compile or link. See the file config.log for the"
86 echo "*** exact error that occured. This usually means Shout2 was incorrectly installed"
87 echo "*** or that you have moved Shout2 since it was installed. In the latter case, you"
88 echo "*** may want to edit the shout-config script: $SHOUT2_CONFIG" ])
89 CFLAGS="$ac_save_CFLAGS"
94 ifelse([$2], , :, [$2])
96 AC_SUBST(SHOUT2_CFLAGS)