I want to compile Boost with some specific options (eg: using zlib from its latest source)
So I try next bash code like:
WD=`pwd`
#//...
cd $BOOST_ROOT_DIR
echo_run ./bootstrap.sh
#// problem with \"$WD/$ZLIB_ROOT_DIR\"
echo_run ./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE=\"$WD/$ZLIB_ROOT_DIR\" link=static runtime-link=static --prefix=./$BOOST_INSTALL_SUBDIR install
echo Done!
But I get next outputfrom b2:
./b2 -j4 -d0 debug release --toolset=gcc --with-thread --with-system --with-filesystem --with-program_options --with-regex --with-date_time --with-iostreams -sZLIB_SOURCE="/home/tim/Рабочий стол/mask-viewer-standalone/MaskLoader/zlib_libraries" link=static runtime-link=static --prefix=./install-dir install
notice: could not find main target стол/mask-viewer-standalone/MaskLoader/zlib_libraries"
notice: assuming it is a name of file to create.
Which is preatty scarry!( (стол
is part of russian Ubuntu translation of Desctop
- Рабочий стол
)
So I wonder - what I do wrong - how to make b2
friend of paths with spaces?
You can quote the shell variables like:
-sZLIB_SOURCE="$WD"/"$ZLIB_ROOT_DIR"
. Do not escape the quotes.