1
0
mirror of https://gitlab.xiph.org/xiph/ezstream.git synced 2024-09-15 04:08:07 -04:00
ezstream/m4/vars.m4
moritz 9acbffc2dd Overhaul the ezstream build system, using my own library of autoconf macros.
There are a few benefits to this, but the main reason is consistency and me
completely understanding what's going on. Regressions are not expected, but
wouldn't surprise either ... this needs lots of testing.


git-svn-id: https://svn.xiph.org/trunk/ezstream@15776 0101bb08-14d6-0310-b084-bc0e0c8e3800
2009-03-16 00:08:31 +00:00

58 lines
1.7 KiB
Plaintext

dnl $Id: vars.m4 947 2009-03-15 17:51:37Z mgrimm $
dnl # Append or prepend items to a variable, but keep the items in the
dnl # variable unique.
dnl # Re-implemented from scratch after seeing XIPH_VAR_[PRE,AP]PEND, written
dnl # by Karl Heyes of the Icecast project, in action. The end result turned
dnl # out to be quite similar ...
dnl # Copyright (c) 2008 Moritz Grimm <mgrimm@mrsserver.net>
dnl #
dnl # Permission to use, copy, modify, and distribute this software for any
dnl # purpose with or without fee is hereby granted, provided that the above
dnl # copyright notice and this permission notice appear in all copies.
dnl #
dnl # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
dnl # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
dnl # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
dnl # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
dnl # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
dnl # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
dnl # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl # AX_UNIQVAR_APPEND([VARIABLE], [ITEM-LIST])
dnl # AX_UNIQVAR_PREPEND([VARIABLE], [ITEM-LIST])
AC_DEFUN([AX_UNIQVAR_APPEND],
[
AC_REQUIRE([AC_PROG_FGREP])
for arg in $2
do
if `echo " ${$1} x" | ${FGREP} -v -e " ${arg} " > /dev/null`; then
if test -z "${$1}"; then
$1="${arg}"
else
$1="${$1} ${arg}"
fi
fi
done
])
AC_DEFUN([AX_UNIQVAR_PREPEND],
[
AC_REQUIRE([AC_PROG_FGREP])
for arg in $2
do
if `echo " ${$1} x" | ${FGREP} -v -e " ${arg} " > /dev/null`; then
if test -z "${$1}"; then
$1="${arg}"
else
$1="${arg} ${$1}"
fi
fi
done
])