comp.lang.ada
 help / color / mirror / Atom feed
* Is it possible invoke $(pkg-config ...) in gnat project file?
@ 2013-05-18 10:30 kylix
  2013-05-18 17:10 ` Georg Bauhaus
  0 siblings, 1 reply; 3+ messages in thread
From: kylix @ 2013-05-18 10:30 UTC (permalink / raw)


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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is it possible invoke $(pkg-config ...) in gnat project file?
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Georg Bauhaus @ 2013-05-18 17:10 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Is it possible invoke $(pkg-config ...) in gnat project file?
  2013-05-18 17:10 ` Georg Bauhaus
@ 2013-05-21 18:47   ` Per Sandberg
  0 siblings, 0 replies; 3+ messages in thread
From: Per Sandberg @ 2013-05-21 18:47 UTC (permalink / raw)


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







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-05-21 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox