database: Unmap all mapped sections when freeing database
[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 AC_PROG_SED
33 AC_PROG_MKDIR_P
34
35 AC_ARG_ENABLE([debug],
36         AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
37         [], [enable_debug=no])
38 AS_IF([test "x$enable_debug" = "xyes"], [
39         AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
40 ])
41
42 AC_CHECK_HEADERS_ONCE([
43         arpa/inet.h \
44         endian.h \
45         netinet/in.h \
46         string.h \
47 ])
48
49 AC_CHECK_FUNCS([ \
50         be16toh \
51         be32toh \
52         be64toh \
53         htobe16 \
54         htobe32 \
55         htobe64 \
56         mmap \
57         munmap \
58         __secure_getenv \
59         secure_getenv \
60         qsort \
61 ])
62
63 my_CFLAGS="\
64 -Wall \
65 -Wchar-subscripts \
66 -Wformat-security \
67 -Wmissing-declarations \
68 -Wmissing-prototypes \
69 -Wnested-externs \
70 -Wpointer-arith \
71 -Wshadow \
72 -Wsign-compare \
73 -Wstrict-prototypes \
74 -Wtype-limits \
75 "
76 AC_SUBST([my_CFLAGS])
77
78 # Python
79 AM_PATH_PYTHON([3.4])
80 PKG_CHECK_MODULES([PYTHON], [python-${PYTHON_VERSION}])
81
82 AC_CONFIG_HEADERS(config.h)
83 AC_CONFIG_FILES([
84         Makefile
85 ])
86
87 AC_OUTPUT
88 AC_MSG_RESULT([
89         $PACKAGE $VERSION
90         =====
91
92         prefix:                 ${prefix}
93         sysconfdir:             ${sysconfdir}
94         libdir:                 ${libdir}
95         includedir:             ${includedir}
96
97         compiler:               ${CC}
98         cflags:                 ${CFLAGS}
99         ldflags:                ${LDFLAGS}
100
101         debug:                  ${enable_debug}
102 ])