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