From: Per Sandberg <per.sandberg@sandat.dyndns.org>
Subject: Re: Is it possible invoke $(pkg-config ...) in gnat project file?
Date: Tue, 21 May 2013 20:47:28 +0200
Date: 2013-05-21T20:47:28+02:00 [thread overview]
Message-ID: <20130521204728.2dfa989e@lufsen.sandat.dyndns.org> (raw)
In-Reply-To: 5197b61f$0$6642$9b4e6d93@newsspool2.arcor-online.net
On Sat, 18 May 2013 19:10:55 +0200
Georg Bauhaus <rm.dash-bauhaus@futureapps.de> wrote:
> On 18.05.13 12:30, kylix wrote:
> > I tried add link switch "$(pkg-config --libs cairo) in Linker
> > section, it seems not work, any idea?
> >
> > project P is
> > for Main use ("program");
> > package Linker is
> > for Default_Switches("Ada") use ("$(pkg-config --libs
> > cairo)"); end Linker;
> > end P;
> >
>
> $(pkg-config ...) is shell syntax for command substitution, i.e.
> starting a new process. I think that GNAT project relates programs
> will only pass text, not interpret it, or have the shell interpret
> it.
>
> You could have an external variable referenced in the project file and
> initialize it "outside", thus
>
> package Linker is
> for Default_Switches("Ada") use ("-gnatwa") & external("MYGTKL");
> end Linker;
>
> $ MYGTKL=$(pkg-config --libs cairo) gnatmake -PP
>
Not exact but almost the following works with GNAT 7.1:
package Linker is
for Default_Switches("Ada") use ("-gnatwa") & external_as_list("MYGTKL"," ");
end Linker;
$gnatmake -PP "-XMYGTKL=$(pkg-config --libs cairo)"
/Per
prev parent reply other threads:[~2013-05-21 18:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-18 10:30 Is it possible invoke $(pkg-config ...) in gnat project file? kylix
2013-05-18 17:10 ` Georg Bauhaus
2013-05-21 18:47 ` Per Sandberg [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox