4 [michael.tremer@ipfire.org],
6 [https://www.ipfire.org/])
8 AC_CONFIG_SRCDIR([src/libloc.c])
9 AC_CONFIG_AUX_DIR([build-aux])
22 AC_USE_SYSTEM_EXTENSIONS
24 AC_CONFIG_MACRO_DIR([m4])
25 AM_SILENT_RULES([yes])
30 AC_PREFIX_DEFAULT([/usr])
33 IT_PROG_INTLTOOL([0.40.0])
34 GETTEXT_PACKAGE=${PACKAGE_TARNAME}
35 AC_SUBST(GETTEXT_PACKAGE)
40 # - man ------------------------------------------------------------------------
43 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
44 [do not install man pages]))
45 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
46 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
48 AC_PATH_PROG([XSLTPROC], [xsltproc])
50 AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
51 if test "${have_manpages}" = "yes" && test -z "${ASCIIDOC}"; then
52 AC_MSG_ERROR([Required program 'asciidoc' not found])
54 # - debug ----------------------------------------------------------------------
56 AC_ARG_ENABLE([debug],
57 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
58 [], [enable_debug=no])
59 AS_IF([test "x$enable_debug" = "xyes"], [
60 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
63 AC_CHECK_HEADERS_ONCE([
66 arpa/nameser_compat.h \
92 -Wmissing-declarations \
93 -Wmissing-prototypes \
101 AC_SUBST([my_CFLAGS])
103 # ------------------------------------------------------------------------------
105 AC_ARG_WITH([systemd],
106 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
109 AS_IF([test "x$with_systemd" != "xno"],
110 [PKG_CHECK_MODULES(systemd, [libsystemd],
111 [have_systemd=yes], [have_systemd=no])],
115 AS_IF([test "x$have_systemd" = "xyes"],
116 [AC_MSG_CHECKING([for systemd system unit directory])
117 AC_ARG_WITH([systemdsystemunitdir],
118 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
119 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
122 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
124 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
125 AC_MSG_RESULT([$systemdsystemunitdir])
127 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
130 [AS_IF([test "x$with_systemd" = "xyes"],
131 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
135 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
137 # ------------------------------------------------------------------------------
140 AM_PATH_PYTHON([3.4])
141 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
144 AC_PATH_PROG(PERL, perl, no)
147 AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
149 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
150 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
152 dnl Checking for libresolv
155 AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
158 AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
161 RESOLV_LIBS="${LIBS}"
162 AC_SUBST(RESOLV_LIBS)
164 dnl Checking for OpenSSL
166 AC_CHECK_LIB(crypto, EVP_EncryptInit,, AC_MSG_ERROR([libcrypto has not been found]))
167 OPENSSL_LIBS="${LIBS}"
168 AC_SUBST(OPENSSL_LIBS)
170 AC_CONFIG_HEADERS(config.h)
182 sysconfdir: ${sysconfdir}
184 includedir: ${includedir}
190 debug: ${enable_debug}
191 systemd support: ${have_systemd}