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])
20 AM_MAINTAINER_MODE([enable])
22 AS_IF([test "x$enable_static" = "xyes"],
23 [AC_MSG_ERROR([--enable-static is not supported by kmod])])
26 #####################################################################
27 # Program checks and configurations
28 #####################################################################
33 AC_PROG_GCC_TRADITIONAL
39 AC_PATH_PROG([XSLTPROC], [xsltproc])
42 #####################################################################
43 # Function and structure checks
44 #####################################################################
46 AC_CHECK_FUNCS_ONCE(__xstat)
47 AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
48 AC_CHECK_FUNCS_ONCE([finit_module])
50 # dietlibc doesn't have st.st_mtim struct member
51 AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
53 # Check kernel headers
54 AC_CHECK_HEADERS_ONCE([linux/module.h])
56 AC_MSG_CHECKING([whether _Static_assert() is supported])
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])])
63 #####################################################################
65 #####################################################################
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])
73 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
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.])
79 AC_MSG_NOTICE([Xz support not requested])
83 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
85 AS_IF([test "x$with_zlib" != "xno"], [
86 PKG_CHECK_MODULES([zlib], [zlib])
87 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
89 AC_MSG_NOTICE([zlib support not requested])
92 AC_ARG_WITH([bashcompletiondir],
93 AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completions directory]),
95 [AS_IF([$($PKG_CONFIG --exists bash-completion)], [
96 with_bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)
98 with_bashcompletiondir=${datadir}/bash-completion/completions
100 AC_SUBST([bashcompletiondir], [$with_bashcompletiondir])
102 #####################################################################
104 #####################################################################
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"])
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 AS_IF(["x$enable_manpages" != "xno"], ["have_manpages=yes"])
117 AC_ARG_ENABLE([logging],
118 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
119 [], enable_logging=yes)
120 AS_IF([test "x$enable_logging" = "xyes"], [
121 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
124 AC_ARG_ENABLE([debug],
125 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
126 [], [enable_debug=no])
127 AS_IF([test "x$enable_debug" = "xyes"], [
128 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
131 m4_ifdef([GTK_DOC_CHECK], [
132 GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
134 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
137 #####################################################################
138 # Default CFLAGS and LDFLAGS
139 #####################################################################
141 CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
143 -DANOTHER_BRICK_IN_THE \
154 -Wmissing-include-dirs \
155 -Wformat-nonliteral \
156 -Wold-style-definition \
159 -Wdeclaration-after-statement \
161 -Wmissing-prototypes \
162 -Wstrict-prototypes \
164 -Wmissing-declarations \
168 -Wstrict-aliasing=2 \
171 -Wno-overlength-strings \
172 -Wno-unused-parameter \
173 -Wno-missing-field-initializers \
180 -fdiagnostics-show-option \
181 -fdiagnostics-color=auto \
182 -fvisibility=hidden \
183 -ffunction-sections \
185 AC_SUBST([WARNINGFLAGS], $with_cflags)
188 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
191 AC_SUBST([GCLDFLAGS], $with_ldflags)
193 #####################################################################
194 # Generate files from *.in
195 #####################################################################
197 AC_CONFIG_HEADERS(config.h)
201 libkmod/docs/Makefile
202 libkmod/docs/version.xml
206 #####################################################################
214 sysconfdir: ${sysconfdir}
216 rootlibdir: ${rootlibdir}
217 includedir: ${includedir}
219 Bash completions dir: ${with_bashcompletiondir}
222 cflags: ${with_cflags} ${CFLAGS}
223 ldflags: ${with_ldflags} ${LDFLAGS}
225 tools: ${enable_tools}
226 logging: ${enable_logging}
227 compression: xz=${with_xz} zlib=${with_zlib}
228 debug: ${enable_debug}
229 doc: ${enable_gtk_doc}
230 man: ${enable_manpages}