X-Git-Url: http://git.ipfire.org/?p=oddments%2Fddns.git;a=blobdiff_plain;f=configure.ac;h=66d5db3b02ea5fcb48e11a00c88bb20c93be108e;hp=c036a075aaa7c58eb5cee546e9792f10e306a9fe;hb=673f2c7418c02fde9b9651d1887cc0cdf7b5a80f;hpb=c510004df54473dfd43e4c6c7b9025b16a26794a diff --git a/configure.ac b/configure.ac index c036a07..66d5db3 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,11 @@ AM_PATH_PYTHON([2.7]) save_LIBS="$LIBS" +# pkg-config +PKG_PROG_PKG_CONFIG +# This makes sure pkg.m4 is available. +m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) + # ------------------------------------------------------------------------------ have_manpages=no AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages], @@ -67,6 +72,40 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) # ------------------------------------------------------------------------------ +AC_ARG_WITH([systemd], + AS_HELP_STRING([--with-systemd], [Enable systemd support.]) +) + +AS_IF([test "x$with_systemd" != "xno"], + [PKG_CHECK_MODULES(systemd, [libsystemd-daemon], + [have_systemd=yes], [have_systemd=no])], + [have_systemd=no] +) + +AS_IF([test "x$have_systemd" = "xyes"], + [AC_MSG_CHECKING([for systemd system unit directory]) + AC_ARG_WITH([systemdsystemunitdir], + AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]), + [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)] + ) + + AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) + + if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then + AC_MSG_RESULT([$systemdsystemunitdir]) + else + AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)]) + fi + ], + [AS_IF([test "x$with_systemd" = "xyes"], + [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.]) + ]) +]) + +AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"]) + +# ------------------------------------------------------------------------------ + AC_CONFIG_FILES([ Makefile po/Makefile.in @@ -77,8 +116,9 @@ AC_OUTPUT AC_MSG_RESULT([ ${PACKAGE_NAME} ${VERSION} - prefix : ${prefix} - sysconfdir : ${sysconfdir} + prefix: ${prefix} + sysconfdir: ${sysconfdir} - Generate man-pages : ${have_manpages} + Systemd support ${have_systemd} + Generate man-pages: ${have_manpages} ])