X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Ben Peddell User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: obtaining GCC -march setting in code? References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Lines: 32 Message-ID: Date: Fri, 14 Nov 2003 06:57:45 GMT NNTP-Posting-Host: 144.134.90.59 X-Complaints-To: abuse AT bigpond DOT net DOT au X-Trace: news-server.bigpond.net.au 1068793065 144.134.90.59 (Fri, 14 Nov 2003 17:57:45 EST) NNTP-Posting-Date: Fri, 14 Nov 2003 17:57:45 EST Organization: BigPond Internet Services To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com nospam AT none DOT com wrote: > Is there a way to get the gcc's -march=XXX and -mfpmath=YYY type in > the c/c++ code? > > I want the code to be able to output something like: > > built for "pentium3" with "sse".... > > Basically something telling the user how the program is compiled and > for what platform... > > Thanks. > > Raymond The following examples assume that you want to just compile it, and link it later. Either include a comment saying: /* * Compile with * gcc -march=pentium3 -mfpmath=sse -c your_code.c */ Or concoct a Makefile: (I've put it in printf format, since it contains embedded tabs.) "your_code.o:\n" "\tgcc -march=pentium3 -mfpmath=sse -c your_code.c\n" I don't know of any compiler pragmas that would do what you want.