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 #####################################################################
22 # Program checks and configurations
23 #####################################################################
29 AC_PROG_GCC_TRADITIONAL
37 #####################################################################
38 # Function and structure checks
39 #####################################################################
41 AC_CHECK_FUNCS_ONCE(__xstat)
42 AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
43 AC_CHECK_FUNCS_ONCE([finit_module])
45 # dietlibc doesn't have st.st_mtim struct member
46 AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
48 # Check kernel headers
49 AC_CHECK_HEADERS_ONCE([linux/module.h])
52 #####################################################################
54 #####################################################################
56 AC_ARG_WITH([rootlibdir],
57 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
58 [], [with_rootlibdir=$libdir])
59 AC_SUBST([rootlibdir], [$with_rootlibdir])
62 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
64 AS_IF([test "x$with_xz" != "xno"], [
65 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
66 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
68 AC_MSG_NOTICE([Xz support not requested])
72 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
74 AS_IF([test "x$with_zlib" != "xno"], [
75 PKG_CHECK_MODULES([zlib], [zlib])
76 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
78 AC_MSG_NOTICE([zlib support not requested])
82 #####################################################################
84 #####################################################################
86 AC_ARG_ENABLE([tools],
87 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
89 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
91 AC_ARG_ENABLE([manpages],
92 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
93 [], enable_manpages=yes)
94 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
95 AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
96 AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
97 AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
100 AC_ARG_ENABLE([logging],
101 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
102 [], enable_logging=yes)
103 AS_IF([test "x$enable_logging" = "xyes"], [
104 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
107 AC_ARG_ENABLE([debug],
108 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
109 [], [enable_debug=no])
110 AS_IF([test "x$enable_debug" = "xyes"], [
111 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
114 m4_ifdef([GTK_DOC_CHECK], [
115 GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
117 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
120 #####################################################################
121 # Default CFLAGS and LDFLAGS
122 #####################################################################
124 CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
126 -DANOTHER_BRICK_IN_THE \
137 -Wmissing-include-dirs \
138 -Wformat-nonliteral \
139 -Wold-style-definition \
142 -Wdeclaration-after-statement \
144 -Wmissing-prototypes \
145 -Wstrict-prototypes \
147 -Wmissing-declarations \
151 -Wstrict-aliasing=2 \
154 -Wno-overlength-strings \
155 -Wno-unused-parameter \
156 -Wno-missing-field-initializers \
163 -fdiagnostics-show-option \
164 -fvisibility=hidden \
165 -ffunction-sections \
167 AC_SUBST([WARNINGFLAGS], $with_cflags)
170 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
173 AC_SUBST([GCLDFLAGS], $with_ldflags)
175 #####################################################################
176 # Generate files from *.in
177 #####################################################################
179 AC_CONFIG_HEADERS(config.h)
183 libkmod/docs/Makefile
184 libkmod/docs/version.xml
188 #####################################################################
196 sysconfdir: ${sysconfdir}
198 rootlibdir: ${rootlibdir}
199 includedir: ${includedir}
203 cflags: ${with_cflags} ${CFLAGS}
204 ldflags: ${with_ldflags} ${LDFLAGS}
206 tools: ${enable_tools}
207 logging: ${enable_logging}
208 compression: xz=${with_xz} zlib=${with_zlib}
209 debug: ${enable_debug}
210 doc: ${enable_gtk_doc}
211 man: ${enable_manpages}