I’m running Mac OS X v10.8 (Mountain Lion) with Xcode 4.5.1 with command line tools.
I have just installed GNAT 2012 from here.
I installed it using this tutorial:
Navigate to the directory that contains a file called: doinstall Enter: sudo mkdir /usr/loca/gnat You will have to enter your password Enter: sudo ./doinstall Press return and y as prompted Update your path: sudo export PATH=/usr/local/gnat/bin:$PATH You should now be able to compile using the command gnatmake
Everything went fine and I restarted. On my desktop I have file hello.adb:
with Ada.Text_IO;use Ada.Text_IO;
procedure Hello is
begin
Put_Line ("Hello, World!");
end Hello;
And in terminal I navigate to my desktop and execute the gnatmake hello.adb
. But I get this
-bash: gnatmake: command not found
But in the terminal, if I execute info gnat
, I get a very large documentation file.
You need to put the path to Ada in a more permanent place. The command you entered in your Terminal only lasts for as long as the terminal is open.
Open the $HOME/.bash_profile file and add
export PATH=/usr/local/gnat/bin:$PATH
You can open the file from Terminal with either
nano ~/.bashrc
or
vim ~/.bashrc
If you're using Z shell (executable zsh
), place the export
line in the $HOME/.zshrc file.
For #2, I can't find an updated Xcode plugin, but if you want an IDE, check out this top answer.