On 2007-09-28 01:46-0700 Jerry wrote: > [...]Since the c.l.a. list strongly suggested, in any case, multiple > source files, it seems to me that we could take one of two routes. > One is for me to supply two sets of files, one that compiles with Ada > 95 and one that compiles with Ada 2007. Since there are already a > number of files (three bindings of two files each and two auxiliary > files), I would do this by a bit of sed trickery, I suppose--sort of > a little non-GNAT preprocessor. This would require some kludgey file > naming but should work. > > The other way, very similar, would for me to keep the same number of > binding files and let the build system take care of the sed stuff and > create derived files with standardized names. > > These two approaches also have the advantage that nobody has to > bother themselves with any extra-compiler GNAT stuff. The differences > in the sources for the two scenarios is really quite small. I could > figure out how to write the source files to make the sed easy, and > create the sed myself, but someone else would need to incorporate it > into the build system.
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. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel