automake
[Top][All Lists]
Advanced

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

Re: Portable $addprefix


From: Kip Warner
Subject: Re: Portable $addprefix
Date: Fri, 01 Sep 2017 17:34:59 -0700

On Mon, 2017-08-28 at 11:03 -0700, Quinn Grier wrote:
> A portable way to do this is to do the work in configure.ac and
> transfer
> it to the Makefile with AC_SUBST. For example, with an empty
> Makefile.am
> and the following configure.ac:
> 
>       AC_INIT([Example], [1.0])
>       AM_INIT_AUTOMAKE([foreign])
> 
>       m4_define([m_files_only], [a.foo b.foo c.foo])
>       files_only='m_files_only'
>       files_with_path='m4_map_args_w(m_files_only, [dir/], [], [ ])'
>       AC_SUBST([files_only])
>       AC_SUBST([files_with_path])
> 
>       AC_CONFIG_FILES([Makefile])
>       AC_OUTPUT
> 
> The desired macros will appear in the resulting Makefile:
> 
>       files_only = a.foo b.foo c.foo
>       files_with_path = dir/a.foo dir/b.foo dir/c.foo

Hey Quinn. This would have worked perfectly, except automake bails when
I run autoreconf:

    autoreconf: running: automake --add-missing --copy --no-force
    configure.ac:310: error: 'parser_clobbered_source_full_paths' includes 
configure substitution     '@parser    _clobbered_source_full_paths@'
    configure.ac:310: and is referred to from 'nodist_narayan_designer_SOURCES';
    configure.ac:310: configure substitutions are not allowed in _SOURCES 
variables
    autoreconf: automake failed with exit status: 1

This is likely because as the message says, I am attempting to use the
substitution within a *_SOURCES variable.

Is this a dead end or is there a workaround? Assume a reference within
a _SOURCES variable is probably necessary.

-- 
Kip Warner | Senior Software Engineer
OpenPGP signed/encrypted mail preferred
http://www.thevertigo.com

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

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