[gitg] Added configure time check for git2 threadsafe



commit 270350f2c06a2191dac879e032f2e1d4c74f701a
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Tue Jan 7 00:27:10 2014 +0100

    Added configure time check for git2 threadsafe
    
    https://bugzilla.gnome.org/show_bug.cgi?id=721663

 configure.ac |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 2684cf2..bef60c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -107,6 +107,27 @@ PKG_CHECK_MODULES(LIBGITG, [
        json-glib-1.0
 ])
 
+AC_MSG_CHECKING([for libgit2-glib threading support])
+
+cflags_save="${CFLAGS}"
+libs_save="${LIBS}"
+
+CFLAGS="${LIBGITG_CFLAGS}"
+LIBS="${LIBGITG_LIBS}"
+
+AC_TRY_RUN([
+       #include <libgit2-glib/ggit.h>
+       int
+       main(int argc, const char *argv[])
+       {
+               ggit_init ();
+               return ((ggit_get_capabilities() & GGIT_CAP_THREADS) != 0) ? 0 : 1;
+       }
+],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, please recompile a threadsafe version of libgit2 
(-DTHREADSAFE:BOOL=ON)])])
+
+CFLAGS="${cflags_save}"
+LIBS="${libs_save}"
+
 AC_ARG_ENABLE(docs,
               [AS_HELP_STRING([--enable-docs],
                               [enable generating documentation [default=no]])],


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