Questions tagged [m4]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
48 views

Expanding a macro into quotes in `m4`

In m4, is it possible to expand a macro and to immediately put it in quotes? That is, instead of define(HELLO, `Hello!')dnl define(MACRO, `HELLO')dnl MACRO expanding to Hello!, I would love to have ...
1
vote
0answers
88 views

Problem compiling autoconf

I am experiencing problems with compiling autoconf and they probably are related to the version of the M4 that I am using. I will put part of the result of running both ./configure as running ./make ...
1
vote
1answer
137 views

Freebsd 11.1 issues with gnu m4 eval test fail

I am pretty new Freebsd user. As I am trying to install gnu m4-1.4.18, I get eval fail on eval test section: Checking ./189.eval @ ../doc/m4.texi:6405: Origin of test ./189.eval: stdout mismatch --- ...
1
vote
1answer
111 views

Implement inclusion of another file into a stream (read from stdin)

Background I'm facing the following problem: I insist on using m4_include([some/file.m4]) in my configure.ac file, where some/file.m4 then contains patterns like 'AC_INIT' and 'LT_INIT' that are ...
1
vote
2answers
11k views

m4 command not found after manual install

Just finished installing ubuntu 16.04.1 desktop version. Now I am trying to install m4. So far installed m4 as follows. Downloaded m4-1.4.18.tar.gz tar -xvzf m4-1.4.18.tar.gz cd m4-1.4.18 ./...
2
votes
2answers
2k views

Checking for required M4 macros… yelp.m4 not found

I am on Linux Mint 18 Cinnamon 64-bit. I was about to compile file-roller known as Archive manager for GNOME from source. But when running: ./autogen.sh There is a following M4 macro missing: ...
1
vote
1answer
181 views

m4 macro implementation of global (non-volatile) counter

Is it possible to define a m4 macro (without arguments), which expands to 1 on first invocation, expands to 2 on second invocation, and so on? In other words, it should have internal memory storing ...
2
votes
1answer
364 views

m4 macro using variable number of tabs to line up a column

This is the macro I have so far: define(`debug_macro', ` #ifndef $1_DEBUG #define $1_DEBUG'forloop(`i',`1',eval(5-(len($1)/4+ifelse(eval(len($1)%4 == 0)), `0', `1')),` ')dnl`0 #endif ') The goal ...
1
vote
1answer
90 views

Loop through m4's dumpdef

Is it possible to loop through the list of macro names given by dumpdef? I want to process certain macros which have a certain prefix in their name.
1
vote
2answers
121 views

Create files from templates, substitutions in middle of other words

Is there a way to convince m4 to replace a macro in the middle of a word? I would like this file, day.m4: define(Sat,Cat)dnl Saturday and this command: m4 day.m4 to produce this output: Caturday ...
5
votes
0answers
1k views

How can I install M4 on Linux, avoiding the dependency loop with Automake and Autoconf?

I am trying to install GNU M4 on my Chromebook using the 1.4.17 tarball, but when I run ./configure and thenmake I get an error related to aclocal, which is apparently part of the GNU Automake package....