emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r107375: Fixes related to /usr/includ


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107375: Fixes related to /usr/include path on multiarch systems
Date: Wed, 22 Feb 2012 00:34:02 -0800
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107375
fixes bug(s): http://debbugs.gnu.org/10702
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Wed 2012-02-22 00:34:02 -0800
message:
  Fixes related to /usr/include path on multiarch systems
  
  * lisp/ffap.el (ffap-c-path):
  * lisp/man.el (Man-header-file-path): Handle multiarch.
modified:
  lisp/ChangeLog
  lisp/ffap.el
  lisp/man.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-22 06:10:03 +0000
+++ b/lisp/ChangeLog    2012-02-22 08:34:02 +0000
@@ -1,3 +1,8 @@
+2012-02-22  Glenn Morris  <address@hidden>
+
+       * ffap.el (ffap-c-path):
+       * man.el (Man-header-file-path): Handle multiarch.  (Bug#10702)
+
 2012-02-22  Chong Yidong  <address@hidden>
 
        * custom.el (load-theme): Doc fix.

=== modified file 'lisp/ffap.el'
--- a/lisp/ffap.el      2012-01-19 07:21:25 +0000
+++ b/lisp/ffap.el      2012-02-22 08:34:02 +0000
@@ -850,9 +850,24 @@
   (and (not (string-match "\\.el\\'" name))
        (ffap-locate-file name '(".el") load-path)))
 
+;; FIXME this duplicates the logic of Man-header-file-path.
+;; There should be a single central variable or function for this.
+;; See also (bug#10702):
+;; cc-search-directories, semantic-c-dependency-system-include-path,
+;; semantic-gcc-setup
 (defvar ffap-c-path
-  ;; Need smarter defaults here!  Suggestions welcome.
-  '("/usr/include" "/usr/local/include"))
+  (let ((arch (with-temp-buffer
+                (when (eq 0 (ignore-errors
+                              (call-process "gcc" nil '(t nil) nil
+                                            "-print-multiarch")))
+                  (goto-char (point-min))
+                  (buffer-substring (point) (line-end-position)))))
+        (base '("/usr/include" "/usr/local/include")))
+    (if (zerop (length arch))
+        base
+      (append base (list (expand-file-name arch "/usr/include")))))
+  "List of directories to search for include files.")
+
 (defun ffap-c-mode (name)
   (ffap-locate-file name t ffap-c-path))
 

=== modified file 'lisp/man.el'
--- a/lisp/man.el       2012-02-11 22:13:29 +0000
+++ b/lisp/man.el       2012-02-22 08:34:02 +0000
@@ -215,9 +215,20 @@
                       (string :tag "Real Section")))
   :group 'man)
 
+;; FIXME see comments at ffap-c-path.
 (defcustom Man-header-file-path
-  '("/usr/include" "/usr/local/include")
+  (let ((arch (with-temp-buffer
+                (when (eq 0 (ignore-errors
+                              (call-process "gcc" nil '(t nil) nil
+                                            "-print-multiarch")))
+                  (goto-char (point-min))
+                  (buffer-substring (point) (line-end-position)))))
+        (base '("/usr/include" "/usr/local/include")))
+    (if (zerop (length arch))
+        base
+      (append base (list (expand-file-name arch "/usr/include")))))
   "C Header file search path used in Man."
+  :version "24.1"                       ; add multiarch
   :type '(repeat string)
   :group 'man)
 


reply via email to

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