automake
[Top][All Lists]
Advanced

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

Re: Like config.h.in but in Ada


From: Mathieu Lirzin
Subject: Re: Like config.h.in but in Ada
Date: Mon, 30 Oct 2017 14:28:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux)

Victor Porton <address@hidden> writes:

> I want to create file config.ads similar to config.h but with Ada
> syntax instead of C.
>
> I created config.ads.in, added it to configure.ac and got:
>
> package Boiler.Config is
>    Data_Dir: constant String := "${prefix}/share";
> end Boiler.Config;
>
> from
>
> package Boiler.Config is
>    Data_Dir: constant String := "@datadir@";
> end Boiler.Config;
>
> It is not acceptable because Ada does not understand ${prefix}.
>
> How to make a value into an Ada string (a string delimited by double
> quotes)?
>
> It could be not ideal but acceptable if the code didn't work with paths
> containing double quotes.

I have no experience with Ada however the general fix is to generate
"config.ads" at "make" time so that $prefix variable will be expanded.
in C you can achieve that with CPPFLAGS:

   AM_CPPFLAGS = -DPACKAGE_LOAD_PATH=\"$(moduledir)\"

With other language this has to be done differently, you can use 'sed'
or 'config.status' in your Makefile.  More details are provided in the
Autoconf manual [1].

[1] 
https://www.gnu.org/software/autoconf/manual/autoconf.html#Installation-Directory-Variables

-- 
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761  070D 0ADE E100 9460 4D37



reply via email to

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