[gnome-builder] build: be stricter about libgit2 and libgit2-glib checks



commit 6a5e1686cc860a05a0aa9df3a2d4d15a131c033d
Author: Christian Hergert <christian hergert me>
Date:   Mon Aug 31 02:43:00 2015 -0700

    build: be stricter about libgit2 and libgit2-glib checks

 configure.ac |   35 +++++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 0594552..a2a5112 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,6 +170,7 @@ PKG_CHECK_MODULES(EGG,      [glib-2.0 >= glib_required_version
                              gtk+-3.0 >= gtk_required_version])
 PKG_CHECK_MODULES(GD,       [gtk+-3.0 >= gtk_required_version])
 PKG_CHECK_MODULES(ICONS,    [gio-2.0 >= glib_required_version])
+PKG_CHECK_MODULES(LIBGITG,  [libgit2-glib-1.0 >= ggit_required_version])
 PKG_CHECK_MODULES(LIBIDE,   [gio-2.0 >= glib_required_version
                              gio-unix-2.0 >= glib_required_version
                              gtksourceview-3.0 >= gtksourceview_required_version
@@ -190,6 +191,40 @@ PKG_CHECK_MODULES(XML,      [gio-2.0 >= glib_required_version
 
 
 dnl ***********************************************************************
+dnl Be extra careful about libgit2-glib requirements
+dnl ***********************************************************************
+cflags_save="${CFLAGS}"
+libs_save="${LIBS}"
+CFLAGS="${CFLAGS} ${LIBGITG_CFLAGS}"
+LIBS="${LIBS} ${LIBGITG_LIBS}"
+# Thread-Safe
+AC_MSG_CHECKING([for thread-safe support in libgit2])
+AC_TRY_RUN([
+       #include <libgit2-glib/ggit.h>
+       int
+       main(int argc, const char *argv[])
+       {
+               ggit_init ();
+               return ((ggit_get_features() & GGIT_FEATURE_THREADS) != 0) ? 0 : 1;
+       }
+],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, please recompile a threadsafe version of libgit2 
(-DTHREADSAFE:BOOL=ON)])])
+# SSH
+AC_MSG_CHECKING([for SSH support in libgit2])
+AC_TRY_RUN([
+       #include <libgit2-glib/ggit.h>
+       int
+       main(int argc, const char *argv[])
+       {
+               ggit_init ();
+               return ((ggit_get_features() & GGIT_FEATURE_SSH) != 0) ? 0 : 1;
+       }
+],[AC_MSG_RESULT([yes])],[AC_MSG_ERROR([no, please recompile a libgit2 with ssh support])])
+CFLAGS="${cflags_save}"
+LIBS="${libs_save}"
+
+
+
+dnl ***********************************************************************
 dnl Check for Clang, Required for C/C++ Diagnostics
 dnl ***********************************************************************
 AC_CHECK_PROGS([LLVM_CONFIG], [llvm-config-3.5 llvm-config35 llvm-config], [])


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