From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] OS X: make configure work better out of the box with FSF GCC Date: Mon, 28 Feb 2011 13:04:43 -0800 Message-ID: References: <4D69DBAE.5070401@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1298927099 2835 80.91.229.12 (28 Feb 2011 21:04:59 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 28 Feb 2011 21:04:59 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Feb 28 22:04:55 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PuAH0-0000y6-KO for ged-emacs-devel@m.gmane.org; Mon, 28 Feb 2011 22:04:54 +0100 Original-Received: from localhost ([127.0.0.1]:35719 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuAH0-0003cy-1I for ged-emacs-devel@m.gmane.org; Mon, 28 Feb 2011 16:04:54 -0500 Original-Received: from [140.186.70.92] (port=56253 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PuAGq-0003Vn-P5 for emacs-devel@gnu.org; Mon, 28 Feb 2011 16:04:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PuAGp-00019e-PG for emacs-devel@gnu.org; Mon, 28 Feb 2011 16:04:44 -0500 Original-Received: from mail-vx0-f169.google.com ([209.85.220.169]:57498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PuAGp-00019a-MX for emacs-devel@gnu.org; Mon, 28 Feb 2011 16:04:43 -0500 Original-Received: by vxc38 with SMTP id 38so4468632vxc.0 for ; Mon, 28 Feb 2011 13:04:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=mmzK984wgEQxVcyxyEAnMeUWqm22j0wXrLgLMiMbc3o=; b=pYAqM8FOs//mpbDnxVyrXW4c8NlUeOCAPt0p/viWZ4UZnILKl2v+R5H+SCYeQZkd9Q YIfBKkLwJ/Eo6UcZmnfcwHt0+RBa0ZS2pCyOw8m3ZU19gkNPX6CG6VOImV4pSLeQfYNQ G7zaz/vIdt876OUeoDl9k/EGWD0QqP0Ue79OY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=iJqNAOPCqmm67hYEt22ZSvOtGL5cqmV0ZKaZwkqIG7A0XmN3ScbAylSVIC4F+8n6+w TyEUMXoacJqTGvUXVShxYafG1OQGU136Yt+VMhDjM6CwVwlF9aAPluO0IcookjyrzlsE 91vsyuesoWJ7F/3U5mj9rV1mIb5o/Msz2BFws= Original-Received: by 10.52.164.166 with SMTP id yr6mr9961378vdb.245.1298927083164; Mon, 28 Feb 2011 13:04:43 -0800 (PST) Original-Received: by 10.220.74.205 with HTTP; Mon, 28 Feb 2011 13:04:43 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.220.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:136622 Archived-At: On Mon, Feb 28, 2011 at 11:56 AM, Glenn Morris wrote: > > Daniel Colascione wrote: > >> I didn't include the corresponding configure changes; I figure I can let >> whoever installs this patch regenerate the script. > > Could you explain what problem this change is supposed to fix? Various header files (right now, Carbon --- which, granted, isn't used in the in-tree Emacs) presume that Apple-gcc specific features like printf attributes for CFStrings work. With FSF gcc (i.e., gcc without Apple-specific patches) these declarations break the build. Defining __INTEL_COMPILER essentially tells the system to use only the set of gcc extensions supported by icc, which is a subset of the extensions supported by FSF GCC. > >> + case "$(which "${CC-cc}")" in >> + /usr/bin/* | /usr/lib/* ) >> + CPP="${CC-cc} -E -no-cpp-precomp" >> + ;; >> + * ) >> + # The below macro prevents the Carbon headers from defining >> + # nonstandard constructs not understood by FSF GCC. >> + CPPFLAGS="$CPPFLAGS -D__INTEL_COMPILER=1" >> + CPP="${CC-cc} -E -D__INTEL_COMPILER=1" > > "FSF GCC" seems tautological at best. > > It seems fragile to test the location of the compiler. Why not test for > the actual compiler version? > Apple essentially forked gcc 4.2, and it still reports that version. I don't know a good way to distinguish Apple-patched gcc 4.2 from FSF-issue gcc 4.2, and seeing whether the compiler is installed in the "system compiler" location seems like a robust-enough way to figure this out. Another option would be to just do a test compilation, but that takes time.