How should a make-time field width option look like?

Mon, 7 Apr 1997 03:35:09 +0200 (MET DST)


Hello everybody,

I just had a look at the GPC configuration scripts and makefiles
in order to implement the compile-time `--field-widths' option.

It makes trouble.

  * GPC's configuration scripts are written using `autoconf'.
    I have no idea how to implement such an option there.  But even if
    I had, it would disappear again when GPC will be integrated into
    the main distribution line of the GNU compiler.

  * It is easier to implement an option to `make' rather than to
    `configure':  With small changes to `rts/rts.h' I can provide
    the following:

      make CFLAGS="-O2 -D INT_OUT_WIDTH=12 -D REAL_OUT_WIDTH=24" install

    Alternatively, you can edit the Makefile to pass these definitions.

    Would this be enough?  It doesn't look too nice for me.  And:
    This might also cause trouble when GPC will be integrated into the
    GCC main distribution line because the other compilers will see
    those `-D's, too:

      make LANGUAGES="c,c++,pascal" \
           CFLAGS="-O2 -D INT_OUT_WIDTH=12 -D REAL_OUT_WIDTH=24" install

  * We already had some discussions about configuration files.
    I am just adding a "*gpc1:" line to the `specs' file Jan-Jaap
    wrote about.  Below the "*gpc1:" there are two empty lines.
    Whatever you write there will be passed to the GNU Pascal
    compiler as additional command-line options, for instance

      *gpc1:
      -ffield-widths=10,25,7

    Note that `--foo' switches are not supported; you have to specify
    them as `-ffoo'.  Similarly, `--pedantic' must be `-pedantic'
    (*not* `-fpedantic').

    The default contents of this `specs' line can be specified at
    make-time either using

      make CFLAGS="-O2 -D GPC1_SPEC=\\\"--field-widths=10,25,7\\\"" install

    or by editing the Makefile.  But when looking at those triple
    backslashes it seems more comfortable for me to edit `specs'
    after having installed GPC.

The run-time `--field-widths' switch ("run-time" means: when you compile
a program by running GPC), in contrast, does not seem to cause major
problems.

There will be no variables like "default_int_width" like I wrote about on
5 Apr.  Such variables would require the compiler switch (*$field-widths*)
to produce executable code - which is not its purpose.  But the switch
will act as a local switch (as promised).

Please let me know your suggestions about that global compile-time
configuration problem.

Yours,

    Peter

  Dipl.-Phys. Peter Gerwinski, Essen, Germany, free physicist and programmer
peter.gerwinski@uni-essen.de - http://home.pages.de/~peter.gerwinski/ [970201]
 maintainer GNU Pascal [970401] - http://home.pages.de/~gnu-pascal/ [970125]


Peter Gerwinski (peter@agnes.dida.physik.uni-essen.de)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es