bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using shell variables with AC_CONFIG_LINKS


From: Niels Möller
Subject: Using shell variables with AC_CONFIG_LINKS
Date: Wed, 27 Feb 2013 15:34:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (usg-unix-v)

Hi,

I'm using a shell loop to create some links, e.g.,

    for tmp_f in $asm_replace_list ; do
      if test -f "$srcdir/$asm_path/$tmp_f"; then
        asm_file_list="$asm_file_list $tmp_f"
        AC_CONFIG_LINKS($tmp_f:$asm_path/$tmp_f)
      fi
    done

This works fine, and ./config-status --help even displays a list of the
links with properly expanded file names.

However, if I have two such loops in configure.ac, using the same loop
variable $tmp_f (but looping over different values), autoconf fails with

  configure.ac:275: error: `$tmp_f' is already registered with AC_CONFIG_LINKS.
  ../../lib/autoconf/status.m4:923: AC_CONFIG_LINKS is expanded from...
  configure.ac:275: the top level
  autom4te: /usr/bin/m4 failed with exit status: 1

Tested with autoconf 2.68. I would suggest to either take out the
_AC_CONFIG_UNIQUE completely from the processing of AC_CONFIG_LINKS, or
do something more adhoc and do the uniqueness check only if the m4
argument contains no magic shell characters, e.g,. "$". Or provide some
variant of AC_CONFIG_LINKS which doesn't do this check.

I can work around the problem by renaming te loop variable in the second
loop, but it really makes no sense to me to require that the string
"$tmp_f" is unique.

Regards,
/Niels

-- 
Niels Möller. PGP-encrypted email is preferred. Keyid C0B98E26.
Internet email is subject to wholesale government surveillance.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]