]> git.ipfire.org Git - thirdparty/kmod.git/blame - configure.ac
libkmod: Add missing definitions
[thirdparty/kmod.git] / configure.ac
CommitLineData
ecd40ee4 1AC_PREREQ(2.60)
cb48c9b2 2AC_INIT([kmod],
6feba028 3 [12],
e17cc3af 4 [linux-modules@vger.kernel.org],
cb48c9b2 5 [kmod],
bb05bc8a 6 [http://git.kernel.org/?p=utils/kernel/kmod/kmod.git])
586fc304
LDM
7
8AC_CONFIG_SRCDIR([libkmod/libkmod.c])
ecd40ee4 9AC_CONFIG_AUX_DIR([build-aux])
a597c8bb 10AM_INIT_AUTOMAKE([check-news foreign 1.11 silent-rules
80f9e023 11 tar-pax no-dist-gzip dist-xz subdir-objects color-tests])
ecd40ee4
LDM
12AC_PROG_CC_STDC
13AC_USE_SYSTEM_EXTENSIONS
14AC_SYS_LARGEFILE
15AC_CONFIG_MACRO_DIR([m4])
fe8bf3b0 16m4_ifndef([AM_SILENT_RULES], [m4_define([AM_SILENT_RULES],[])])
ecd40ee4
LDM
17AM_SILENT_RULES([yes])
18LT_INIT([disable-static pic-only])
19AC_PREFIX_DEFAULT([/usr])
20
3ef7208e
LDM
21#####################################################################
22# Program checks and configurations
23#####################################################################
24
648a842b
LDM
25AC_PROG_CC
26AC_PROG_CC_C99
27AC_C_TYPEOF
28AM_PROG_CC_C_O
29AC_PROG_GCC_TRADITIONAL
708624a4 30AC_C_BIGENDIAN
648a842b 31
9faa7b37
KS
32AC_PROG_SED
33AC_PROG_MKDIR_P
7b3a74fc 34PKG_PROG_PKG_CONFIG
3d8226ed 35
3ef7208e
LDM
36
37#####################################################################
38# Function and structure checks
39#####################################################################
40
d005aeb7 41AC_CHECK_FUNCS_ONCE(__xstat)
41a51c2a 42AC_CHECK_FUNCS_ONCE([__secure_getenv secure_getenv])
d005aeb7 43
3ef7208e
LDM
44# dietlibc doesn't have st.st_mtim struct member
45AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
46
144d1826
KC
47# Check kernel headers
48AC_CHECK_HEADERS_ONCE([linux/module.h])
49
3ef7208e
LDM
50
51#####################################################################
52# --with-
53#####################################################################
54
e79bf83b
KS
55AC_ARG_WITH([rootlibdir],
56 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
57 [], [with_rootlibdir=$libdir])
58AC_SUBST([rootlibdir], [$with_rootlibdir])
59
b182f8fb
JE
60AC_ARG_WITH([xz],
61 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
62 [], [with_xz=no])
63AS_IF([test "x$with_xz" != "xno"], [
64 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
65 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
66], [
67 AC_MSG_NOTICE([Xz support not requested])
68])
69
5a51a357
JE
70AC_ARG_WITH([zlib],
71 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
72 [], [with_zlib=no])
73AS_IF([test "x$with_zlib" != "xno"], [
7b3a74fc
JE
74 PKG_CHECK_MODULES([zlib], [zlib])
75 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
cfb908bf
LDM
76], [
77 AC_MSG_NOTICE([zlib support not requested])
cfb908bf 78])
3d8226ed 79
3ef7208e
LDM
80
81#####################################################################
82# --enable-
83#####################################################################
84
85AC_ARG_ENABLE([tools],
86 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
87 [], enable_tools=yes)
88AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
89
8631552d
CW
90AC_ARG_ENABLE([manpages],
91 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
92 [], enable_manpages=yes)
93AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
5c61b149 94AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
caaf438c 95AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
5c61b149 96 AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
caaf438c 97])
8631552d 98
3ef7208e
LDM
99AC_ARG_ENABLE([logging],
100 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
101 [], enable_logging=yes)
102AS_IF([test "x$enable_logging" = "xyes"], [
103 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
104])
105
ecd40ee4
LDM
106AC_ARG_ENABLE([debug],
107 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
108 [], [enable_debug=no])
109AS_IF([test "x$enable_debug" = "xyes"], [
110 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
111])
112
3ef7208e
LDM
113m4_ifdef([GTK_DOC_CHECK], [
114GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
115], [
116AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
117
118
119#####################################################################
120# Default CFLAGS and LDFLAGS
121#####################################################################
6068aaae 122
e48f3765
LDM
123CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
124 -pipe \
125 -DANOTHER_BRICK_IN_THE \
126 -Wall \
127 -W \
128 -Wextra \
129 -Wno-inline \
130 -Wvla \
131 -Wundef \
132 -Wformat=2 \
133 -Wlogical-op \
134 -Wsign-compare \
135 -Wformat-security \
136 -Wmissing-include-dirs \
137 -Wformat-nonliteral \
138 -Wold-style-definition \
139 -Wpointer-arith \
140 -Winit-self \
141 -Wdeclaration-after-statement \
142 -Wfloat-equal \
143 -Wmissing-prototypes \
144 -Wstrict-prototypes \
145 -Wredundant-decls \
146 -Wmissing-declarations \
147 -Wmissing-noreturn \
148 -Wshadow \
149 -Wendif-labels \
150 -Wstrict-aliasing=2 \
151 -Wwrite-strings \
152 -Wno-long-long \
153 -Wno-overlength-strings \
154 -Wno-unused-parameter \
155 -Wno-missing-field-initializers \
156 -Wno-unused-result \
157 -Wnested-externs \
158 -Wchar-subscripts \
159 -Wtype-limits \
160 -Wuninitialized \
161 -fno-common \
162 -fdiagnostics-show-option \
163 -fvisibility=hidden \
164 -ffunction-sections \
165 -fdata-sections])
166AC_SUBST([WARNINGFLAGS], $with_cflags)
167
168
169CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
170 -Wl,--as-needed \
171 -Wl,--gc-sections])
172AC_SUBST([GCLDFLAGS], $with_ldflags)
3ef7208e
LDM
173
174#####################################################################
175# Generate files from *.in
176#####################################################################
177
ecd40ee4
LDM
178AC_CONFIG_HEADERS(config.h)
179AC_CONFIG_FILES([
180 Makefile
904b57d0 181 man/Makefile
646b83b8
LDM
182 libkmod/docs/Makefile
183 libkmod/docs/version.xml
ecd40ee4
LDM
184])
185
3ef7208e
LDM
186
187#####################################################################
646b83b8 188
ecd40ee4
LDM
189AC_OUTPUT
190AC_MSG_RESULT([
191 $PACKAGE $VERSION
63dc8329 192 ======
ecd40ee4
LDM
193
194 prefix: ${prefix}
195 sysconfdir: ${sysconfdir}
196 libdir: ${libdir}
e79bf83b 197 rootlibdir: ${rootlibdir}
ecd40ee4 198 includedir: ${includedir}
7c41c2dd 199 bindir: ${bindir}
ecd40ee4
LDM
200
201 compiler: ${CC}
e48f3765
LDM
202 cflags: ${with_cflags} ${CFLAGS}
203 ldflags: ${with_ldflags} ${LDFLAGS}
ecd40ee4 204
7c41c2dd 205 tools: ${enable_tools}
ecd40ee4 206 logging: ${enable_logging}
b182f8fb 207 compression: xz=${with_xz} zlib=${with_zlib}
ecd40ee4 208 debug: ${enable_debug}
646b83b8 209 doc: ${enable_gtk_doc}
382de85c 210 man: ${enable_manpages}
ecd40ee4 211])