Manuel Bachmann
2016-06-06 09:17:11 UTC
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> *
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> *