home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.misc
- Path: sparky!uunet!paladin.american.edu!europa.asd.contel.com!darwin.sura.net!cs.ucf.edu!crigler
- From: crigler@cs.ucf.edu (James Crigler)
- Subject: m4 - pseudo-survey summary
- Message-ID: <crigler.722288449@eola.cs.ucf.edu>
- Summary: Replies to my request
- Keywords: m4,macro,preprocessor
- Sender: news@cs.ucf.edu (News system)
- Organization: University of Central Florida
- Distribution: comp.unix.misc
- Date: Fri, 20 Nov 1992 19:40:49 GMT
- Lines: 104
-
-
- Finally, I am posting a summary of replies to my inquiry about the
- use of m4. Many thanks for the replies. And for the patience of
- those who have waited with bated breath. And bait breath.
-
- My original question was this:
-
- >Is m4 really used for anything,
- >or is it just a curiosity?
- ------------------------------------------------------------
- From the keyboard of David Barr <barr@pop.psu.edu>:
- I use it. It's used as a preprocessor for tvtwm, a window manager for
- X11R5. I also use it as a preprocessor for my automount maps for NIS.
- It's quite handy, actually.
-
- ------------------------------------------------------------
- From the keyboard of Mike Oliver <moliver@shadow.eng.pyramid.com>:
- I use `m4' to preprocess 68K assembler files; this is in lieu of a
- decent macro facility in this assembler. The C preprocessor won't cut
- it in this case because it doesn't preserve line breaks.
-
- ------------------------------------------------------------
- From the keyboard of Peter J Dohm <dohm@magnus.acs.ohio-state.edu>:
- Yes, actually, tvtwm (Tom's Virtual Tab Window Manager) for X11 does
- optionally use m4 for it's .twmrc parsing/macro expanding... I find their
- use of m4 to be basically pointless, but that's the way they chose to expand
- any macros. it's not really expanding macros, but just defining standard
- things in the .twmrc with m4. seems like overkill, but it may have been easier
- than writing the code to do this. heck, i'm sure it had to have *some* merit
- ;)
-
- ------------------------------------------------------------
- From the keyboard of Michael Haardt <michael@gandalf.moria>:
- I use it to generate machine dependent makefiles from one general source
- and as macroprocessor for my transputer assembler. I love it since good
- old Minix times, cpp is too poor in its capabilities and I am curious
- about m5, which I ftp'ed today.
-
- [Editor's note: m5 is available on thor.ece.uc.edu in /pub/dain/m5 -- JBC]
-
- ------------------------------------------------------------
- From the keyboard of Mischa Sandberg <Mischa_Sandberg@mindlink.bc.ca>:
- Yes, we use m4 as a precompiler for SQL (we use nawk as a report generator
- and for more complicated symbolic manipulation of SQL). It's useful for
- extending the standard set of in-line functions of Sybase transact/sql,
- with equivalent but gross expressions; for example, to return a numeric
- result MAX(COL1, COL2) --- the larger numeric value of two columns ---
- can be done with the expression (abs(COL1-COL2)+COL1+COL2)/2); so we
- define(`MAXOF', `...'). The only problem we've had so far has been working
- around the reserved word "index", which is also an M4 intrinsic function.
-
- ------------------------------------------------------------
- From the keyboard of Andrew D Hay <adh@petrel.att.com>:
- i _did_, quite heavily. m4 is/was the programming language of an
- internal automated test tool called FAST (facility for automated
- system test). oddly, fast was pretty slow...
-
- i think the at&t cpp is written in m4.
-
- ------------------------------------------------------------
- From the keyboard of Kevin Walsh <kev@dsbc.icl.co.uk>:
- I was lurking about the news when I came across your message. I don't
- normally read this group as it is a long way down my active list. That's
- my excuse and I'm sticking to it :-)
-
- In answer to your question, the m4 processor isn't widely used these days.
- It used to be used as part of the assembler. I beleive the cpp pre-processor
- used to use it and it was probably used before cpp was around. (but that
- was before _I_ was around so I don't really know about that :-)
-
- I can only find one actual current use for m4 and that is to process the
- sendmail configuration files (like sendmail.m4 -> sendmail.cf). Even that
- has other utilities scrambling for a bit of the action (like the ease
- language).
-
- ------------------------------------------------------------
- From the keyboard of William Pietri <William.Pietri@umich.edu>:
- I love m4; I've created a bunch of macro files for all my common
- configuration files (like /etc/rc, /etc/ttys, and basically every file
- in /etc that might get changed). A couple of scripts will feed these
- macro files to m4 with the the right things defined, and I will get the
- proper rc.local (or whatever) for a given machine.
-
- The win is that when I want to change some configuration detail for all
- my workstations, I change one file and run one command (say, 'iinstall
- /etc/inetd.conf ALL') instead of editing files on all the workstations.
-
- ------------------------------------------------------------
- From the keyboard of Richard Brooksby <richard@harlqn.co.uk>:
- I use m4 for two main purposes:
-
- 1. My .Xresources, .twmrc, and other X setup files are generated by
- m4 programs because they need to share information about which
- fonts, colours, and so forth to use. The m4 programs also take
- care of different settings on different machines. This allows me
- to maintain a central database.
-
- 2. I use m4 in our project for preprocessing assembly-language
- sources.
-
- =========================================================================
- Jim Crigler
- crigler@eola.cs.ucf.edu
- Guinan is Q's mother.
-