annotate src/opus-1.3/m4/ltsugar.m4 @ 154:4664ac0c1032

Add Opus sources and macOS builds
author Chris Cannam <cannam@all-day-breakfast.com>
date Wed, 23 Jan 2019 13:48:08 +0000
parents
children
rev   line source
cannam@154 1 # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
cannam@154 2 #
cannam@154 3 # Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
cannam@154 4 # Foundation, Inc.
cannam@154 5 # Written by Gary V. Vaughan, 2004
cannam@154 6 #
cannam@154 7 # This file is free software; the Free Software Foundation gives
cannam@154 8 # unlimited permission to copy and/or distribute it, with or without
cannam@154 9 # modifications, as long as this notice is preserved.
cannam@154 10
cannam@154 11 # serial 6 ltsugar.m4
cannam@154 12
cannam@154 13 # This is to help aclocal find these macros, as it can't see m4_define.
cannam@154 14 AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
cannam@154 15
cannam@154 16
cannam@154 17 # lt_join(SEP, ARG1, [ARG2...])
cannam@154 18 # -----------------------------
cannam@154 19 # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
cannam@154 20 # associated separator.
cannam@154 21 # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
cannam@154 22 # versions in m4sugar had bugs.
cannam@154 23 m4_define([lt_join],
cannam@154 24 [m4_if([$#], [1], [],
cannam@154 25 [$#], [2], [[$2]],
cannam@154 26 [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
cannam@154 27 m4_define([_lt_join],
cannam@154 28 [m4_if([$#$2], [2], [],
cannam@154 29 [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
cannam@154 30
cannam@154 31
cannam@154 32 # lt_car(LIST)
cannam@154 33 # lt_cdr(LIST)
cannam@154 34 # ------------
cannam@154 35 # Manipulate m4 lists.
cannam@154 36 # These macros are necessary as long as will still need to support
cannam@154 37 # Autoconf-2.59, which quotes differently.
cannam@154 38 m4_define([lt_car], [[$1]])
cannam@154 39 m4_define([lt_cdr],
cannam@154 40 [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
cannam@154 41 [$#], 1, [],
cannam@154 42 [m4_dquote(m4_shift($@))])])
cannam@154 43 m4_define([lt_unquote], $1)
cannam@154 44
cannam@154 45
cannam@154 46 # lt_append(MACRO-NAME, STRING, [SEPARATOR])
cannam@154 47 # ------------------------------------------
cannam@154 48 # Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
cannam@154 49 # Note that neither SEPARATOR nor STRING are expanded; they are appended
cannam@154 50 # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
cannam@154 51 # No SEPARATOR is output if MACRO-NAME was previously undefined (different
cannam@154 52 # than defined and empty).
cannam@154 53 #
cannam@154 54 # This macro is needed until we can rely on Autoconf 2.62, since earlier
cannam@154 55 # versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
cannam@154 56 m4_define([lt_append],
cannam@154 57 [m4_define([$1],
cannam@154 58 m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
cannam@154 59
cannam@154 60
cannam@154 61
cannam@154 62 # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
cannam@154 63 # ----------------------------------------------------------
cannam@154 64 # Produce a SEP delimited list of all paired combinations of elements of
cannam@154 65 # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
cannam@154 66 # has the form PREFIXmINFIXSUFFIXn.
cannam@154 67 # Needed until we can rely on m4_combine added in Autoconf 2.62.
cannam@154 68 m4_define([lt_combine],
cannam@154 69 [m4_if(m4_eval([$# > 3]), [1],
cannam@154 70 [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
cannam@154 71 [[m4_foreach([_Lt_prefix], [$2],
cannam@154 72 [m4_foreach([_Lt_suffix],
cannam@154 73 ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
cannam@154 74 [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
cannam@154 75
cannam@154 76
cannam@154 77 # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
cannam@154 78 # -----------------------------------------------------------------------
cannam@154 79 # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
cannam@154 80 # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
cannam@154 81 m4_define([lt_if_append_uniq],
cannam@154 82 [m4_ifdef([$1],
cannam@154 83 [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
cannam@154 84 [lt_append([$1], [$2], [$3])$4],
cannam@154 85 [$5])],
cannam@154 86 [lt_append([$1], [$2], [$3])$4])])
cannam@154 87
cannam@154 88
cannam@154 89 # lt_dict_add(DICT, KEY, VALUE)
cannam@154 90 # -----------------------------
cannam@154 91 m4_define([lt_dict_add],
cannam@154 92 [m4_define([$1($2)], [$3])])
cannam@154 93
cannam@154 94
cannam@154 95 # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
cannam@154 96 # --------------------------------------------
cannam@154 97 m4_define([lt_dict_add_subkey],
cannam@154 98 [m4_define([$1($2:$3)], [$4])])
cannam@154 99
cannam@154 100
cannam@154 101 # lt_dict_fetch(DICT, KEY, [SUBKEY])
cannam@154 102 # ----------------------------------
cannam@154 103 m4_define([lt_dict_fetch],
cannam@154 104 [m4_ifval([$3],
cannam@154 105 m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
cannam@154 106 m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
cannam@154 107
cannam@154 108
cannam@154 109 # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
cannam@154 110 # -----------------------------------------------------------------
cannam@154 111 m4_define([lt_if_dict_fetch],
cannam@154 112 [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
cannam@154 113 [$5],
cannam@154 114 [$6])])
cannam@154 115
cannam@154 116
cannam@154 117 # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
cannam@154 118 # --------------------------------------------------------------
cannam@154 119 m4_define([lt_dict_filter],
cannam@154 120 [m4_if([$5], [], [],
cannam@154 121 [lt_join(m4_quote(m4_default([$4], [[, ]])),
cannam@154 122 lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
cannam@154 123 [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
cannam@154 124 ])