[gnome-builder/wip/libide: 228/237] libide: check for clang includes using llvm-config --includedir



commit d07a155215a1e19659cdc351c467c09c4b633d6b
Author: Christian Hergert <christian hergert me>
Date:   Mon Feb 16 16:06:26 2015 -0800

    libide: check for clang includes using llvm-config --includedir

 build/autotools/autoconf.d/50_dependencies.post-am |   11 -----------
 build/autotools/autoconf.d/60_check_clang.post-am  |   18 ++++++++++++++++++
 libide/Makefile.am                                 |    1 +
 3 files changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/build/autotools/autoconf.d/50_dependencies.post-am 
b/build/autotools/autoconf.d/50_dependencies.post-am
index ff6a092..82d2c03 100644
--- a/build/autotools/autoconf.d/50_dependencies.post-am
+++ b/build/autotools/autoconf.d/50_dependencies.post-am
@@ -17,15 +17,4 @@ PKG_CHECK_MODULES(LIBIDE, [gio-2.0 >= glib_required_version
                            gjs-internals-1.0 >= gjs_required_version])
 
 
-AC_PATH_PROG([LLVM_CONFIG], [llvm-config])
-AS_IF([test "x$LLVM_CONFIG" = "x"],[
-    AC_MSG_ERROR([Failed to locate the llvm-config program. Please install llvm-devel.])
-])
-CLANG_LDFLAGS=`$LLVM_CONFIG --ldflags`
-AC_SUBST([CLANG_LDFLAGS])
-
-AC_CHECK_HEADER([clang-c/Index.h], [], [
-    AC_MSG_ERROR([Failed to locage clang-c/Index.h. Please install clang-devel.])
-])
-
 GOBJECT_INTROSPECTION_CHECK([1.30.0])
diff --git a/build/autotools/autoconf.d/60_check_clang.post-am 
b/build/autotools/autoconf.d/60_check_clang.post-am
new file mode 100644
index 0000000..a98449b
--- /dev/null
+++ b/build/autotools/autoconf.d/60_check_clang.post-am
@@ -0,0 +1,18 @@
+AC_PATH_PROG([LLVM_CONFIG], [llvm-config])
+AS_IF([test "x$LLVM_CONFIG" = "x"],[
+    AC_MSG_ERROR([Failed to locate the llvm-config program. Please install llvm-devel.])
+])
+CLANG_INCLUDEDIR=`$LLVM_CONFIG --includedir`
+CLANG_CFLAGS="-I$CLANG_INCLUDEDIR"
+CLANG_LDFLAGS=`$LLVM_CONFIG --ldflags`
+AC_SUBST([CLANG_INCLUDEDIR])
+AC_SUBST([CLANG_CFLAGS])
+AC_SUBST([CLANG_LDFLAGS])
+
+
+CPPFLAGS_SAVE=${CPPFLAGS}
+CPPFLAGS=-I${CLANG_INCLUDEDIR}
+AC_CHECK_HEADER([clang-c/Index.h], [], [
+    AC_MSG_ERROR([Failed to locage clang-c/Index.h. Please install clang-devel.])
+])
+CPPFLAGS=${CPPFLAGS_SAVE}
diff --git a/libide/Makefile.am b/libide/Makefile.am
index 2bd7788..db2071a 100644
--- a/libide/Makefile.am
+++ b/libide/Makefile.am
@@ -175,6 +175,7 @@ libide_1_0_la_includes = \
        -I$(top_srcdir)/libide/gsettings \
        -I$(top_srcdir)/libide/local \
        -I$(top_srcdir)/libide/tasks \
+       $(CLANG_CFLAGS) \
        $(NULL)
 
 libide_1_0_la_CPPFLAGS = \


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