[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /lib/cpp not found in c-mode

From: Eli Zaretskii
Subject: Re: /lib/cpp not found in c-mode
Date: Fri, 06 May 2005 15:34:13 +0300

> From: Nick Roberts <address@hidden>
> Date: Fri, 6 May 2005 09:02:51 +1200
> Cc: Eli Zaretskii <address@hidden>, address@hidden,
>       address@hidden
> 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\\)"
              (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)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]