]>
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 |
bccb4b25 | 39 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
3d8226ed | 40 | |
3ef7208e LDM |
41 | |
42 | ##################################################################### | |
43 | # Function and structure checks | |
44 | ##################################################################### | |
45 | ||
d005aeb7 | 46 | AC_CHECK_FUNCS_ONCE(__xstat) |
41a51c2a | 47 | AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv]) |
55112d19 | 48 | AC_CHECK_FUNCS_ONCE([finit_module]) |
d005aeb7 | 49 | |
3ef7208e LDM |
50 | # dietlibc doesn't have st.st_mtim struct member |
51 | AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>]) | |
52 | ||
144d1826 KC |
53 | # Check kernel headers |
54 | AC_CHECK_HEADERS_ONCE([linux/module.h]) | |
55 | ||
dc8ed09f TP |
56 | AC_MSG_CHECKING([whether _Static_assert() is supported]) |
57 | AC_COMPILE_IFELSE( | |
58 | [AC_LANG_SOURCE([[_Static_assert(1, "Test");]])], | |
59 | [AC_DEFINE([HAVE_STATIC_ASSERT], [1], [Define if _Static_assert() is available]) | |
60 | AC_MSG_RESULT([yes])], | |
61 | [AC_MSG_RESULT([no])]) | |
3ef7208e LDM |
62 | |
63 | ##################################################################### | |
64 | # --with- | |
65 | ##################################################################### | |
66 | ||
e79bf83b KS |
67 | AC_ARG_WITH([rootlibdir], |
68 | AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]), | |
69 | [], [with_rootlibdir=$libdir]) | |
70 | AC_SUBST([rootlibdir], [$with_rootlibdir]) | |
71 | ||
b182f8fb JE |
72 | AC_ARG_WITH([xz], |
73 | AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]), | |
74 | [], [with_xz=no]) | |
75 | AS_IF([test "x$with_xz" != "xno"], [ | |
76 | PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99]) | |
77 | AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.]) | |
78 | ], [ | |
79 | AC_MSG_NOTICE([Xz support not requested]) | |
80 | ]) | |
81 | ||
5a51a357 JE |
82 | AC_ARG_WITH([zlib], |
83 | AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]), | |
84 | [], [with_zlib=no]) | |
85 | AS_IF([test "x$with_zlib" != "xno"], [ | |
7b3a74fc JE |
86 | PKG_CHECK_MODULES([zlib], [zlib]) |
87 | AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.]) | |
cfb908bf LDM |
88 | ], [ |
89 | AC_MSG_NOTICE([zlib support not requested]) | |
cfb908bf | 90 | ]) |
3d8226ed | 91 | |
80cf2c8f LDM |
92 | AC_ARG_WITH([bashcompletiondir], |
93 | AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]), | |
94 | [], | |
95 | [AS_IF([$($PKG_CONFIG --exists bash-completion)], [ | |
96 | with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion) | |
97 | ] , [ | |
98 | with_bashcompletiondir=${datadir}/bash-completion/completions | |
99 | ])]) | |
100 | AC_SUBST([bashcompletiondir], [$with_bashcompletiondir]) | |
3ef7208e LDM |
101 | |
102 | ##################################################################### | |
103 | # --enable- | |
104 | ##################################################################### | |
105 | ||
106 | AC_ARG_ENABLE([tools], | |
107 | AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]), | |
108 | [], enable_tools=yes) | |
109 | AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"]) | |
110 | ||
8631552d CW |
111 | AC_ARG_ENABLE([manpages], |
112 | AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]), | |
113 | [], enable_manpages=yes) | |
114 | AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"]) | |
115 | ||
3ef7208e LDM |
116 | AC_ARG_ENABLE([logging], |
117 | AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]), | |
118 | [], enable_logging=yes) | |
119 | AS_IF([test "x$enable_logging" = "xyes"], [ | |
120 | AC_DEFINE(ENABLE_LOGGING, [1], [System logging.]) | |
121 | ]) | |
122 | ||
ecd40ee4 LDM |
123 | AC_ARG_ENABLE([debug], |
124 | AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), | |
125 | [], [enable_debug=no]) | |
126 | AS_IF([test "x$enable_debug" = "xyes"], [ | |
127 | AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) | |
128 | ]) | |
129 | ||
3ef7208e LDM |
130 | m4_ifdef([GTK_DOC_CHECK], [ |
131 | GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat]) | |
132 | ], [ | |
133 | AM_CONDITIONAL([ENABLE_GTK_DOC], false)]) | |
134 | ||
135 | ||
136 | ##################################################################### | |
137 | # Default CFLAGS and LDFLAGS | |
138 | ##################################################################### | |
6068aaae | 139 | |
e48f3765 LDM |
140 | CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\ |
141 | -pipe \ | |
142 | -DANOTHER_BRICK_IN_THE \ | |
143 | -Wall \ | |
144 | -W \ | |
145 | -Wextra \ | |
146 | -Wno-inline \ | |
147 | -Wvla \ | |
148 | -Wundef \ | |
149 | -Wformat=2 \ | |
150 | -Wlogical-op \ | |
151 | -Wsign-compare \ | |
152 | -Wformat-security \ | |
153 | -Wmissing-include-dirs \ | |
154 | -Wformat-nonliteral \ | |
155 | -Wold-style-definition \ | |
156 | -Wpointer-arith \ | |
157 | -Winit-self \ | |
158 | -Wdeclaration-after-statement \ | |
159 | -Wfloat-equal \ | |
160 | -Wmissing-prototypes \ | |
161 | -Wstrict-prototypes \ | |
162 | -Wredundant-decls \ | |
163 | -Wmissing-declarations \ | |
164 | -Wmissing-noreturn \ | |
165 | -Wshadow \ | |
166 | -Wendif-labels \ | |
db62153e | 167 | -Wstrict-aliasing=3 \ |
e48f3765 LDM |
168 | -Wwrite-strings \ |
169 | -Wno-long-long \ | |
170 | -Wno-overlength-strings \ | |
171 | -Wno-unused-parameter \ | |
172 | -Wno-missing-field-initializers \ | |
173 | -Wno-unused-result \ | |
174 | -Wnested-externs \ | |
175 | -Wchar-subscripts \ | |
176 | -Wtype-limits \ | |
177 | -Wuninitialized \ | |
178 | -fno-common \ | |
179 | -fdiagnostics-show-option \ | |
b3e0a075 | 180 | -fdiagnostics-color=auto \ |
e48f3765 LDM |
181 | -fvisibility=hidden \ |
182 | -ffunction-sections \ | |
183 | -fdata-sections]) | |
184 | AC_SUBST([WARNINGFLAGS], $with_cflags) | |
185 | ||
186 | ||
187 | CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \ | |
188 | -Wl,--as-needed \ | |
189 | -Wl,--gc-sections]) | |
190 | AC_SUBST([GCLDFLAGS], $with_ldflags) | |
3ef7208e LDM |
191 | |
192 | ##################################################################### | |
193 | # Generate files from *.in | |
194 | ##################################################################### | |
195 | ||
ecd40ee4 LDM |
196 | AC_CONFIG_HEADERS(config.h) |
197 | AC_CONFIG_FILES([ | |
198 | Makefile | |
904b57d0 | 199 | man/Makefile |
646b83b8 LDM |
200 | libkmod/docs/Makefile |
201 | libkmod/docs/version.xml | |
ecd40ee4 LDM |
202 | ]) |
203 | ||
3ef7208e LDM |
204 | |
205 | ##################################################################### | |
646b83b8 | 206 | |
ecd40ee4 LDM |
207 | AC_OUTPUT |
208 | AC_MSG_RESULT([ | |
209 | $PACKAGE $VERSION | |
80cf2c8f | 210 | ======= |
ecd40ee4 LDM |
211 | |
212 | prefix: ${prefix} | |
213 | sysconfdir: ${sysconfdir} | |
214 | libdir: ${libdir} | |
e79bf83b | 215 | rootlibdir: ${rootlibdir} |
ecd40ee4 | 216 | includedir: ${includedir} |
7c41c2dd | 217 | bindir: ${bindir} |
80cf2c8f | 218 | Bash completions dir: ${with_bashcompletiondir} |
ecd40ee4 LDM |
219 | |
220 | compiler: ${CC} | |
e48f3765 LDM |
221 | cflags: ${with_cflags} ${CFLAGS} |
222 | ldflags: ${with_ldflags} ${LDFLAGS} | |
ecd40ee4 | 223 | |
7c41c2dd | 224 | tools: ${enable_tools} |
ecd40ee4 | 225 | logging: ${enable_logging} |
b182f8fb | 226 | compression: xz=${with_xz} zlib=${with_zlib} |
ecd40ee4 | 227 | debug: ${enable_debug} |
646b83b8 | 228 | doc: ${enable_gtk_doc} |
382de85c | 229 | man: ${enable_manpages} |
ecd40ee4 | 230 | ]) |