config: in cross-compile case interrogate cross-compiler, not host, work
around sub-shell limitation.
This commit is contained in:
parent
5fd722600b
commit
8b8d2dccf1
34
config
34
config
@ -411,25 +411,18 @@ exit 0
|
|||||||
# this is where the translation occurs into SSLeay terms
|
# this is where the translation occurs into SSLeay terms
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
if [ -z "$GCCVER" ]; then
|
|
||||||
GCCVER=`(gcc -dumpversion) 2>/dev/null`
|
|
||||||
fi
|
|
||||||
if [ "$GCCVER" != "" ]; then
|
|
||||||
# then strip off whatever prefix egcs prepends the number with...
|
|
||||||
# Hopefully, this will work for any future prefixes as well.
|
|
||||||
GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
|
|
||||||
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
|
|
||||||
# does give us what we want though, so we use that. We just just the
|
|
||||||
# major and minor version numbers.
|
|
||||||
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
|
||||||
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Only set CC if not supplied already
|
# Only set CC if not supplied already
|
||||||
if [ -z "$CC" ]; then
|
if [ -z "$CROSS_COMPILE$CC" ]; then
|
||||||
# figure out if gcc is available and if so we use it otherwise
|
GCCVER=`sh -c "gcc -dumpversion" 2>/dev/null`
|
||||||
# we fallback to whatever cc does on the system
|
|
||||||
if [ "$GCCVER" != "" ]; then
|
if [ "$GCCVER" != "" ]; then
|
||||||
|
# then strip off whatever prefix egcs prepends the number with...
|
||||||
|
# Hopefully, this will work for any future prefixes as well.
|
||||||
|
GCCVER=`echo $GCCVER | LC_ALL=C sed 's/^[a-zA-Z]*\-//'`
|
||||||
|
# Since gcc 3.1 gcc --version behaviour has changed. gcc -dumpversion
|
||||||
|
# does give us what we want though, so we use that. We just just the
|
||||||
|
# major and minor version numbers.
|
||||||
|
# peak single digit before and after first dot, e.g. 2.95.1 gives 29
|
||||||
|
GCCVER=`echo $GCCVER | sed 's/\([0-9]\)\.\([0-9]\).*/\1\2/'`
|
||||||
CC=gcc
|
CC=gcc
|
||||||
else
|
else
|
||||||
CC=cc
|
CC=cc
|
||||||
@ -851,10 +844,9 @@ if [ -n "$CONFIG_OPTIONS" ]; then
|
|||||||
options="$options $CONFIG_OPTIONS"
|
options="$options $CONFIG_OPTIONS"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$CONFIG_SKIP_NOEXECSTACK" ]; then
|
if expr "$options" : '.*no\-asm' > /dev/null; then :; else
|
||||||
! expr "$options" : '.*no\-asm' > /dev/null && \
|
sh -c "$CROSS_COMPILE${CC:-gcc} -Wa,--help -c -o /tmp/null.$$.o -x assembler /dev/null && rm /tmp/null.$$.o" 2>&1 | \
|
||||||
($CC -Wa,--help -c -o /dev/null -x assembler /dev/null 2>&1 | \
|
grep \\--noexecstack >/dev/null && \
|
||||||
grep \\--noexecstack) 2>&1 > /dev/null && \
|
|
||||||
options="$options -Wa,--noexecstack"
|
options="$options -Wa,--noexecstack"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user