aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMax Horn2007-12-02 20:59:19 +0000
committerMax Horn2007-12-02 20:59:19 +0000
commit40474c5acbf9210022649890f755cc0df91edeb3 (patch)
tree9ec521ca28078b321f81cedb3a279d53b9628039 /configure
parent411688ef8f6b8598201aac8119e925eff0d1870c (diff)
downloadscummvm-rg350-40474c5acbf9210022649890f755cc0df91edeb3.tar.gz
scummvm-rg350-40474c5acbf9210022649890f755cc0df91edeb3.tar.bz2
scummvm-rg350-40474c5acbf9210022649890f755cc0df91edeb3.zip
Abort configure run if no matching datatypes are found; some tweaks for cross compiling (do not try to link when you don't use the resulting binary; but *if* we want to link, we must pass the LDFLAGS in case there are require linker flag modifications)
svn-id: r29707
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 9 insertions, 4 deletions
diff --git a/configure b/configure
index 079932e21a..ef1b73b284 100755
--- a/configure
+++ b/configure
@@ -207,9 +207,9 @@ EOF
if test -n "$_host"; then
# In cross-compiling mode, we cannot run the result
- eval "$1 $CXXFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
else
- eval "$1 $CXXFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
+ eval "$1 $CXXFLAGS $LDFLAGS -o tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp" 2> /dev/null && eval "./tmp_cxx_compiler 2> /dev/null" && rm -f tmp_cxx_compiler$EXEEXT tmp_cxx_compiler.cpp
fi
}
@@ -268,7 +268,7 @@ int main() {
return 0;
}
EOF
-if $CXX $CXXFLAGS -o tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp 2>/dev/null ; then
+if $CXX $CXXFLAGS -c -o tmp_find_type_with_size$EXEEXT tmp_find_type_with_size.cpp 2>/dev/null ; then
break
else
if test "$datatype" = "unknown"; then
@@ -819,7 +819,6 @@ case $_host_os in
esac
-cxx_name=`( $cc -v ) 2>&1 | $tail -n 1 | cut -d ' ' -f 1`
cxx_version=`( $CXX -dumpversion ) 2>&1`
if test "$?" -gt 0; then
cxx_version="not found"
@@ -919,15 +918,21 @@ rm -f tmp_endianness_check.o tmp_endianness_check.cpp
#
echo_n "Type with 1 byte... "
type_1_byte=`find_type_with_size 1`
+TMP="$?"
echo "$type_1_byte"
+test $TMP -eq 0 || exit 1 # check exit code of subshell
echo_n "Type with 2 bytes... "
type_2_byte=`find_type_with_size 2`
+TMP="$?"
echo "$type_2_byte"
+test $TMP -eq 0 || exit 1 # check exit code of subshell
echo_n "Type with 4 bytes... "
type_4_byte=`find_type_with_size 4`
+TMP="$?"
echo "$type_4_byte"
+test $TMP -eq 0 || exit 1 # check exit code of subshell
#
# Check whether we can use x86 asm routines