Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Sep 2015 09:07:00 -0700
From:      Carl Johnson <carlj@peak.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: GCC question
Message-ID:  <87oahg97ff.fsf@elk.localnet>
In-Reply-To: <55EAF9BA.3080700@hiwaay.net> (William A. Mahaffey, III's message of "Sat, 5 Sep 2015 09:24:04 -0453.75")
References:  <55EAEE19.2060807@hiwaay.net> <20150905140658.GA790@ozzmosis.com> <55EAF9BA.3080700@hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
"William A. Mahaffey III" <wam@hiwaay.net> writes:

> On 09/05/15 09:13, andrew clarke wrote:
>> On Sat 2015-09-05 08:34:27 UTC-0453, William A. Mahaffey III (wam@hiwaay.net) wrote:
>>
>>>> I have some code which was originally SGI native, then moved to Linux
>>> (FC14 x86_64 & CentOS 5). I am now interested in getting it going under
>>> FreeBSD 9.3R. Due to differences in system header file includes, I need
>>> to tweek some of my app-specific header files. I have poked around the
>>> (*COPIOUS* !!!!) GCC man page & I couldn't find (or missed) either how
>>> to get it to regurgitate its default compiler-defines or a tabulation of
>>> those defines, so I can use them to conditionally include system headers
>>> in my own header files. Where is this info :-) ? TIA & have a nice
>>> (long) weekend.
>> You probably want:
>>
>> gcc -dM -E - < /dev/null
>>
>> Ordinarily to detect FreeBSD you'd use:
>>
>> #ifdef __FreeBSD__
>> ...
>> #endif
>>
>
> *Booooyah* !!!! Both worked AOK. I haven't used gcc in a while, so
> there may be a few more noob-ish questions to follow :-/ .... Thanks
> again & have a nice weekend.

As long as this came up, does anybody know of a similar incantation to
show the defined rules and symbols for make?  I remember seeing
something like that years ago, but I haven't been able to find it
since.

Thanks.

-- 
Carl Johnson		carlj@peak.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87oahg97ff.fsf>