From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6426898aedaa5880 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!r29g2000hsg.googlegroups.com!not-for-mail From: Jerry Newsgroups: comp.lang.ada Subject: Re: Pragma for conditional compilation? (Ada 2005 vs. 95) Date: Sat, 29 Sep 2007 15:13:07 -0700 Organization: http://groups.google.com Message-ID: <1191103987.456677.192640@r29g2000hsg.googlegroups.com> References: <1190879769.361848.188220@22g2000hsm.googlegroups.com> NNTP-Posting-Host: 75.171.63.196 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1191103987 2732 127.0.0.1 (29 Sep 2007 22:13:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 29 Sep 2007 22:13:07 +0000 (UTC) In-Reply-To: <1190879769.361848.188220@22g2000hsm.googlegroups.com> User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v612.0.91344,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: r29g2000hsg.googlegroups.com; posting-host=75.171.63.196; posting-account=ps2QrAMAAAA6_jCuRt2JEIpn5Otqf_w0 Xref: g2news2.google.com comp.lang.ada:2228 Date: 2007-09-29T15:13:07-07:00 List-Id: 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