1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-08 13:22:53 +02:00

configure: properly quote configure options stored in config.*

Originally committed as revision 19201 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Måns Rullgård 2009-06-15 22:12:21 +00:00
parent 7cc8d616aa
commit b04251c5d0

14
configure vendored
View File

@ -283,6 +283,12 @@ c_escape(){
echo "$*" | sed 's/["\\]/\\\0/g' echo "$*" | sed 's/["\\]/\\\0/g'
} }
sh_quote(){
v=$(echo "$1" | sed "s/'/'\\\\''/g")
test "$v" = "${v#*[ |&;<>()$\`\\\"\'*?\[\]#~=%]}" || v="'$v'"
echo "$v"
}
set_all(){ set_all(){
value=$1 value=$1
shift shift
@ -1270,9 +1276,9 @@ else
fi fi
for v in "$@"; do for v in "$@"; do
r="${v#*=}" r=${v#*=}
l="${v%$r}" l=${v%"$r"}
test "$r" = "${r#* }" || r="'$r'" r=$(sh_quote "$r")
FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}" FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
done done
@ -2444,7 +2450,7 @@ echo "# Automatically generated by configure - do not modify!" > config.mak
echo "/* Automatically generated by configure - do not modify! */" > $TMPH echo "/* Automatically generated by configure - do not modify! */" > $TMPH
echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIG_H" >> $TMPH echo "#define FFMPEG_CONFIG_H" >> $TMPH
echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak