[gps-users] Gnatmake and multiple naming conventions

Benjamin Horowitz bhorowitdevnull@yahoo.com
Thu, 29 Jan 2004 16:15:42 -0800 (PST)


I am trying to compile a program with gnat, and am running into some
funny issues with naming.

I have two sets of files, with different naming conventions.  One set,
a part of ORBexpress, follows the .ads/.adb convention.  I don't have
the .adb files; instead I have the corresponding .ali and .o files.

The other set of files, part of software that I'm trying to get to
compile under gnat, follows the .1.ada/.2.ada convention.

I would like, insofar as possible, to (a) retain the .1.ada/.2.ada
convention for the files that follow that convention already [we have
thousands of files, and renaming them, even with gnatchop, would be
unpleasant]; and (b) use gnatmake for compilation [other developers I
work with would eventually like to use GPS for building files, and GPS
uses gnatmake].

I have tried creating two project files for this naming scenario;
these appear below.  The first project file, ois.gpr, uses the
.ads/.adb convention.  The second file, for my code, "withs" ois.gpr
and uses the .1.ada/.2.ada convention.

When I compile using gnatmake, I get the following error messages
(this is an excerpt; the full output of gnatmake appears below):

gnatmake: "corba.2.ada" not found
gnatmake: "corba-boa.2.ada" not found
gnatmake: "corba-command_line.2.ada" not found
gnatmake: "corba-orb.2.ada" not found
gnatmake: "corba-impl.2.ada" not found
gnatmake: "corba-impl-servant.2.ada" not found
gnatmake: "corba-request.2.ada" not found
gnatmake: "corba-serverrequest.2.ada" not found
gnatmake: "corba-stream.2.ada" not found
gnatmake: "corba-stream-time_optimized.2.ada" not found
gnatmake: "corba-object.2.ada" not found
gnatmake: "corba-object-helper.2.ada" not found
gnatmake: "corba-impl-server.2.ada" not found

It would appear that gnatmake is interpreting my project files to
mean: always use the .1.ada/.2.ada convention.  When I "with" ois.gpr,
the second project file, gnatmake does not understand this to mean:
use the .ads/.adb convention for the ORBexpress files.

Is there any way to inform gnatmake to use the .1.ada/.2.ada
convention for my code, and the .ads/.adb convention for the
ORBexpress files?

I am using gnatpro 3.16a1.

Thanks,
Ben

--------------------

Project file for ORBexpress:
(Note the naming section.)

project OIS is

   for Languages use ("Ada");
   for Source_Dirs use ("include\");
   for Object_Dir use "lib\";

   package Naming is
      for Specification_Suffix ("Ada") use ".ads";
      for Implementation_Suffix ("Ada") use ".adb";
      for Separate_Suffix use ".adb";
      for Casing use "lowercase";
      for Dot_Replacement use "-";
   end Naming;

   package Builder is
      for Default_Switches ("Ada") use ("-s", "-k", "-gnatf",
"-gnatv");
   end Builder;

   package Compiler is
      for Default_Switches ("Ada") use ("-gnatf", "-gnatv");
      for Default_Switches ("c") use ("");
      for Default_Switches ("c++") use ("");
   end Compiler;

   package Binder is
      for Default_Switches ("Ada") use ("-E", "-static");
   end Binder;

   package Linker is
      for Default_Switches ("Ada") use ("-g");
   end Linker;

   package Pretty_Printer is
      for Default_Switches ("Ada") use ("");
   end Pretty_Printer;

end OIS;



--------------------

Project file for files following the .1.ada/.2.ada naming convention:

with "ois.gpr";

project Test is

   for Languages use ("Ada");
   for Source_Dirs use ("src\");
   for Object_Dir use "obj\";
   for Exec_Dir use "bin\";
   for Main use ("client", "server");

   package Naming is
      for Specification_Suffix ("Ada") use ".1.ada";
      for Implementation_Suffix ("Ada") use ".2.ada";
      for Separate_Suffix use ".1.ada";
      for Casing use "lowercase";
      for Dot_Replacement use "-";
   end Naming;

   package Builder is
      for Default_Switches ("Ada") use ("-s", "-k", "-gnatf",
"-gnatv",
         "-vP2");
   end Builder;

   package Compiler is
      for Default_Switches ("Ada") use ("-gnatf", "-gnatv");
      for Default_Switches ("c") use ("");
      for Default_Switches ("c++") use ("");
   end Compiler;

   package Binder is
      for Default_Switches ("Ada") use ("-E", "-static");
   end Binder;

   package Linker is
      for Default_Switches ("Ada") use ("-g");
   end Linker;

   package Pretty_Printer is
      for Default_Switches ("Ada") use ("");
   end Pretty_Printer;

end Test;


--------------------

Output of
gnatmake -PTest.gpr


test.gpr:3:20: warning: file name does not match unit name, should be
"start_here.gpr"
gcc -c -gnatf -gnatv -o
d:\projects\ois_demos\start_here\obj\client.2.o
-gnatec=d:\projects\ois_demos\start_here\obj\GNAT-TEMP-000001.TMP
-gnatf -gnatv -I- -gnatA -x ada
d:\projects\ois_demos\start_here\src\client.2.ada

GNAT Pro 3.16a1 (20030610) Copyright 1992-2002 Free Software
Foundation, Inc.

Compiling: d:\projects\ois_demos\start_here\src\client.2.ada (source
file time stamp: 2003-08-27 01:19:58)
 131 lines: No errors
gcc -c -gnatf -gnatv -o
d:\projects\ois_demos\start_here\obj\counter.2.o
-gnatec=d:\projects\ois_demos\start_here\obj\GNAT-TEMP-000001.TMP
-gnatf -gnatv -I- -gnatA -x ada
d:\projects\ois_demos\start_here\src\counter.2.ada

GNAT Pro 3.16a1 (20030610) Copyright 1992-2002 Free Software
Foundation, Inc.

Compiling: d:\projects\ois_demos\start_here\src\counter.2.ada (source
file time stamp: 2004-01-28 23:48:26)
 99 lines: No errors
gcc -c -gnatf -gnatv -o
d:\projects\ois_demos\start_here\obj\counter-helper.2.o
-gnatec=d:\projects\ois_demos\start_here\obj\GNAT-TEMP-000001.TMP
-gnatf -gnatv -I- -gnatA -x ada
d:\projects\ois_demos\start_here\src\counter-helper.2.ada

GNAT Pro 3.16a1 (20030610) Copyright 1992-2002 Free Software
Foundation, Inc.

Compiling: d:\projects\ois_demos\start_here\src\counter-helper.2.ada
(source file time stamp: 2004-01-28 23:48:26)
 82 lines: No errors
gcc -c -gnatf -gnatv -o
d:\projects\ois_demos\start_here\obj\counter-impl.2.o
-gnatec=d:\projects\ois_demos\start_here\obj\GNAT-TEMP-000001.TMP
-gnatf -gnatv -I- -gnatA -x ada
d:\projects\ois_demos\start_here\src\counter-impl.2.ada

GNAT Pro 3.16a1 (20030610) Copyright 1992-2002 Free Software
Foundation, Inc.

Compiling: d:\projects\ois_demos\start_here\src\counter-impl.2.ada
(source file time stamp: 2003-08-27 01:19:58)
 51 lines: No errors
gcc -c -gnatf -gnatv -o
d:\projects\ois_demos\start_here\obj\server.2.o
-gnatec=d:\projects\ois_demos\start_here\obj\GNAT-TEMP-000004.TMP
-gnatf -gnatv -I- -gnatA -x ada
d:\projects\ois_demos\start_here\src\server.2.ada

GNAT Pro 3.16a1 (20030610) Copyright 1992-2002 Free Software
Foundation, Inc.

Compiling: d:\projects\ois_demos\start_here\src\server.2.ada (source
file time stamp: 2003-08-27 01:19:58)
 118 lines: No errors
gnatmake: "corba.2.ada" not found
gnatmake: "corba-boa.2.ada" not found
gnatmake: "corba-command_line.2.ada" not found
gnatmake: "corba-orb.2.ada" not found
gnatmake: "corba-impl.2.ada" not found
gnatmake: "corba-impl-servant.2.ada" not found
gnatmake: "corba-request.2.ada" not found
gnatmake: "corba-serverrequest.2.ada" not found
gnatmake: "corba-stream.2.ada" not found
gnatmake: "corba-stream-time_optimized.2.ada" not found
gnatmake: "corba-object.2.ada" not found
gnatmake: "corba-object-helper.2.ada" not found
gnatmake: "corba-impl-server.2.ada" not found

--------------------


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
http://webhosting.yahoo.com/ps/sb/