Re: $sysconfdir substitution

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

 



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

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

_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
https://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux