Hi I'm trying to create a build script that executes these commands:
cd libiconv
../../src/libiconv/configure --prefix=/home/ruben/mingw64/build/gcc-libs \
--host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 \
CFLAGS="-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer" LFLAGS="-flto -fwhopr=2"
make -j3 -s
make -s install
cd ..
It looks like this:
#!/bin/sh
HOST=x86_64-w64-mingw32
TARGET=x86_64-w64-mingw32
BUILD=x86_64-w64_mingw32
# options
BUILD_CORES=2 #used as argument for "make -j#"
# directories: SRC_DIR contains full source package.
GCC_LIBS_DIR=$BUILD_DIR/gcc-libs
# optimized for my system.
BUILD_CFLAGS="\"-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer\""
BUILD_LFLAGS="\"-flto -fwhopr="${BUILD_CORES}"\""
CONFIG_OPTS="--prefix="${PREFIX}" --host="${HOST}" --build="${BUILD}" CFLAGS="${BUILD_CFLAGS}" LFLAGS="${BUILD_LFLAGS}
makeopts="-s -j"${BUILD_CORES}
# libiconv
cd libiconv
echo "configuring libiconv: "${CONFIG_OPTS}
../../src/libiconv/configure "${CONFIG_OPTS}" > configure.log || exit 1
echo "building libiconv"
make $MAKEOPTS > build.log || exit 1
echo "installing libiconv"
make -s install > install.log || exit 1
cd ..
The thing is, the echo command shows the exact configure command I want, but when running configure it doesn't so the right thing. Something goes terribly wrong, after CFLAGS=-mtunecore2
, when configure tries to use -flto (which is quoted!!) as an argument.
What am I doing wrong?
Thanks!
PS: I'm running MSYS, not real *nix...