]> git.ipfire.org Git - thirdparty/kmod.git/blob - configure.ac
Merge branch 'use-mmap'
[thirdparty/kmod.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT([libkmod],
3 [0.1],
4 [],
5 [libkmod],
6 [http://git.profusion.mobi/cgit.cgi/lucas/libkmod/])
7
8 AC_CONFIG_SRCDIR([libkmod/libkmod.c])
9 AC_CONFIG_AUX_DIR([build-aux])
10 AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules tar-pax dist-bzip2 subdir-objects])
11 AC_PROG_CC_STDC
12 AC_USE_SYSTEM_EXTENSIONS
13 AC_SYS_LARGEFILE
14 AC_CONFIG_MACRO_DIR([m4])
15 AM_SILENT_RULES([yes])
16 LT_INIT([disable-static pic-only])
17 AC_PREFIX_DEFAULT([/usr])
18
19 AC_PROG_CC
20 AC_PROG_CC_C99
21 AC_C_TYPEOF
22 AM_PROG_CC_C_O
23 AC_PROG_GCC_TRADITIONAL
24
25 AC_ARG_ENABLE([tools],
26 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
27 [], enable_tools=yes)
28 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
29
30 AC_ARG_ENABLE([logging],
31 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
32 [], enable_logging=yes)
33 AS_IF([test "x$enable_logging" = "xyes"], [
34 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
35 ])
36
37 AC_ARG_ENABLE([debug],
38 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
39 [], [enable_debug=no])
40 AS_IF([test "x$enable_debug" = "xyes"], [
41 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
42 ])
43
44 CC_CHECK_CFLAGS_APPEND([ \
45 -pipe \
46 -Wall \
47 -W \
48 -Wextra \
49 -Wno-inline \
50 -Wvla \
51 -Wundef \
52 -Wformat=2 \
53 -Wlogical-op \
54 -Wsign-compare \
55 -Wformat-security \
56 -Wmissing-include-dirs \
57 -Wformat-nonliteral \
58 -Wold-style-definition \
59 -Wpointer-arith \
60 -Winit-self \
61 -Wdeclaration-after-statement \
62 -Wfloat-equal \
63 -Wmissing-prototypes \
64 -Wstrict-prototypes \
65 -Wredundant-decls \
66 -Wmissing-declarations \
67 -Wmissing-noreturn \
68 -Wshadow \
69 -Wendif-labels \
70 -Wcast-align \
71 -Wstrict-aliasing=2 \
72 -Wwrite-strings \
73 -Wno-long-long \
74 -Wno-overlength-strings \
75 -Wno-unused-parameter \
76 -Wno-missing-field-initializers \
77 -Wno-unused-result \
78 -Wp,-D_FORTIFY_SOURCE=2 \
79 -ffast-math \
80 -fno-common \
81 -fdiagnostics-show-option \
82 -fno-strict-aliasing \
83 -fvisibility=hidden \
84 -ffunction-sections \
85 -fdata-sections \
86 -Wl,--as-needed \
87 -Wl,--gc-sections])
88
89
90 AC_CONFIG_HEADERS(config.h)
91 AC_CONFIG_FILES([
92 Makefile
93 libkmod/libkmod.pc
94 ])
95
96 AC_OUTPUT
97 AC_MSG_RESULT([
98 $PACKAGE $VERSION
99 ========
100
101 prefix: ${prefix}
102 sysconfdir: ${sysconfdir}
103 libdir: ${libdir}
104 includedir: ${includedir}
105 bindir: ${bindir}
106
107 compiler: ${CC}
108 cflags: ${CFLAGS}
109 ldflags: ${LDFLAGS}
110
111 tools: ${enable_tools}
112 logging: ${enable_logging}
113 debug: ${enable_debug}
114 ])