4 [linux-modules@vger.kernel.org],
6 [http://git.kernel.org/?p=utils/kernel/kmod/kmod.git])
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
11 tar-pax no-dist-gzip dist-xz subdir-objects color-tests parallel-tests])
13 AC_USE_SYSTEM_EXTENSIONS
15 AC_CONFIG_MACRO_DIR([m4])
16 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
17 AM_SILENT_RULES([yes])
18 LT_INIT([disable-static pic-only])
19 AC_PREFIX_DEFAULT([/usr])
21 AS_IF([test "x$enable_static" = "xyes"],
22 [AC_MSG_ERROR([--enable-static is not supported by kmod])])
25 #####################################################################
26 # Program checks and configurations
27 #####################################################################
33 AC_PROG_GCC_TRADITIONAL
41 #####################################################################
42 # Function and structure checks
43 #####################################################################
45 AC_CHECK_FUNCS_ONCE(__xstat)
46 AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
47 AC_CHECK_FUNCS_ONCE([finit_module])
49 # dietlibc doesn't have st.st_mtim struct member
50 AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
52 # Check kernel headers
53 AC_CHECK_HEADERS_ONCE([linux/module.h])
56 #####################################################################
58 #####################################################################
60 AC_ARG_WITH([rootlibdir],
61 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
62 [], [with_rootlibdir=$libdir])
63 AC_SUBST([rootlibdir], [$with_rootlibdir])
66 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
68 AS_IF([test "x$with_xz" != "xno"], [
69 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
70 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
72 AC_MSG_NOTICE([Xz support not requested])
76 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
78 AS_IF([test "x$with_zlib" != "xno"], [
79 PKG_CHECK_MODULES([zlib], [zlib])
80 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
82 AC_MSG_NOTICE([zlib support not requested])
85 AC_ARG_WITH([bashcompletiondir],
86 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
88 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
89 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
91 with_bashcompletiondir=${datadir}/bash-completion/completions
93 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
95 #####################################################################
97 #####################################################################
99 AC_ARG_ENABLE([tools],
100 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
101 [], enable_tools=yes)
102 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
104 AC_ARG_ENABLE([manpages],
105 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
106 [], enable_manpages=yes)
107 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
108 AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
109 AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
110 AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
113 AC_ARG_ENABLE([logging],
114 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
115 [], enable_logging=yes)
116 AS_IF([test "x$enable_logging" = "xyes"], [
117 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
120 AC_ARG_ENABLE([debug],
121 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
122 [], [enable_debug=no])
123 AS_IF([test "x$enable_debug" = "xyes"], [
124 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
127 m4_ifdef([GTK_DOC_CHECK], [
128 GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
130 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
133 #####################################################################
134 # Default CFLAGS and LDFLAGS
135 #####################################################################
137 CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
139 -DANOTHER_BRICK_IN_THE \
150 -Wmissing-include-dirs \
151 -Wformat-nonliteral \
152 -Wold-style-definition \
155 -Wdeclaration-after-statement \
157 -Wmissing-prototypes \
158 -Wstrict-prototypes \
160 -Wmissing-declarations \
164 -Wstrict-aliasing=2 \
167 -Wno-overlength-strings \
168 -Wno-unused-parameter \
169 -Wno-missing-field-initializers \
176 -fdiagnostics-show-option \
177 -fvisibility=hidden \
178 -ffunction-sections \
180 AC_SUBST([WARNINGFLAGS], $with_cflags)
183 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
186 AC_SUBST([GCLDFLAGS], $with_ldflags)
188 #####################################################################
189 # Generate files from *.in
190 #####################################################################
192 AC_CONFIG_HEADERS(config.h)
196 libkmod/docs/Makefile
197 libkmod/docs/version.xml
201 #####################################################################
209 sysconfdir: ${sysconfdir}
211 rootlibdir: ${rootlibdir}
212 includedir: ${includedir}
214 Bash completions dir: ${with_bashcompletiondir}
217 cflags: ${with_cflags} ${CFLAGS}
218 ldflags: ${with_ldflags} ${LDFLAGS}
220 tools: ${enable_tools}
221 logging: ${enable_logging}
222 compression: xz=${with_xz} zlib=${with_zlib}
223 debug: ${enable_debug}
224 doc: ${enable_gtk_doc}
225 man: ${enable_manpages}