ada-mode and emacsUp to emacs-26, possibly around 2020, there was a good ada-mode among the other progmodes, that worked. However, it does not immediately compile on any recent Linux distribution (but see towards the end of this page).Ada, of course, evolved in the mean time, the maintainer of the old ada-mode ceased maintainance and emacsen from version 27 on do not come with ada-mode preinstalled. Another maintainer developed a new, vastly more complex ada-mode, as part of ELPA, reaching version 8.1.0, after which, in 2023, he retired. Thus, it is now an orphan package. This package does not easily install in modern Linux distributions either. I tried to install this package on Linux Mint 22.1 and it failed. First, it tried to use alire, but the stock alire of LM22.1 crashes. Then it tried with gprbuild, but failed to produce a working ada-mode. Eventually, I found missing symlinks, dependencies and other inconsistencies and apparently made it install on LM22.1. I put all these steps in a bash script that you can download below. DownloadTo install, make a directory, say mkdir ~/inadamode, copy the script there, cd to it and run the script. It will require a sudo password at some point, if it will install debian packages. Besides debian packages, it will download elpa packages, move them in ~/.emacs.d/elpa, unpack them there, compile and perform other moves and links. About the ada-mode install scriptThis script works in my setup, but is not guaranteed to work in any other. Still, it contains the steps I found missing and could provide an easier startpoint to install ada-mode 8.1.0. Please note that running the script takes anywere between 5 minutes and half an hour, depending on your hardware, and at some point it requires over 8Gb of memory. It produces 0.5Gb of code and data in your ~/.emacs.d/elpa directory, adds files in your ~/.local/bin directory and modifies your .emacs somewhat blindly. After installation, ada-mode is available only to the user account from which you ran the script. Do not run the script with 'sudo' or it will install everything for user root. Provide the sudo password only when prompted, for the installation of necessary debian packages. It requires an active internet connection to download elpa packages (but you can easily change it to use local files) and may need to install some debian packages. I would expect it to work on any other trixie-derived packages but I didn't test. Where the inst-ada-mode script doesn't workThe ada-mode installation script does not work on linuxen derived from earlier debian versions, as the latest, 8.1.0 version, requires the latest gnat to compile. On Linux Mint 21 and on Ubuntu 22.04, I couldn't get gnat-12 installed simultaneously with libgnatcoll-dev, apt insists on gnat-9, and gnat-9 does not compile ada-mode 8.1.0. You might try an earlier version of the package and of its dependencies. Compiling an older version of emacs on a new systemAs mentioned above, the elpa ada-mode 8.0.1 and the above script were not needed in emacs until version 26, but version 26 and earlier ones do not compile, as downloaded, on modern system (they failed for me). However, in V26.3, the last version that still came with a working ada-mode, the sole reason for not compiling proved to be the line 1795 in sysdep.c, which reads: static unsigned char sigsegv_stack[SIGSTKSZ];The homologous definition in emacs-29.4 is:
static max_align_t sigsegv_stack[(64 * 1024
+ sizeof (max_align_t) - 1)
/ sizeof (max_align_t)];
I replaced the first with the second in file sysdep.c. sigsegv_stack is used only once, where a variabile is initialised at its address and another with its size (using sizeof), thus it seems the change might not introduce critical bugs, although I don't have sufficient understanding of the emacs sources to be sure. The updated source code, with this only difference, is at: http://dan.corlan.net/software/emacs-26.3-dan.tgz This compiled and worked, with ada mode, using the following configure command (I didn't try any other configuration): ./configure --with-x-toolkit=no --with-xpm=no --with-jpeg=no --with-gif=no --with-tiff=no --with-gnutls=no --with-png=90 I tested that it works on the following systems: Linux Mint 22.1, Ubuntu 14.04, Ubuntu 22.04, Linux Mint 21.3, Almalinux 10.1. I did not try the X mode, only the character terminal mode (in lxterminal). |