autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using "m4_bpatsubst/patsubst" to remove a string from a variable


From: Manuel Bachmann
Subject: Using "m4_bpatsubst/patsubst" to remove a string from a variable
Date: Mon, 6 Jun 2016 11:17:11 +0200

Hi folks,

I am trying to use the "m4_bpatsubst" and/or "patsubst" macros (which I
found documented here : [1] [2]), to remove a string from a variable in my "
configure.ac" ; and pass it to "Makefile.am", so it ends up in final
"Makefile".

I was able to get some kind of output, with this in "configure.ac" :

VAR="text1 text2"
VAR2=m4_bpatsubst("$VAR", "text1")
AC_SUBST(VAR2)

with the hope of obtaining "VAR2="text2"", but when running "autoreconf
--install; ./configure", and opening "Makefile", the final variable is
still :
VAR2="text1 text2"
no text was removed...

I've also tried only syntaxes, such as :
VAR2=m4_bpatsubst([VAR], [text1])
or :
AC_DEFINE(VAR2, m4_bpatsubst([VAR], [text1])
but they all issue errors or the resulting "VAR2" is empty.

Any ideas on this ?

[1] :
https://www.gnu.org/software/autoconf/manual/autoconf-2.68/html_node/Redefined-M4-Macros.html
[2] :
https://www.gnu.org/software/m4/manual/m4-1.4.15/html_node/Patsubst.html

Regards,

*Manuel Bachmann, Graphics & Multimedia Engineer www.iot.bzh
<http://iot.bzh> *


reply via email to

[Prev in Thread] Current Thread [Next in Thread]