Sophie

Sophie

distrib > Mandriva > 2007.1 > x86_64 > by-pkgid > 2b89af6564905e6a69cd2de5bd78b086 > files > 19

mplayer-1.0-1.rc1.11mdv2007.1.src.rpm

--- MPlayer-1.0rc1/configure.lib64	2006-10-24 09:40:21.000000000 +0200
+++ MPlayer-1.0rc1/configure	2006-10-24 09:42:09.000000000 +0200
@@ -131,6 +131,14 @@
   esac
 }
 
+# 64 bit system
+x86_64() {
+  case "$host_arch" in
+    x86_64|x86-64|amd64) return 0 ;;
+    *) return 1 ;;
+  esac
+}
+
 ppc() {
   case "$host_arch" in
     ppc) return 0;;
@@ -179,6 +187,49 @@
   echo "$@ $_res_comment"
   _res_comment=""
 }
+
+# check $prefix/lib64 (linux 64bit version)
+check_linux_lib64() {
+  _use_linux_lib64=1
+  if not linux ; then
+    return 1
+  fi
+  if not test -d $_prefix/lib64 ; then
+    return 1
+  fi
+  # 
+  if not x86_64 ; then
+    return 1
+  fi
+  case "`$_cc -dumpmachine`" in
+  x86_64-*|amd64-*)
+    :
+    ;;
+  *)
+    return 1
+    ;;
+  esac
+  if not test -z "`echo $CFLAGS | grep -- -m32`" ; then
+    return 1
+  fi
+  _use_linux_lib64=0
+  return 0
+}
+
+# (needed for more OS as well)?
+check_lib64() {
+  _use_lib64=1
+  if linux ; then
+    check_linux_lib64
+    _use_lib64=$_use_linux_lib64
+  fi
+  return $_use_lib64
+}
+
+# return _use_lib64 value (check only once)
+use_lib64() {
+    return $_use_lib64
+}
 #############################################################################
 
 # Check how echo works in this /bin/sh
@@ -2220,7 +2271,12 @@
 test -z "$_datadir" && _datadir="$_prefix/share/mplayer"
 test -z "$_mandir" && _mandir="$_prefix/man"
 test -z "$_confdir" && _confdir="$_prefix/etc/mplayer"
-test -z "$_libdir" && _libdir="$_prefix/lib"
+check_lib64
+if use_lib64 ; then
+	test -z "$_libdir" && _libdir="$_prefix/lib64"
+else
+	test -z "$_libdir" && _libdir="$_prefix/lib"
+fi
 
 if x86 ; then
   # Checking assembler (_as) compatibility...
@@ -6969,7 +7025,11 @@
       _xmmsplugindir=`xmms-config --input-plugin-dir`
     fi
     if test -z "$_xmmslibdir" ; then
-      _xmmslibdir=`xmms-config --exec-prefix`/lib
+      if use_lib64 ; then
+        _xmmslibdir=`xmms-config --exec-prefix`/lib64
+      else
+        _xmmslibdir=`xmms-config --exec-prefix`/lib
+      fi
     fi
   else
     if test -z "$_xmmsplugindir" ; then