]> granicus.if.org Git - sysstat/commitdiff
Updated 64 bit OS detection in configure
authorPeter Schiffer <pschiffe@redhat.com>
Thu, 12 Feb 2015 09:52:25 +0000 (10:52 +0100)
committerPeter Schiffer <pschiffe@redhat.com>
Thu, 12 Feb 2015 09:52:25 +0000 (10:52 +0100)
If command "getconf LONG_BIT" fails, fallback to the looking for the "lm" flag
in the /proc/cpuinfo file.

configure.in

index a1de35532fabcbea841328327d4361d61c99ff99..77d928e5f5867e2dcc9908c6ae43362b7ac8e928 100644 (file)
@@ -210,10 +210,19 @@ fi
 
 SADC_DIR=$AuxPrefix/lib
 if test -d $AuxPrefix/lib64; then
-   # Verify that this OS is really 64 bit
-   if test $(getconf LONG_BIT) = 64; then
-      SADC_DIR=$AuxPrefix/lib64
-   fi
+    # Verify that this OS is really 64 bit
+    BITS=$(getconf LONG_BIT 2>/dev/null)
+    if test $? = 0; then
+        if test $BITS = 64; then
+            SADC_DIR=$AuxPrefix/lib64
+        fi
+    else
+        # Fallback: look for lm (long mode) flag to know if CPU is 64 bit
+        grep " lm " /proc/cpuinfo >/dev/null 2>&1
+        if test $? = 0; then
+            SADC_DIR=$AuxPrefix/lib64
+        fi
+    fi
 fi
 
 AC_MSG_CHECKING(sadc directory)