4 [linux-modules@vger.kernel.org],
6 [http://git.profusion.mobi/cgit.cgi/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])
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])
25 AC_PROG_GCC_TRADITIONAL
28 required_private_libs=""
30 AC_ARG_WITH([rootprefix],
31 AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
32 [], [with_rootprefix=$prefix])
33 AC_SUBST([rootprefix], [$with_rootprefix])
35 AC_ARG_ENABLE([tools],
36 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
38 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
40 AC_ARG_ENABLE([logging],
41 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
42 [], enable_logging=yes)
43 AS_IF([test "x$enable_logging" = "xyes"], [
44 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
48 AS_HELP_STRING([--enable-zlib], [handle gzipped modules (options: static or dynamic) @<:@default=disabled@:>@]),
50 if test "x$enable_zlib" = "xyes" -o "x$enable_zlib" = "xstatic"; then
52 zlib_libs="-Wl,-Bstatic -lz -Wl,-Bdynamic"
54 LIBS="${LIBS} ${zlib_libs}"
55 AC_MSG_CHECKING([if static zlib exists])
56 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
59 gzFile f = gzopen("/tmp", "rb");
61 [have_zlib=yes], [have_zlib=no])
63 AC_MSG_RESULT([$have_zlib])
64 if test "x$have_zlib" != "xyes"; then
66 AC_MSG_ERROR([static zlib is not present])
68 elif test "x$enable_zlib" = "xdynamic"; then
69 AC_CHECK_LIB([z], [gzopen],
72 required_private_libs="${required_private_libs} ${zlib_libs}"
74 [AC_MSG_ERROR([dynamic zlib is not present])])
76 AC_MSG_NOTICE([zlib support not requested])
79 if test "x$zlib_libs" != "x"; then
80 AC_DEFINE(ENABLE_ZLIB, [1], [Enable zlib for modules.])
84 AC_ARG_ENABLE([debug],
85 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
86 [], [enable_debug=no])
87 AS_IF([test "x$enable_debug" = "xyes"], [
88 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
91 CC_CHECK_CFLAGS_APPEND([ \
103 -Wmissing-include-dirs \
104 -Wformat-nonliteral \
105 -Wold-style-definition \
108 -Wdeclaration-after-statement \
110 -Wmissing-prototypes \
111 -Wstrict-prototypes \
113 -Wmissing-declarations \
118 -Wstrict-aliasing=2 \
121 -Wno-overlength-strings \
122 -Wno-unused-parameter \
123 -Wno-missing-field-initializers \
129 -Wp,-D_FORTIFY_SOURCE=2 \
132 -fdiagnostics-show-option \
133 -fno-strict-aliasing \
134 -fvisibility=hidden \
135 -ffunction-sections \
141 AC_SUBST(required_private_libs)
143 AC_CONFIG_HEADERS(config.h)
155 rootprefix: ${rootprefix}
156 sysconfdir: ${sysconfdir}
158 includedir: ${includedir}
165 tools: ${enable_tools}
166 logging: ${enable_logging}
168 debug: ${enable_debug}