[FFmpeg-devel] [PATCH] build: make sure probed tools don't wait for stdin input.
Clément Bœsch
ubitux at gmail.com
Wed Jan 9 00:15:46 CET 2013
a758c5e added probing for various tools, such as as. Unfortunately, GNU
as is reading stdin with -v, and thus configure is stalled with
configure arguments such as --as=as.
The --version calls are unchanged because it is supposed to -v + exit.
Fixes Ticket #1898.
---
configure | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/configure b/configure
index 576905c..5dd27c9 100755
--- a/configure
+++ b/configure
@@ -2545,14 +2545,14 @@ probe_cc(){
unset _depflags _DEPCMD _DEPFLAGS
_flags_filter=echo
- if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
+ if $_cc -v 2>&1 < /dev/null | grep -q '^gcc.*LLVM'; then
_type=llvm_gcc
gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
_ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O3'
_cflags_size='-Os'
- elif $_cc -v 2>&1 | grep -qi ^gcc; then
+ elif $_cc -v 2>&1 < /dev/null | grep -qi ^gcc; then
_type=gcc
gcc_version=$($_cc --version | head -n1)
gcc_basever=$($_cc -dumpversion)
@@ -2571,19 +2571,19 @@ probe_cc(){
_cflags_speed='-O3'
_cflags_size='-Os'
_cflags_noopt='-O1'
- elif $_cc -v 2>&1 | grep -q xlc; then
+ elif $_cc -v 2>&1 < /dev/null | grep -q xlc; then
_type=xlc
_ident=$($_cc -qversion 2>/dev/null | head -n1)
_cflags_speed='-O5'
_cflags_size='-O5 -qcompact'
- elif $_cc -V 2>/dev/null | grep -q Compaq; then
+ elif $_cc -V 2>/dev/null < /dev/null | grep -q Compaq; then
_type=ccc
_ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
_DEPFLAGS='-M'
_cflags_speed='-fast'
_cflags_size='-O1'
_flags_filter=ccc_flags
- elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
+ elif $_cc --vsn 2>/dev/null < /dev/null | grep -q "ARM C/C++ Compiler"; then
test -d "$sysroot" || die "No valid sysroot specified."
_type=armcc
_ident=$($_cc --vsn | head -n1)
@@ -2609,13 +2609,13 @@ probe_cc(){
_cflags_speed='-O3 -mf=5'
_cflags_size='-O3 -mf=2'
_flags_filter=tms470_flags
- elif $_cc -v 2>&1 | grep -q clang; then
+ elif $_cc -v 2>&1 < /dev/null | grep -q clang; then
_type=clang
_ident=$($_cc --version | head -n1)
_depflags='-MMD'
_cflags_speed='-O3'
_cflags_size='-Os'
- elif $_cc -V 2>&1 | grep -q Sun; then
+ elif $_cc -V 2>&1 < /dev/null | grep -q Sun; then
_type=suncc
_ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
@@ -2624,21 +2624,21 @@ probe_cc(){
_cflags_speed='-O5'
_cflags_size='-O5 -xspace'
_flags_filter=suncc_flags
- elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
+ elif $_cc -v 2>&1 < /dev/null | grep -q 'PathScale\|Path64'; then
_type=pathscale
_ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O2'
_cflags_size='-Os'
_flags_filter='filter_out -Wdisabled-optimization'
- elif $_cc -v 2>&1 | grep -q Open64; then
+ elif $_cc -v 2>&1 < /dev/null | grep -q Open64; then
_type=open64
_ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
_depflags='-MMD -MF $(@:.o=.d) -MT $@'
_cflags_speed='-O2'
_cflags_size='-Os'
_flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
- elif $_cc -V 2>&1 | grep -q Portland; then
+ elif $_cc -V 2>&1 < /dev/null | grep -q Portland; then
_type=pgi
_ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
opt_common='-alias=ansi -Mdse -Mlre -Mpre'
@@ -2646,7 +2646,7 @@ probe_cc(){
_cflags_size="-O2 -Munroll=c:1 $opt_common"
_cflags_noopt="-O1"
_flags_filter=pgi_flags
- elif $_cc 2>&1 | grep -q Microsoft; then
+ elif $_cc 2>&1 < /dev/null | grep -q Microsoft; then
_type=msvc
_ident=$($cc 2>&1 | head -n1)
_DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
@@ -2654,7 +2654,7 @@ probe_cc(){
_cflags_speed="-O2"
_cflags_size="-O1"
# Nonstandard output options, to avoid msys path conversion issues, relies on wrapper to remap it
- if $_cc 2>&1 | grep -q Linker; then
+ if $_cc 2>&1 < /dev/null | grep -q Linker; then
_ld_o='-out $@'
else
_ld_o='-Fe$@'
--
1.8.1
More information about the ffmpeg-devel
mailing list