From b387e8355330bffc1b0b69f8a579b94c2710325a Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Thu, 3 Dec 1998 14:49:39 +0000 Subject: Only check for the linux table () function on Linux systems. svn path=/trunk/; revision=498 --- macros/gnome-libgtop-sysdeps.m4 | 83 ++++++++++++++++++++--------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/macros/gnome-libgtop-sysdeps.m4 b/macros/gnome-libgtop-sysdeps.m4 index 6a96214..371ee43 100644 --- a/macros/gnome-libgtop-sysdeps.m4 +++ b/macros/gnome-libgtop-sysdeps.m4 @@ -23,48 +23,6 @@ AC_DEFUN([GNOME_LIBGTOP_SYSDEPS],[ AM_CONDITIONAL(EXAMPLES, test x"$build_examples" = xyes) - AC_ARG_WITH(linux-table, - [ --with-linux-table Use the table () function from Martin Baulig],[ - linux_table="$withval"],[linux_table=auto]) - - if test $linux_table = yes ; then - AC_CHECK_HEADER(linux/table.h, linux_table=yes, linux_table=no) - elif test $linux_table = auto ; then - AC_MSG_CHECKING(for table function in Linux Kernel) - AC_TRY_RUN([ -#include -#include - -#include -#include -#include - -#include - -static inline _syscall3 (int, table, int, type, union table *, tbl, const void *, param); - -int -main (void) -{ - union table tbl; - int ret; - - ret = table (TABLE_VERSION, NULL, NULL); - - if (ret == -1) - exit (-errno); - - exit (ret < 1 ? ret : 0); -} -], linux_table=yes, linux_table=no, linux_table=no) - AC_MSG_RESULT($linux_table) - fi - - if test $linux_table = yes ; then - AC_DEFINE(HAVE_LINUX_TABLE) - fi - - AM_CONDITIONAL(LINUX_TABLE, test $linux_table = yes) AC_ARG_WITH(libgtop-smp, [ --with-libgtop-smp Enable SMP support (default-auto)],[ @@ -205,6 +163,47 @@ main (void) fi fi ;; + linux*) + AC_ARG_WITH(linux-table, + [ --with-linux-table Use the table () function from Martin Baulig],[ + linux_table="$withval"],[linux_table=auto]) + if test $linux_table = yes ; then + AC_CHECK_HEADER(linux/table.h, linux_table=yes, linux_table=no) + elif test $linux_table = auto ; then + AC_MSG_CHECKING(for table function in Linux Kernel) + AC_TRY_RUN([ +#include +#include + +#include +#include +#include + +#include + +static inline _syscall3 (int, table, int, type, union table *, tbl, const void *, param); + +int +main (void) +{ + union table tbl; + int ret; + + ret = table (TABLE_VERSION, NULL, NULL); + + if (ret == -1) + exit (-errno); + + exit (ret < 1 ? ret : 0); +} +], linux_table=yes, linux_table=no, linux_table=no) + AC_MSG_RESULT($linux_table) + fi + if test $linux_table = yes ; then + AC_DEFINE(HAVE_LINUX_TABLE) + fi + AM_CONDITIONAL(LINUX_TABLE, test $linux_table = yes) + ;; esac AC_MSG_CHECKING(for machine.h in libgtop sysdeps dir) -- cgit v1.2.1