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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e60edb8dc1d5e3b3 X-Google-Attributes: gid103376,public From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby) Subject: Re: Conditonal compilation Date: 1996/04/03 Message-ID: <4xbula9re9.fsf@leibniz.enst-bretagne.fr>#1/1 X-Deja-AN: 145496455 distribution: world sender: guerby@leibniz.enst-bretagne.fr references: <4jrehm$489q@info4.rus.uni-stuttgart.de> content-type: text/plain; charset=US-ASCII organization: Telecom Bretagne mime-version: 1.0 newsgroups: comp.lang.ada Date: 1996-04-03T00:00:00+00:00 List-Id: Robert A Duff writes : In article <4xrau6d0l6.fsf@leibniz.enst-bretagne.fr>, : Laurent Guerby wrote: : >-- pragma Source_File_Name --%x11 : >-- (Unit_Name => Images.Display, --%x11 : >-- Body_File_Name => "x11.images-display.adb"); --%x11 : > : > (The "--%x11" is here for Makefile easy-auto-configuration-sed : >hacks.) ... : : Looks like macro preprocessing, to me. You're right saying it looks like a macro processing hack, since I added it for Makefile lovers. The "--%x11" is here to allow an user to configure the software without editing the Ada file (to be honnest, it's to simplify the regexps in the Makefile, and to avoid the use of m4 and configure for such a simple thing ;-). In this case, I added the Makefile only for the release. And here is the main target : # targets all: @echo "Please check the README file before compiling." @echo "Available targets:" @echo " clean" @echo " distclean" @echo " strip" @echo " dart" @echo " true-dart" @echo " use-default" @echo " use-x11" @echo " dont-use-x11" @echo " use-tasking" @echo " dont-use-tasking" ;-). But, the prefered way to configure the software is to edit the configuration file by hand, commenting out such declaration (with GNAT, in the gnat.adc file), staying in the Ada world. That's like editing config.h, but there's no macro at all, and no ifdefs at any place in the entire source. By default, the software will work on every platform where you can get a working Ada 95 compiler without any macro, and any ifdef. If you want to take advantage of tasking or X11, you have to comment out one declaration each time in one single file. BTW, If you find any simpler way of configuring software, please tell us ;-). : > Ada can be a portable language without too much external tools : >(like preprocessors ands Makefiles) ;-). See above ;-) : - Bob -- -- Laurent Guerby, student at Telecom Bretagne (France), Team Ada -- "Use the Source, Luke. The Source will be with you, always (GPL)" -- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project) -- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat)