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?
June 28th, 2013, 04:20 AM
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.
June 28th, 2013, 05:41 AM
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... :(