comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby)
Subject: Re: Conditonal compilation
Date: 1996/04/03
Date: 1996-04-03T00:00:00+00:00	[thread overview]
Message-ID: <4xbula9re9.fsf@leibniz.enst-bretagne.fr> (raw)
In-Reply-To: 4jrehm$489q@info4.rus.uni-stuttgart.de

Robert A Duff writes
: In article <4xrau6d0l6.fsf@leibniz.enst-bretagne.fr>,
: Laurent Guerby <Laurent.Guerby@enst-bretagne.fr> 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)




  parent reply	other threads:[~1996-04-03  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-02  0:00 Conditonal compilation Peter Hermann
1996-04-02  0:00 ` Laurent Guerby
1996-04-02  0:00   ` Robert A Duff
1996-04-03  0:00 ` Laurent Guerby [this message]
1996-04-03  0:00   ` Peter Hermann
replies disabled

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