[tracker/tracker-0.12: 118/202] libtracker-common: Disable configure.ac checks for ioprio_set()



commit d4a808a865f3e0550909d1d194452721fd97d450
Author: Martyn Russell <martyn lanedo com>
Date:   Mon Sep 26 15:04:05 2011 +0100

    libtracker-common: Disable configure.ac checks for ioprio_set()
    
    We expect this to be defined for all linux architectures and now use #ifdef
    __linux__ instead.
    
    This should avoid errors like:
    
    checking if we have ioprio... configure: error: cross-compiling: please set
    'tracker_cv_have_ioprio'

 configure.ac                           |   26 --------------------------
 src/libtracker-common/tracker-ioprio.c |   15 ++++++++-------
 2 files changed, 8 insertions(+), 33 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index e84ed93..d5eebec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,31 +153,6 @@ if test "x$have_function" = "xno" ; then
             [Defined for compilers not supporting __FUNCTION__])
 fi
 
-# Check ioprio support
-AC_CACHE_CHECK([if we have ioprio],[tracker_cv_have_ioprio],
-   [AC_RUN_IFELSE(
-      [AC_LANG_PROGRAM([[
-         #include <stdlib.h>
-         #include <errno.h>
-         #include <sys/syscall.h>
-         #include <unistd.h>
-         inline int ioprio_get (int which, int who)
-         {
-             return syscall (__NR_ioprio_get, which, who);
-         }
-         ]],
-         [[
-             return !(ioprio_get (1, 0) != -1);
-         ]])],
-   [tracker_cv_have_ioprio=yes],
-   [tracker_cv_have_ioprio=no],
-   [AC_MSG_ERROR([cross-compiling: please set 'tracker_cv_have_ioprio'])])
-])
-
-if test "x$tracker_cv_have_ioprio" = "xyes" ; then
-   AC_DEFINE(HAVE_IOPRIO, 1, [Define if we have ioprio])
-fi
-
 # Binary required versions
 PYTHON_REQUIRED=2.6
 
@@ -2302,7 +2277,6 @@ Build Configuration:
 	Enable functional tests:                $enable_functional_tests
 	Enable unit tests:                      $have_unit_tests
 
-	Support for ioprio:                     $tracker_cv_have_ioprio
 	Support for HAL:                        $have_hal
 	Support for UPower:                     $have_upower
 	Support for Cyrillic languages (enca):  $have_enca
diff --git a/src/libtracker-common/tracker-ioprio.c b/src/libtracker-common/tracker-ioprio.c
index 3dc5ad5..4108119 100644
--- a/src/libtracker-common/tracker-ioprio.c
+++ b/src/libtracker-common/tracker-ioprio.c
@@ -26,7 +26,7 @@
 
 #include "config.h"
 
-#ifdef HAVE_IOPRIO
+#ifdef __linux__
 
 #include <stdio.h>
 #include <errno.h>
@@ -40,14 +40,16 @@
 
 #include <glib/gstdio.h>
 
-#endif /* HAVE_IOPRIO */
+#endif /* __linux__ */
 
 #include <libtracker-common/tracker-log.h>
 
 #include "tracker-ioprio.h"
 
-#ifdef HAVE_IOPRIO
+/* We assume ALL linux architectures have the syscalls defined here */
+#ifdef __linux__
 
+/* Make sure the system call is supported */
 #ifndef __NR_ioprio_set
 
 #if defined(__i386__)
@@ -84,7 +86,7 @@
 #error "Unsupported architecture!"
 #endif
 
-#endif
+#endif /* __NR_ioprio_set */
 
 enum {
 	IOPRIO_CLASS_NONE,
@@ -140,12 +142,11 @@ tracker_ioprio_init (void)
 	}
 }
 
-#else  /* HAVE_IOPRIO */
-
+#else  /* __linux__ */
 
 void
 tracker_ioprio_init (void)
 {
 }
 
-#endif /* HAVE_IOPRIO */
+#endif /* __linux__ */



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]