diff --git a/configure.ac b/configure.ac index b3ba947ef..014d9496f 100644 --- a/configure.ac +++ b/configure.ac @@ -248,11 +248,9 @@ BINDING_LIB_TARGETS="" dnl Check if cxx-binding not wanted, default is to build it -if test x"${CXX}" = x; then - cf_with_cxx=no -else - cf_with_cxx=yes -fi +# TODO: check whether CXX is functional +AC_CHECK_PROG(cf_with_cxx, "${CXX}", [yes], [no]) + AC_MSG_CHECKING(whether to build C++ binding and demo) AC_ARG_WITH(cxx-binding, [ --without-cxx-binding do not build C++ binding and demo], @@ -379,6 +377,7 @@ if test "${cf_with_cxx}" = "yes" ; then [AC_DEFINE(HAVE_USRP,[1],[Define if usrp is available])]) fi fi +AM_CONDITIONAL(ENABLE_CXX, test x"${cf_with_cxx}" = "xyes") PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1, , diff --git a/kit/Makefile.am b/kit/Makefile.am index 8c4c33684..63c57c213 100644 --- a/kit/Makefile.am +++ b/kit/Makefile.am @@ -2,8 +2,11 @@ AM_CFLAGS = @LIBUSB_CFLAGS@ AM_CXXFLAGS = @USRP_CFLAGS@ # FIXME: compile usrp only if CXX available -KITSRCLIST = elektor304.c drt1.c dwt.c usrp.c usrp_impl.cc elektor507.c \ +KITSRCLIST = elektor304.c drt1.c dwt.c usrp.c elektor507.c \ dds60.c miniVNA.c si570avrusb.c +if ENABLE_CXX +KITSRCLIST += usrp_impl.cc +endif KITROTSRCLIST = pcrotor.c