Get the Compile-time Environment Variables ?

B

Benoit Lefebvre

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 ?
 
W

Walter Roberson

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
 
J

Joe

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.1.2/cpp/Common-Predefined-Macros.html
 
K

Keith Thompson

Benoit Lefebvre said:
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().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top