]> git.ipfire.org Git - thirdparty/kmod.git/blame - configure.ac
libkmod: Move finit_module() definition to missing.h
[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])
55112d19 43AC_CHECK_FUNCS_ONCE([finit_module])
d005aeb7 44
3ef7208e
LDM
45# dietlibc doesn't have st.st_mtim struct member
46AC_CHECK_MEMBERS([struct stat.st_mtim], [], [], [#include <sys/stat.h>])
47
144d1826
KC
48# Check kernel headers
49AC_CHECK_HEADERS_ONCE([linux/module.h])
50
3ef7208e
LDM
51
52#####################################################################
53# --with-
54#####################################################################
55
e79bf83b
KS
56AC_ARG_WITH([rootlibdir],
57 AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
58 [], [with_rootlibdir=$libdir])
59AC_SUBST([rootlibdir], [$with_rootlibdir])
60
b182f8fb
JE
61AC_ARG_WITH([xz],
62 AS_HELP_STRING([--with-xz], [handle Xz-compressed modules @<:@default=disabled@:>@]),
63 [], [with_xz=no])
64AS_IF([test "x$with_xz" != "xno"], [
65 PKG_CHECK_MODULES([liblzma], [liblzma >= 4.99])
66 AC_DEFINE([ENABLE_XZ], [1], [Enable Xz for modules.])
67], [
68 AC_MSG_NOTICE([Xz support not requested])
69])
70
5a51a357
JE
71AC_ARG_WITH([zlib],
72 AS_HELP_STRING([--with-zlib], [handle gzipped modules @<:@default=disabled@:>@]),
73 [], [with_zlib=no])
74AS_IF([test "x$with_zlib" != "xno"], [
7b3a74fc
JE
75 PKG_CHECK_MODULES([zlib], [zlib])
76 AC_DEFINE([ENABLE_ZLIB], [1], [Enable zlib for modules.])
cfb908bf
LDM
77], [
78 AC_MSG_NOTICE([zlib support not requested])
cfb908bf 79])
3d8226ed 80
3ef7208e
LDM
81
82#####################################################################
83# --enable-
84#####################################################################
85
86AC_ARG_ENABLE([tools],
87 AS_HELP_STRING([--disable-tools], [disable building tools that provide same functionality as module-init-tools @<:@default=enabled@:>@]),
88 [], enable_tools=yes)
89AM_CONDITIONAL([BUILD_TOOLS], [test "x$enable_tools" = "xyes"])
90
8631552d
CW
91AC_ARG_ENABLE([manpages],
92 AS_HELP_STRING([--disable-manpages], [disable manpages @<:@default=enabled@:>@]),
93 [], enable_manpages=yes)
94AM_CONDITIONAL([BUILD_MANPAGES], [test "x$enable_manpages" = "xyes"])
5c61b149 95AC_PATH_PROG([XSLTPROC], [xsltproc], [no])
caaf438c 96AS_IF([test "x$XSLTPROC" = "xno" && test "x$enable_manpages" = "xyes"], [
5c61b149 97 AC_MSG_ERROR([xsltproc command not found, try ./configure --disable-manpages])
caaf438c 98])
8631552d 99
3ef7208e
LDM
100AC_ARG_ENABLE([logging],
101 AS_HELP_STRING([--disable-logging], [disable system logging @<:@default=enabled@:>@]),
102 [], enable_logging=yes)
103AS_IF([test "x$enable_logging" = "xyes"], [
104 AC_DEFINE(ENABLE_LOGGING, [1], [System logging.])
105])
106
ecd40ee4
LDM
107AC_ARG_ENABLE([debug],
108 AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]),
109 [], [enable_debug=no])
110AS_IF([test "x$enable_debug" = "xyes"], [
111 AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.])
112])
113
3ef7208e
LDM
114m4_ifdef([GTK_DOC_CHECK], [
115GTK_DOC_CHECK([1.14],[--flavour no-tmpl-flat])
116], [
117AM_CONDITIONAL([ENABLE_GTK_DOC], false)])
118
119
120#####################################################################
121# Default CFLAGS and LDFLAGS
122#####################################################################
6068aaae 123
e48f3765
LDM
124CC_CHECK_FLAGS_APPEND(with_cflags, [CFLAGS], [\
125 -pipe \
126 -DANOTHER_BRICK_IN_THE \
127 -Wall \
128 -W \
129 -Wextra \
130 -Wno-inline \
131 -Wvla \
132 -Wundef \
133 -Wformat=2 \
134 -Wlogical-op \
135 -Wsign-compare \
136 -Wformat-security \
137 -Wmissing-include-dirs \
138 -Wformat-nonliteral \
139 -Wold-style-definition \
140 -Wpointer-arith \
141 -Winit-self \
142 -Wdeclaration-after-statement \
143 -Wfloat-equal \
144 -Wmissing-prototypes \
145 -Wstrict-prototypes \
146 -Wredundant-decls \
147 -Wmissing-declarations \
148 -Wmissing-noreturn \
149 -Wshadow \
150 -Wendif-labels \
151 -Wstrict-aliasing=2 \
152 -Wwrite-strings \
153 -Wno-long-long \
154 -Wno-overlength-strings \
155 -Wno-unused-parameter \
156 -Wno-missing-field-initializers \
157 -Wno-unused-result \
158 -Wnested-externs \
159 -Wchar-subscripts \
160 -Wtype-limits \
161 -Wuninitialized \
162 -fno-common \
163 -fdiagnostics-show-option \
164 -fvisibility=hidden \
165 -ffunction-sections \
166 -fdata-sections])
167AC_SUBST([WARNINGFLAGS], $with_cflags)
168
169
170CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [ \
171 -Wl,--as-needed \
172 -Wl,--gc-sections])
173AC_SUBST([GCLDFLAGS], $with_ldflags)
3ef7208e
LDM
174
175#####################################################################
176# Generate files from *.in
177#####################################################################
178
ecd40ee4
LDM
179AC_CONFIG_HEADERS(config.h)
180AC_CONFIG_FILES([
181 Makefile
904b57d0 182 man/Makefile
646b83b8
LDM
183 libkmod/docs/Makefile
184 libkmod/docs/version.xml
ecd40ee4
LDM
185])
186
3ef7208e
LDM
187
188#####################################################################
646b83b8 189
ecd40ee4
LDM
190AC_OUTPUT
191AC_MSG_RESULT([
192 $PACKAGE $VERSION
63dc8329 193 ======
ecd40ee4
LDM
194
195 prefix: ${prefix}
196 sysconfdir: ${sysconfdir}
197 libdir: ${libdir}
e79bf83b 198 rootlibdir: ${rootlibdir}
ecd40ee4 199 includedir: ${includedir}
7c41c2dd 200 bindir: ${bindir}
ecd40ee4
LDM
201
202 compiler: ${CC}
e48f3765
LDM
203 cflags: ${with_cflags} ${CFLAGS}
204 ldflags: ${with_ldflags} ${LDFLAGS}
ecd40ee4 205
7c41c2dd 206 tools: ${enable_tools}
ecd40ee4 207 logging: ${enable_logging}
b182f8fb 208 compression: xz=${with_xz} zlib=${with_zlib}
ecd40ee4 209 debug: ${enable_debug}
646b83b8 210 doc: ${enable_gtk_doc}
382de85c 211 man: ${enable_manpages}
ecd40ee4 212])