[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: cool hack for simplifying do_subst generation of scripts
From: |
Federico Simoncelli |
Subject: |
Re: RFC: cool hack for simplifying do_subst generation of scripts |
Date: |
Fri, 13 Jan 2012 04:44:09 -0500 (EST) |
----- Original Message -----
> From: "Eric Blake" <address@hidden>
> To: "GNU Automake mailing list" <address@hidden>
> Cc: "Federico Simoncelli" <address@hidden>
> Sent: Thursday, January 12, 2012 8:16:14 PM
> Subject: RFC: cool hack for simplifying do_subst generation of scripts
>
> [...]
>
> diff --git i/Makefile.am w/Makefile.am
> index 8fe9c0f..0ef39c1 100644
> --- i/Makefile.am
> +++ w/Makefile.am
> @@ -67,21 +67,11 @@ uninstall-hook:
> done
>
>
> -## We can't use configure to do the substitution here; we must do it
> -## by hand. We use a funny notation here to avoid configure
> -## substitutions in our text.
> +## We want a handful of substitutions to be fully-expanded by make;
> +## then use config.status to substitute the remainder where a single
> +## expansion is sufficient. We use a funny notation here to avoid
> +## configure substitutions in our text.
> do_subst = sed \
> - -e 's,address@hidden@],$(APIVERSION),g' \
> - -e 's,address@hidden@],$(PACKAGE),g' \
> - -e 's,address@hidden@],$(PACKAGE_BUGREPORT),g' \
> - -e 's,address@hidden@],$(PACKAGE_URL),g' \
> - -e 's,address@hidden@],$(PATH_SEPARATOR),g' \
> - -e 's,address@hidden@],$(PERL),g' \
> - -e 's,address@hidden@],$(PERL_THREADS),g' \
> - -e 's,address@hidden@],$(SHELL),g' \
> - -e 's,address@hidden@],$(am_AUTOCONF),g' \
> - -e 's,address@hidden@],$(am_AUTOM4TE),g' \
> - -e 's,address@hidden@],$(VERSION),g' \
> -e 's,address@hidden@],Generated from address@hidden; do not edit by
> hand.,g' \
> -e 's,address@hidden@],$(datadir),g'
>
> @@ -92,7 +82,7 @@ automake: automake.in
> aclocal: aclocal.in
> automake aclocal: Makefile
> rm -f $@ address@hidden
> - $(do_subst) $(srcdir)/address@hidden >address@hidden
> + $(do_subst) $(srcdir)/address@hidden | ./config.status --file=-
> >address@hidden
> chmod +x address@hidden
> chmod a-w address@hidden
> mv -f address@hidden $@
This is not enough when you use it in subdirectories, you should add
config.log to CLEANFILES to pass distcheck.
Probably it would be best if config.status didn't produce a log when
it's used with --file=-; the content is rather useless in that case.
--
Federico