Commit 4e4a6f9a authored by brendan's avatar brendan

Copied back from ices/m4/shout.m4 1.2. There must be a better way of keeping

these m4 macros synchronised.

svn path=/trunk/m4/; revision=4944
parent 055160b0
...@@ -14,46 +14,51 @@ SHOUT_LIBS="" ...@@ -14,46 +14,51 @@ SHOUT_LIBS=""
# Step 1: Use pkg-config if available # Step 1: Use pkg-config if available
m4_ifdef([PKG_CHECK_MODULES], m4_ifdef([PKG_CHECK_MODULES],
[# PKG_CHECK_MODULES available [# PKG_CHECK_MODULES available
PKG_CHECK_MODULES([SHOUT], [shout >= 2.0]) PKG_CHECK_MODULES([SHOUT], [shout])
have_shout="maybe"], have_shout="maybe"],
[# PKG_CHECK_MODULES is unavailable, search for pkg-config program [# PKG_CHECK_MODULES is unavailable, search for pkg-config program
AC_PATH_PROG([PKGCONFIG], [pkg-config], [none]) AC_PATH_PROG([PKGCONFIG], [pkg-config], [none])
if test "$PKGCONFIG" != "none" && `$PKGCONFIG --exists 'shout >= 2.0'` if test "$PKGCONFIG" != "none" && `$PKGCONFIG --exists shout`
then then
SHOUT_CFLAGS=`$PKGCONFIG --cflags` SHOUT_CFLAGS=`$PKGCONFIG --cflags shout`
SHOUT_LIBS=`$PKGCONFIG --libs` SHOUT_LIBS=`$PKGCONFIG --libs shout`
have_shout="maybe" have_shout="maybe"
else else
if test "$PKGCONFIG" != "none"
then
AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
fi
# Step 2: try shout-config # Step 2: try shout-config
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [none]) AC_PATH_PROG([SHOUTCONFIG], [shout-config], [none])
if test "$SHOUTCONFIG" != "none" -a `$SHOUTCONFIG --package` = "libshout" if test "$SHOUTCONFIG" != "none" && test `$SHOUTCONFIG --package` = "libshout"
then then
SHOUT_CFLAGS=`$SHOUTCONFIG --cflags` SHOUT_CFLAGS=`$SHOUTCONFIG --cflags`
SHOUT_LIBS=`$SHOUTCONFIG --libs` SHOUT_LIBS=`$SHOUTCONFIG --libs`
have_shout="maybe" have_shout="maybe"
fi fi
fi fi
])
if test "$have_shout" != "no" # Now try actually using libshout
then if test "$have_shout" != "no"
ac_save_CFLAGS="$CFLAGS" then
ac_save_LIBS="$LIBS" ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $SHOUT_CFLAGS" ac_save_LIBS="$LIBS"
LIBS="$LIBS $SHOUT_LIBS" CFLAGS="$CFLAGS $SHOUT_CFLAGS"
AC_CHECK_HEADER([shout/shout.h], [ LIBS="$LIBS $SHOUT_LIBS"
AC_DEFINE([HAVE_SHOUT_SHOUT_H], 1, [Define if you have <shout/shout.h>]) AC_CHECK_HEADER([shout/shout.h], [
AC_CHECK_FUNC([shout_new], [ AC_DEFINE([HAVE_SHOUT_SHOUT_H], 1, [Define if you have <shout/shout.h>])
ifelse([$1], , :, [$1]) AC_CHECK_FUNC([shout_new], [
have_shout="yes" ifelse([$1], , :, [$1])
]) have_shout="yes"
]) ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "$have_shout" != "yes"
then
ifelse([$2], , :, [$2])
fi
]) ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "$have_shout" != "yes"
then
ifelse([$2], , :, [$2])
fi
])dnl XIPH_PATH_SHOUT ])dnl XIPH_PATH_SHOUT
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment