--- configure.ac +++ configure.ac @@ -115,14 +115,24 @@ AC_MSG_ERROR([No gacutil tool found]) fi -dnl Check for the NUnit testing framework -have_nunit="yes" -AC_PATH_PROG(NUNIT, nunit-console) -AC_PATH_PROG(XSLTPROC, xsltproc) -if test "x$NUNIT" = "x" -o "x$XSLTPROC" = "x"; then - AC_MSG_WARN([Can't find NUnit and xsltproc. You will not be able to run unit tests]) +dnl Check for dbus-sharp +PKG_CHECK_EXISTS(dbus-sharp, have_dbus_sharp="yes", have_dbus_sharp="no") +dnl dbus-sharp is only needed for the tests. Allow building without them. +if test "$have_dbus_sharp" = "no"; then + AC_MSG_WARN([Can't find dbus-sharp. Test programs will not be built]) + dnl no need to check for NUnit, the unit tests won't work without dbus-sharp have_nunit="no" +else + dnl Check for the NUnit testing framework + have_nunit="yes" + AC_PATH_PROG(NUNIT, nunit-console) + AC_PATH_PROG(XSLTPROC, xsltproc) + if test "x$NUNIT" = "x" -o "x$XSLTPROC" = "x"; then + AC_MSG_WARN([Can't find NUnit and xsltproc. You will not be able to run unit tests]) + have_nunit="no" + fi fi +AM_CONDITIONAL(HAVE_DBUS_SHARP, test "$have_dbus_sharp" = "yes") AM_CONDITIONAL(HAVE_NUNIT, test "$have_nunit" = "yes") AC_SUBST(RUNTIME) --- Makefile.am +++ Makefile.am @@ -1,4 +1,8 @@ -SUBDIRS = galago tests +SUBDIRS = galago + +if HAVE_DBUS_SHARP +SUBDIRS += tests +endif pcdata_DATA = galago-sharp.pc pcdatadir = $(libdir)/pkgconfig