helpGNU M4 - Support: sr #106268, Please implement -M option for M4!


sr #106268: Please implement -M option for M4!

Submitted by:  None
Submitted on:  Wed 20 Feb 2008 09:59:38 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  1 - Wish Status:  Confirmed
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Thu 21 Feb 2008 05:34:01 PM UTC, comment #2: 

Thanks Eric,

I specified -M more for the ability to refer directly
to GCC's interface definition than anything else.  Call
it --supercalifragilisticexpialidocious if you must...

The best news for me to take away from this is that
the M4 developers consider this to be A Good Thing (tm),
and would be willing to include it in a future release
if we were to implement it.

I will check with my supervisor to see whether or not
such a "volunteer" exists within our organization...

David Warme

Thu 21 Feb 2008 02:07:33 AM UTC, comment #1: 

Hmm.  git head already provides -M to mean --module-directory, which has nothing to do with dependency tracking, so we would have to use a different letter (or if Gary's idea of simplifying modules pans out, free it up for a better use).  However, the idea of dependency tracking is reasonable, and in fact is already in the TODO from several years ago:

  + Make m4 show include dependencies like gcc so Makefile targets are
    updated when their (included) input files are updated (Erick B).

All we need is a volunteer with enough time and desire to implement it.

Eric Blake <ericb>
Project Administrator
Wed 20 Feb 2008 09:59:38 PM UTC, original submission:  

It would be very nice if GNU M4 supported the -M flag
(and perhaps -MM) like GCC (which has had it for ages).

Over the years I have had several encounters with
Richard M. Stallman of the following form:

DMW: Adding a %include directive to bison would be a nice

RMS: Do this using some external macro pre-processor, such
     as M4.  Don't clutter up bison with something that
     can be performed better using some other tool.

He is right, of course.

However, there is no simple (nor difficult) method for
automatically generating Makefile dependencies for such
hacks.  This is especially true when include file names
encountered by M4 are obtained via macro expansion.
No external shell script or other hack should reasonably
be expected to reproduce all of this internal M4
functionality just to obtain a list of referenced
include files.  Having M4 keep an internal list of
filenames touched, however, should be pretty simple.

If M4 is to be the standard tool to lean on for
implementing ad-hoc "include" functionality, then M4
should definitely support automatic dependency

More recent versions of gcc now have an entire suite
of additional -M style "bells and whistles" options,
and M4 may eventually need to follow suite.  I would
definitely settle for plain old -M initially.  (Of
course -MM would also be nice to have as part of
the initial rollout.)

David Warme



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-02-21 ericb StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.5