comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Standalone (.exe) Ada Programs can run in isolation of any ada compiler - True or False ?
Date: Thu, 05 Feb 2015 23:33:43 +0000
Date: 2015-02-05T23:33:43+00:00	[thread overview]
Message-ID: <ly7fvw3pd4.fsf@pushface.org> (raw)
In-Reply-To: 0f33e6b4-d423-4539-ae62-680f3b72afc0@googlegroups.com

Austin Obyrne <austin.obyrne@hotmail.com> writes:

> 1)Would some reader confirm that this true or false and explain the
> mechanics of how it is done.

The Ada compiler translates the source code into object code, which is
linked against Ada libraries (which come with the compiler) and system
libraries to produce the executable.

After this point, the source code and the object code are no longer
relevant.

The Ada libraries and the system libraries are usually dynamic libraries
(.dll on Windows), which means that they are separate entities. When you
run the .exe, the system first loads the .exe and then loads all the
.dlls which it needs (and the ones they need, ...); then the system can
actually run the program.

> 2)Is the ensuing (.exe) program then bound to that computer alone
> i.e. customised for running in that environment only and will require
> customising again to any other computer i.e. not generally portable
> without some attention each time.

You don't need to worry about the system libraries, but the Ada
libraries won't be present on machines that haven't had Ada installed;
and they must match the .exe, so you can't mix a GNAT GPL 2014 .exe
with a GNAT GPL 2013 .dll.

The simple way round this is to supply the .exe and the (Ada) .dlls it
needs in one directory.

On my machine, the .dlls are libgnat-2014.dll and libgnarl-2014.dll,
both in C:\GNAT\2014\lib\gcc\i686-pc-mingw32\4.7.4\adalib (together with
a *lot* of other files!)

And, of course, this is Windows; you can't run the same .exe on Linux or
Mac.

  parent reply	other threads:[~2015-02-05 23:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-05 19:00 Standalone (.exe) Ada Programs can run in isolation of any ada compiler - True or False ? Austin Obyrne
2015-02-05 22:25 ` David Botton
2015-02-05 22:32   ` MM
2015-02-05 22:28 ` MM
2015-02-06  0:05   ` David Botton
2015-02-06  0:57     ` Dennis Lee Bieber
2015-02-06  8:55     ` MM
2015-02-05 23:33 ` Simon Wright [this message]
2015-02-06  8:14   ` Austin Obyrne
2015-02-06 12:37     ` Denis McMahon
2015-02-06 18:12     ` MM
2015-02-06 16:50   ` Stephen Leake
2015-02-06 17:56     ` G.B.
2015-02-06 12:10 ` gautier_niouzes
2015-02-06 14:55   ` Simon Wright
2015-02-06 19:38     ` gautier_niouzes
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox