[Emacs-ada-mode] Default build command is stuck to the first "Compile file" command line
Alexy Khrabrov
deliverable at gmail.com
Sat Nov 17 15:36:16 PST 2007
Stephe -- thanks for many tips! Here's about the default make
command...
On Nov 18, 2007, at 1:36 AM, Stephen Leake wrote:
>> If I first try to build with C-c C-c, Emacs asks me, "enter command
>> to compile:"
>
> Hmm. You must have set ada-prj-default-make-cmd to nil. With the
> default Ada mode this uses the default command (gnatmake) for me.
>
> Can you be more specific? Start with emacs -q (to not load your
> .emacs), and say how to reproduce the problem.
I have the .emacs which consists only of the following:
;; ada-mode debugging .emacs
;; use gnat-bin-dir for reuse in paths, etc.
(setq gnat-bin-dir "/usr/local/ada/bin")
(setenv "PATH" (concat gnat-bin-dir ":" (getenv "PATH")))
(setq base-dir (expand-file-name "~/setup/emacs/"))
(setq ada-mode-dir (concat base-dir "ada-mode/"))
(add-to-list 'load-path ada-mode-dir)
;; (require 'ada-mode)
(set 'ada-prj-default-project-file (concat base-dir "gnat.adp"))
;; end of file
My GNAT root is in /usr/local/ada/, gnatmake and friends are in /usr/
local/ada/bin/.
~/setup/emacs/gnat.adp consists of only one line:
$ cat ~/setup/emacs/gnat.adp
cross_prefix=/usr/local/ada/bin/
When I commented out (setenv "PATH" ...) above, C-c u was complaining
for not seeing gnatls, so I symlinked just gnatls into /usr/local/bin/
gnatls/. Regardless, I now get a prompt to " enter a command to
compile" for any of C-c C-v or C-c C-c. But when doing C-c u, I see
the ada mode project with cross_prefix set to /usr/local/ada/bin/ as
it should've been.
Looking at the default shows it' still there, same as in edit project
buffer:
ada-prj-default-make-cmd is a variable defined in `ada-xref.el'.
Its value is
"${cross_prefix}gnatmake -o ${main} ${main} ${gnatmake_opt} -cargs $
{comp_opt} -bargs ${bind_opt} -largs ${link_opt}"
Note: when commenting out the default project,
;; (set 'ada-prj-default-project-file (concat base-dir "gnat.adp"))
-- things start to work!
However,
Should I provide all other strings in gnat.adp, in addition to
cross_prefix?
Cheers,
Alexy
More information about the Emacs-ada-mode
mailing list