comp.lang.ada
 help / color / mirror / Atom feed
* Re: Using GNAT with SunAda?
       [not found] <4iaor8$lnk@s-cwis.unomaha.edu>
@ 1996-03-16  0:00 ` Robert Dewar
  1996-03-18  0:00   ` Rolf Ebert
  1996-03-18  0:00 ` Samuel Tardieu
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Dewar @ 1996-03-16  0:00 UTC (permalink / raw)


Louis Winter asks

"I am one of many programmers using a SunAda compiler for the project
I am working on.  With many people on the project it is hard to share
one license.  We have been investigating the use of GNAT to help our
situation.  Does anybody know of a way to get GNAT to compile files
that do not have extensions of .ads and .adb?  Our files all have a
.a extension.  We are working under SunOS 4.1.3."

THere is no way to compile files directly that have a .a extension (GCC
uses the extension to dermine what language the file is in, GNAT is called
only for Ada files, which have an extension of .ada .ads or .adb (for .ada
you have to use the Source_File_Name_Praga). Unfortunately, .a standardly
is used for archive files.

You could use gnatchop all the time, compiling into a temprary directory.
You will want to use the -r switch on gnatchop if you do this, so that
error messages refer back to the original .a file.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GNAT with SunAda?
  1996-03-18  0:00 ` Samuel Tardieu
@ 1996-03-18  0:00   ` Robert Dewar
  0 siblings, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1996-03-18  0:00 UTC (permalink / raw)


Sam wrote:

  gcc -x ada -c myfile.a


of course!! I knew this feature, but had forgotten it. Must have been 
sleeping when I answered it the other day. So, given this capability
in the gcc command, all you need to do is to tell GNAT to use the
non-standard file names for with statements.

This is done by using a file called gnat.adc containing 
source_file_name pragmas to specify the file names being used.
Here is the documentation for the source_file_name pragma:

   --  pragma Source_File_Name (
   --    [UNIT_NAME =>] unit_NAME,
   --    [BODY_FILE_NAME | SPEC_FILE_NAME] => STRING_LITERAL)

   --    The source file name pragma allows a program to override the normal
   --    naming convention. It is a configuration pragma, and so has the usual
   --    applicability of configuration pragmas (i.e. it applies to either an
   --    entire partition, or to all units in a compilation, or to a single
   --    unit, depending on how it is used. The form of the pragma is:

   --    The given unit name is mapped to the given file name. The identifier
   --    for the second argument is required, and indicates whether this is
   --    the file name for the spec or for the body.

an example for the above file would be

  pragma Source_File_Name (My_Unit_Name, Spec_File_Name => "myfile.a");





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GNAT with SunAda?
       [not found] <4iaor8$lnk@s-cwis.unomaha.edu>
  1996-03-16  0:00 ` Using GNAT with SunAda? Robert Dewar
@ 1996-03-18  0:00 ` Samuel Tardieu
  1996-03-18  0:00   ` Robert Dewar
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Tardieu @ 1996-03-18  0:00 UTC (permalink / raw)


>>>>> "Louis" == LOUIS WINTER <lwinter@s-cwis.unomaha.edu> writes:

Louis> I am one of many programmers using a SunAda compiler for the
Louis> project I am working on.  With many people on the project it is
Louis> hard to share one license.  We have been investigating the use
Louis> of GNAT to help our situation.  Does anybody know of a way to
Louis> get GNAT to compile files that do not have extensions of .ads
Louis> and .adb?  Our files all have a .a extension.  We are working
Louis> under SunOS 4.1.3.

You can force GCC to Ada-compile these files using:

  gcc -x ada -c myfile.a

 Sam
--
"La cervelle des petits enfants, ca doit avoir comme un petit gout de noisette"
                                                       Charles Baudelaire




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Using GNAT with SunAda?
  1996-03-16  0:00 ` Using GNAT with SunAda? Robert Dewar
@ 1996-03-18  0:00   ` Rolf Ebert
  0 siblings, 0 replies; 4+ messages in thread
From: Rolf Ebert @ 1996-03-18  0:00 UTC (permalink / raw)


>>>>> "RD" == Robert Dewar <dewar@cs.nyu.edu> writes:

> Louis Winter asks "I am one of many programmers using a SunAda
> compiler for the project I am working on.  With many people on the
> project it is hard to share one license.  We have been investigating
> the use of GNAT to help our situation.  Does anybody know of a way
> to get GNAT to compile files that do not have extensions of .ads and
> .adb?  Our files all have a .a extension.  We are working under
> SunOS 4.1.3."

RD> THere is no way to compile files directly that have a .a extension
RD> (GCC uses the extension to dermine what language the file is in,
RD> GNAT is called only for Ada files, which have an extension of .ada
RD> .ads or .adb (for .ada you have to use the
RD> Source_File_Name_Praga). Unfortunately, .a standardly is used for
RD> archive files.

RD> You could use gnatchop all the time, compiling into a temprary
RD> directory.  You will want to use the -r switch on gnatchop if you do
RD> this, so that error messages refer back to the original .a file.

You do can use *.a source files directly with GNAT.  Use the -x option
and specify `ada' as language.  Like in

$ gcc -c -x ada test.a 

This works with Gnat 3.01 and 3.03

        Rolf




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1996-03-18  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <4iaor8$lnk@s-cwis.unomaha.edu>
1996-03-16  0:00 ` Using GNAT with SunAda? Robert Dewar
1996-03-18  0:00   ` Rolf Ebert
1996-03-18  0:00 ` Samuel Tardieu
1996-03-18  0:00   ` Robert Dewar

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