[gmx-developers] bad sed expression in share/template/Makefile.am

Ake Sandgren ake.sandgren at hpc2n.umu.se
Fri Nov 13 23:58:44 CET 2009


On Sat, 2009-11-14 at 09:46 +1100, Mark Abraham wrote:
> Ake Sandgren wrote:
> > On Fri, 2009-11-13 at 11:31 +1100, Mark Abraham wrote:
> >> Ake Sandgren wrote:
> >>> Hi!
> >>>
> >>> The sed in share/template/Makefile.am uses "," as separator. This is bad
> >>> since LDFLAGS and others might contains things like -Wl,-rpath and other
> >>> things with "," in them. "#" is usually a better choice.
> >> Using "," as a sed separator seems to be standard practice with the 
> >> autotools. From autoconf docs:
> >>
> >> "When using sed, don't use -e except for indenting purpose. With the s 
> >> command, the preferred separator is `/' unless `/' itself is used in the 
> >> command, in which case you should use `,'. "
> >>
> >> Wouldn't "#" get interpreted as a Makefile comment?
> > 
> > Nope, it's within single-quotes.
> 
> True... but on the converse, many's the time I've been playing with 
> xxFLAGS arguments and just commented out the last bunch to see the 
> effect... that'll break the sed line as well.

Nope, because the comment will not be part of the variable.
As can be seen in this small makefile snippet (if this is what you meant
by commenting out the last bunch)
=========
xxFLAG=-O1 -g -Wl,-rpath,/some-path # -someflag

all:
	@echo "xxFLAG=@xxFLAG@" | sed 's#@xxFLAG@#$(xxFLAG)#'
=========

-- 
Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden
Internet: ake at hpc2n.umu.se   Phone: +46 90 7866134 Fax: +46 90 7866126
Mobile: +46 70 7716134 WWW: http://www.hpc2n.umu.se




More information about the gromacs.org_gmx-developers mailing list