I'm trying to run this inside a bash script.
./configure --with-cc-opt='-O0 -g -Wno-error'
but with the '-O0 -g -Wno-error'
part passed in as a variable. Note the above works just fine without the variable.
if I use this
CC_OPTS="'-O0 -g -Wno-error'"
./configure --with-cc-opt=${CC_OPTS}
it's like the value in the single quotes gets split up and ./configure
ends up getting --with-cc-opt=-O0
, -g
and -Wno-error
as separate arguments.
CC_OPTS="'-O0 -g -Wno-error'"
echo ${CC_OPTS}
prints out '-O0 -g -Wno-error'
, with the right single quotes.
CC_OPTS="'-O0 -g -Wno-error'"
echo --with-cc-opt=${CC_OPTS}
prints out --with-cc-opt='-O0 -g -Wno-error'
which is correct too. But still ./configure
receives them as separate arguments.
What am I doing wrong?