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 tar-pax dist-bzip2 subdir-objects])
12 AC_USE_SYSTEM_EXTENSIONS
14 AC_CONFIG_MACRO_DIR([m4])
15 m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
16 AM_SILENT_RULES([yes])
17 LT_INIT([disable-static pic-only])
18 AC_PREFIX_DEFAULT([/usr])
24 AC_PROG_GCC_TRADITIONAL
27 required_private_libs=""
29 AC_ARG_ENABLE([tools],
30 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
32 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
34 AC_ARG_ENABLE([logging],
35 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
36 [], enable_logging=yes)
37 AS_IF([test "x$enable_logging" = "xyes"], [
38 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
42 AS_HELP_STRING([--enable-zlib], [handle gzipped modules (options: static or dynamic) @<:@default=disabled@:>@]),
44 if test "x$enable_zlib" = "xyes" -o "x$enable_zlib" = "xstatic"; then
46 zlib_libs="-Wl,-Bstatic -lz -Wl,-Bdynamic"
48 LIBS="${LIBS} ${zlib_libs}"
49 AC_MSG_CHECKING([if static zlib exists])
50 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
53 gzFile f = gzopen("/tmp", "rb");
55 [have_zlib=yes], [have_zlib=no])
57 AC_MSG_RESULT([$have_zlib])
58 if test "x$have_zlib" != "xyes"; then
60 AC_MSG_ERROR([static zlib is not present])
62 elif test "x$enable_zlib" = "xdynamic"; then
63 AC_CHECK_LIB([z], [gzopen],
66 required_private_libs="${required_private_libs} ${zlib_libs}"
68 [AC_MSG_ERROR([dynamic zlib is not present])])
70 AC_MSG_NOTICE([zlib support not requested])
73 if test "x$zlib_libs" != "x"; then
74 AC_DEFINE(ENABLE_ZLIB, [1], [Enable zlib for modules.])
78 AC_ARG_ENABLE([debug],
79 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
80 [], [enable_debug=no])
81 AS_IF([test "x$enable_debug" = "xyes"], [
82 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
85 CC_CHECK_CFLAGS_APPEND([ \
97 -Wmissing-include-dirs \
99 -Wold-style-definition \
102 -Wdeclaration-after-statement \
104 -Wmissing-prototypes \
105 -Wstrict-prototypes \
107 -Wmissing-declarations \
112 -Wstrict-aliasing=2 \
115 -Wno-overlength-strings \
116 -Wno-unused-parameter \
117 -Wno-missing-field-initializers \
123 -Wp,-D_FORTIFY_SOURCE=2 \
126 -fdiagnostics-show-option \
127 -fno-strict-aliasing \
128 -fvisibility=hidden \
129 -ffunction-sections \
135 AC_SUBST(required_private_libs)
137 AC_CONFIG_HEADERS(config.h)
149 sysconfdir: ${sysconfdir}
151 includedir: ${includedir}
158 tools: ${enable_tools}
159 logging: ${enable_logging}
161 debug: ${enable_debug}