【发布时间】:2017-05-25 02:35:50
【问题描述】:
我正在尝试调整自动构建包的 bash 测试脚本。脚本的相关部分是:
# https://kojipkgs.fedoraproject.org//packages/cryptopp/5.6.3/8.fc27/data/logs/i686/build.log
# https://kojipkgs.fedoraproject.org//packages/cryptopp/5.6.3/8.fc27/data/logs/x86_64/build.log
if [[ ("$IS_X86" -ne "0") ]]; then
MARCH_OPT=(-m32 -march=i686)
else
MARCH_OPT=(-m64 -mtune=generic)
fi
FEDORA_FLAGS=(-DHAVE_CONFIG_H -I. -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-fexceptions -fstack-protector-strong --param=ssp-buffer-size=4
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 "${MARCH_OPT[@]}" -fasynchronous-unwind-tables)
"$MAKE" distclean > /dev/null 2>&1
CXX="g++" "$MAKE" "${MAKEARGS[@]}" CXXFLAGS="${FEDORA_FLAGS[@]}" cryptest.exe 2>&1
它产生了一个错误:
Testing: Fedora standard build
make: invalid option -- 'g'
make: unrecognized option '--param=ssp-buffer-size=4'
make: invalid option -- 'c'
make: invalid option -- '='
make: invalid option -- '/'
make: invalid option -- 'u'
make: invalid option -- '/'
make: invalid option -- '6'
make: invalid option -- '4'
make: invalid option -- 'u'
make: invalid option -- '='
make: invalid option -- 'g'
make: invalid option -- 'c'
Usage: make [options] [target] ...
Options:
-b, -m Ignored for compatibility.
-B, --always-make Unconditionally make all targets.
-C DIRECTORY, --directory=DIRECTORY
Change to DIRECTORY before doing anything.
-d Print lots of debugging information.
--debug[=FLAGS] Print various types of debugging information.
-e, --environment-overrides
Environment variables override makefiles.
...
我认为问题与 Bash 数组有关。但我很确定事情是正确的。元素括在括号中;其元素以${VAR[@]} 引用。我还尝试引用 FEDORA_FLAGS 数组中的每个值,但它产生了相同的错误。
是什么导致了错误,我该如何解决?
【问题讨论】: