]> git.ipfire.org Git - location/libloc.git/blame - configure.ac
Add an example country to the python create-database example script.
[location/libloc.git] / configure.ac
CommitLineData
46aded9a
MT
1AC_PREREQ(2.60)
2AC_INIT([libloc],
89c4f1dd 3 [0.9.3],
3b4f1368 4 [location@lists.ipfire.org],
46aded9a 5 [libloc],
3b4f1368 6 [https://location.ipfire.org/])
46aded9a
MT
7
8AC_CONFIG_SRCDIR([src/libloc.c])
9AC_CONFIG_AUX_DIR([build-aux])
10AM_INIT_AUTOMAKE([
11 foreign
12 1.11
13 -Wall
14 -Wno-portability
15 silent-rules
16 tar-pax
17 no-dist-gzip
18 dist-xz
19 subdir-objects
20])
21AC_PROG_CC_STDC
22AC_USE_SYSTEM_EXTENSIONS
23AC_SYS_LARGEFILE
24AC_CONFIG_MACRO_DIR([m4])
25AM_SILENT_RULES([yes])
26LT_INIT([
27 disable-static
28 pic-only
29])
30AC_PREFIX_DEFAULT([/usr])
a76b0b96 31gl_LD_VERSION_SCRIPT
46aded9a 32
2bb7d64e 33IT_PROG_INTLTOOL([0.40.0])
7b76dffa
MT
34
35# Interpret embedded Python in HTML files
36XGETTEXT="${XGETTEXT} -L Python --keyword=_:1,2 --keyword=N_:1,2 --no-location"
37
2bb7d64e
MT
38GETTEXT_PACKAGE=${PACKAGE_TARNAME}
39AC_SUBST(GETTEXT_PACKAGE)
40
46aded9a
MT
41AC_PROG_SED
42AC_PROG_MKDIR_P
43
161ac92d
MT
44# - man ------------------------------------------------------------------------
45
46have_manpages=no
47AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
48 [do not install man pages]))
49AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
50AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
51
52AC_PATH_PROG([XSLTPROC], [xsltproc])
53
54AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
55if test "${have_manpages}" = "yes" && test -z "${ASCIIDOC}"; then
56 AC_MSG_ERROR([Required program 'asciidoc' not found])
57fi
58# - debug ----------------------------------------------------------------------
59
46aded9a
MT
60AC_ARG_ENABLE([debug],
61 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
62 [], [enable_debug=no])
63AS_IF([test "x$enable_debug" = "xyes"], [
64 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
65])
66
dda7cfb5
MT
67AC_CHECK_HEADERS_ONCE([
68 arpa/inet.h \
f7b7019a
MT
69 arpa/nameser.h \
70 arpa/nameser_compat.h \
dda7cfb5
MT
71 endian.h \
72 netinet/in.h \
f4fef543 73 resolv.h \
dda7cfb5
MT
74 string.h \
75])
76
46aded9a 77AC_CHECK_FUNCS([ \
f4fef543
MT
78 be16toh \
79 be32toh \
80 be64toh \
81 htobe16 \
82 htobe32 \
83 htobe64 \
84 mmap \
85 munmap \
86 res_query \
46aded9a 87 __secure_getenv \
a5db3e49 88 secure_getenv \
f4fef543 89 qsort \
46aded9a
MT
90])
91
92my_CFLAGS="\
93-Wall \
94-Wchar-subscripts \
95-Wformat-security \
96-Wmissing-declarations \
97-Wmissing-prototypes \
98-Wnested-externs \
99-Wpointer-arith \
100-Wshadow \
101-Wsign-compare \
102-Wstrict-prototypes \
103-Wtype-limits \
104"
105AC_SUBST([my_CFLAGS])
106
be748fa8
MT
107# ------------------------------------------------------------------------------
108
109AC_ARG_WITH([systemd],
110 AS_HELP_STRING([--with-systemd], [Enable systemd support.])
111)
112
113AS_IF([test "x$with_systemd" != "xno"],
114 [PKG_CHECK_MODULES(systemd, [libsystemd],
115 [have_systemd=yes], [have_systemd=no])],
116 [have_systemd=no]
117)
118
119AS_IF([test "x$have_systemd" = "xyes"],
120 [AC_MSG_CHECKING([for systemd system unit directory])
121 AC_ARG_WITH([systemdsystemunitdir],
122 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
123 [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)]
124 )
125
126 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
127
128 if test -n "$systemdsystemunitdir" -a "x$systemdsystemunitdir" != xno; then
129 AC_MSG_RESULT([$systemdsystemunitdir])
130 else
131 AC_MSG_ERROR([not found (try --with-systemdsystemunitdir)])
132 fi
133 ],
134 [AS_IF([test "x$with_systemd" = "xyes"],
135 [AC_MSG_ERROR([Systemd support is enabled but no systemd has been found.])
136 ])
137])
138
139AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" = "xyes"])
140
141# ------------------------------------------------------------------------------
142
18e2b14c
MT
143# Python
144AM_PATH_PYTHON([3.4])
145PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
146
747cbcb1
MT
147# Perl
148AC_PATH_PROG(PERL, perl, no)
149AC_SUBST(PERL)
150
151AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
152
153AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
154AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
155
f4fef543 156dnl Checking for libresolv
f60ee33f
MT
157case "${host}" in
158 *-gnu*)
159 AC_CHECK_LIB(resolv, ns_msg_getflag, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
160 ;;
161 *)
162 AC_CHECK_LIB(resolv, res_init, [LIBS="-lresolv $LIBS"], AC_MSG_ERROR([libresolv has not been found]), -lresolv)
163 ;;
164esac
f4fef543 165RESOLV_LIBS="${LIBS}"
18ecd261 166AC_SUBST(RESOLV_LIBS)
f4fef543 167
e568f8d4
MT
168dnl Checking for OpenSSL
169LIBS=
170AC_CHECK_LIB(crypto, EVP_EncryptInit,, AC_MSG_ERROR([libcrypto has not been found]))
171OPENSSL_LIBS="${LIBS}"
18ecd261 172AC_SUBST(OPENSSL_LIBS)
e568f8d4 173
46aded9a
MT
174AC_CONFIG_HEADERS(config.h)
175AC_CONFIG_FILES([
176 Makefile
2bb7d64e 177 po/Makefile.in
46aded9a
MT
178])
179
180AC_OUTPUT
181AC_MSG_RESULT([
182 $PACKAGE $VERSION
183 =====
184
185 prefix: ${prefix}
186 sysconfdir: ${sysconfdir}
187 libdir: ${libdir}
188 includedir: ${includedir}
189
190 compiler: ${CC}
191 cflags: ${CFLAGS}
192 ldflags: ${LDFLAGS}
193
46aded9a 194 debug: ${enable_debug}
be748fa8 195 systemd support: ${have_systemd}
747cbcb1
MT
196
197 Bindings:
198 perl: ${enable_perl}
46aded9a 199])