2003-06-13 00:26:23 -04:00
|
|
|
dnl XIPH_PATH_SHOUT
|
|
|
|
dnl Jack Moffitt <jack@icecast.org> 08-06-2001
|
|
|
|
dnl Rewritten for libshout 2
|
|
|
|
dnl Brendan Cully <brendan@xiph.org> 20030612
|
2003-06-25 13:03:55 -04:00
|
|
|
dnl
|
2003-07-01 14:02:19 -04:00
|
|
|
dnl $Id: shout.m4,v 1.11 2003/07/01 18:02:19 brendan Exp $
|
2003-06-25 13:03:55 -04:00
|
|
|
|
2003-06-13 00:26:23 -04:00
|
|
|
# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
|
2003-07-01 14:02:19 -04:00
|
|
|
# Test for libshout, and define SHOUT_CPPFLAGS SHOUT_CFLAGS SHOUT_LIBS, and
|
|
|
|
# SHOUT_THREADED
|
2003-06-13 00:26:23 -04:00
|
|
|
AC_DEFUN([XIPH_PATH_SHOUT],
|
|
|
|
[dnl
|
2003-06-25 13:03:55 -04:00
|
|
|
xt_have_shout="no"
|
2003-07-01 14:02:19 -04:00
|
|
|
SHOUT_THREADED="no"
|
|
|
|
SHOUT_CPPFLAGS=""
|
2003-06-13 00:26:23 -04:00
|
|
|
SHOUT_CFLAGS=""
|
|
|
|
SHOUT_LIBS=""
|
|
|
|
|
2003-06-25 13:03:55 -04:00
|
|
|
# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the targe
|
|
|
|
# system, so we can't use it.
|
|
|
|
|
2003-06-26 15:34:00 -04:00
|
|
|
# seed pkg-config with the default libshout location
|
|
|
|
PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-/usr/local/lib/pkgconfig}
|
2003-06-26 15:38:23 -04:00
|
|
|
export PKG_CONFIG_PATH
|
2003-06-26 15:34:00 -04:00
|
|
|
|
2003-06-13 00:26:23 -04:00
|
|
|
# Step 1: Use pkg-config if available
|
2003-06-25 13:03:55 -04:00
|
|
|
AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
|
|
|
|
if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
|
|
|
|
then
|
2003-07-01 14:02:19 -04:00
|
|
|
SHOUT_CFLAGS=`$PKGCONFIG --variable=cflags_only shout`
|
|
|
|
SHOUT_CPPFLAGS=`$PKGCONFIG --variable=cppflags shout`
|
2003-06-25 13:03:55 -04:00
|
|
|
SHOUT_LIBS=`$PKGCONFIG --libs shout`
|
|
|
|
xt_have_shout="maybe"
|
|
|
|
else
|
|
|
|
if test "$PKGCONFIG" != "no"
|
2003-06-13 00:26:23 -04:00
|
|
|
then
|
2003-06-25 13:03:55 -04:00
|
|
|
AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
|
2001-09-09 22:24:39 -04:00
|
|
|
fi
|
2003-06-25 13:03:55 -04:00
|
|
|
# pkg-config unavailable, try shout-config
|
|
|
|
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
|
|
|
|
if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
|
|
|
|
then
|
2003-07-01 14:02:19 -04:00
|
|
|
SHOUT_CPPFLAGS=`$SHOUTCONFIG --cppflags`
|
|
|
|
SHOUT_CFLAGS=`$SHOUTCONFIG --cflags-only`
|
2003-06-25 13:03:55 -04:00
|
|
|
SHOUT_LIBS=`$SHOUTCONFIG --libs`
|
|
|
|
xt_have_shout="maybe"
|
|
|
|
fi
|
|
|
|
fi
|
2001-09-09 22:24:39 -04:00
|
|
|
|
2003-06-13 18:20:26 -04:00
|
|
|
# Now try actually using libshout
|
2003-06-25 13:03:55 -04:00
|
|
|
if test "$xt_have_shout" != "no"
|
2003-06-13 18:20:26 -04:00
|
|
|
then
|
2003-07-01 14:02:19 -04:00
|
|
|
ac_save_CPPFLAGS="$CPPFLAGS"
|
2003-06-13 18:20:26 -04:00
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
ac_save_LIBS="$LIBS"
|
2003-07-01 14:02:19 -04:00
|
|
|
CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS"
|
2003-06-13 18:20:26 -04:00
|
|
|
CFLAGS="$CFLAGS $SHOUT_CFLAGS"
|
2003-07-01 14:02:19 -04:00
|
|
|
LIBS="$SHOUT_LIBS $LIBS"
|
|
|
|
AC_CHECK_HEADERS([shout/shout.h], [
|
2003-06-13 18:20:26 -04:00
|
|
|
AC_CHECK_FUNC([shout_new], [
|
|
|
|
ifelse([$1], , :, [$1])
|
2003-06-25 13:03:55 -04:00
|
|
|
xt_have_shout="yes"
|
2003-06-13 00:26:23 -04:00
|
|
|
])
|
2003-07-01 14:02:19 -04:00
|
|
|
AC_CHECK_FUNC([thread_initialize], [SHOUT_THREADED="yes"])
|
2003-06-13 00:26:23 -04:00
|
|
|
])
|
2003-07-01 14:02:19 -04:00
|
|
|
CPPFLAGS="$ac_save_CPPFLAGS"
|
2003-06-13 18:20:26 -04:00
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
|
|
LIBS="$ac_save_LIBS"
|
|
|
|
fi
|
|
|
|
|
2003-06-25 13:03:55 -04:00
|
|
|
if test "$xt_have_shout" != "yes"
|
2003-06-13 18:20:26 -04:00
|
|
|
then
|
|
|
|
ifelse([$2], , :, [$2])
|
|
|
|
fi
|
2003-06-13 00:26:23 -04:00
|
|
|
])dnl XIPH_PATH_SHOUT
|