From: Bert Vermeulen Date: Fri, 18 Jul 2014 19:12:31 +0000 (+0200) Subject: configure: Add C++ bindings dependency checks. X-Git-Tag: libsigrok-0.4.0~1247 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=bcacb8633ec3b4789801b92c73e72ca964948872;p=libsigrok.git configure: Add C++ bindings dependency checks. --- diff --git a/configure.ac b/configure.ac index db6f644e..f27b39f3 100644 --- a/configure.ac +++ b/configure.ac @@ -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";