Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > by-pkgid > b81461808d37c672ed8286167d2680dc > files > 1

libvorbis-1.2.0-4mdv2009.0.src.rpm

--- libvorbis-1.0/vorbis.m4.lib64	2002-07-09 09:08:57.000000000 -0400
+++ libvorbis-1.0/vorbis.m4	2002-07-25 13:56:52.000000000 -0400
@@ -15,12 +15,37 @@ AC_ARG_WITH(vorbis-libraries,[  --with-v
 AC_ARG_WITH(vorbis-includes,[  --with-vorbis-includes=DIR   Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
 AC_ARG_ENABLE(vorbistest, [  --disable-vorbistest       Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
 
+  case $host in
+  *-*-linux*)
+    # Test if the compiler is 64bit
+    echo 'int i;' > conftest.$ac_ext
+    vorbis_cv_cc_64bit_output=no
+    if AC_TRY_EVAL(ac_compile); then
+      case `/usr/bin/file conftest.$ac_objext` in
+      *"ELF 64"*)
+       vorbis_cv_cc_64bit_output=yes
+        ;;
+      esac
+    fi
+    rm -rf conftest*
+    ;;
+  esac
+  
+  case $host_cpu:$vorbis_cv_cc_64bit_output in
+  powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
+    vorbis_libname="lib64"
+    ;;
+  *:*)
+    vorbis_libname="lib"
+    ;;
+  esac
+
   if test "x$vorbis_libraries" != "x" ; then
     VORBIS_LIBS="-L$vorbis_libraries"
   elif test "x$vorbis_prefix" != "x" ; then
-    VORBIS_LIBS="-L$vorbis_prefix/lib"
+    VORBIS_LIBS="-L$vorbis_prefix/$vorbis_libname"
   elif test "x$prefix" != "xNONE"; then
-    VORBIS_LIBS="-L$prefix/lib"
+    VORBIS_LIBS="-L$prefix/$vorbis_libname"
   fi
 
   VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"