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_ENABLE([tools],
31 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
33 AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
35 AC_ARG_ENABLE([logging],
36 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
37 [], enable_logging=yes)
38 AS_IF([test "x$enable_logging" = "xyes"], [
39 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
43 AS_HELP_STRING([--enable-zlib], [handle gzipped modules (options: static or dynamic) @<:@default=disabled@:>@]),
45 if test "x$enable_zlib" = "xyes" -o "x$enable_zlib" = "xstatic"; then
47 zlib_libs="-Wl,-Bstatic -lz -Wl,-Bdynamic"
49 LIBS="${LIBS} ${zlib_libs}"
50 AC_MSG_CHECKING([if static zlib exists])
51 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
54 gzFile f = gzopen("/tmp", "rb");
56 [have_zlib=yes], [have_zlib=no])
58 AC_MSG_RESULT([$have_zlib])
59 if test "x$have_zlib" != "xyes"; then
61 AC_MSG_ERROR([static zlib is not present])
63 elif test "x$enable_zlib" = "xdynamic"; then
64 AC_CHECK_LIB([z], [gzopen],
67 required_private_libs="${required_private_libs} ${zlib_libs}"
69 [AC_MSG_ERROR([dynamic zlib is not present])])
71 AC_MSG_NOTICE([zlib support not requested])
74 if test "x$zlib_libs" != "x"; then
75 AC_DEFINE(ENABLE_ZLIB, [1], [Enable zlib for modules.])
79 AC_ARG_ENABLE([debug],
80 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
81 [], [enable_debug=no])
82 AS_IF([test "x$enable_debug" = "xyes"], [
83 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
86 CC_CHECK_CFLAGS_APPEND([ \
98 -Wmissing-include-dirs \
100 -Wold-style-definition \
103 -Wdeclaration-after-statement \
105 -Wmissing-prototypes \
106 -Wstrict-prototypes \
108 -Wmissing-declarations \
113 -Wstrict-aliasing=2 \
116 -Wno-overlength-strings \
117 -Wno-unused-parameter \
118 -Wno-missing-field-initializers \
124 -Wp,-D_FORTIFY_SOURCE=2 \
127 -fdiagnostics-show-option \
128 -fno-strict-aliasing \
129 -fvisibility=hidden \
130 -ffunction-sections \
136 AC_SUBST(required_private_libs)
138 AC_CONFIG_HEADERS(config.h)
150 sysconfdir: ${sysconfdir}
152 includedir: ${includedir}
159 tools: ${enable_tools}
160 logging: ${enable_logging}
162 debug: ${enable_debug}