Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Apr 2003 15:36:44 -0500
From:      Chuck Swiger <cswiger@mac.com>
To:        freebsd-questions@freebsd.org
Subject:   Compiler defines for FreeBSD, was: Re: [Directoryadmin-list]compile trouble
Message-ID:  <3E8F3E5C.304@mac.com>
In-Reply-To: <XFMail.20030405150017.ah54@httpsite.com>
References:  <XFMail.20030405150017.ah54@httpsite.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Andy Harrison wrote:
> I was wondering if any of you guys could help this guy out.  I tried to
> download and compile his app and it didn't go so smoothly.  He ask me a
> question about detecting freebsd that I couldn't answer.  Anyone know a way he
> could accomplish this?  Thanx!

"gcc -v" suggests __FreeBSD__:

[ ... ]
gcc version 2.95.4 20020320 [FreeBSD]
  /usr/libexec/cpp0 -lang-c -v -D__GNUC__=2 -D__GNUC_MINOR__=95 -Di386 
-D__FreeBSD__=4 -D__FreeBSD_cc_version=460001 -Dunix -D__i386__ 
-D__FreeBSD__=4 -D__FreeBSD_cc_version=460001 -D__unix__ -D__i386 
-D__unix -Acpu(i386) -Amachine(i386) -Asystem(unix) -Asystem(FreeBSD) 
-Acpu(i386) -Amachine(i386) -Di386 -D__i386 -D__i386__ -D__ELF__ 
/tmp/a.c /tmp/ccDlMXAX.i

...although using OS-specific defines is not particularly graceful.

-Chuck



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E8F3E5C.304>