Skip to content

Commit ffbabb6

Browse files
author
Peter Schiffer
committed
Updated 64 bit OS detection in configure
If command "getconf LONG_BIT" fails, fallback to the looking for the "lm" flag in the /proc/cpuinfo file.
1 parent 8005de2 commit ffbabb6

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

configure.in

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,19 @@ fi
210210

211211
SADC_DIR=$AuxPrefix/lib
212212
if test -d $AuxPrefix/lib64; then
213-
# Verify that this OS is really 64 bit
214-
if test $(getconf LONG_BIT) = 64; then
215-
SADC_DIR=$AuxPrefix/lib64
216-
fi
213+
# Verify that this OS is really 64 bit
214+
BITS=$(getconf LONG_BIT 2>/dev/null)
215+
if test $? = 0; then
216+
if test $BITS = 64; then
217+
SADC_DIR=$AuxPrefix/lib64
218+
fi
219+
else
220+
# Fallback: look for lm (long mode) flag to know if CPU is 64 bit
221+
grep " lm " /proc/cpuinfo >/dev/null 2>&1
222+
if test $? = 0; then
223+
SADC_DIR=$AuxPrefix/lib64
224+
fi
225+
fi
217226
fi
218227

219228
AC_MSG_CHECKING(sadc directory)

0 commit comments

Comments
 (0)