From: Dmitry Antipov Date: Tue, 26 Aug 2014 14:42:06 +0000 (+0400) Subject: * configure.ac (HAVE_LINUX_SYSINFO): Avoid false positive on Solaris. X-Git-Tag: emacs-25.0.90~2635^2~679^2~428 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=75c76162ab1a60717ef9665cfb9d8ce0bc6d39b1;p=emacs.git * configure.ac (HAVE_LINUX_SYSINFO): Avoid false positive on Solaris. --- diff --git a/ChangeLog b/ChangeLog index 67fc0b87bcb..9eb4637694f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,8 @@ support. Unconditionally check for sigsetjmp and siglongjmp. (HAVE_STACK_OVERFLOW_HANDLING): Define if we can support it. + (HAVE_LINUX_SYSINFO): Avoid false positive on Solaris. + 2014-08-25 Ken Brown * configure.ac (G_SLICE_ALWAYS_MALLOC): Remove obsolete macro. diff --git a/configure.ac b/configure.ac index d6476d2e1c7..4f22be4745d 100644 --- a/configure.ac +++ b/configure.ac @@ -1526,10 +1526,15 @@ if test $emacs_cv_personality_linux32 = yes; then [Define to 1 if personality LINUX32 can be set.]) fi +# Note that Solaris has sys/sysinfo.h which defines struct +# sysinfo as well. To make sure that we're using GNU/Linux +# sysinfo, we explicitly set one of its fields. if test "$ac_cv_header_sys_sysinfo_h" = yes; then AC_MSG_CHECKING([if Linux sysinfo may be used]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[struct sysinfo si; sysinfo (&si)]])], + [[struct sysinfo si; + si.totalram = 0; + sysinfo (&si)]])], emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no) AC_MSG_RESULT($emacs_cv_linux_sysinfo) if test $emacs_cv_linux_sysinfo = yes; then