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