Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Get the Compile-time Environment Variables ?

Reply
Thread Tools

Get the Compile-time Environment Variables ?

 
 
Benoit Lefebvre
Guest
Posts: n/a
 
      11-29-2007
I need to know the Environment Variables for gcc at the compile time.

eg: _AIX, __hpux, __GNUC__, etc..

Is there a way to list that ?
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      11-29-2007
In article <(E-Mail Removed)>,
Benoit Lefebvre <(E-Mail Removed)> wrote:
>I need to know the Environment Variables for gcc at the compile time.
>
>eg: _AIX, __hpux, __GNUC__, etc..
>
>Is there a way to list that ?


That's a question for a gnu newsgroup or mailing list.

On one of my unix systems, the method was,

$ gcc -E -dM - < /dev/null

--
We regret to announce that sub-millibarn resolution bio-hyperdimensional
plasmatic space polyimaging has been delayed until the release
of Windows Vista SP2.
 
Reply With Quote
 
 
 
 
Benoit Lefebvre
Guest
Posts: n/a
 
      11-29-2007
On Nov 29, 3:08 pm, (E-Mail Removed)-cnrc.gc.ca (Walter Roberson)
wrote:
> In article <(E-Mail Removed)>,
> Benoit Lefebvre <(E-Mail Removed)> wrote:
>
> >I need to know the Environment Variables for gcc at the compile time.

>
> >eg: _AIX, __hpux, __GNUC__, etc..

>
> >Is there a way to list that ?

>
> That's a question for a gnu newsgroup or mailing list.
>
> On one of my unix systems, the method was,
>
> $ gcc -E -dM - < /dev/null
>
> --
> We regret to announce that sub-millibarn resolution bio-hyperdimensional
> plasmatic space polyimaging has been delayed until the release
> of Windows Vista SP2.


Cool, thanks!

--Ben
 
Reply With Quote
 
Joe
Guest
Posts: n/a
 
      11-29-2007
On Nov 29, 2:47 pm, Benoit Lefebvre <(E-Mail Removed)> wrote:
> I need to know the Environment Variables for gcc at the compile time.
>
> eg: _AIX, __hpux, __GNUC__, etc..
>
> Is there a way to list that ?


I assume that you mean predefined macros? This is how I do it:

$ touch tmp.c
$ gcc -E -dM tmp.c

The set of predefined macros varies with compiler flags, so this is a
good way to find the exact set of macros produced for a given set of
compiler flags. Some of the useful predefined macros are documented
here: http://gcc.gnu.org/onlinedocs/gcc-4....ed-Macros.html
 
Reply With Quote
 
Keith Thompson
Guest
Posts: n/a
 
      11-29-2007
Benoit Lefebvre <(E-Mail Removed)> writes:
> I need to know the Environment Variables for gcc at the compile time.
>
> eg: _AIX, __hpux, __GNUC__, etc..
>
> Is there a way to list that ?


Those aren't environment variables; they're probably predefined
macros. Environment variables are the things you access at run time
using getenv().

--
Keith Thompson (The_Other_Keith) <(E-Mail Removed)>
Looking for software development work in the San Diego area.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: to get environment variables... shakah Java 12 07-13-2008 02:13 PM
70-284 Lab Environment, Need Virtual Environment brooklynbridge508@hotmail.com MCSA 4 05-02-2007 09:49 AM
Setting an environment variable from another environment variable marcwentink@hotmail.com Java 5 04-04-2007 10:39 PM
How to get all httpd environment variables in JSP/Servlet? RC Java 4 07-12-2005 08:32 PM
get environment variables Ramon Barquier Javascript 1 11-06-2003 01:19 PM



Advertisments