]> git.ipfire.org Git - people/ms/libloc.git/blob - configure.ac
Format off_t data types properly for printing
[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
32 IT_PROG_INTLTOOL([0.40.0])
33 GETTEXT_PACKAGE=${PACKAGE_TARNAME}
34 AC_SUBST(GETTEXT_PACKAGE)
35
36 AC_PROG_SED
37 AC_PROG_MKDIR_P
38
39 # - man ------------------------------------------------------------------------
40
41 have_manpages=no
42 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages],
43 [do not install man pages]))
44 AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes])
45 AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
46
47 AC_PATH_PROG([XSLTPROC], [xsltproc])
48
49 AC_CHECK_PROGS(ASCIIDOC, [asciidoc])
50 if test "${have_manpages}" = "yes" && test -z "${ASCIIDOC}"; then
51 AC_MSG_ERROR([Required program 'asciidoc' not found])
52 fi
53 # - debug ----------------------------------------------------------------------
54
55 AC_ARG_ENABLE([debug],
56 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
57 [], [enable_debug=no])
58 AS_IF([test "x$enable_debug" = "xyes"], [
59 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
60 ])
61
62 AC_CHECK_HEADERS_ONCE([
63 arpa/inet.h \
64 endian.h \
65 netinet/in.h \
66 string.h \
67 ])
68
69 AC_CHECK_FUNCS([ \
70 be16toh \
71 be32toh \
72 be64toh \
73 htobe16 \
74 htobe32 \
75 htobe64 \
76 mmap \
77 munmap \
78 __secure_getenv \
79 secure_getenv \
80 qsort \
81 ])
82
83 my_CFLAGS="\
84 -Wall \
85 -Wchar-subscripts \
86 -Wformat-security \
87 -Wmissing-declarations \
88 -Wmissing-prototypes \
89 -Wnested-externs \
90 -Wpointer-arith \
91 -Wshadow \
92 -Wsign-compare \
93 -Wstrict-prototypes \
94 -Wtype-limits \
95 "
96 AC_SUBST([my_CFLAGS])
97
98 # Python
99 AM_PATH_PYTHON([3.4])
100 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
101
102 # Perl
103 AC_PATH_PROG(PERL, perl, no)
104 AC_SUBST(PERL)
105
106 AX_PROG_PERL_MODULES(ExtUtils::MakeMaker,, AC_MSG_WARN(Need some Perl modules))
107
108 AC_ARG_ENABLE(perl, AS_HELP_STRING([--disable-perl], [do not build the perl modules]), [],[enable_perl=yes])
109 AM_CONDITIONAL(ENABLE_PERL, test "$enable_perl" = "yes")
110
111 AC_CONFIG_HEADERS(config.h)
112 AC_CONFIG_FILES([
113 Makefile
114 po/Makefile.in
115 ])
116
117 AC_OUTPUT
118 AC_MSG_RESULT([
119 $PACKAGE $VERSION
120 =====
121
122 prefix: ${prefix}
123 sysconfdir: ${sysconfdir}
124 libdir: ${libdir}
125 includedir: ${includedir}
126
127 compiler: ${CC}
128 cflags: ${CFLAGS}
129 ldflags: ${LDFLAGS}
130
131 debug: ${enable_debug}
132
133 Bindings:
134 perl: ${enable_perl}
135 ])