comp.lang.ada
 help / color / mirror / Atom feed
From: rugxulo@gmail.com
Subject: Re: GNAT library directory - how to detect it at build time?
Date: Thu, 8 Nov 2012 14:05:36 -0800 (PST)
Date: 2012-11-08T14:05:36-08:00	[thread overview]
Message-ID: <410f27aa-5e6d-48b8-a566-5cbe09ba06b0@googlegroups.com> (raw)
In-Reply-To: <a996d87a-273d-43f8-9b63-dfe7e3de77b5@googlegroups.com>

Hi,

On Tuesday, October 30, 2012 4:02:31 AM UTC-5, Maciej Sobczak wrote:
> 
> Yes, it helped. Not directly, but I have followed this idea and finally ended up with this:
> 
> $ gnatgcc --print-search-dirs | grep 'install: ' | grep -o '/.*'
> 
> The above command extracts the name of GNAT installation
> directory, which I can then inject into the GNAT project
> manager and use to portably link the final program. I
> hope the above will help others as well.

While I'm extremely noobish in all these things, I couldn't help but think you're doing it incorrectly. But my first instinct (basename or dirname) wouldn't work here (and I forgot I had GNAT installed on this machine, so I can actually test).

Just for the record, a quick search shows that POSIX grep doesn't support '-o', so you may wish to avoid that (though further searches show some *BSDs do support it). The easier solution seems to be to just use AWK:

(Thu Nov 08, 03:54 PM) /tmp/doydoy # gnatgcc --print-search-dirs | awk '/install:/ { print $2 }'
/usr/lib/gcc/i486-linux-gnu/4.4.3/

http://pubs.opengroup.org/onlinepubs/9699919799/utilities/grep.html



  reply	other threads:[~2012-11-08 22:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-29 13:42 GNAT library directory - how to detect it at build time? Maciej Sobczak
2012-10-29 15:08 ` Simon Wright
2012-10-30  9:02   ` Maciej Sobczak
2012-11-08 22:05     ` rugxulo [this message]
2012-11-09  8:07       ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox