forked from mirrors/org-mode
Let ob-C and ob-fortran work correctly on Windows/Cygwin
* lisp/ob.el (org-babel-exeext): New defconst to hold extension for executables or nil if none. Should be ".exe" for both Windows and Cygwin. * lisp/ob-C.el (org-babel-C-execute): Use org-babel-exeext when constructing the target file name for the compiled executable. * lisp/ob-fortran.el (org-babel-execute:fortran): Add org-babel-exeext when constructing the target file name for the compiled executable.
This commit is contained in:
parent
556f725e5b
commit
2dfa6aaf79
|
@ -88,9 +88,7 @@ or `org-babel-execute:C++'."
|
|||
(cond
|
||||
((equal org-babel-c-variant 'c) ".c")
|
||||
((equal org-babel-c-variant 'cpp) ".cpp"))))
|
||||
(tmp-bin-file (org-babel-temp-file
|
||||
"C-bin-"
|
||||
(if (equal system-type 'windows-nt) ".exe" "")))
|
||||
(tmp-bin-file (org-babel-temp-file "C-bin-" org-babel-exeext))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(flags (cdr (assoc :flags params)))
|
||||
(full-body (org-babel-C-expand body params))
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
(defun org-babel-execute:fortran (body params)
|
||||
"This function should only be called by `org-babel-execute:fortran'"
|
||||
(let* ((tmp-src-file (org-babel-temp-file "fortran-src-" ".F90"))
|
||||
(tmp-bin-file (org-babel-temp-file "fortran-bin-"))
|
||||
(tmp-bin-file (org-babel-temp-file "fortran-bin-" org-babel-exeext))
|
||||
(cmdline (cdr (assoc :cmdline params)))
|
||||
(flags (cdr (assoc :flags params)))
|
||||
(full-body (org-babel-expand-body:fortran body params))
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
(require 'ob-eval)
|
||||
(require 'org-macs)
|
||||
|
||||
(defconst org-babel-exeext
|
||||
(if (memq system-type '(windows-nt cygwin))
|
||||
".exe"
|
||||
nil))
|
||||
(defvar org-babel-call-process-region-original)
|
||||
(defvar org-src-lang-modes)
|
||||
(defvar org-babel-library-of-babel)
|
||||
|
|
Loading…
Reference in a new issue