Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Is it possible invoke $(pkg-config ...) in gnat project file?

47 views
Skip to first unread message

kylix

unread,
May 18, 2013, 6:30:47 AM5/18/13
to
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;

Georg Bauhaus

unread,
May 18, 2013, 1:10:55 PM5/18/13
to
$(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

Per Sandberg

unread,
May 21, 2013, 2:47:28 PM5/21/13
to
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





0 new messages