CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: M4

  1. #1
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    M4

    I'm building a GNU library which uses an obscure 1970's macro language called M4. Actually, it's probably not so obscure really. I gather that it's relatively common with code that's intended to be built for *nix. But it's rare to find it being used with programs that are intended to be built for Windows.

    I gather that M4 is available for gcc-like compilers, such as Cygwin and MinGW - but I'd prefer to build with MSVC. Has anyone ever come across a version of M4 that could be used by someone building with MSVC? I guess what I'm asking is whether there's a standalone version of M4 which can be installed without having to install a new (but otherwise un-needed) compiler?
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  2. #2
    Join Date
    Sep 2009
    Posts
    19

    Re: M4

    I do not have an MSVC-working source tree but *some* years ago I made a port to MS-DOS. I have it at home and I can provide it to you. Mail me johau (at) gmx (dot) net if you are interested.
    The main thing for compiling under MS OS is to get the "config.h file". It consists mostly of defines to check (at compliue time) whether certain library functions are available. Under Unix the "configure" script creates it from "config.hin". I see that there is no "config.hin" in the root directory of the source tar ball but there is one in the "lib" sub directory, which I would use as a starting point. Apparently you have to build a library in the "lib" directory first and the build the "m4.exe" executable.
    Since it is a commandline (console) app, it should be not too difficult to compile with MSVC although some work will be involved.

    Best regards,
    Johannes

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: M4

    Thanks Johannes, I'll email you later. BTW, I discovered that it's possible to obtain M4 by installing something called MSYS. Several people have told me that MSYS can be installed as a standalone product but whenever I look for MSYS on the internet, it always seems to be intrinsically tied to MinGW. I'd prefer not to have to install stuff that I'm never going to use - but if the worst comes to the worst, I suppose I'll have to install MinGW too...
    "A problem well stated is a problem half solved.” - Charles F. Kettering

  4. #4
    Join Date
    Nov 2003
    Posts
    1,902

  5. #5
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,835

    Re: M4

    Thanks Codeplug. That pre-built version works a treat.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured