How can I migrate an application written in DEC Ada to Windows?

217 views Asked by At

I have a batch application written in Ada in the OpenVMS DEC ADA ENVIRONMENT which I need to port to Windows.

How should I approach this?

2

There are 2 answers

0
Simon Wright On

I'm going to assume that you don't need to continue to maintain the DEC Ada version from the same code base. There are at least two possible technical obstacles.

First, file naming conventions used by GNAT (you don't say, but I'm guessing you're going to be using GNAT). By default, GNAT expects each file to contain one compilation unit (spec or body): so

package Pkg is
   ...
end Pkg;

would be in file pkg.ads, and

package body Pkg is
   ...
end Pkg;

would be in file pkg.adb. When compiling a file that begins with Pkg; GNAT looks for pkg.ads (not Pkg.ads, though you'd get away with that on Windows or macOS, which have case-insensitive but case-preserving file systems).

You may be able to use gnatchop to do this.

gnatchop *.ada chopped

will split all the *.ada source files into the files that GNAT expects in the directory chopped/.

One thing that can go wrong here is if a given unit is in more than one source file; you'll have to decide which one you want to keep (or what to do if you need both versions to deal with different environments).

If gnatchop doesn't meet your needs, you could try gnatname (the above reference, or this answer).

Second, DEC Ada supported a lot of VMS-specific features. Whether this will affect you depends on how extensively the original programmers of your application used them. Your best bet is to have a go; if you come up against problems, ask again (in a different question, please!)

0
Marc C On

I always just jump into the deep end of the pool whenever I port Ada from one compiler/platform to another, i.e. Just Do It.

Get the files and directories arranged on the target platform, handling the file naming with either gnatchop or gnatname (as per Simon's answer), set up a project file (I do this interactively within gps), and then press F4 (Build Main).

Fix as needed.