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
26 required_private_libs=""
28 AC_ARG_ENABLE([tools],
29 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
31 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
33 AC_ARG_ENABLE([logging],
34 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
35 [], enable_logging=yes)
36 AS_IF([test "x$enable_logging" = "xyes"], [
37 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
41 AS_HELP_STRING([--enable-zlib], [handle gzipped modules (options: static or dynamic) @<:@default=disabled@:>@]),
43 if test "x$enable_zlib" = "xyes" -o "x$enable_zlib" = "xstatic"; then
45 zlib_libs="-Wl,-Bstatic -lz -Wl,-Bdynamic"
47 LIBS="${LIBS} ${zlib_libs}"
48 AC_MSG_CHECKING([if static zlib exists])
49 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
52 gzFile f = gzopen("/tmp", "rb");
54 [have_zlib=yes], [have_zlib=no])
56 AC_MSG_RESULT([$have_zlib])
57 if test "x$have_zlib" != "xyes"; then
59 AC_MSG_ERROR([static zlib is not present])
61 elif test "x$enable_zlib" = "xdynamic"; then
62 AC_CHECK_LIB([z], [gzopen],
65 required_private_libs="${required_private_libs} ${zlib_libs}"
67 [AC_MSG_ERROR([dynamic zlib is not present])])
69 AC_MSG_NOTICE([zlib support not requested])
72 if test "x$zlib_libs" != "x"; then
73 AC_DEFINE(ENABLE_ZLIB, [1], [Enable zlib for modules.])
77 AC_ARG_ENABLE([debug],
78 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
79 [], [enable_debug=no])
80 AS_IF([test "x$enable_debug" = "xyes"], [
81 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
84 CC_CHECK_CFLAGS_APPEND([ \
96 -Wmissing-include-dirs \
98 -Wold-style-definition \
101 -Wdeclaration-after-statement \
103 -Wmissing-prototypes \
104 -Wstrict-prototypes \
106 -Wmissing-declarations \
111 -Wstrict-aliasing=2 \
114 -Wno-overlength-strings \
115 -Wno-unused-parameter \
116 -Wno-missing-field-initializers \
122 -Wp,-D_FORTIFY_SOURCE=2 \
125 -fdiagnostics-show-option \
126 -fno-strict-aliasing \
127 -fvisibility=hidden \
128 -ffunction-sections \
134 AC_SUBST(required_private_libs)
136 AC_CONFIG_HEADERS(config.h)
148 sysconfdir: ${sysconfdir}
150 includedir: ${includedir}
157 tools: ${enable_tools}
158 logging: ${enable_logging}
160 debug: ${enable_debug}