diff options
author | 2016-01-21 18:53:18 -0500 | |
---|---|---|
committer | 2016-01-21 18:53:18 -0500 | |
commit | 79787fcc061362905f0b47a67c922884a27616fc (patch) | |
tree | 6f4e0f5ec6436739bacb3f1bbd08adadec163830 /Makefile.am | |
parent | Fix cleanup up libphp[57].so symlinks. (diff) | |
download | eselect-php-79787fcc061362905f0b47a67c922884a27616fc.tar.gz eselect-php-79787fcc061362905f0b47a67c922884a27616fc.tar.bz2 eselect-php-79787fcc061362905f0b47a67c922884a27616fc.zip |
Add another layer of indirection to get @bindir@ and friends in the output.
When we create php.eselect from php.eselect.in using autoconf, we
don't have a way to get the full, expanded value of @bindir@,
@libdir@, and the other paths that we need. The autoconf documentation
suggests a workaround for this: add another layer of indirection, and
use the Makefile to substitute those values into the output files.
This commit sets the stage by renaming php.eselect.in to
php.eselect.in.in. The first round of processing by autoconf takes
php.eselect.in.in to php.eselect.in. The Makefile will then generate
php.eselect from php.eselect.in after substituting @bindir@, @libdir@,
and @localstatedir@.
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index 330f491..073abf9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,2 +1,19 @@ eselectdir = $(datadir)/eselect/modules -nodist_eselect_DATA = src/php.eselect +nodist_eselect_DATA = $(srcdir)/src/php.eselect + +# The next few rules allow us to replace bindir, libdir, and +# localstatedir within our script and conf file. The example is taken +# from the autoconf documentation and can be found in the +# "Installation Directory Variables" section. +edit = sed -e 's|@bindir[@]|$(bindir)|g' \ + -e 's|@libdir[@]|$(libdir)|g' \ + -e 's|@localstatedir[@]|$(localstatedir)|g' + +$(nodist_eselect_DATA): Makefile + rm -f $@ $@.tmp + srcdir=''; \ + test -f ./$@.in || srcdir=$(srcdir)/; \ + $(edit) $${srcdir}$@.in > $@.tmp + mv $@.tmp $@ + +$(srcdir)/src/php.eselect: $(srcdir)/src/php.eselect.in |