File: shout.m4

package info (click to toggle)
ices2 2.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 2,224 kB
  • sloc: sh: 11,327; ansic: 7,361; xml: 162; makefile: 100
file content (75 lines) | stat: -rw-r--r-- 2,000 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
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
dnl 
dnl $Id$

# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
# Test for libshout, and define SHOUT_CPPFLAGS SHOUT_CFLAGS SHOUT_LIBS, and
# SHOUT_THREADSAFE
AC_DEFUN([XIPH_PATH_SHOUT],
[dnl
xt_have_shout="no"
SHOUT_THREADSAFE="no"
SHOUT_CPPFLAGS=""
SHOUT_CFLAGS=""
SHOUT_LIBS=""

# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the target
# system, so we can't use it.

# Step 1: Use pkg-config if available
PKG_PROG_PKG_CONFIG
if test "x$PKG_CONFIG" != x && `$PKG_CONFIG --exists shout`
then
  SHOUT_CFLAGS=`$PKG_CONFIG --variable=cflags_only shout`
  SHOUT_CPPFLAGS=`$PKG_CONFIG --variable=cppflags shout`
  SHOUT_LIBS=`$PKG_CONFIG --libs shout`
  xt_have_shout="maybe"
else
  if test "x$PKG_CONFIG" != x
  then
    AC_MSG_NOTICE([$PKG_CONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
  fi
  # pkg-config unavailable, try shout-config
  AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
  if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
  then
    SHOUT_CPPFLAGS=`$SHOUTCONFIG --cppflags`
    SHOUT_CFLAGS=`$SHOUTCONFIG --cflags-only`
    SHOUT_LIBS=`$SHOUTCONFIG --libs`
    xt_have_shout="maybe"
  fi
fi

# Now try actually using libshout
if test "$xt_have_shout" != "no"
then
  ac_save_CPPFLAGS="$CPPFLAGS"
  ac_save_CFLAGS="$CFLAGS"
  ac_save_LIBS="$LIBS"
  CPPFLAGS="$CPPFLAGS $SHOUT_CPPFLAGS"
  CFLAGS="$CFLAGS $SHOUT_CFLAGS"
  LIBS="$SHOUT_LIBS $LIBS"
  AC_CHECK_HEADERS([shout/shout.h], [
    AC_CHECK_FUNC([shout_new], [
      ifelse([$1], , :, [$1])
      xt_have_shout="yes"
    ])
    AC_EGREP_CPP([yes], [#include <shout/shout.h>
#if SHOUT_THREADSAFE
yes
#endif
], [SHOUT_THREADSAFE="yes"])
  ])
  CPPFLAGS="$ac_save_CPPFLAGS"
  CFLAGS="$ac_save_CFLAGS"
  LIBS="$ac_save_LIBS"
fi

if test "$xt_have_shout" != "yes"
then
  ifelse([$2], , :, [$2])
fi
])dnl XIPH_PATH_SHOUT