aboutsummaryrefslogtreecommitdiffstats
path: root/macros/gnome-libgtop-sysdeps.m4
diff options
context:
space:
mode:
authorMartin Baulig <martin@home-of-linux.org>1998-12-04 00:08:24 +0800
committerMartin Baulig <martin@src.gnome.org>1998-12-04 00:08:24 +0800
commitc2c203d4980ea68808bdd158f87db73604a11bb4 (patch)
tree3e73360c755cd2e423327ebf8b40573e6bc99784 /macros/gnome-libgtop-sysdeps.m4
parent405dbe01d90c954f52e0a79b45ec5c764dfcb83a (diff)
downloadgsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar.gz
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar.bz2
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar.lz
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar.xz
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.tar.zst
gsoc2013-evolution-c2c203d4980ea68808bdd158f87db73604a11bb4.zip
Define this to be the same as LINUX_VERSION_CODE either from
1998-12-03 Martin Baulig <martin@home-of-linux.org> * gnome-libgtop-sysdeps.m4 (GLIBTOP_LINUX_VERSION_CODE): Define this to be the same as LINUX_VERSION_CODE either from <linux/version.h> or from the running kernel. svn path=/trunk/; revision=503
Diffstat (limited to 'macros/gnome-libgtop-sysdeps.m4')
-rw-r--r--macros/gnome-libgtop-sysdeps.m424
1 files changed, 24 insertions, 0 deletions
diff --git a/macros/gnome-libgtop-sysdeps.m4 b/macros/gnome-libgtop-sysdeps.m4
index 371ee43323..82c50c0c3a 100644
--- a/macros/gnome-libgtop-sysdeps.m4
+++ b/macros/gnome-libgtop-sysdeps.m4
@@ -203,6 +203,30 @@ main (void)
AC_DEFINE(HAVE_LINUX_TABLE)
fi
AM_CONDITIONAL(LINUX_TABLE, test $linux_table = yes)
+
+ os_major_version=`uname -r | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
+ os_minor_version=`uname -r | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
+ os_micro_version=`uname -r | \
+ sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
+ os_version_expr="$os_major_version 65536 * $os_minor_version 256 * + $os_micro_version + p q"
+
+ AC_CHECK_HEADERS(linux/version.h, have_linux_version_h=yes,
+ have_linux_version_h=no)
+
+ if test x$have_linux_version_h = xyes ; then
+ version_code=`cat /usr/include/linux/version.h | \
+ grep \#define | grep LINUX_VERSION_CODE`
+ os_version_code=`echo $version_code | \
+ sed 's/^.*LINUX_VERSION_CODE[[ \t]]*\([[0-9]]*\).*$/\1/'`
+ else
+ os_version_code=`echo "$os_version_expr" | dc`
+ fi
+
+ AC_MSG_CHECKING(for Linux kernel version code)
+ AC_DEFINE_UNQUOTED(GLIBTOP_LINUX_VERSION_CODE, $os_version_code)
+ AC_MSG_RESULT($os_version_code)
;;
esac