We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b0aad7d commit 1aa75ceCopy full SHA for 1aa75ce
configure
@@ -479,10 +479,19 @@ esac
479
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
480
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]
481
then
482
- file -L "$SHELL" | grep -q "x86[_-]64"
483
- if [ $? != 0 ]; then
484
- CFG_CPUTYPE=i686
+ # $SHELL does not exist in standard 'sh', so probably only exists
+ # if configure is running in an interactive bash shell. /usr/bin/env
+ # 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"
488
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
495
496
497
0 commit comments