4 [location@lists.ipfire.org],
6 [https://location.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])
35 # Interpret embedded Python in HTML files
36 XGETTEXT="${XGETTEXT} -L Python --keyword=_:1,2 --keyword=N_:1,2 --no-location"
38 GETTEXT_PACKAGE=${PACKAGE_TARNAME}
39 AC_SUBST(GETTEXT_PACKAGE)
44 # - man ------------------------------------------------------------------------
47 AC_ARG_ENABLE(man_pages, AS_HELP_STRING([--disable-man-pages],
48 [do not install man pages]))
49 AS_IF([test "x$enable_man_pages" != xno], [have_man_pages=yes])
50 AM_CONDITIONAL(ENABLE_MAN_PAGES, [test "x$have_man_pages" = "xyes"])
52 AC_PATH_PROG([XSLTPROC], [xsltproc])
54 AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
55 if test "${have_man_pages}" = "yes" && test -z "${ASCIIDOC}"; then
56 AC_MSG_ERROR([Required program 'asciidoc' not found])
58 # - debug ----------------------------------------------------------------------
60 AC_ARG_ENABLE([debug],
61 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
62 [], [enable_debug=no])
63 AS_IF([test "x$enable_debug" = "xyes"], [
64 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
67 AC_CHECK_HEADERS_ONCE([
70 arpa/nameser_compat.h \
96 -Wmissing-declarations \
97 -Wmissing-prototypes \
102 -Wstrict-prototypes \
105 AC_SUBST([my_CFLAGS])
106 AC_SUBST([my_LDFLAGS])
108 # Enable -fanalyzer if requested
109 AC_ARG_ENABLE([analyzer],
110 AS_HELP_STRING([--enable-analyzer], [enable static analyzer (-fanalyzer) @<:@default=disabled@:>@]),
111 [], [enable_analyzer=no])
112 AS_IF([test "x$enable_analyzer" = "xyes"],
113 CC_CHECK_FLAGS_APPEND([my_CFLAGS], [CFLAGS], [-fanalyzer])
116 # Enable -fno-semantic-interposition (if available)
117 CC_CHECK_FLAGS_APPEND([my_CFLAGS], [CFLAGS], [-fno-semantic-interposition])
118 CC_CHECK_FLAGS_APPEND([my_LDFLAGS], [LDFLAGS], [-fno-semantic-interposition])
120 # ------------------------------------------------------------------------------
122 AC_ARG_WITH([systemd],
123 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
126 AS_IF([test "x$with_systemd" != "xno"],
127 [PKG_CHECK_MODULES(systemd, [libsystemd],
128 [have_systemd=yes], [have_systemd=no])],
132 AS_IF([test "x$have_systemd" = "xyes"],
133 [AC_MSG_CHECKING([for systemd system unit directory])
134 AC_ARG_WITH([systemdsystemunitdir],
135 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
136 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
139 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
141 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
142 AC_MSG_RESULT([$systemdsystemunitdir])
144 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
147 [AS_IF([test "x$with_systemd" = "xyes"],
148 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
152 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
154 # ------------------------------------------------------------------------------
157 AM_PATH_PYTHON([3.4])
158 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
161 AC_PATH_PROG(PERL, perl, no)
164 AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
166 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
167 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
169 dnl Checking for libresolv
172 AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
175 AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
178 RESOLV_LIBS="${LIBS}"
179 AC_SUBST(RESOLV_LIBS)
181 dnl Checking for OpenSSL
183 AC_CHECK_LIB(crypto, EVP_EncryptInit,, AC_MSG_ERROR([libcrypto has not been found]))
184 OPENSSL_LIBS="${LIBS}"
185 AC_SUBST(OPENSSL_LIBS)
187 AC_CONFIG_HEADERS(config.h)
199 sysconfdir: ${sysconfdir}
201 includedir: ${includedir}
207 debug: ${enable_debug}
208 systemd support: ${have_systemd}