From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!news.glorb.com!news-xxxfer.readnews.com!news-out.readnews.com!s08-03.readnews.com!unm2.readnews.com.POSTED!not-for-mail X-Trace: DXC=U_LGjg:dWPZbLKG; AeXcYY[3OhcoN[H0PX44`8^\]>7Z8DHB_I2k0TPakaeb48eibXhPiZiP4S@RVK0oHDS`=7MW4nGJUmF4OTPZ6QXeo5nKi[ X-Complaints-To: abuse@ngroups.net Date: Tue, 21 May 2013 20:47:28 +0200 From: Per Sandberg Newsgroups: comp.lang.ada Subject: Re: Is it possible invoke $(pkg-config ...) in gnat project file? Message-ID: <20130521204728.2dfa989e@lufsen.sandat.dyndns.org> References: <27c98def-e317-474d-aa7e-2b3f93de92f3@googlegroups.com> <5197b61f$0$6642$9b4e6d93@newsspool2.arcor-online.net> X-Newsreader: Claws Mail 3.9.0 (GTK+ 2.24.8; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Organization: readnews.com - News for Geeks and ISPs NNTP-Posting-Host: d078a740.newsreader.readnews.com X-Original-Bytes: 2277 Xref: number.nntp.dca.giganews.com comp.lang.ada:181719 Date: 2013-05-21T20:47:28+02:00 List-Id: On Sat, 18 May 2013 19:10:55 +0200 Georg Bauhaus 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