public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: <guerby@acm.org>
To: gcc@gcc.gnu.org
Cc: ebert@bms.de
Subject: [Ada] new "-margs" flag to gnatmake
Date: Tue, 04 Dec 2001 12:14:00 -0000	[thread overview]
Message-ID: <200112041930.fB4JUhV29718@ulmo.localdomain> (raw)

gnatmake currently handle multiple "-cargs", "-bargs" or "-largs" sections, however
it is not currently possible to go back to the "normal" section, this is
annoying for GNOME-like xxx-config tools. One wants to be able to build
an Ada program using packages p1 and p2 in one short invocation:

gnatmake main `p1-config` `p2-config`

xxx-config providing the needed flags to go after specs and libraries.
If one of such xxx-config needs to provide "normal" flags to gnatmake
it can't do so since there is no way to tell gnatmake
to process "normal" args after it has gone into "-xargs" mode.

gcc/ada/make.adb:

   type Make_Program_Type is (None, Compiler, Binder, Linker);

   Program_Args : Make_Program_Type := None;

...

      --  Then check if we are dealing with a -cargs, -bargs or -largs

      elsif (Argv (1) = Switch_Character or else Argv (1) = '-')
        and then (Argv (2 .. Argv'Last) = "cargs"
                   or else Argv (2 .. Argv'Last) = "bargs"
                   or else Argv (2 .. Argv'Last) = "largs")
      then
         if not File_Name_Seen then
            Fail ("-cargs, -bargs, -largs ",
                  "must appear after unit or file name");
         end if;

         case Argv (2) is
            when 'c' => Program_Args := Compiler;
            when 'b' => Program_Args := Binder;
            when 'l' => Program_Args := Linker;

            when others =>
               raise Program_Error;
         end case;

The intended modification is to add a "-margs" going back in
Program_Args = None, plus may be a few things I haven't thought about
(detection of the target name probably).

Are people okay with the idea before I really implement it? I'll
submit a documentation patch of course, but since there's no doc file
to patch against yet in CVS I have to wait a bit :).

PS: the current workaround is something like:

gnatmake `p1-config --margs` `p2-config --margs` main `p1-config --cargs --largs` `p2-config --cargs --largs`

which is a bit cumbersome and defeats the original intent of
simplicity.

-- 
Laurent Guerby <guerby@acm.org>

             reply	other threads:[~2001-12-04 20:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-12-04 12:14 guerby [this message]
2001-12-04 13:40 ` Florian Weimer
2001-12-04 14:05   ` guerby
2001-12-04 14:09 dewar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200112041930.fB4JUhV29718@ulmo.localdomain \
    --to=guerby@acm.org \
    --cc=ebert@bms.de \
    --cc=gcc@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).