aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-19 13:36:58 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-09-19 13:36:58 +0000
commit4aeef295900747afad2d61aaf65ead5aa9f3a6e1 (patch)
treefeb64f7d792650d119667408b9f31f6925e59ed9
parenta7845321db50f67e7379ca972db7539ece4fa452 (diff)
Use a compilation check to distinguish between x86 and x86_64, uname and
CFLAGS checks alone are not reliable. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29693 b3059339-0415-0410-9bf9-f77b7e298cf2
-rwxr-xr-xconfigure36
1 files changed, 19 insertions, 17 deletions
diff --git a/configure b/configure
index 5e264a3853..e963eb11e7 100755
--- a/configure
+++ b/configure
@@ -1392,16 +1392,8 @@ if test -z "$_target" ; then
# x86/x86pc is used by QNX
case "$(uname -m 2>&1)" in
- i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
+ x86_64|amd64|i[3-9]86*|x86|x86pc|k5|k6|k6_2|k6_3|k6-2|k6-3|pentium*|athlon*|i586_i686|i586-i686|BePC) host_arch=i386 ;;
ia64) host_arch=ia64 ;;
- x86_64|amd64)
- if [ -n "$($_cc -dumpmachine | sed -n '/^x86_64-/p;/^amd64-/p')" -a \
- -z "$(echo $CFLAGS $_cc | grep -- -m32)" ]; then
- host_arch=x86_64
- else
- host_arch=i386
- fi
- ;;
macppc|ppc) host_arch=ppc ;;
ppc64) host_arch=ppc64 ;;
alpha) host_arch=alpha ;;
@@ -1442,14 +1434,6 @@ else # if test -z "$_target"
fi
fi
-echo "Detected operating system: $system_name"
-echo "Detected host architecture: $host_arch"
-
-if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
- die "Runtime CPU detection only works for x86, x86-64 and PPC!"
-fi
-
-
extra_cflags="-I. $extra_cflags"
_timer=timer-linux.c
_getch=getch2.c
@@ -1532,6 +1516,24 @@ echo configuration: $_configuration > "$TMPLOG"
echo >> "$TMPLOG"
+if x86 ; then
+ cat > $TMPC << EOF
+int main(void) {
+ int test[sizeof(char *)-7];
+ return 0;
+}
+EOF
+ cc_check && host_arch=x86_64 || host_arch=i386
+fi
+
+echo "Detected operating system: $system_name"
+echo "Detected host architecture: $host_arch"
+
+if test "$_runtime_cpudetection" = yes && ! x86 && ! ppc; then
+ die "Runtime CPU detection only works for x86, x86-64 and PPC!"
+fi
+
+
# Checking CC version...
# Intel C++ Compilers (no autoselect, use CC=/some/binary ./configure)
if test "$(basename $_cc)" = "icc" || test "$(basename $_cc)" = "ecc"; then