[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: $sysconfdir substitution
From: |
Kip Warner |
Subject: |
Re: $sysconfdir substitution |
Date: |
Fri, 10 Jun 2016 14:08:29 -0700 |
On Fri, 2016-06-10 at 17:05 +1000, Peter Johansson wrote:
> Hi Kip,
>
> I have the following rule in my Makefile.am to generate a C header
> file.
>
> configmake.h: Makefile
> $(AM_V_GEN)echo '#define BINDIR "$(bindir)"' > $@
>
> You could have a similar rule to generate a file suitable to source
> into
> your script.
Hey Peter,
That looks good, but I really like the AC_CONFIG_FILES approach because
I think it looks cleaner. If I went your method it would be similar,
but I'd probably use sed instead.
What I ended up coming up with seems to work, albeit it is a bit ugly.
SYSCONFDIR=`test "$prefix" = NONE && prefix=$ac_default_prefix; eval echo
"${sysconfdir}"`
AC_SUBST([sysconfdir], [$SYSCONFDIR])
AC_CONFIG_FILES([myfile])
--
Kip Warner -- Senior Software Engineer
OpenPGP encrypted/signed mail preferred
http://www.thevertigo.com
signature.asc
Description: This is a digitally signed message part