comp.lang.ada
 help / color / mirror / Atom feed
From: Jerry <lanceboyle@qwest.net>
Subject: Re: Pragma for conditional compilation? (Ada 2005 vs. 95)
Date: Sat, 29 Sep 2007 15:13:07 -0700
Date: 2007-09-29T15:13:07-07:00	[thread overview]
Message-ID: <1191103987.456677.192640@r29g2000hsg.googlegroups.com> (raw)
In-Reply-To: <1190879769.361848.188220@22g2000hsm.googlegroups.com>

Hi. OP here.

After the first round of responses to my post, I relayed my (your)
thoughts to the PLplot people (the project for which I made the
bindings). I stated a preference for not creating a GNAT dependency so
that other Ada compilers could be used. (I have no idea what the
relative usage among Ada compilers is. It is however a good guess that
PLplot will not be used in embedded systems.) I suggested that either
I or the project maintainers provide a little sed script to modify my
sources for either Ada 95 or Ada 05 and incorporate into their build
system which is CMake. Here is the response by one Alan Irwin. Note
that I might have mislead in my original post--I guess I do have a bit
of control, if indirect, over the build process 8^).

Following is from the PLplot list. I don't understand it yet but it
seems that I have to put some stuff into my source (presumably hidden
behind comment marks) and modify one of the build files.


>>>>>>
Here is what I believe is needed from the CMake perspective in order
to deal with versioned Ada bindings.

(1) Add an OPTION command to cmake/modules/ada.cmake which allows the
user to specify if they have an ada system that is capable of Ada
2007. See example below.

(2) It is a trivial matter for cmake to configure Ada bindings files
using the CONFIGURE_FILE command. A most extensive example of a file
to be configured is test/plplot-test.sh.cmake. The CONFIGURE_FILE
command in test/CMakeLists.txt replaces the many different place-
holders (variables surrounded by @ signs) by the value of the
corresponding CMake variable, and it would be straightforward to set
up something similar in bindings/ada/CMakeLists.txt. This placeholder
replacement functionality is similar to the sed approach you outlined
above but with the advantage that it is native to cmake.

Jerry, to get this rolling what I need from you are the configurable
Ada bindings files with @CMake_variable_name@ placeholders in them.
You should send that as a normal patch on the existing bindings files.
You should also send me a list of the placeholder CMake variable names
(please start each one of them with ADA so they don't clash with other
CMake variable names) and the strings those placeholders should be
changed to in the two cases of HAVE_ADA_2007=OFF or ON. To make life
simple for me, please put this into a patch for cmake/modules/
ada.cmake.

The changes should look like this:

option(HAVE_ADA_2007 "Ada 2007?" OFF)

if(HAVE_ADA_2007) set(ADA_whatever1 "replacement string for Ada 2007
case") ... else(HAVE_ADA_2007) set(ADA_whatever1 "replacement string
for non Ada 2007 case") ... endif(HAVE_ADA_2007)

where you should replace the ADA_whatever1 variable with a series of
the appropriate placeholder variable names that you have embedded into
the Ada bindings files.

Once you send me the requested patch there will be more for me to do
to get this all to work, but it should be straightforward.

>>>>>>

Jerry




  parent reply	other threads:[~2007-09-29 22:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-27  7:56 Pragma for conditional compilation? (Ada 2005 vs. 95) Jerry
2007-09-27  9:31 ` Georg Bauhaus
2007-09-27 16:59   ` Pascal Obry
2007-09-27 21:56     ` Jerry
2007-09-27  9:52 ` Stephen Leake
2007-09-27  9:58 ` Brian Drummond
2007-09-27 15:26 ` anon
2007-09-27 21:46   ` Jerry
2007-09-28  4:55     ` Jeffrey R. Carter
2007-09-28 12:15       ` Jeffrey Creem
2007-09-28 14:06         ` Jean-Pierre Rosen
2007-09-28 15:24           ` Ludovic Brenta
2007-09-28 16:08             ` Jean-Pierre Rosen
2007-09-28 17:54               ` Georg Bauhaus
2007-09-28 18:19                 ` Pascal Obry
2007-09-28 20:02                   ` Stefan Bellon
2007-09-28 20:14                     ` Pascal Obry
2007-09-28 20:26                       ` Stefan Bellon
2007-09-29 10:24                     ` Stephen Leake
2007-09-28 20:04                   ` Simon Wright
2007-09-28 20:11                     ` Pascal Obry
2007-09-29 10:29                     ` Stephen Leake
2007-09-29 10:18               ` Stephen Leake
2007-09-28 18:07     ` anon
2007-09-29 22:13 ` Jerry [this message]
2007-09-30 10:54   ` Stephen Leake
replies disabled

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