Questions tagged [m4]

18 questions
5
votes
1 answer

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. The exact error I get is WARNING:…
murgatroid99
  • 173
  • 7
3
votes
1 answer

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 some function qexpand, for example, such…
k.stm
  • 689
  • 1
  • 11
  • 24
3
votes
2 answers

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 ./configure --prefix=/usr/local/m4 make sudo make…
arod2028
  • 45
  • 1
  • 1
  • 4
3
votes
2 answers

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: Checking for required M4 macros... yelp.m4 not…
Vlastimil Burián
  • 27,586
  • 56
  • 179
  • 309
2
votes
1 answer

output redirection issue - m4 macro with self increasing build counter

My goal is to create a m4 macro, that reads a value from a file (BUILD), increases it and then saves the output into the file. I came up with the following solution (BUILD.m4): define(`__buildnumber__',`esyscmd(cat…
bckmnn
  • 23
  • 3
2
votes
1 answer

Why is m4 -D option not doing a substitution

How does -DQUOTE=yes work in the code below? I expected the second line to be ifelse(yes,yes,Learn Linux today!) The other parts make sense to me. From Linux Pocket Guide - by Daniel J. Barrett $ cat myfile My name is NAME and I am AGE years…
PurpleMongrel
  • 53
  • 1
  • 5
2
votes
1 answer

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 is to put the correct number of tabs between the…
MyTallest
  • 123
  • 3
1
vote
1 answer

What does it mean when "aclocal cannot open VERSION"

Is this the correct forum? I am running ./bootstrap for a program called Qucs and it complains about VERSION Running aclocal... Running automake... Running autoconf... bootstrapping /home/lasse/Downloads/qucs-0.0.20/qucs-core bootstrapping the…
1
vote
0 answers

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 so someone can confirm is the cause is really that…
user2752471
  • 237
  • 1
  • 2
  • 11
1
vote
1 answer

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 --- m4-tmp.2536/m4-xout 2017-12-18 22:11:42.931036000…
B. Belete
  • 13
  • 6
1
vote
1 answer

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 necessary for libtoolize to work. In otherwords, I…
Carlo Wood
  • 233
  • 2
  • 11
1
vote
2 answers

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 the number of times it is invoked. Can this be…
adgadg
  • 69
  • 7
1
vote
1 answer

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.
Rnet
  • 113
  • 4
1
vote
2 answers

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 As shown, m4 will not do this. Alternatively, is…
Praxeolitic
  • 1,638
  • 3
  • 18
  • 24
0
votes
0 answers

Debugging m4 macros

I was reading the manual and got stuck with the following example: define(`l', `<[>')define(`r', `<]>') ⇒ changequote(`[', `]') ⇒ defn([l])defn([r]) ]) ⇒<[>]defn([r]) ⇒) defn([l], [r]) ⇒<[>][<]> I've managed to understand why it produces the shown…
x-yuri
  • 3,223
  • 10
  • 39
  • 62
1
2