lemon-project-template-glpk

diff deps/glpk/m4/ltsugar.m4 @ 9:33de93886c88

Import GLPK 4.47
author Alpar Juttner <alpar@cs.elte.hu>
date Sun, 06 Nov 2011 20:59:10 +0100
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/deps/glpk/m4/ltsugar.m4	Sun Nov 06 20:59:10 2011 +0100
     1.3 @@ -0,0 +1,123 @@
     1.4 +# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
     1.5 +#
     1.6 +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
     1.7 +# Written by Gary V. Vaughan, 2004
     1.8 +#
     1.9 +# This file is free software; the Free Software Foundation gives
    1.10 +# unlimited permission to copy and/or distribute it, with or without
    1.11 +# modifications, as long as this notice is preserved.
    1.12 +
    1.13 +# serial 6 ltsugar.m4
    1.14 +
    1.15 +# This is to help aclocal find these macros, as it can't see m4_define.
    1.16 +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
    1.17 +
    1.18 +
    1.19 +# lt_join(SEP, ARG1, [ARG2...])
    1.20 +# -----------------------------
    1.21 +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
    1.22 +# associated separator.
    1.23 +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
    1.24 +# versions in m4sugar had bugs.
    1.25 +m4_define([lt_join],
    1.26 +[m4_if([$#], [1], [],
    1.27 +       [$#], [2], [[$2]],
    1.28 +       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
    1.29 +m4_define([_lt_join],
    1.30 +[m4_if([$#$2], [2], [],
    1.31 +       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
    1.32 +
    1.33 +
    1.34 +# lt_car(LIST)
    1.35 +# lt_cdr(LIST)
    1.36 +# ------------
    1.37 +# Manipulate m4 lists.
    1.38 +# These macros are necessary as long as will still need to support
    1.39 +# Autoconf-2.59 which quotes differently.
    1.40 +m4_define([lt_car], [[$1]])
    1.41 +m4_define([lt_cdr],
    1.42 +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
    1.43 +       [$#], 1, [],
    1.44 +       [m4_dquote(m4_shift($@))])])
    1.45 +m4_define([lt_unquote], $1)
    1.46 +
    1.47 +
    1.48 +# lt_append(MACRO-NAME, STRING, [SEPARATOR])
    1.49 +# ------------------------------------------
    1.50 +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
    1.51 +# Note that neither SEPARATOR nor STRING are expanded; they are appended
    1.52 +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
    1.53 +# No SEPARATOR is output if MACRO-NAME was previously undefined (different
    1.54 +# than defined and empty).
    1.55 +#
    1.56 +# This macro is needed until we can rely on Autoconf 2.62, since earlier
    1.57 +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
    1.58 +m4_define([lt_append],
    1.59 +[m4_define([$1],
    1.60 +	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
    1.61 +
    1.62 +
    1.63 +
    1.64 +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
    1.65 +# ----------------------------------------------------------
    1.66 +# Produce a SEP delimited list of all paired combinations of elements of
    1.67 +# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
    1.68 +# has the form PREFIXmINFIXSUFFIXn.
    1.69 +# Needed until we can rely on m4_combine added in Autoconf 2.62.
    1.70 +m4_define([lt_combine],
    1.71 +[m4_if(m4_eval([$# > 3]), [1],
    1.72 +       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
    1.73 +[[m4_foreach([_Lt_prefix], [$2],
    1.74 +	     [m4_foreach([_Lt_suffix],
    1.75 +		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
    1.76 +	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
    1.77 +
    1.78 +
    1.79 +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
    1.80 +# -----------------------------------------------------------------------
    1.81 +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
    1.82 +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
    1.83 +m4_define([lt_if_append_uniq],
    1.84 +[m4_ifdef([$1],
    1.85 +	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
    1.86 +		 [lt_append([$1], [$2], [$3])$4],
    1.87 +		 [$5])],
    1.88 +	  [lt_append([$1], [$2], [$3])$4])])
    1.89 +
    1.90 +
    1.91 +# lt_dict_add(DICT, KEY, VALUE)
    1.92 +# -----------------------------
    1.93 +m4_define([lt_dict_add],
    1.94 +[m4_define([$1($2)], [$3])])
    1.95 +
    1.96 +
    1.97 +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
    1.98 +# --------------------------------------------
    1.99 +m4_define([lt_dict_add_subkey],
   1.100 +[m4_define([$1($2:$3)], [$4])])
   1.101 +
   1.102 +
   1.103 +# lt_dict_fetch(DICT, KEY, [SUBKEY])
   1.104 +# ----------------------------------
   1.105 +m4_define([lt_dict_fetch],
   1.106 +[m4_ifval([$3],
   1.107 +	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
   1.108 +    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
   1.109 +
   1.110 +
   1.111 +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
   1.112 +# -----------------------------------------------------------------
   1.113 +m4_define([lt_if_dict_fetch],
   1.114 +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
   1.115 +	[$5],
   1.116 +    [$6])])
   1.117 +
   1.118 +
   1.119 +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
   1.120 +# --------------------------------------------------------------
   1.121 +m4_define([lt_dict_filter],
   1.122 +[m4_if([$5], [], [],
   1.123 +  [lt_join(m4_quote(m4_default([$4], [[, ]])),
   1.124 +           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
   1.125 +		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
   1.126 +])