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
34 AC_PATH_PROG([XSLTPROC], [xsltproc])
38 #####################################################################
39 # Function and structure checks
40 #####################################################################
42 AC_CHECK_FUNCS_ONCE(__xstat)
44 # dietlibc doesn't have st.st_mtim struct member
45 AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
48 #####################################################################
50 #####################################################################
52 AC_ARG_WITH([rootprefix],
53 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
54 [], [with_rootprefix=""])
55 AC_SUBST([rootprefix], [$with_rootprefix])
57 AC_ARG_WITH([rootlibdir],
58 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
59 [], [with_rootlibdir=$libdir])
60 AC_SUBST([rootlibdir], [$with_rootlibdir])
63 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
65 AS_IF([test "x$with_xz" != "xno"], [
66 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
67 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
69 AC_MSG_NOTICE([Xz support not requested])
73 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
75 AS_IF([test "x$with_zlib" != "xno"], [
76 PKG_CHECK_MODULES([zlib], [zlib])
77 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
79 AC_MSG_NOTICE([zlib support not requested])
83 #####################################################################
85 #####################################################################
87 AC_ARG_ENABLE([tools],
88 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
90 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
92 AC_ARG_ENABLE([logging],
93 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
94 [], enable_logging=yes)
95 AS_IF([test "x$enable_logging" = "xyes"], [
96 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
99 AC_ARG_ENABLE([debug],
100 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
101 [], [enable_debug=no])
102 AS_IF([test "x$enable_debug" = "xyes"], [
103 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
106 m4_ifdef([GTK_DOC_CHECK], [
107 GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
109 AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
112 #####################################################################
113 # Default CFLAGS and LDFLAGS
114 #####################################################################
116 CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
118 -DANOTHER_BRICK_IN_THE \
129 -Wmissing-include-dirs \
130 -Wformat-nonliteral \
131 -Wold-style-definition \
134 -Wdeclaration-after-statement \
136 -Wmissing-prototypes \
137 -Wstrict-prototypes \
139 -Wmissing-declarations \
143 -Wstrict-aliasing=2 \
146 -Wno-overlength-strings \
147 -Wno-unused-parameter \
148 -Wno-missing-field-initializers \
155 -fdiagnostics-show-option \
156 -fvisibility=hidden \
157 -ffunction-sections \
159 AC_SUBST([WARNINGFLAGS], $with_cflags)
162 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
165 AC_SUBST([GCLDFLAGS], $with_ldflags)
167 #####################################################################
168 # Generate files from *.in
169 #####################################################################
171 AC_CONFIG_HEADERS(config.h)
175 libkmod/docs/Makefile
176 libkmod/docs/version.xml
180 #####################################################################
188 rootprefix: ${rootprefix}
189 sysconfdir: ${sysconfdir}
191 rootlibdir: ${rootlibdir}
192 includedir: ${includedir}
196 cflags: ${with_cflags} ${CFLAGS}
197 ldflags: ${with_ldflags} ${LDFLAGS}
199 tools: ${enable_tools}
200 logging: ${enable_logging}
201 compression: xz=${with_xz} zlib=${with_zlib}
202 debug: ${enable_debug}
203 doc: ${enable_gtk_doc}