From owner-freebsd-hackers Fri Jan 4 11:21:15 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mail12.speakeasy.net (mail12.speakeasy.net [216.254.0.212]) by hub.freebsd.org (Postfix) with ESMTP id B9E5137B417 for ; Fri, 4 Jan 2002 11:21:09 -0800 (PST) Received: (qmail 7613 invoked from network); 4 Jan 2002 19:21:08 -0000 Received: from unknown (HELO laptop.baldwin.cx) ([64.81.54.73]) (envelope-sender ) by mail12.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 4 Jan 2002 19:21:08 -0000 Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <3C35F513.2F16AC08@math.missouri.edu> Date: Fri, 04 Jan 2002 11:20:55 -0800 (PST) From: John Baldwin To: Stephen Montgomery-Smith Subject: Re: Tell gcc I have a i686 Cc: freebsd-hackers@FreeBSD.ORG, Alfred Perlstein Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 04-Jan-02 Stephen Montgomery-Smith wrote: > Alfred Perlstein wrote: >> >> * Stephen Montgomery-Smith [020104 12:02] wrote: >> > I want to create a Makefile for a C program that includes some Pentium >> > II specific inline assembler code. How do I tell the compiler whether >> > we are compiling on a i686? >> > >> > For Linux, I can do something like this (for gnu-make) >> > Arch = $(shell arch) >> > cc ...... -DArch ..... >> > >> > and inside the program >> > >> > #ifdef i686 >> > >> > But arch doesn't exist on FreeBSD. >> >> Isn't this somewhat trivial? >> >> ARCH=i686 >> CFLAGS+=-D${ARCH} >> >> ? >> > > > What I want is a makefile that automatically detects whether it is on an > i686 or not (not for me to tell it so). This doesn't support a user who wants to compile an app that they want to run on some other machine. :) On FreeBSD, you can see if CPUTYPE is set from make.conf, but it's not required to be set. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message