Dizzy wrote:
Hi
I have an input file named project.conf.in in which I have some variable
placeholders of the form ${VARIABLE}. I am trying to use sed to replace them
with some actual contents so I have added a make rule in Makefile.am such as:
project.conf:project.conf.in $(top_builddir)/config.status
$(SED) -e '[EMAIL PROTECTED]/@'"${localstatedir}/@g"
$(top_srcdir)/conf/project.conf.in > $@
Instead of having the Makefile do this for you, why not during
'configure' time with the AC_CONFIG_FILES? And then define the variable
substitutions as part of the configure script? Even define a macro if
you want to logically separate everything.
e.g.
AC_CONFIG_FILES([project.conf
Makefile
subdir/Makefile])
Notice that I first have a string with single quotes so I tell bash to not
deal with ${LOCALSTATEDIR} then I have a string with double quotes so bash
can replace the ${localstatedir} variable contents and no space between which
seems to work well if I run that command in shell.
However I think that configure replaces the ${LOCALSTATEDIR} from the
generated Makefile.in with "" (because there is no such variable so it puts
an empty string) and ignores my single quotes.
Any idea how to implement such a make rule that should replace variable
placeholders with contents of actual variables?
Thanks!