]> git.ipfire.org Git - people/ms/libloc.git/blob - configure.ac
python: Raise error when a network/AS could not be read
[people/ms/libloc.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([libloc],
3 [0],
4 [michael.tremer@ipfire.org],
5 [libloc],
6 [https://www.ipfire.org/])
7
8 AC_CONFIG_SRCDIR([src/libloc.c])
9 AC_CONFIG_AUX_DIR([build-aux])
10 AM_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 ])
21 AC_PROG_CC_STDC
22 AC_USE_SYSTEM_EXTENSIONS
23 AC_SYS_LARGEFILE
24 AC_CONFIG_MACRO_DIR([m4])
25 AM_SILENT_RULES([yes])
26 LT_INIT([
27 disable-static
28 pic-only
29 ])
30 AC_PREFIX_DEFAULT([/usr])
31 gl_LD_VERSION_SCRIPT
32
33 IT_PROG_INTLTOOL([0.40.0])
34 GETTEXT_PACKAGE=${PACKAGE_TARNAME}
35 AC_SUBST(GETTEXT_PACKAGE)
36
37 AC_PROG_SED
38 AC_PROG_MKDIR_P
39
40 # - man ------------------------------------------------------------------------
41
42 have_manpages=no
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"])
47
48 AC_PATH_PROG([XSLTPROC], [xsltproc])
49
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])
53 fi
54 # - debug ----------------------------------------------------------------------
55
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.])
61 ])
62
63 AC_CHECK_HEADERS_ONCE([
64 arpa/inet.h \
65 endian.h \
66 netinet/in.h \
67 string.h \
68 ])
69
70 AC_CHECK_FUNCS([ \
71 be16toh \
72 be32toh \
73 be64toh \
74 htobe16 \
75 htobe32 \
76 htobe64 \
77 mmap \
78 munmap \
79 __secure_getenv \
80 secure_getenv \
81 qsort \
82 ])
83
84 my_CFLAGS="\
85 -Wall \
86 -Wchar-subscripts \
87 -Wformat-security \
88 -Wmissing-declarations \
89 -Wmissing-prototypes \
90 -Wnested-externs \
91 -Wpointer-arith \
92 -Wshadow \
93 -Wsign-compare \
94 -Wstrict-prototypes \
95 -Wtype-limits \
96 "
97 AC_SUBST([my_CFLAGS])
98
99 # Python
100 AM_PATH_PYTHON([3.4])
101 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
102
103 # Perl
104 AC_PATH_PROG(PERL, perl, no)
105 AC_SUBST(PERL)
106
107 AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
108
109 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
110 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
111
112 AC_CONFIG_HEADERS(config.h)
113 AC_CONFIG_FILES([
114 Makefile
115 po/Makefile.in
116 ])
117
118 AC_OUTPUT
119 AC_MSG_RESULT([
120 $PACKAGE $VERSION
121 =====
122
123 prefix: ${prefix}
124 sysconfdir: ${sysconfdir}
125 libdir: ${libdir}
126 includedir: ${includedir}
127
128 compiler: ${CC}
129 cflags: ${CFLAGS}
130 ldflags: ${LDFLAGS}
131
132 debug: ${enable_debug}
133
134 Bindings:
135 perl: ${enable_perl}
136 ])