]>
Commit | Line | Data |
---|---|---|
ecd40ee4 | 1 | AC_PREREQ(2.60) |
cb48c9b2 | 2 | AC_INIT([kmod], |
36c4bb92 | 3 | [16], |
e17cc3af | 4 | [linux-modules@vger.kernel.org], |
cb48c9b2 | 5 | [kmod], |
bb05bc8a | 6 | [http://git.kernel.org/?p=utils/kernel/kmod/kmod.git]) |
586fc304 LDM |
7 | |
8 | AC_CONFIG_SRCDIR([libkmod/libkmod.c]) | |
ecd40ee4 | 9 | AC_CONFIG_AUX_DIR([build-aux]) |
a597c8bb | 10 | AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules |
8edd5bb2 | 11 | tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests]) |
ecd40ee4 LDM |
12 | AC_PROG_CC_STDC |
13 | AC_USE_SYSTEM_EXTENSIONS | |
14 | AC_SYS_LARGEFILE | |
15 | AC_CONFIG_MACRO_DIR([m4]) | |
fe8bf3b0 | 16 | m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])]) |
ecd40ee4 LDM |
17 | AM_SILENT_RULES([yes]) |
18 | LT_INIT([disable-static pic-only]) | |
19 | AC_PREFIX_DEFAULT([/usr]) | |
f5cc26c7 | 20 | AM_MAINTAINER_MODE([enable]) |
ecd40ee4 | 21 | |
b7016153 LDM |
22 | AS_IF([test "x$enable_static" = "xyes"], |
23 | [AC_MSG_ERROR([--enable-static is not supported by kmod])]) | |
24 | ||
25 | ||
3ef7208e LDM |
26 | ##################################################################### |
27 | # Program checks and configurations | |
28 | ##################################################################### | |
29 | ||
648a842b LDM |
30 | AC_PROG_CC |
31 | AC_PROG_CC_C99 | |
648a842b LDM |
32 | AM_PROG_CC_C_O |
33 | AC_PROG_GCC_TRADITIONAL | |
708624a4 | 34 | AC_C_BIGENDIAN |
648a842b | 35 | |
9faa7b37 KS |
36 | AC_PROG_SED |
37 | AC_PROG_MKDIR_P | |
7b3a74fc | 38 | PKG_PROG_PKG_CONFIG |
3d8226ed | 39 | |
3ef7208e LDM |
40 | |
41 | ##################################################################### | |
42 | # Function and structure checks | |
43 | ##################################################################### | |
44 | ||
d005aeb7 | 45 | AC_CHECK_FUNCS_ONCE(__xstat) |
41a51c2a | 46 | AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv]) |
55112d19 | 47 | AC_CHECK_FUNCS_ONCE([finit_module]) |
d005aeb7 | 48 | |
3ef7208e LDM |
49 | # dietlibc doesn't have st.st_mtim struct member |
50 | AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>]) | |
51 | ||
144d1826 KC |
52 | # Check kernel headers |
53 | AC_CHECK_HEADERS_ONCE([linux/module.h]) | |
54 | ||
dc8ed09f TP |
55 | AC_MSG_CHECKING([whether _Static_assert() is supported]) |
56 | AC_COMPILE_IFELSE( | |
57 | [AC_LANG_SOURCE([[_Static_assert(1, "Test");]])], | |
58 | [AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define if _Static_assert() is available]) | |
59 | AC_MSG_RESULT([yes])], | |
60 | [AC_MSG_RESULT([no])]) | |
3ef7208e LDM |
61 | |
62 | ##################################################################### | |
63 | # --with- | |
64 | ##################################################################### | |
65 | ||
e79bf83b KS |
66 | AC_ARG_WITH([rootlibdir], |
67 | AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), | |
68 | [], [with_rootlibdir=$libdir]) | |
69 | AC_SUBST([rootlibdir], [$with_rootlibdir]) | |
70 | ||
b182f8fb JE |
71 | AC_ARG_WITH([xz], |
72 | AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]), | |
73 | [], [with_xz=no]) | |
74 | AS_IF([test "x$with_xz" != "xno"], [ | |
75 | PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99]) | |
76 | AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.]) | |
77 | ], [ | |
78 | AC_MSG_NOTICE([Xz support not requested]) | |
79 | ]) | |
80 | ||
5a51a357 JE |
81 | AC_ARG_WITH([zlib], |
82 | AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]), | |
83 | [], [with_zlib=no]) | |
84 | AS_IF([test "x$with_zlib" != "xno"], [ | |
7b3a74fc JE |
85 | PKG_CHECK_MODULES([zlib], [zlib]) |
86 | AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.]) | |
cfb908bf LDM |
87 | ], [ |
88 | AC_MSG_NOTICE([zlib support not requested]) | |
cfb908bf | 89 | ]) |
3d8226ed | 90 | |
80cf2c8f LDM |
91 | AC_ARG_WITH([bashcompletiondir], |
92 | AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), | |
93 | [], | |
94 | [AS_IF([$($PKG_CONFIG --exists bash-completion)], [ | |
95 | with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion) | |
96 | ] , [ | |
97 | with_bashcompletiondir=${datadir}/bash-completion/completions | |
98 | ])]) | |
99 | AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) | |
3ef7208e LDM |
100 | |
101 | ##################################################################### | |
102 | # --enable- | |
103 | ##################################################################### | |
104 | ||
105 | AC_ARG_ENABLE([tools], | |
106 | AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]), | |
107 | [], enable_tools=yes) | |
108 | AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"]) | |
109 | ||
8631552d CW |
110 | AC_ARG_ENABLE([manpages], |
111 | AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]), | |
112 | [], enable_manpages=yes) | |
113 | AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"]) | |
5c61b149 | 114 | AC_PATH_PROG([XSLTPROC], [xsltproc], [no]) |
caaf438c | 115 | AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [ |
5c61b149 | 116 | AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages]) |
caaf438c | 117 | ]) |
8631552d | 118 | |
3ef7208e LDM |
119 | AC_ARG_ENABLE([logging], |
120 | AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), | |
121 | [], enable_logging=yes) | |
122 | AS_IF([test "x$enable_logging" = "xyes"], [ | |
123 | AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) | |
124 | ]) | |
125 | ||
ecd40ee4 LDM |
126 | AC_ARG_ENABLE([debug], |
127 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), | |
128 | [], [enable_debug=no]) | |
129 | AS_IF([test "x$enable_debug" = "xyes"], [ | |
130 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) | |
131 | ]) | |
132 | ||
3ef7208e LDM |
133 | m4_ifdef([GTK_DOC_CHECK], [ |
134 | GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat]) | |
135 | ], [ | |
136 | AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) | |
137 | ||
138 | ||
139 | ##################################################################### | |
140 | # Default CFLAGS and LDFLAGS | |
141 | ##################################################################### | |
6068aaae | 142 | |
e48f3765 LDM |
143 | CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\ |
144 | -pipe \ | |
145 | -DANOTHER_BRICK_IN_THE \ | |
146 | -Wall \ | |
147 | -W \ | |
148 | -Wextra \ | |
149 | -Wno-inline \ | |
150 | -Wvla \ | |
151 | -Wundef \ | |
152 | -Wformat=2 \ | |
153 | -Wlogical-op \ | |
154 | -Wsign-compare \ | |
155 | -Wformat-security \ | |
156 | -Wmissing-include-dirs \ | |
157 | -Wformat-nonliteral \ | |
158 | -Wold-style-definition \ | |
159 | -Wpointer-arith \ | |
160 | -Winit-self \ | |
161 | -Wdeclaration-after-statement \ | |
162 | -Wfloat-equal \ | |
163 | -Wmissing-prototypes \ | |
164 | -Wstrict-prototypes \ | |
165 | -Wredundant-decls \ | |
166 | -Wmissing-declarations \ | |
167 | -Wmissing-noreturn \ | |
168 | -Wshadow \ | |
169 | -Wendif-labels \ | |
170 | -Wstrict-aliasing=2 \ | |
171 | -Wwrite-strings \ | |
172 | -Wno-long-long \ | |
173 | -Wno-overlength-strings \ | |
174 | -Wno-unused-parameter \ | |
175 | -Wno-missing-field-initializers \ | |
176 | -Wno-unused-result \ | |
177 | -Wnested-externs \ | |
178 | -Wchar-subscripts \ | |
179 | -Wtype-limits \ | |
180 | -Wuninitialized \ | |
181 | -fno-common \ | |
182 | -fdiagnostics-show-option \ | |
b3e0a075 | 183 | -fdiagnostics-color=auto \ |
e48f3765 LDM |
184 | -fvisibility=hidden \ |
185 | -ffunction-sections \ | |
186 | -fdata-sections]) | |
187 | AC_SUBST([WARNINGFLAGS], $with_cflags) | |
188 | ||
189 | ||
190 | CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \ | |
191 | -Wl,--as-needed \ | |
192 | -Wl,--gc-sections]) | |
193 | AC_SUBST([GCLDFLAGS], $with_ldflags) | |
3ef7208e LDM |
194 | |
195 | ##################################################################### | |
196 | # Generate files from *.in | |
197 | ##################################################################### | |
198 | ||
ecd40ee4 LDM |
199 | AC_CONFIG_HEADERS(config.h) |
200 | AC_CONFIG_FILES([ | |
201 | Makefile | |
904b57d0 | 202 | man/Makefile |
646b83b8 LDM |
203 | libkmod/docs/Makefile |
204 | libkmod/docs/version.xml | |
ecd40ee4 LDM |
205 | ]) |
206 | ||
3ef7208e LDM |
207 | |
208 | ##################################################################### | |
646b83b8 | 209 | |
ecd40ee4 LDM |
210 | AC_OUTPUT |
211 | AC_MSG_RESULT([ | |
212 | $PACKAGE $VERSION | |
80cf2c8f | 213 | ======= |
ecd40ee4 LDM |
214 | |
215 | prefix: ${prefix} | |
216 | sysconfdir: ${sysconfdir} | |
217 | libdir: ${libdir} | |
e79bf83b | 218 | rootlibdir: ${rootlibdir} |
ecd40ee4 | 219 | includedir: ${includedir} |
7c41c2dd | 220 | bindir: ${bindir} |
80cf2c8f | 221 | Bash completions dir: ${with_bashcompletiondir} |
ecd40ee4 LDM |
222 | |
223 | compiler: ${CC} | |
e48f3765 LDM |
224 | cflags: ${with_cflags} ${CFLAGS} |
225 | ldflags: ${with_ldflags} ${LDFLAGS} | |
ecd40ee4 | 226 | |
7c41c2dd | 227 | tools: ${enable_tools} |
ecd40ee4 | 228 | logging: ${enable_logging} |
b182f8fb | 229 | compression: xz=${with_xz} zlib=${with_zlib} |
ecd40ee4 | 230 | debug: ${enable_debug} |
646b83b8 | 231 | doc: ${enable_gtk_doc} |
382de85c | 232 | man: ${enable_manpages} |
ecd40ee4 | 233 | ]) |