]> sigrok.org Git - libsigrok.git/commitdiff
configure: Add C++ bindings dependency checks.
authorBert Vermeulen <redacted>
Fri, 18 Jul 2014 19:12:31 +0000 (21:12 +0200)
committerMartin Ling <redacted>
Fri, 18 Jul 2014 20:40:20 +0000 (21:40 +0100)
configure.ac

index db6f644e4ddce3cd72d8ec8bcf9c476d6b18c491..f27b39f3cd3601f6ea87477cd3e65036d3aa918b 100644 (file)
@@ -180,6 +180,29 @@ if test "x$HAVE_CXX11" != "x1"; then
        BINDINGS_CXX="no"
 fi
 
+# The C++ bindings use gccxml to parse libsigrok symbols.
+AC_CHECK_PROG([HAVE_GCCXML], [gccxml], [yes])
+if test "x$HAVE_GCCXML" != "xyes"; then
+       BINDINGS_CXX="no"
+fi
+
+# Python is needed for the C++ (and Python) bindings.
+PKG_CHECK_MODULES([python], [python3 >= 2.7],
+        [CXXFLAGS="$CXXFLAGS $python_CFLAGS";
+        CXXLIBS="$CXXLIBS $python_LIBS"],
+               [BINDINGS_CXX="no"])
+
+# The C++ bindings need the pygccxml Python module.
+m4_ifdef([AX_PYTHON_MODULE], [AX_PYTHON_MODULE([pygccxml])],
+       # We'll let it go through even if the macro wasn't found, the python
+       # module may still be there.
+       [HAVE_PYTHON_PYGCCXML="yes";
+               AC_MSG_NOTICE([Missing macro m4_toupper(aX_PYTHON_MODULE), no pygccxml check])]
+)
+if test "x$HAVE_PYMOD_PYGCCXML" != "xyes"; then
+       BINDINGS_CXX="no"
+fi
+
 # Python and Java bindings depend on C++ bindings.
 
 if test "x$BINDINGS_CXX" != "xyes"; then
@@ -341,11 +364,6 @@ PKG_CHECK_MODULES([glibmm], [glibmm-2.4 >= 2.32.0],
        [CXXFLAGS="$CXXFLAGS $glibmm_CFLAGS";
        CXXLIBS="$CXXLIBS $glibmm_LIBS"], [BINDINGS_CXX="no"])
 
-# Python is needed for the Python bindings.
-PKG_CHECK_MODULES([python], [python3 >= 2.7],
-        [CXXFLAGS="$CXXFLAGS $python_CFLAGS";
-        CXXLIBS="$CXXLIBS $python_LIBS"], [BINDINGS_PYTHON="no"])
-
 # PyGObject is needed for the Python bindings.
 PKG_CHECK_MODULES([pygobject], [pygobject-3.0],
         [CXXFLAGS="$CXXFLAGS $pygobject_CFLAGS";