[Top][All Lists]

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

Re: replacement of variable placeholders in files

From: Jason Curl
Subject: Re: replacement of variable placeholders in files
Date: Wed, 22 Aug 2007 12:23:38 +0200
User-agent: Thunderbird (Windows/20070728)

Dizzy wrote:

I have an input file named 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 such as: $(top_builddir)/config.status
$(SED) -e 'address@hidden/@'"${localstatedir}/@g" $(top_srcdir)/conf/ > $@
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.


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 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?


reply via email to

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