File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -479,10 +479,19 @@ esac
479479# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
480480if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
481481then
482- file -L " $SHELL " | grep -q " x86[_-]64"
483- if [ $? != 0 ]; then
484- CFG_CPUTYPE=i686
482+ # $SHELL does not exist in standard 'sh', so probably only exists
483+ # if configure is running in an interactive bash shell. /usr/bin/env
484+ # exists *everywhere*.
485+ BIN_TO_PROBE=" $SHELL "
486+ if [ -z " $BIN_TO_PROBE " -a -e " /usr/bin/env" ]; then
487+ BIN_TO_PROBE=" /usr/bin/env"
485488 fi
489+ if [ -n " $BIN_TO_PROBE " ]; then
490+ file -L " $BIN_TO_PROBE " | grep -q " x86[_-]64"
491+ if [ $? != 0 ]; then
492+ CFG_CPUTYPE=i686
493+ fi
494+ fi
486495fi
487496
488497
You can’t perform that action at this time.
0 commit comments