From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Eli Zaretskii" Newsgroups: gmane.emacs.devel Subject: Re: /lib/cpp not found in c-mode Date: Fri, 06 May 2005 15:34:13 +0300 Message-ID: <01c55238$Blat.v2.4$0e1c2960@zahav.net.il> References: <17013.26868.207510.370151@farnswood.snap.net.nz> <17013.52411.51878.781739@farnswood.snap.net.nz> <17014.39042.74353.677362@farnswood.snap.net.nz> <87d5s8144e.fsf@zemdatav.stor.no-ip.org> <17017.13673.613123.524633@farnswood.snap.net.nz> <87ll6tn4hh.fsf-monnier+emacs@gnu.org> <01c5519b$Blat.v2.4$0c9b1d00@zahav.net.il> <17018.35323.755067.631608@farnswood.snap.net.nz> Reply-To: Eli Zaretskii NNTP-Posting-Host: main.gmane.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7BIT X-Trace: sea.gmane.org 1115390913 3161 80.91.229.2 (6 May 2005 14:48:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 6 May 2005 14:48:33 +0000 (UTC) Cc: mange@freemail.hu, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri May 06 16:48:27 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DU461-0003Rl-Oj for ged-emacs-devel@m.gmane.org; Fri, 06 May 2005 16:46:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DU4Dk-00080G-No for ged-emacs-devel@m.gmane.org; Fri, 06 May 2005 10:54:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DU29h-0002df-28 for emacs-devel@gnu.org; Fri, 06 May 2005 08:42:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DU29e-0002ck-Kv for emacs-devel@gnu.org; Fri, 06 May 2005 08:42:07 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DU28H-0002Be-No for emacs-devel@gnu.org; Fri, 06 May 2005 08:40:41 -0400 Original-Received: from [192.114.186.24] (helo=legolas.inter.net.il) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DU2A1-0001Ds-HX for emacs-devel@gnu.org; Fri, 06 May 2005 08:42:29 -0400 Original-Received: from zaretski (IGLD-83-130-245-224.inter.net.il [83.130.245.224]) by legolas.inter.net.il (MOS 3.5.6-GR) with ESMTP id EHR05084 (AUTH halo1); Fri, 6 May 2005 15:36:44 +0300 (IDT) Original-To: Nick Roberts X-Mailer: emacs 22.0.50 (via feedmail 8 I) and Blat ver 2.4 In-reply-to: <17018.35323.755067.631608@farnswood.snap.net.nz> (message from Nick Roberts on Fri, 6 May 2005 09:02:51 +1200) 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:36756 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36756 > From: Nick Roberts > Date: Fri, 6 May 2005 09:02:51 +1200 > Cc: Eli Zaretskii , mange@freemail.hu, > emacs-devel@gnu.org > > Stefan Monnier writes: > > >> ((not (file-executable-p "/lib/cpp")) "gcc -E -C -") > > > > > Right, but please amend this to look for cpp.exe etc. on systems that > > > need that (or perhaps file-executable-p should try that > > > automatically?). > > > > Or maybe (executable-find "/lib/cpp"), > > Since its a trivial change for someone who knows what the right change is, > could you or Eli make it please. I think my changes are more general, but > theres not much point in them being continually reviewed for correctness. Done. I preferred to use locate-file instead of executable-find, since the latter would load another package. The new version is below, in case someone wants to comment. (defcustom c-macro-preprocessor (cond ;; Solaris has it in an unusual place. ((and (string-match "^[^-]*-[^-]*-\\(solaris\\|sunos5\\)" system-configuration) (file-exists-p "/opt/SUNWspro/SC3.0.1/bin/acomp")) "/opt/SUNWspro/SC3.0.1/bin/acomp -C -E") ((locate-file "/usr/ccs/lib/cpp" '("/") exec-suffixes 'file-executable-p) "/usr/ccs/lib/cpp -C") ((locate-file "/lib/cpp" '("/") exec-suffixes 'file-executable-p) "/lib/cpp -C") ;; On some systems, we cannot rely on standard directories to ;; find CPP. In fact, we cannot rely on having cpp, either, ;; in some GCC versions. ((locate-file "cpp" exec-path exec-suffixes 'file-executable-p) "cpp -C") (t "gcc -E -C -o - -")) "The preprocessor used by the cmacexp package. If you change this, be sure to preserve the `-C' (don't strip comments) option, or to set an equivalent one." :type 'string :group 'c-macro)