1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-12-04 14:46:30 -05:00

Don't use PKG_CHECK_MODULES: it aborts configure on systems without pkg-config,

even if action-if-not-found is defined.

Rename have_shout to xt_have_shout, in conformance with macro writing guidelines :)

svn path=/trunk/m4/; revision=5006
This commit is contained in:
brendan 2003-06-25 17:03:55 +00:00
parent 4dacf00422
commit 1726d0cd89

View File

@ -3,44 +3,43 @@ dnl Jack Moffitt <jack@icecast.org> 08-06-2001
dnl Rewritten for libshout 2
dnl Brendan Cully <brendan@xiph.org> 20030612
dnl
dnl $Id: shout.m4,v 1.8 2003/06/25 17:03:55 brendan Exp $
# XIPH_PATH_SHOUT([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
# Test for libshout, and define SHOUT_CFLAGS and SHOUT_LIBS
AC_DEFUN([XIPH_PATH_SHOUT],
[dnl
have_shout="no"
xt_have_shout="no"
SHOUT_CFLAGS=""
SHOUT_LIBS=""
# NB: PKG_CHECK_MODULES exits if pkg-config is unavailable on the targe
# system, so we can't use it.
# Step 1: Use pkg-config if available
m4_ifdef([PKG_CHECK_MODULES],
[# PKG_CHECK_MODULES available
PKG_CHECK_MODULES([SHOUT], [shout])
have_shout="maybe"],
[# PKG_CHECK_MODULES is unavailable, search for pkg-config program
AC_PATH_PROG([PKGCONFIG], [pkg-config], [none])
if test "$PKGCONFIG" != "none" && `$PKGCONFIG --exists shout`
AC_PATH_PROG([PKGCONFIG], [pkg-config], [no])
if test "$PKGCONFIG" != "no" && `$PKGCONFIG --exists shout`
then
SHOUT_CFLAGS=`$PKGCONFIG --cflags shout`
SHOUT_LIBS=`$PKGCONFIG --libs shout`
have_shout="maybe"
xt_have_shout="maybe"
else
if test "$PKGCONFIG" != "none"
if test "$PKGCONFIG" != "no"
then
AC_MSG_NOTICE([$PKGCONFIG couldn't find libshout. Try adjusting PKG_CONFIG_PATH.])
fi
# Step 2: try shout-config
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [none])
if test "$SHOUTCONFIG" != "none" && test `$SHOUTCONFIG --package` = "libshout"
# pkg-config unavailable, try shout-config
AC_PATH_PROG([SHOUTCONFIG], [shout-config], [no])
if test "$SHOUTCONFIG" != "no" && test `$SHOUTCONFIG --package` = "libshout"
then
SHOUT_CFLAGS=`$SHOUTCONFIG --cflags`
SHOUT_LIBS=`$SHOUTCONFIG --libs`
have_shout="maybe"
xt_have_shout="maybe"
fi
fi
])
# Now try actually using libshout
if test "$have_shout" != "no"
if test "$xt_have_shout" != "no"
then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
@ -50,14 +49,14 @@ then
AC_DEFINE([HAVE_SHOUT_SHOUT_H], 1, [Define if you have <shout/shout.h>])
AC_CHECK_FUNC([shout_new], [
ifelse([$1], , :, [$1])
have_shout="yes"
xt_have_shout="yes"
])
])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "$have_shout" != "yes"
if test "$xt_have_shout" != "yes"
then
ifelse([$2], , :, [$2])
fi