From: Michael Friedrich Date: Thu, 8 Aug 2013 14:44:16 +0000 (+0200) Subject: ido: Build ido_mysql only if mysql headers/libs detected. X-Git-Tag: v0.0.3~723 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5633eda892718bc306a8fee555a483172bd0b05b;p=icinga2 ido: Build ido_mysql only if mysql headers/libs detected. fixes #4416 --- diff --git a/components/ido_mysql/Makefile.am b/components/ido_mysql/Makefile.am index 998474f41..8e48e0e43 100644 --- a/components/ido_mysql/Makefile.am +++ b/components/ido_mysql/Makefile.am @@ -1,5 +1,6 @@ ## Process this file with automake to produce Makefile.in +if MYSQL_USE pkglib_LTLIBRARIES = \ libido_mysql.la @@ -38,3 +39,10 @@ libido_mysql_la_LIBADD = \ ${top_builddir}/lib/remoting/libremoting.la \ ${top_builddir}/lib/icinga/libicinga.la \ ${top_builddir}/lib/ido/libido.la + +else + +all-local: + @echo 'MySQL not enabled. Install libs/headers and rerun configure/make.' + +endif diff --git a/configure.ac b/configure.ac index af54c31dc..6cf9042d0 100644 --- a/configure.ac +++ b/configure.ac @@ -63,7 +63,6 @@ AX_BOOST_THREAD AX_BOOST_SYSTEM AX_BOOST_UNIT_TEST_FRAMEWORK AX_BOOST_PROGRAM_OPTIONS -AX_LIB_MYSQL([5.0]) AX_CHECK_OPENSSL([], [AC_MSG_ERROR([You need the OpenSSL headers and libraries in order to build this application])]) AC_CHECK_LIB(ssl, SSL_new) AC_CHECK_LIB(crypto, X509_NAME_oneline) @@ -96,6 +95,10 @@ if test "x$enable_coverage" = "xyes"; then fi AC_MSG_RESULT($enable_coverage) +AX_LIB_MYSQL([5.0]) +AC_CHECK_HEADERS([mysql/mysql.h], [mysql_use=true], [AC_MSG_WARN([mysql.h not found. Will not build mysql related libs/components.])]) +AM_CONDITIONAL(MYSQL_USE, test x"$mysql_use" = x"true") + AX_PYTHON_DEFAULT AX_PYTHON_ENABLE AX_PYTHON_VERSION_ENSURE([2.5])