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])
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)
43 # dietlibc doesn't have st.st_mtim struct member
44 AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
47 #####################################################################
49 #####################################################################
51 AC_ARG_WITH([rootlibdir],
52 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
53 [], [with_rootlibdir=$libdir])
54 AC_SUBST([rootlibdir], [$with_rootlibdir])
57 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
59 AS_IF([test "x$with_xz" != "xno"], [
60 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
61 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
63 AC_MSG_NOTICE([Xz support not requested])
67 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
69 AS_IF([test "x$with_zlib" != "xno"], [
70 PKG_CHECK_MODULES([zlib], [zlib])
71 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
73 AC_MSG_NOTICE([zlib support not requested])
77 #####################################################################
79 #####################################################################
81 AC_ARG_ENABLE([tools],
82 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
84 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
86 AC_ARG_ENABLE([manpages],
87 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
88 [], enable_manpages=yes)
89 AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
90 AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
91 AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
92 AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
95 AC_ARG_ENABLE([logging],
96 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
97 [], enable_logging=yes)
98 AS_IF([test "x$enable_logging" = "xyes"], [
99 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
102 AC_ARG_ENABLE([debug],
103 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
104 [], [enable_debug=no])
105 AS_IF([test "x$enable_debug" = "xyes"], [
106 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
109 m4_ifdef([GTK_DOC_CHECK], [
110 GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
112 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
115 #####################################################################
116 # Default CFLAGS and LDFLAGS
117 #####################################################################
119 CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
121 -DANOTHER_BRICK_IN_THE \
132 -Wmissing-include-dirs \
133 -Wformat-nonliteral \
134 -Wold-style-definition \
137 -Wdeclaration-after-statement \
139 -Wmissing-prototypes \
140 -Wstrict-prototypes \
142 -Wmissing-declarations \
146 -Wstrict-aliasing=2 \
149 -Wno-overlength-strings \
150 -Wno-unused-parameter \
151 -Wno-missing-field-initializers \
158 -fdiagnostics-show-option \
159 -fvisibility=hidden \
160 -ffunction-sections \
162 AC_SUBST([WARNINGFLAGS], $with_cflags)
165 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
168 AC_SUBST([GCLDFLAGS], $with_ldflags)
170 #####################################################################
171 # Generate files from *.in
172 #####################################################################
174 AC_CONFIG_HEADERS(config.h)
178 libkmod/docs/Makefile
179 libkmod/docs/version.xml
183 #####################################################################
191 sysconfdir: ${sysconfdir}
193 rootlibdir: ${rootlibdir}
194 includedir: ${includedir}
198 cflags: ${with_cflags} ${CFLAGS}
199 ldflags: ${with_ldflags} ${LDFLAGS}
201 tools: ${enable_tools}
202 logging: ${enable_logging}
203 compression: xz=${with_xz} zlib=${with_zlib}
204 debug: ${enable_debug}
205 doc: ${enable_gtk_doc}
206 man: ${enable_manpages}