[Ffmpeg-devel] configure script broken with dash as sh

John Dalgliesh johnd
Tue Aug 15 06:19:53 CEST 2006


On Mon, 14 Aug 2006, Alan Curry wrote:
> Diego Biurrun writes:
>> On Mon, Aug 14, 2006 at 11:56:26PM +0200, matthieu castet wrote:
>>> if dash is used as sh instead of bash, the configure script put in config.h
>>>
>>> #define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "
>>> 	"
>>> instead of :
>>> #define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"
...
> You can't portably echo a backslash.

OK. Does the attached patch fix the problem?

> printf would be better. If there's some printf-phobia, post-process the echo
> through tr or sed or use a heredoc.

As printf isn't yet used in the configure script, this patch uses tr. In 
bash you cannot escape a single quote within single quotes, even with a 
backslash. If your shell differs then another backslash could be safely 
added to the last arg to tr.

{P^/
-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 5992)
+++ configure	(working copy)
@@ -2105,10 +2105,11 @@
 fi
 
 if test "$asmalign_pot" = "yes" ; then
-  echo '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\n\t"' >> $TMPH
+  alignexpr='" #ZEROBITS "'
 else
-  echo '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\n\t"' >> $TMPH
+  alignexpr='1<<" #ZEROBITS "'
 fi
+echo '#define ASMALIGN(ZEROBITS) ".align' $alignexpr '|n|t"' | tr '|' '\' >> $TMPH
 
 
 for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do



More information about the ffmpeg-devel mailing list