]>
Commit | Line | Data |
---|---|---|
9262a519 | 1 | |
47be870b LP |
2 | # This file is part of systemd. |
3 | # | |
3e214785 KS |
4 | # Copyright 2010-2012 Lennart Poettering |
5 | # Copyright 2010-2012 Kay Sievers | |
47be870b LP |
6 | # |
7 | # systemd is free software; you can redistribute it and/or modify it | |
5430f7f2 LP |
8 | # under the terms of the GNU Lesser General Public License as published by |
9 | # the Free Software Foundation; either version 2.1 of the License, or | |
47be870b LP |
10 | # (at your option) any later version. |
11 | # | |
12 | # systemd is distributed in the hope that it will be useful, but | |
13 | # WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
5430f7f2 | 15 | # Lesser General Public License for more details. |
47be870b | 16 | # |
5430f7f2 | 17 | # You should have received a copy of the GNU Lesser General Public License |
47be870b LP |
18 | # along with systemd; If not, see <http://www.gnu.org/licenses/>. |
19 | ||
4e949c11 JJ |
20 | AC_PREREQ([2.64]) |
21 | ||
22 | AC_INIT([systemd], | |
c4f1b862 | 23 | [187], |
4e949c11 JJ |
24 | [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd], |
25 | [systemd], | |
26 | [http://www.freedesktop.org/wiki/Software/systemd]) | |
47be870b | 27 | |
78a825f2 | 28 | AC_CONFIG_SRCDIR([src/core/main.c]) |
47be870b LP |
29 | AC_CONFIG_MACRO_DIR([m4]) |
30 | AC_CONFIG_HEADERS([config.h]) | |
a80db8bd JJ |
31 | AC_CONFIG_AUX_DIR([build-aux]) |
32 | ||
4db6d587 | 33 | AC_USE_SYSTEM_EXTENSIONS |
907dd195 | 34 | AC_SYS_LARGEFILE |
eb7bbee6 | 35 | AC_PREFIX_DEFAULT([/usr]) |
bbd9b8c2 | 36 | AM_INIT_AUTOMAKE([foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects check-news]) |
3e214785 | 37 | AM_SILENT_RULES([yes]) |
47be870b | 38 | AC_CANONICAL_HOST |
22be093f | 39 | AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.]) |
d59d0a2b | 40 | AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" || |
41 | test "x$host_cpu" = "xmips64" || test "x$host_cpu" = "xmips64el"], | |
42 | [AC_DEFINE(ARCH_MIPS, [], [Whether on mips arch])]) | |
47be870b | 43 | |
3e214785 KS |
44 | LT_PREREQ(2.2) |
45 | LT_INIT | |
47be870b | 46 | |
1c7dde3e BN |
47 | # i18n stuff for the PolicyKit policy files |
48 | IT_PROG_INTLTOOL([0.40.0]) | |
49 | ||
50 | GETTEXT_PACKAGE=systemd | |
51 | AC_SUBST(GETTEXT_PACKAGE) | |
52 | ||
e9da3678 LP |
53 | AC_PROG_MKDIR_P |
54 | AC_PROG_LN_S | |
55 | AC_PROG_SED | |
3ce4fad8 | 56 | AC_PROG_GREP |
f975e971 | 57 | AC_PROG_AWK |
e9da3678 | 58 | |
47be870b LP |
59 | AC_PROG_CC |
60 | AC_PROG_CC_C99 | |
61 | AM_PROG_CC_C_O | |
62 | AC_PROG_GCC_TRADITIONAL | |
47be870b | 63 | |
3e214785 | 64 | AC_PATH_PROG([M4], [m4]) |
92ec4495 | 65 | |
80a5cbac | 66 | # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line |
92ec4495 | 67 | m4_ifdef([GTK_DOC_CHECK], [ |
9e45e7d8 | 68 | GTK_DOC_CHECK([1.18],[--flavour no-tmpl]) |
6e92b23f | 69 | ], [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])]) |
92ec4495 | 70 | |
6e92b23f | 71 | m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [ |
0eaeca1f | 72 | GOBJECT_INTROSPECTION_CHECK([1.31.1]) |
6e92b23f | 73 | ], [AM_CONDITIONAL([HAVE_INTROSPECTION], [false])]) |
3e214785 | 74 | |
9a60da28 TR |
75 | AC_CHECK_TOOL(OBJCOPY, objcopy) |
76 | AC_CHECK_TOOL(STRINGS, strings) | |
f975e971 | 77 | AC_CHECK_TOOL(GPERF, gperf) |
b62cfcea MB |
78 | if test -z "$GPERF" ; then |
79 | AC_MSG_ERROR([*** gperf not found]) | |
80 | fi | |
9a60da28 | 81 | |
9c4fa6ed LP |
82 | # we use python only to build the man page index |
83 | AM_PATH_PYTHON(,, [:]) | |
84 | AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) | |
85 | ||
eb2e280f | 86 | CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ |
be1a67d9 | 87 | -pipe \ |
d1ab0ca0 LP |
88 | -Wall \ |
89 | -W \ | |
90 | -Wextra \ | |
27765dfc | 91 | -Wno-inline \ |
d1ab0ca0 LP |
92 | -Wundef \ |
93 | -Wformat=2 \ | |
94 | -Wlogical-op \ | |
95 | -Wsign-compare \ | |
96 | -Wformat-security \ | |
97 | -Wmissing-include-dirs \ | |
98 | -Wformat-nonliteral \ | |
99 | -Wold-style-definition \ | |
100 | -Wpointer-arith \ | |
101 | -Winit-self \ | |
102 | -Wdeclaration-after-statement \ | |
103 | -Wfloat-equal \ | |
104 | -Wmissing-prototypes \ | |
105 | -Wstrict-prototypes \ | |
106 | -Wredundant-decls \ | |
107 | -Wmissing-declarations \ | |
108 | -Wmissing-noreturn \ | |
109 | -Wshadow \ | |
110 | -Wendif-labels \ | |
111 | -Wcast-align \ | |
112 | -Wstrict-aliasing=2 \ | |
113 | -Wwrite-strings \ | |
be1a67d9 LP |
114 | -Wno-long-long \ |
115 | -Wno-overlength-strings \ | |
d1ab0ca0 | 116 | -Wno-unused-parameter \ |
be1a67d9 | 117 | -Wno-missing-field-initializers \ |
8745297f | 118 | -Wno-unused-result \ |
d200735e | 119 | -Werror=overflow \ |
d1ab0ca0 | 120 | -Wp,-D_FORTIFY_SOURCE=2 \ |
be1a67d9 | 121 | -ffast-math \ |
d1ab0ca0 LP |
122 | -fno-common \ |
123 | -fdiagnostics-show-option \ | |
9b85fc6a GSB |
124 | -fno-strict-aliasing \ |
125 | -fvisibility=hidden \ | |
126 | -ffunction-sections \ | |
9e7adc3a LDM |
127 | -fdata-sections]) |
128 | AC_SUBST([WARNINGFLAGS], $with_cflags) | |
129 | ||
130 | CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ | |
9b85fc6a GSB |
131 | -Wl,--as-needed \ |
132 | -Wl,--gc-sections]) | |
9e7adc3a | 133 | AC_SUBST([GCLDFLAGS], $with_ldflags) |
47be870b LP |
134 | |
135 | AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])]) | |
afea26ad | 136 | AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])]) |
85f19d82 MB |
137 | |
138 | save_LIBS="$LIBS" | |
139 | LIBS= | |
47be870b LP |
140 | AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])]) |
141 | AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers not found])]) | |
85f19d82 MB |
142 | CAP_LIBS="$LIBS" |
143 | LIBS="$save_LIBS" | |
144 | AC_SUBST(CAP_LIBS) | |
47be870b | 145 | |
b237ef2c | 146 | # This makes sure pkg.m4 is available. |
a9b5b032 | 147 | m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) |
d1ab0ca0 | 148 | |
3e214785 KS |
149 | PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2]) |
150 | PKG_CHECK_MODULES(KMOD, [libkmod >= 5]) | |
151 | PKG_CHECK_MODULES(BLKID,[blkid >= 2.20]) | |
728beb28 | 152 | |
3e214785 | 153 | # ------------------------------------------------------------------------------ |
81611586 RS |
154 | have_ima=yes |
155 | AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]), | |
156 | [case "${enableval}" in | |
157 | yes) have_ima=yes ;; | |
158 | no) have_ima=no ;; | |
159 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-ima) ;; | |
160 | esac], | |
161 | [have_ima=yes]) | |
162 | ||
163 | if test "x${have_ima}" != xno ; then | |
164 | AC_DEFINE(HAVE_IMA, 1, [Define if IMA is available]) | |
165 | fi | |
166 | ||
3e214785 | 167 | # ------------------------------------------------------------------------------ |
591622d7 LP |
168 | have_selinux=no |
169 | AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support])) | |
170 | if test "x$enable_selinux" != "xno"; then | |
171 | PKG_CHECK_MODULES(SELINUX, [ libselinux ], | |
172 | [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no) | |
591622d7 LP |
173 | if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then |
174 | AC_MSG_ERROR([*** SELinux support requested but libraries not found]) | |
175 | fi | |
56cf987f | 176 | fi |
591622d7 | 177 | AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"]) |
ed061a8d MS |
178 | if test "x${have_selinux}" != xno ; then |
179 | sushell=/sbin/sushell | |
180 | else | |
181 | sushell=/bin/bash | |
182 | fi | |
183 | AC_SUBST(sushell) | |
56cf987f | 184 | |
3e214785 | 185 | # ------------------------------------------------------------------------------ |
807e17f0 LP |
186 | have_xz=no |
187 | AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support])) | |
188 | if test "x$enable_xz" != "xno"; then | |
189 | PKG_CHECK_MODULES(XZ, [ liblzma ], | |
190 | [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no) | |
807e17f0 LP |
191 | if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then |
192 | AC_MSG_ERROR([*** Xz support requested but libraries not found]) | |
193 | fi | |
194 | fi | |
195 | AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"]) | |
196 | ||
3e214785 | 197 | # ------------------------------------------------------------------------------ |
0213c3f8 LP |
198 | AC_ARG_ENABLE([tcpwrap], |
199 | AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]), | |
200 | [case "${enableval}" in | |
5b6319dc LP |
201 | yes) have_tcpwrap=yes ;; |
202 | no) have_tcpwrap=no ;; | |
0213c3f8 LP |
203 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;; |
204 | esac], | |
5b6319dc | 205 | [have_tcpwrap=auto]) |
0213c3f8 | 206 | |
5b6319dc | 207 | if test "x${have_tcpwrap}" != xno ; then |
0213c3f8 LP |
208 | ACX_LIBWRAP |
209 | if test "x${LIBWRAP_LIBS}" = x ; then | |
5b6319dc LP |
210 | if test "x$have_tcpwrap" = xyes ; then |
211 | AC_MSG_ERROR([*** TCP wrappers support not found.]) | |
0213c3f8 | 212 | fi |
812cce32 | 213 | have_tcpwrap=no |
0213c3f8 | 214 | else |
5b6319dc | 215 | have_tcpwrap=yes |
0213c3f8 LP |
216 | fi |
217 | else | |
5b6319dc | 218 | LIBWRAP_LIBS= |
0213c3f8 | 219 | fi |
0213c3f8 LP |
220 | AC_SUBST(LIBWRAP_LIBS) |
221 | ||
3e214785 | 222 | # ------------------------------------------------------------------------------ |
5b6319dc LP |
223 | AC_ARG_ENABLE([pam], |
224 | AS_HELP_STRING([--disable-pam],[Disable optional PAM support]), | |
225 | [case "${enableval}" in | |
226 | yes) have_pam=yes ;; | |
227 | no) have_pam=no ;; | |
228 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-pam) ;; | |
229 | esac], | |
230 | [have_pam=auto]) | |
231 | ||
232 | if test "x${have_pam}" != xno ; then | |
233 | AC_CHECK_HEADERS( | |
234 | [security/pam_modules.h security/pam_modutil.h security/pam_ext.h], | |
235 | [have_pam=yes], | |
236 | [if test "x$have_pam" = xyes ; then | |
237 | AC_MSG_ERROR([*** PAM headers not found.]) | |
238 | fi]) | |
239 | ||
240 | AC_CHECK_LIB( | |
241 | [pam], | |
242 | [pam_syslog], | |
243 | [have_pam=yes], | |
244 | [if test "x$have_pam" = xyes ; then | |
245 | AC_MSG_ERROR([*** libpam not found.]) | |
246 | fi]) | |
247 | ||
248 | if test "x$have_pam" = xyes ; then | |
249 | PAM_LIBS="-lpam -lpam_misc" | |
250 | AC_DEFINE(HAVE_PAM, 1, [PAM available]) | |
812cce32 LP |
251 | else |
252 | have_pam=no | |
5b6319dc LP |
253 | fi |
254 | else | |
255 | PAM_LIBS= | |
256 | fi | |
257 | AC_SUBST(PAM_LIBS) | |
258 | AM_CONDITIONAL([HAVE_PAM], [test "x$have_pam" != xno]) | |
259 | ||
3e214785 | 260 | # ------------------------------------------------------------------------------ |
5eda94dd LP |
261 | AC_ARG_ENABLE([acl], |
262 | AS_HELP_STRING([--disable-acl],[Disable optional ACL support]), | |
263 | [case "${enableval}" in | |
264 | yes) have_acl=yes ;; | |
265 | no) have_acl=no ;; | |
266 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-acl) ;; | |
267 | esac], | |
268 | [have_acl=auto]) | |
269 | ||
270 | if test "x${have_acl}" != xno ; then | |
271 | AC_CHECK_HEADERS( | |
272 | [sys/acl.h acl/libacl.h], | |
273 | [have_acl=yes], | |
274 | [if test "x$have_acl" = xyes ; then | |
275 | AC_MSG_ERROR([*** ACL headers not found.]) | |
276 | fi]) | |
277 | ||
278 | AC_CHECK_LIB( | |
279 | [acl], | |
280 | [acl_get_file], | |
281 | [have_acl=yes], | |
282 | [if test "x$have_acl" = xyes ; then | |
283 | AC_MSG_ERROR([*** libacl not found.]) | |
284 | fi]) | |
285 | ||
286 | if test "x$have_acl" = xyes ; then | |
287 | ACL_LIBS="-lacl" | |
288 | AC_DEFINE(HAVE_ACL, 1, [ACL available]) | |
289 | else | |
290 | have_acl=no | |
291 | fi | |
292 | else | |
293 | ACL_LIBS= | |
294 | fi | |
295 | AC_SUBST(ACL_LIBS) | |
296 | AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno]) | |
297 | ||
3e214785 | 298 | # ------------------------------------------------------------------------------ |
4927fcae LP |
299 | AC_ARG_ENABLE([audit], |
300 | AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]), | |
301 | [case "${enableval}" in | |
302 | yes) have_audit=yes ;; | |
303 | no) have_audit=no ;; | |
304 | *) AC_MSG_ERROR(bad value ${enableval} for --disable-audit) ;; | |
305 | esac], | |
306 | [have_audit=auto]) | |
307 | ||
308 | if test "x${have_audit}" != xno ; then | |
309 | AC_CHECK_HEADERS( | |
310 | [libaudit.h], | |
311 | [have_audit=yes], | |
312 | [if test "x$have_audit" = xyes ; then | |
313 | AC_MSG_ERROR([*** AUDIT headers not found.]) | |
314 | fi]) | |
315 | ||
316 | AC_CHECK_LIB( | |
317 | [audit], | |
318 | [audit_open], | |
319 | [have_audit=yes], | |
320 | [if test "x$have_audit" = xyes ; then | |
321 | AC_MSG_ERROR([*** libaudit not found.]) | |
322 | fi]) | |
323 | ||
324 | if test "x$have_audit" = xyes ; then | |
325 | AUDIT_LIBS="-laudit" | |
326 | AC_DEFINE(HAVE_AUDIT, 1, [AUDIT available]) | |
327 | else | |
328 | have_audit=no | |
329 | fi | |
330 | else | |
331 | AUDIT_LIBS= | |
332 | fi | |
333 | AC_SUBST(AUDIT_LIBS) | |
334 | ||
3e214785 | 335 | # ------------------------------------------------------------------------------ |
7f4e0805 LP |
336 | have_libcryptsetup=no |
337 | AC_ARG_ENABLE(libcryptsetup, AS_HELP_STRING([--disable-libcryptsetup], [disable libcryptsetup tools])) | |
338 | if test "x$enable_libcryptsetup" != "xno"; then | |
880a599e | 339 | PKG_CHECK_MODULES(LIBCRYPTSETUP, [ libcryptsetup >= 1.4.2 ], |
7f4e0805 | 340 | [AC_DEFINE(HAVE_LIBCRYPTSETUP, 1, [Define if libcryptsetup is available]) have_libcryptsetup=yes], have_libcryptsetup=no) |
7f4e0805 | 341 | if test "x$have_libcryptsetup" = xno -a "x$enable_libcryptsetup" = xyes; then |
591622d7 | 342 | AC_MSG_ERROR([*** libcryptsetup support requested but libraries not found]) |
7f4e0805 LP |
343 | fi |
344 | fi | |
345 | AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"]) | |
346 | ||
3e214785 | 347 | # ------------------------------------------------------------------------------ |
27669061 MV |
348 | have_binfmt=no |
349 | AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool])) | |
350 | if test "x$enable_binfmt" != "xno"; then | |
be31376e | 351 | have_binfmt=yes |
27669061 MV |
352 | fi |
353 | AM_CONDITIONAL(ENABLE_BINFMT, [test "$have_binfmt" = "yes"]) | |
354 | ||
3e214785 | 355 | # ------------------------------------------------------------------------------ |
e5e83e83 LP |
356 | have_vconsole=no |
357 | AC_ARG_ENABLE(vconsole, AS_HELP_STRING([--disable-vconsole], [disable vconsole tool])) | |
358 | if test "x$enable_vconsole" != "xno"; then | |
be31376e | 359 | have_vconsole=yes |
e5e83e83 LP |
360 | fi |
361 | AM_CONDITIONAL(ENABLE_VCONSOLE, [test "$have_vconsole" = "yes"]) | |
362 | ||
3e214785 | 363 | # ------------------------------------------------------------------------------ |
e5e83e83 LP |
364 | have_readahead=no |
365 | AC_ARG_ENABLE(readahead, AS_HELP_STRING([--disable-readahead], [disable readahead tools])) | |
366 | if test "x$enable_readahead" != "xno"; then | |
be31376e | 367 | have_readahead=yes |
e5e83e83 LP |
368 | fi |
369 | AM_CONDITIONAL(ENABLE_READAHEAD, [test "$have_readahead" = "yes"]) | |
370 | ||
3e214785 | 371 | # ------------------------------------------------------------------------------ |
4de85612 LP |
372 | have_quotacheck=no |
373 | AC_ARG_ENABLE(quotacheck, AS_HELP_STRING([--disable-quotacheck], [disable quotacheck tools])) | |
374 | if test "x$enable_quotacheck" != "xno"; then | |
be31376e | 375 | have_quotacheck=yes |
4de85612 LP |
376 | fi |
377 | AM_CONDITIONAL(ENABLE_QUOTACHECK, [test "$have_quotacheck" = "yes"]) | |
378 | ||
3e214785 | 379 | # ------------------------------------------------------------------------------ |
4de85612 LP |
380 | have_randomseed=no |
381 | AC_ARG_ENABLE(randomseed, AS_HELP_STRING([--disable-randomseed], [disable randomseed tools])) | |
382 | if test "x$enable_randomseed" != "xno"; then | |
be31376e | 383 | have_randomseed=yes |
4de85612 LP |
384 | fi |
385 | AM_CONDITIONAL(ENABLE_RANDOMSEED, [test "$have_randomseed" = "yes"]) | |
386 | ||
3e214785 | 387 | # ------------------------------------------------------------------------------ |
2a018e83 KS |
388 | have_logind=no |
389 | AC_ARG_ENABLE(logind, AS_HELP_STRING([--disable-logind], [disable login daemon])) | |
390 | if test "x$enable_logind" != "xno"; then | |
be31376e | 391 | have_logind=yes |
2a018e83 KS |
392 | fi |
393 | AM_CONDITIONAL(ENABLE_LOGIND, [test "$have_logind" = "yes"]) | |
4c80c73c | 394 | AS_IF([test "$have_logind" = "yes"], [ AC_DEFINE(HAVE_LOGIND, [1], [Logind support available]) ]) |
2a018e83 | 395 | |
3e214785 | 396 | # ------------------------------------------------------------------------------ |
b2e9fb99 MV |
397 | have_hostnamed=no |
398 | AC_ARG_ENABLE(hostnamed, AS_HELP_STRING([--disable-hostnamed], [disable hostname daemon])) | |
399 | if test "x$enable_hostnamed" != "xno"; then | |
be31376e | 400 | have_hostnamed=yes |
b2e9fb99 MV |
401 | fi |
402 | AM_CONDITIONAL(ENABLE_HOSTNAMED, [test "$have_hostnamed" = "yes"]) | |
403 | ||
3e214785 | 404 | # ------------------------------------------------------------------------------ |
f47cd184 MV |
405 | have_timedated=no |
406 | AC_ARG_ENABLE(timedated, AS_HELP_STRING([--disable-timedated], [disable timedate daemon])) | |
407 | if test "x$enable_timedated" != "xno"; then | |
be31376e | 408 | have_timedated=yes |
f47cd184 MV |
409 | fi |
410 | AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"]) | |
411 | ||
3e214785 | 412 | # ------------------------------------------------------------------------------ |
4cd1eaa5 MV |
413 | have_localed=no |
414 | AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon])) | |
415 | if test "x$enable_localed" != "xno"; then | |
be31376e | 416 | have_localed=yes |
4cd1eaa5 MV |
417 | fi |
418 | AM_CONDITIONAL(ENABLE_LOCALED, [test "$have_localed" = "yes"]) | |
419 | ||
3e214785 | 420 | # ------------------------------------------------------------------------------ |
f5e04665 LP |
421 | have_coredump=no |
422 | AC_ARG_ENABLE(coredump, AS_HELP_STRING([--disable-coredump], [disable coredump hook])) | |
423 | if test "x$enable_coredump" != "xno"; then | |
be31376e | 424 | have_coredump=yes |
f5e04665 LP |
425 | fi |
426 | AM_CONDITIONAL(ENABLE_COREDUMP, [test "$have_coredump" = "yes"]) | |
427 | ||
3e214785 | 428 | # ------------------------------------------------------------------------------ |
3e214785 | 429 | AC_ARG_WITH(usb-ids-path, |
9a203aff KS |
430 | [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])], |
431 | [USB_DATABASE=${withval}], | |
432 | [if test -n "$usbids" ; then | |
433 | USB_DATABASE="$usbids" | |
434 | else | |
435 | PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82) | |
436 | AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)]) | |
437 | fi]) | |
3e214785 KS |
438 | AC_MSG_CHECKING([for USB database location]) |
439 | AC_MSG_RESULT([$USB_DATABASE]) | |
440 | AC_SUBST(USB_DATABASE) | |
441 | ||
442 | AC_ARG_WITH(pci-ids-path, | |
9a203aff KS |
443 | [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])], |
444 | [PCI_DATABASE=${withval}], | |
445 | [if test -n "$pciids" ; then | |
446 | PCI_DATABASE="$pciids" | |
447 | else | |
448 | PKG_CHECK_MODULES(LIBPCI, libpci >= 3) | |
449 | AC_SUBST([PCI_DATABASE], [$($PKG_CONFIG --variable=idsdir libpci)/pci.ids]) | |
450 | fi]) | |
3e214785 KS |
451 | AC_MSG_CHECKING([for PCI database location]) |
452 | AC_MSG_RESULT([$PCI_DATABASE]) | |
453 | AC_SUBST(PCI_DATABASE) | |
454 | ||
455 | # ------------------------------------------------------------------------------ | |
456 | AC_ARG_WITH(firmware-path, | |
457 | AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], | |
458 | [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]), | |
459 | [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"]) | |
460 | OLD_IFS=$IFS | |
461 | IFS=: | |
462 | for i in $with_firmware_path; do | |
463 | if test "x${FIRMWARE_PATH}" = "x"; then | |
464 | FIRMWARE_PATH="\\\"${i}/\\\"" | |
465 | else | |
466 | FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" | |
467 | fi | |
468 | done | |
469 | IFS=$OLD_IFS | |
470 | AC_SUBST([FIRMWARE_PATH], [$FIRMWARE_PATH]) | |
471 | ||
472 | # ------------------------------------------------------------------------------ | |
473 | AC_ARG_ENABLE([gudev], | |
474 | AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]), | |
475 | [], [enable_gudev=yes]) | |
476 | AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ]) | |
3e214785 KS |
477 | AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"]) |
478 | ||
479 | # ------------------------------------------------------------------------------ | |
480 | AC_ARG_ENABLE([keymap], | |
481 | AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]), | |
482 | [], [enable_keymap=yes]) | |
483 | AS_IF([test "x$enable_keymap" = "xyes"], [ | |
484 | AC_PATH_PROG([GPERF], [gperf]) | |
485 | if test -z "$GPERF"; then | |
486 | AC_MSG_ERROR([gperf is needed]) | |
487 | fi | |
488 | ||
489 | AC_CHECK_HEADER([linux/input.h], [:], AC_MSG_ERROR([kernel headers not found])) | |
490 | AC_SUBST([INCLUDE_PREFIX], [$(echo '#include <linux/input.h>' | eval $ac_cpp -E - | sed -n '/linux\/input.h/ {s:.*"\(.*\)/linux/input.h".*:\1:; p; q}')]) | |
491 | ]) | |
492 | AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"]) | |
493 | ||
494 | # ------------------------------------------------------------------------------ | |
75db9a77 | 495 | have_manpages=no |
4c2b0e4e | 496 | AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages])) |
75db9a77 | 497 | if test "x$enable_manpages" != "xno"; then |
be31376e | 498 | have_manpages=yes |
75db9a77 LP |
499 | fi |
500 | AM_CONDITIONAL(ENABLE_MANPAGES, [test "$have_manpages" = "yes"]) | |
501 | ||
3e214785 | 502 | # ------------------------------------------------------------------------------ |
d1ab0ca0 LP |
503 | AC_PATH_PROG([XSLTPROC], [xsltproc]) |
504 | AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x) | |
505 | ||
8401e9f9 | 506 | AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other])) |
0571e011 LP |
507 | if test "z$with_distro" = "z"; then |
508 | if test "$cross_compiling" = yes; then | |
509 | AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)]) | |
510 | else | |
c87f7103 | 511 | with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//'); |
0571e011 LP |
512 | fi |
513 | if test "z$with_distro" = "z"; then | |
3ce4fad8 | 514 | with_distro=other |
0571e011 LP |
515 | fi |
516 | fi | |
517 | with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' ` | |
7d568925 | 518 | AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution]) |
0571e011 | 519 | |
34eff652 LP |
520 | # Location of the init scripts as mandated by LSB |
521 | SYSTEM_SYSVINIT_PATH=/etc/init.d | |
f1dd0c3f | 522 | SYSTEM_SYSVRCND_PATH=/etc/rc.d |
34eff652 | 523 | |
f975e971 | 524 | M4_DEFINES= |
12e84679 | 525 | |
0571e011 LP |
526 | case $with_distro in |
527 | fedora) | |
528 | SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d | |
2c696a96 | 529 | AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL]) |
f975e971 | 530 | M4_DEFINES=-DTARGET_FEDORA=1 |
0571e011 | 531 | ;; |
3ce4fad8 | 532 | opensuse|suse) |
0571e011 | 533 | SYSTEM_SYSVRCND_PATH=/etc/init.d |
634826b5 | 534 | AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE]) |
f975e971 | 535 | M4_DEFINES=-DTARGET_SUSE=1 |
0571e011 LP |
536 | ;; |
537 | debian) | |
0571e011 | 538 | SYSTEM_SYSVRCND_PATH=/etc |
858dae18 | 539 | AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian]) |
f975e971 | 540 | M4_DEFINES=-DTARGET_DEBIAN=1 |
0571e011 | 541 | ;; |
858dae18 AE |
542 | ubuntu) |
543 | SYSTEM_SYSVRCND_PATH=/etc | |
858dae18 | 544 | AC_DEFINE(TARGET_UBUNTU, [], [Target is Ubuntu]) |
f975e971 | 545 | M4_DEFINES=-DTARGET_UBUNTU=1 |
858dae18 | 546 | ;; |
d7c114c0 | 547 | arch) |
4bf43a32 TG |
548 | SYSTEM_SYSVINIT_PATH= |
549 | SYSTEM_SYSVRCND_PATH= | |
d7c114c0 | 550 | AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux]) |
f975e971 | 551 | M4_DEFINES=-DTARGET_ARCH=1 |
d7c114c0 | 552 | ;; |
f2b4af1c | 553 | gentoo) |
07459bb6 FF |
554 | SYSTEM_SYSVINIT_PATH= |
555 | SYSTEM_SYSVRCND_PATH= | |
f2b4af1c | 556 | AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo]) |
f975e971 | 557 | M4_DEFINES=-DTARGET_GENTOO=1 |
f2b4af1c | 558 | ;; |
65c8976a MS |
559 | slackware) |
560 | SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d | |
65c8976a | 561 | AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware]) |
f975e971 | 562 | M4_DEFINES=-DTARGET_SLACKWARE=1 |
65c8976a | 563 | ;; |
f5c88ec1 MV |
564 | frugalware) |
565 | SYSTEM_SYSVINIT_PATH=/etc/rc.d | |
f5c88ec1 | 566 | AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware]) |
f975e971 | 567 | M4_DEFINES=-DTARGET_FRUGALWARE=1 |
f5c88ec1 | 568 | ;; |
a338bab5 AS |
569 | altlinux) |
570 | SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d | |
a338bab5 | 571 | AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux]) |
f975e971 | 572 | M4_DEFINES=-DTARGET_ALTLINUX=1 |
a338bab5 | 573 | ;; |
1de4d79b AB |
574 | mandriva) |
575 | SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d | |
1de4d79b | 576 | AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva]) |
f975e971 | 577 | M4_DEFINES=-DTARGET_MANDRIVA=1 |
1de4d79b | 578 | ;; |
1bd8b818 KK |
579 | angstrom) |
580 | SYSTEM_SYSVRCND_PATH=/etc | |
581 | AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström]) | |
f975e971 | 582 | M4_DEFINES=-DTARGET_ANGSTROM=1 |
1bd8b818 | 583 | ;; |
6fdae8a6 DM |
584 | mageia) |
585 | SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d | |
586 | AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia]) | |
fbf5b126 | 587 | M4_DEFINES=-DTARGET_MAGEIA=1 |
6fdae8a6 | 588 | ;; |
bf024b02 | 589 | other) |
0571e011 LP |
590 | ;; |
591 | *) | |
bf024b02 | 592 | AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, SysV init scripts could not be found! (patches welcome); you can specify --with-distro=other to skip this check]) |
0571e011 LP |
593 | ;; |
594 | esac | |
595 | ||
136337ff | 596 | AC_ARG_WITH([sysvinit-path], |
be31376e KS |
597 | [AS_HELP_STRING([--with-sysvinit-path=PATH], |
598 | [Specify the path to where the SysV init scripts are located @<:@default=based on distro@:>@])], | |
599 | [SYSTEM_SYSVINIT_PATH="$withval"], | |
600 | []) | |
136337ff TFH |
601 | |
602 | AC_ARG_WITH([sysvrcd-path], | |
603 | [AS_HELP_STRING([--with-sysvrcd-path=PATH], | |
604 | [Specify the path to the base directory for the SysV rcN.d directories @<:@default=based on distro@:>@])], | |
605 | [SYSTEM_SYSVRCND_PATH="$withval"], | |
606 | []) | |
607 | ||
0571e011 | 608 | AC_SUBST(SYSTEM_SYSVINIT_PATH) |
d64b723a | 609 | AC_SUBST(SYSTEM_SYSVRCND_PATH) |
f975e971 | 610 | AC_SUBST(M4_DEFINES) |
0571e011 | 611 | |
07459bb6 FF |
612 | if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then |
613 | AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.]) | |
614 | SYSTEM_SYSV_COMPAT="yes" | |
f975e971 | 615 | M4_DEFINES="$M4_DEFINES -DHAVE_SYSV_COMPAT" |
07459bb6 FF |
616 | elif test "x${SYSTEM_SYSVINIT_PATH}" != "x" -o "x${SYSTEM_SYSVRCND_PATH}" != "x"; then |
617 | AC_MSG_ERROR([*** You need both --with-sysvinit-path=PATH and --with-sysvrcd-path=PATH to enable SysV compatibility support, or both empty to disable it.]) | |
618 | else | |
619 | SYSTEM_SYSV_COMPAT="no" | |
620 | fi | |
621 | ||
bef2733f | 622 | AC_ARG_WITH([tty-gid], |
a05ea46d | 623 | [AS_HELP_STRING([--with-tty-gid=GID], |
bef2733f LP |
624 | [Specify the numeric GID of the 'tty' group])], |
625 | [AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])], | |
626 | []) | |
627 | ||
0571e011 LP |
628 | AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora) |
629 | AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse) | |
630 | AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian) | |
858dae18 AE |
631 | AM_CONDITIONAL(TARGET_UBUNTU, test x"$with_distro" = xubuntu) |
632 | AM_CONDITIONAL(TARGET_DEBIAN_OR_UBUNTU, test x"$with_distro" = xdebian -o x"$with_distro" = xubuntu) | |
d7c114c0 | 633 | AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch) |
f2b4af1c | 634 | AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo) |
65c8976a | 635 | AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware) |
f5c88ec1 | 636 | AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware) |
a338bab5 | 637 | AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux) |
1de4d79b | 638 | AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva) |
1bd8b818 | 639 | AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom) |
6fdae8a6 | 640 | AM_CONDITIONAL(TARGET_MAGEIA, test x"$with_distro" = xmageia) |
0571e011 | 641 | |
cca4aeee | 642 | AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes") |
cd3f8b7d | 643 | |
d2d12cd1 LP |
644 | AC_ARG_WITH([dbuspolicydir], |
645 | AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]), | |
646 | [], | |
647 | [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d]) | |
d122948d | 648 | |
d2d12cd1 LP |
649 | AC_ARG_WITH([dbussessionservicedir], |
650 | AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]), | |
651 | [], | |
652 | [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`]) | |
d122948d | 653 | |
d2d12cd1 LP |
654 | AC_ARG_WITH([dbussystemservicedir], |
655 | AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]), | |
656 | [], | |
657 | [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services]) | |
d122948d | 658 | |
d2d12cd1 LP |
659 | AC_ARG_WITH([dbusinterfacedir], |
660 | AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]), | |
661 | [], | |
662 | [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces]) | |
d122948d | 663 | |
b8079ae1 KS |
664 | AC_ARG_WITH([rootprefix], |
665 | AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]), | |
39ad55a9 | 666 | [], [with_rootprefix=${ac_default_prefix}]) |
d2d12cd1 | 667 | |
ae446765 KS |
668 | AC_ARG_WITH([rootlibdir], |
669 | AS_HELP_STRING([--with-rootlibdir=DIR], [Root directory for libraries necessary for boot]), | |
670 | [], | |
671 | [with_rootlibdir=${libdir}]) | |
672 | ||
9d3203b4 | 673 | AC_ARG_WITH([pamlibdir], |
b0cca7d8 | 674 | AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]), |
9d3203b4 KS |
675 | [], |
676 | [with_pamlibdir=${with_rootlibdir}/security]) | |
677 | ||
bc9bdbba MG |
678 | AC_ARG_ENABLE([split-usr], |
679 | AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]), | |
680 | [], | |
681 | [AS_IF([test "x${ac_default_prefix}" != "x${with_rootprefix}"], [ | |
682 | enable_split_usr=yes | |
683 | ], [ | |
684 | enable_split_usr=no | |
685 | ])]) | |
686 | ||
687 | AS_IF([test "x${enable_split_usr}" = "xyes"], [ | |
2c6db6fb | 688 | AC_DEFINE(HAVE_SPLIT_USR, 1, [Define if /bin, /sbin aren't symlinks into /usr]) |
bc9bdbba | 689 | ]) |
2c6db6fb | 690 | |
d2d12cd1 LP |
691 | AC_SUBST([dbuspolicydir], [$with_dbuspolicydir]) |
692 | AC_SUBST([dbussessionservicedir], [$with_dbussessionservicedir]) | |
693 | AC_SUBST([dbussystemservicedir], [$with_dbussystemservicedir]) | |
694 | AC_SUBST([dbusinterfacedir], [$with_dbusinterfacedir]) | |
8c6db833 | 695 | AC_SUBST([pamlibdir], [$with_pamlibdir]) |
b8079ae1 | 696 | AC_SUBST([rootprefix], [$with_rootprefix]) |
ae446765 | 697 | AC_SUBST([rootlibdir], [$with_rootlibdir]) |
8c4a3079 | 698 | |
3e214785 KS |
699 | AC_CONFIG_FILES([ |
700 | Makefile po/Makefile.in | |
bb061708 KS |
701 | docs/libudev/Makefile |
702 | docs/libudev/version.xml | |
703 | docs/gudev/Makefile | |
704 | docs/gudev/version.xml | |
3e214785 KS |
705 | ]) |
706 | ||
a45a909f | 707 | AC_OUTPUT |
ae446765 | 708 | AC_MSG_RESULT([ |
0571e011 LP |
709 | $PACKAGE_NAME $VERSION |
710 | ||
2c696a96 | 711 | Distribution: ${with_distro} |
07459bb6 | 712 | SysV compatibility: ${SYSTEM_SYSV_COMPAT} |
0571e011 LP |
713 | SysV init scripts: ${SYSTEM_SYSVINIT_PATH} |
714 | SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH} | |
7f4e0805 | 715 | libcryptsetup: ${have_libcryptsetup} |
5b6319dc LP |
716 | tcpwrap: ${have_tcpwrap} |
717 | PAM: ${have_pam} | |
12716238 | 718 | AUDIT: ${have_audit} |
81611586 | 719 | IMA: ${have_ima} |
12716238 | 720 | SELinux: ${have_selinux} |
807e17f0 | 721 | XZ: ${have_xz} |
5eda94dd | 722 | ACL: ${have_acl} |
27669061 | 723 | binfmt: ${have_binfmt} |
e5e83e83 LP |
724 | vconsole: ${have_vconsole} |
725 | readahead: ${have_readahead} | |
4de85612 LP |
726 | quotacheck: ${have_quotacheck} |
727 | randomseed: ${have_randomseed} | |
2a018e83 | 728 | logind: ${have_logind} |
b2e9fb99 | 729 | hostnamed: ${have_hostnamed} |
f47cd184 | 730 | timedated: ${have_timedated} |
4cd1eaa5 | 731 | localed: ${have_localed} |
f5e04665 | 732 | coredump: ${have_coredump} |
3e214785 KS |
733 | firmware path: ${FIRMWARE_PATH} |
734 | usb.ids: ${USB_DATABASE} | |
735 | pci.ids: ${PCI_DATABASE} | |
736 | gudev: ${enable_gudev} | |
737 | gintrospection: ${enable_introspection} | |
738 | keymap: ${enable_keymap} | |
739 | ||
8c4a3079 | 740 | prefix: ${prefix} |
b8079ae1 | 741 | rootprefix: ${with_rootprefix} |
3e214785 KS |
742 | sysconf dir: ${sysconfdir} |
743 | datarootdir: ${datarootdir} | |
744 | includedir: ${includedir} | |
745 | include_prefix: ${INCLUDE_PREFIX} | |
ae446765 KS |
746 | lib dir: ${libdir} |
747 | rootlib dir: ${with_rootlibdir} | |
2c6db6fb | 748 | PAM modules dir: ${with_pamlibdir} |
2c6db6fb LP |
749 | D-Bus policy dir: ${with_dbuspolicydir} |
750 | D-Bus session dir: ${with_dbussessionservicedir} | |
751 | D-Bus system dir: ${with_dbussystemservicedir} | |
752 | D-Bus interfaces dir: ${with_dbusinterfacedir} | |
bc9bdbba | 753 | Split /usr: ${enable_split_usr} |
5ee9f21e | 754 | man pages: ${have_manpages} |
66be6554 KS |
755 | |
756 | CFLAGS: ${CFLAGS} | |
757 | CPPLAGS: ${CPPFLAGS} | |
758 | LDFLAGS: ${LDFLAGS} | |
ae446765 | 759 | ]) |