]>
Commit | Line | Data |
---|---|---|
1 | ############################################################################### | |
2 | ## Copyright (C) 2000-2004 Sistina Software, Inc. All rights reserved. | |
3 | ## Copyright (C) 2004-2012 Red Hat, Inc. All rights reserved. | |
4 | ## | |
5 | ## This copyrighted material is made available to anyone wishing to use, | |
6 | ## modify, copy, or redistribute it subject to the terms and conditions | |
7 | ## of the GNU General Public License v.2. | |
8 | ## | |
9 | ## You should have received a copy of the GNU General Public License | |
10 | ## along with this program; if not, write to the Free Software Foundation, | |
11 | ## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
12 | ################################################################################ | |
13 | ||
14 | AC_PREREQ(2.61) | |
15 | ################################################################################ | |
16 | dnl -- Process this file with autoconf to produce a configure script. | |
17 | AC_INIT | |
18 | AC_CONFIG_SRCDIR([lib/device/dev-cache.h]) | |
19 | AC_CONFIG_HEADERS([lib/misc/configure.h]) | |
20 | ||
21 | ################################################################################ | |
22 | dnl -- Setup the directory where autoconf has auxilary files | |
23 | AC_CONFIG_AUX_DIR(autoconf) | |
24 | ||
25 | ################################################################################ | |
26 | dnl -- Get system type | |
27 | AC_CANONICAL_TARGET([]) | |
28 | ||
29 | case "$host_os" in | |
30 | linux*) | |
31 | CFLAGS="$CFLAGS" | |
32 | COPTIMISE_FLAG="-O2" | |
33 | CLDFLAGS="$CLDFLAGS -Wl,--version-script,.export.sym" | |
34 | ELDFLAGS="-Wl,--export-dynamic" | |
35 | # FIXME Generate list and use --dynamic-list=.dlopen.sym | |
36 | CLDWHOLEARCHIVE="-Wl,-whole-archive" | |
37 | CLDNOWHOLEARCHIVE="-Wl,-no-whole-archive" | |
38 | LDDEPS="$LDDEPS .export.sym" | |
39 | LIB_SUFFIX=so | |
40 | DEVMAPPER=yes | |
41 | LVMETAD=no | |
42 | ODIRECT=yes | |
43 | DM_IOCTLS=yes | |
44 | SELINUX=yes | |
45 | CLUSTER=internal | |
46 | FSADM=yes | |
47 | ;; | |
48 | darwin*) | |
49 | CFLAGS="$CFLAGS -no-cpp-precomp -fno-common" | |
50 | COPTIMISE_FLAG="-O2" | |
51 | CLDFLAGS="$CLDFLAGS" | |
52 | ELDFLAGS= | |
53 | CLDWHOLEARCHIVE="-all_load" | |
54 | CLDNOWHOLEARCHIVE= | |
55 | LIB_SUFFIX=dylib | |
56 | DEVMAPPER=yes | |
57 | ODIRECT=no | |
58 | DM_IOCTLS=no | |
59 | SELINUX=no | |
60 | CLUSTER=none | |
61 | FSADM=no | |
62 | ;; | |
63 | esac | |
64 | ||
65 | ################################################################################ | |
66 | dnl -- Checks for programs. | |
67 | AC_PROG_SED | |
68 | AC_PROG_AWK | |
69 | AC_PROG_CC | |
70 | ||
71 | dnl probably no longer needed in 2008, but... | |
72 | AC_PROG_GCC_TRADITIONAL | |
73 | AC_PROG_INSTALL | |
74 | AC_PROG_LN_S | |
75 | AC_PROG_MAKE_SET | |
76 | AC_PROG_MKDIR_P | |
77 | AC_PROG_RANLIB | |
78 | AC_PATH_PROG(CFLOW_CMD, cflow) | |
79 | AC_PATH_PROG(CSCOPE_CMD, cscope) | |
80 | ||
81 | ################################################################################ | |
82 | dnl -- Check for header files. | |
83 | AC_HEADER_DIRENT | |
84 | AC_HEADER_MAJOR | |
85 | AC_HEADER_STDC | |
86 | AC_HEADER_SYS_WAIT | |
87 | AC_HEADER_TIME | |
88 | ||
89 | AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \ | |
90 | langinfo.h libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h \ | |
91 | sys/wait.h time.h], , | |
92 | [AC_MSG_ERROR(bailing out)]) | |
93 | ||
94 | case "$host_os" in | |
95 | linux*) | |
96 | AC_CHECK_HEADERS(asm/byteorder.h linux/fs.h malloc.h,,AC_MSG_ERROR(bailing out)) ;; | |
97 | darwin*) | |
98 | AC_CHECK_HEADERS(machine/endian.h sys/disk.h,,AC_MSG_ERROR(bailing out)) ;; | |
99 | esac | |
100 | ||
101 | AC_CHECK_HEADERS([ctype.h dirent.h errno.h fcntl.h getopt.h inttypes.h limits.h \ | |
102 | stdarg.h stdio.h stdlib.h string.h sys/ioctl.h sys/param.h sys/stat.h \ | |
103 | sys/types.h unistd.h], , [AC_MSG_ERROR(bailing out)]) | |
104 | AC_CHECK_HEADERS(termios.h sys/statvfs.h) | |
105 | ||
106 | ################################################################################ | |
107 | dnl -- Check for typedefs, structures, and compiler characteristics. | |
108 | AC_C_CONST | |
109 | AC_C_INLINE | |
110 | AC_CHECK_MEMBERS([struct stat.st_rdev]) | |
111 | AC_TYPE_OFF_T | |
112 | AC_TYPE_PID_T | |
113 | AC_TYPE_SIGNAL | |
114 | AC_TYPE_SIZE_T | |
115 | AC_TYPE_MODE_T | |
116 | AC_TYPE_INT8_T | |
117 | AC_TYPE_INT16_T | |
118 | AC_TYPE_INT32_T | |
119 | AC_TYPE_INT64_T | |
120 | AC_TYPE_SSIZE_T | |
121 | AC_TYPE_UID_T | |
122 | AC_TYPE_UINT8_T | |
123 | AC_TYPE_UINT16_T | |
124 | AC_TYPE_UINT32_T | |
125 | AC_TYPE_UINT64_T | |
126 | AC_CHECK_MEMBERS([struct stat.st_rdev]) | |
127 | AC_STRUCT_TM | |
128 | ||
129 | ################################################################################ | |
130 | dnl -- Check for functions | |
131 | AC_CHECK_FUNCS([ftruncate gethostname getpagesize \ | |
132 | gettimeofday memset mkdir mkfifo rmdir munmap nl_langinfo setenv setlocale \ | |
133 | strcasecmp strchr strcspn strspn strdup strncasecmp strerror strrchr \ | |
134 | strstr strtol strtoul uname], , [AC_MSG_ERROR(bailing out)]) | |
135 | AC_CHECK_FUNCS(siginterrupt) | |
136 | AC_FUNC_ALLOCA | |
137 | AC_FUNC_CLOSEDIR_VOID | |
138 | AC_FUNC_CHOWN | |
139 | AC_FUNC_FORK | |
140 | AC_FUNC_LSTAT | |
141 | AC_FUNC_MALLOC | |
142 | AC_FUNC_MEMCMP | |
143 | AC_FUNC_MMAP | |
144 | AC_FUNC_REALLOC | |
145 | AC_FUNC_STAT | |
146 | AC_FUNC_STRTOD | |
147 | AC_FUNC_VPRINTF | |
148 | ||
149 | ################################################################################ | |
150 | dnl -- Enables statically-linked tools | |
151 | AC_MSG_CHECKING(whether to use static linking) | |
152 | AC_ARG_ENABLE(static_link, | |
153 | AC_HELP_STRING([--enable-static_link], | |
154 | [use this to link the tools to their libraries | |
155 | statically (default is dynamic linking]), | |
156 | STATIC_LINK=$enableval, STATIC_LINK=no) | |
157 | AC_MSG_RESULT($STATIC_LINK) | |
158 | ||
159 | ################################################################################ | |
160 | dnl -- Prefix is /usr by default, the exec_prefix default is setup later | |
161 | AC_PREFIX_DEFAULT(/usr) | |
162 | ||
163 | ################################################################################ | |
164 | dnl -- Setup the ownership of the files | |
165 | AC_MSG_CHECKING(file owner) | |
166 | AC_ARG_WITH(user, | |
167 | AC_HELP_STRING([--with-user=USER], | |
168 | [set the owner of installed files [[USER=]]]), | |
169 | OWNER=$withval) | |
170 | AC_MSG_RESULT($OWNER) | |
171 | ||
172 | if test x$OWNER != x; then | |
173 | INSTALL="$INSTALL -o $OWNER" | |
174 | fi | |
175 | ||
176 | ################################################################################ | |
177 | dnl -- Setup the group ownership of the files | |
178 | AC_MSG_CHECKING(group owner) | |
179 | AC_ARG_WITH(group, | |
180 | AC_HELP_STRING([--with-group=GROUP], | |
181 | [set the group owner of installed files [[GROUP=]]]), | |
182 | GROUP=$withval) | |
183 | AC_MSG_RESULT($GROUP) | |
184 | ||
185 | if test x$GROUP != x; then | |
186 | INSTALL="$INSTALL -g $GROUP" | |
187 | fi | |
188 | ||
189 | ################################################################################ | |
190 | dnl -- Setup device node ownership | |
191 | AC_MSG_CHECKING(device node uid) | |
192 | ||
193 | AC_ARG_WITH(device-uid, | |
194 | AC_HELP_STRING([--with-device-uid=UID], | |
195 | [set the owner used for new device nodes [[UID=0]]]), | |
196 | DM_DEVICE_UID=$withval, DM_DEVICE_UID=0) | |
197 | AC_MSG_RESULT($DM_DEVICE_UID) | |
198 | ||
199 | ################################################################################ | |
200 | dnl -- Setup device group ownership | |
201 | AC_MSG_CHECKING(device node gid) | |
202 | ||
203 | AC_ARG_WITH(device-gid, | |
204 | AC_HELP_STRING([--with-device-gid=GID], | |
205 | [set the group used for new device nodes [[GID=0]]]), | |
206 | DM_DEVICE_GID=$withval, DM_DEVICE_GID=0) | |
207 | AC_MSG_RESULT($DM_DEVICE_GID) | |
208 | ||
209 | ################################################################################ | |
210 | dnl -- Setup device mode | |
211 | AC_MSG_CHECKING(device node mode) | |
212 | ||
213 | AC_ARG_WITH(device-mode, | |
214 | AC_HELP_STRING([--with-device-mode=MODE], | |
215 | [set the mode used for new device nodes [[MODE=0600]]]), | |
216 | DM_DEVICE_MODE=$withval, DM_DEVICE_MODE=0600) | |
217 | AC_MSG_RESULT($DM_DEVICE_MODE) | |
218 | ||
219 | AC_MSG_CHECKING(when to create device nodes) | |
220 | AC_ARG_WITH(device-nodes-on, | |
221 | AC_HELP_STRING([--with-device-nodes-on=ON], | |
222 | [create nodes on resume or create [[ON=resume]]]), | |
223 | ADD_NODE=$withval, ADD_NODE=resume) | |
224 | case "$ADD_NODE" in | |
225 | resume) add_on=DM_ADD_NODE_ON_RESUME;; | |
226 | create) add_on=DM_ADD_NODE_ON_CREATE;; | |
227 | *) AC_MSG_ERROR([--with-device-nodes-on parameter invalid]);; | |
228 | esac | |
229 | AC_MSG_RESULT(on $ADD_NODE) | |
230 | AC_DEFINE_UNQUOTED([DEFAULT_DM_ADD_NODE], $add_on, [Define default node creation behavior with dmsetup create]) | |
231 | ||
232 | AC_MSG_CHECKING(default name mangling) | |
233 | AC_ARG_WITH(default-name-mangling, | |
234 | AC_HELP_STRING([--with-default-name-mangling=MANGLING], | |
235 | [default name mangling: auto/none/hex [[MANGLING=auto]]]), | |
236 | MANGLING=$withval, MANGLING=auto) | |
237 | case "$MANGLING" in | |
238 | auto) mangling=DM_STRING_MANGLING_AUTO;; | |
239 | disabled) mangling=DM_STRING_MANGLING_NONE;; | |
240 | hex) mangling=DM_STRING_MANGLING_HEX;; | |
241 | *) AC_MSG_ERROR([--with-default-name-mangling parameter invalid]);; | |
242 | esac | |
243 | AC_MSG_RESULT($MANGLING) | |
244 | AC_DEFINE_UNQUOTED([DEFAULT_DM_NAME_MANGLING], $mangling, [Define default name mangling behaviour]) | |
245 | ||
246 | ################################################################################ | |
247 | dnl -- LVM1 tool fallback option | |
248 | AC_MSG_CHECKING(whether to enable lvm1 fallback) | |
249 | AC_ARG_ENABLE(lvm1_fallback, | |
250 | AC_HELP_STRING([--enable-lvm1_fallback], | |
251 | [use this to fall back and use LVM1 binaries if | |
252 | device-mapper is missing from the kernel]), | |
253 | LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no) | |
254 | AC_MSG_RESULT($LVM1_FALLBACK) | |
255 | ||
256 | if test x$LVM1_FALLBACK = xyes; then | |
257 | AC_DEFINE([LVM1_FALLBACK], 1, [Define to 1 if 'lvm' should fall back to using LVM1 binaries if device-mapper is missing from the kernel]) | |
258 | fi | |
259 | ||
260 | ################################################################################ | |
261 | dnl -- format1 inclusion type | |
262 | AC_MSG_CHECKING(whether to include support for lvm1 metadata) | |
263 | AC_ARG_WITH(lvm1, | |
264 | AC_HELP_STRING([--with-lvm1=TYPE], | |
265 | [LVM1 metadata support: internal/shared/none | |
266 | [[TYPE=internal]]]), | |
267 | LVM1=$withval, LVM1=internal) | |
268 | AC_MSG_RESULT($LVM1) | |
269 | ||
270 | if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]]; | |
271 | then AC_MSG_ERROR( | |
272 | --with-lvm1 parameter invalid | |
273 | ) | |
274 | fi; | |
275 | ||
276 | if test x$LVM1 = xinternal; then | |
277 | AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.]) | |
278 | fi | |
279 | ||
280 | ################################################################################ | |
281 | dnl -- format_pool inclusion type | |
282 | AC_MSG_CHECKING(whether to include support for GFS pool metadata) | |
283 | AC_ARG_WITH(pool, | |
284 | AC_HELP_STRING([--with-pool=TYPE], | |
285 | [GFS pool read-only support: internal/shared/none | |
286 | [[TYPE=internal]]]), | |
287 | POOL=$withval, POOL=internal) | |
288 | AC_MSG_RESULT($POOL) | |
289 | ||
290 | if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]]; | |
291 | then AC_MSG_ERROR( | |
292 | --with-pool parameter invalid | |
293 | ) | |
294 | fi; | |
295 | ||
296 | if test x$POOL = xinternal; then | |
297 | AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.]) | |
298 | fi | |
299 | ||
300 | ################################################################################ | |
301 | dnl -- cluster_locking inclusion type | |
302 | AC_MSG_CHECKING(whether to include support for cluster locking) | |
303 | AC_ARG_WITH(cluster, | |
304 | AC_HELP_STRING([--with-cluster=TYPE], | |
305 | [cluster LVM locking support: internal/shared/none | |
306 | [[TYPE=internal]]]), | |
307 | CLUSTER=$withval) | |
308 | AC_MSG_RESULT($CLUSTER) | |
309 | ||
310 | if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]]; | |
311 | then AC_MSG_ERROR( | |
312 | --with-cluster parameter invalid | |
313 | ) | |
314 | fi; | |
315 | ||
316 | if test x$CLUSTER = xinternal; then | |
317 | AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.]) | |
318 | fi | |
319 | ||
320 | ################################################################################ | |
321 | dnl -- snapshots inclusion type | |
322 | AC_MSG_CHECKING(whether to include snapshots) | |
323 | AC_ARG_WITH(snapshots, | |
324 | AC_HELP_STRING([--with-snapshots=TYPE], | |
325 | [snapshot support: internal/shared/none | |
326 | [[TYPE=internal]]]), | |
327 | SNAPSHOTS=$withval, SNAPSHOTS=internal) | |
328 | AC_MSG_RESULT($SNAPSHOTS) | |
329 | ||
330 | if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]]; | |
331 | then AC_MSG_ERROR( | |
332 | --with-snapshots parameter invalid | |
333 | ) | |
334 | fi; | |
335 | ||
336 | if test x$SNAPSHOTS = xinternal; then | |
337 | AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.]) | |
338 | fi | |
339 | ||
340 | ################################################################################ | |
341 | dnl -- mirrors inclusion type | |
342 | AC_MSG_CHECKING(whether to include mirrors) | |
343 | AC_ARG_WITH(mirrors, | |
344 | AC_HELP_STRING([--with-mirrors=TYPE], | |
345 | [mirror support: internal/shared/none | |
346 | [[TYPE=internal]]]), | |
347 | MIRRORS=$withval, MIRRORS=internal) | |
348 | AC_MSG_RESULT($MIRRORS) | |
349 | ||
350 | if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]]; | |
351 | then AC_MSG_ERROR( | |
352 | --with-mirrors parameter invalid | |
353 | ) | |
354 | fi; | |
355 | ||
356 | if test x$MIRRORS = xinternal; then | |
357 | AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.]) | |
358 | fi | |
359 | ||
360 | ################################################################################ | |
361 | dnl -- raid inclusion type | |
362 | AC_MSG_CHECKING(whether to include raid) | |
363 | AC_ARG_WITH(raid, | |
364 | AC_HELP_STRING([--with-raid=TYPE], | |
365 | [mirror support: internal/shared/none | |
366 | [[TYPE=internal]]]), | |
367 | RAID=$withval, RAID=internal) | |
368 | AC_MSG_RESULT($RAID) | |
369 | ||
370 | if [[ "x$RAID" != xnone -a "x$RAID" != xinternal -a "x$RAID" != xshared ]]; | |
371 | then AC_MSG_ERROR( | |
372 | --with-raid parameter invalid | |
373 | ) | |
374 | fi; | |
375 | ||
376 | if test x$RAID = xinternal; then | |
377 | AC_DEFINE([RAID_INTERNAL], 1, [Define to 1 to include built-in support for raid.]) | |
378 | fi | |
379 | ||
380 | ################################################################################ | |
381 | dnl -- asynchronous volume replicator inclusion type | |
382 | AC_MSG_CHECKING(whether to include replicators) | |
383 | AC_ARG_WITH(replicators, | |
384 | AC_HELP_STRING([--with-replicators=TYPE], | |
385 | [replicator support: internal/shared/none | |
386 | [[TYPE=none]]]), | |
387 | REPLICATORS=$withval, REPLICATORS=none) | |
388 | AC_MSG_RESULT($REPLICATORS) | |
389 | ||
390 | case "$REPLICATORS" in | |
391 | none|shared) ;; | |
392 | internal) AC_DEFINE([REPLICATOR_INTERNAL], 1, | |
393 | [Define to 1 to include built-in support for replicators.]) ;; | |
394 | *) AC_MSG_ERROR([--with-replicators parameter invalid ($REPLICATORS)]) ;; | |
395 | esac | |
396 | ||
397 | ################################################################################ | |
398 | dnl -- thin provisioning | |
399 | AC_MSG_CHECKING(whether to include thin provisioning) | |
400 | AC_ARG_WITH(thin, | |
401 | AC_HELP_STRING([--with-thin=TYPE], | |
402 | [thin provisioning support: internal/shared/none | |
403 | [[TYPE=none]]]), | |
404 | THIN=$withval, THIN=none) | |
405 | AC_MSG_RESULT($THIN) | |
406 | ||
407 | case "$THIN" in | |
408 | none|shared) ;; | |
409 | internal) AC_DEFINE([THIN_INTERNAL], 1, | |
410 | [Define to 1 to include built-in support for thin provisioning.]) ;; | |
411 | *) AC_MSG_ERROR([--with-thin parameter invalid ($THIN)]) ;; | |
412 | esac | |
413 | ||
414 | ################################################################################ | |
415 | dnl -- Disable readline | |
416 | AC_MSG_CHECKING(whether to enable readline) | |
417 | AC_ARG_ENABLE([readline], | |
418 | AC_HELP_STRING([--disable-readline], [disable readline support]), | |
419 | READLINE=$enableval, READLINE=maybe) | |
420 | AC_MSG_RESULT($READLINE) | |
421 | ||
422 | ################################################################################ | |
423 | dnl -- Disable realtime clock support | |
424 | AC_MSG_CHECKING(whether to enable realtime support) | |
425 | AC_ARG_ENABLE(realtime, | |
426 | AC_HELP_STRING([--enable-realtime], [enable realtime clock support]), | |
427 | REALTIME=$enableval) | |
428 | AC_MSG_RESULT($REALTIME) | |
429 | ||
430 | ################################################################################ | |
431 | dnl -- disable OCF resource agents | |
432 | AC_MSG_CHECKING(whether to enable OCF resource agents) | |
433 | AC_ARG_ENABLE(ocf, | |
434 | AC_HELP_STRING([--enable-ocf], | |
435 | [enable Open Cluster Framework (OCF) compliant resource agents]), | |
436 | OCF=$enableval, OCF=no) | |
437 | AC_MSG_RESULT($OCF) | |
438 | AC_ARG_WITH(ocfdir, | |
439 | AC_HELP_STRING([--with-ocfdir=DIR], | |
440 | [install OCF files in DIR [[PREFIX/lib/ocf/resource.d/lvm2]]]), | |
441 | OCFDIR=$withval, OCFDIR='${prefix}/lib/ocf/resource.d/lvm2') | |
442 | ||
443 | ################################################################################ | |
444 | dnl -- Init pkg-config with dummy invokation: | |
445 | dnl -- this is required because PKG_CHECK_MODULES macro is expanded | |
446 | dnl -- to initialize the pkg-config environment only at the first invokation, | |
447 | dnl -- that would be conditional in this configure.in. | |
448 | pkg_config_init() { | |
449 | PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [], | |
450 | [AC_MSG_RESULT([pkg-config initialized])]) | |
451 | PKGCONFIG_INIT=1 | |
452 | } | |
453 | ||
454 | ################################################################################ | |
455 | dnl -- Build cluster LVM daemon | |
456 | AC_MSG_CHECKING(whether to build cluster LVM daemon) | |
457 | AC_ARG_WITH(clvmd, | |
458 | [ --with-clvmd=TYPE build cluster LVM Daemon | |
459 | The following cluster manager combinations are valid: | |
460 | * cman (RHEL5 or equivalent) | |
461 | * cman,corosync,openais (or selection of them) | |
462 | * singlenode (localhost only) | |
463 | * all (autodetect) | |
464 | * none (disable build) | |
465 | [[TYPE=none]]], | |
466 | CLVMD=$withval, CLVMD=none) | |
467 | if test x$CLVMD = xyes; then | |
468 | CLVMD=all | |
469 | fi | |
470 | AC_MSG_RESULT($CLVMD) | |
471 | ||
472 | dnl -- If clvmd enabled without cluster locking, automagically include it | |
473 | if test x$CLVMD != xnone && test x$CLUSTER = xnone; then | |
474 | CLUSTER=internal | |
475 | fi | |
476 | ||
477 | dnl -- init pkgconfig if required | |
478 | if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then | |
479 | pkg_config_init | |
480 | fi | |
481 | ||
482 | dnl -- Express clvmd init script Required-Start / Required-Stop | |
483 | CLVMD_CMANAGERS="" | |
484 | dnl -- On RHEL4/RHEL5, qdiskd is started from a separate init script. | |
485 | dnl -- Enable if we are build for cman. | |
486 | CLVMD_NEEDS_QDISKD=no | |
487 | ||
488 | dnl -- define build types | |
489 | if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then | |
490 | AC_MSG_ERROR([Since version 2.02.87 GULM locking is no longer supported.]); | |
491 | fi | |
492 | if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then | |
493 | BUILDCMAN=yes | |
494 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" | |
495 | CLVMD_NEEDS_QDISKD=yes | |
496 | fi | |
497 | if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then | |
498 | BUILDCOROSYNC=yes | |
499 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" | |
500 | fi | |
501 | if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then | |
502 | BUILDOPENAIS=yes | |
503 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" | |
504 | fi | |
505 | if test x$CLVMD_NEEDS_QDISKD != xno; then | |
506 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" | |
507 | fi | |
508 | ||
509 | dnl -- define a soft bailout if we are autodetecting | |
510 | soft_bailout() { | |
511 | NOTFOUND=1 | |
512 | } | |
513 | ||
514 | hard_bailout() { | |
515 | AC_MSG_ERROR([bailing out]) | |
516 | } | |
517 | ||
518 | dnl -- if clvmd=all then set soft_bailout (we don't want to error) | |
519 | dnl -- and set all builds to yes. We need to do this here | |
520 | dnl -- to skip the openais|corosync sanity check above. | |
521 | if test x$CLVMD = xall; then | |
522 | bailout=soft_bailout | |
523 | BUILDCMAN=yes | |
524 | BUILDCOROSYNC=yes | |
525 | BUILDOPENAIS=yes | |
526 | else | |
527 | bailout=hard_bailout | |
528 | fi | |
529 | ||
530 | dnl -- helper macro to check libs without adding them to LIBS | |
531 | check_lib_no_libs() { | |
532 | lib_no_libs_arg1=$1 | |
533 | shift | |
534 | lib_no_libs_arg2=$1 | |
535 | shift | |
536 | lib_no_libs_args=$@ | |
537 | AC_CHECK_LIB([$lib_no_libs_arg1], | |
538 | [$lib_no_libs_arg2],, | |
539 | [$bailout], | |
540 | [$lib_no_libs_args]) | |
541 | LIBS=$ac_check_lib_save_LIBS | |
542 | } | |
543 | ||
544 | dnl -- Look for cman libraries if required. | |
545 | if test x$BUILDCMAN = xyes; then | |
546 | PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes], | |
547 | [NOTFOUND=0 | |
548 | AC_CHECK_HEADERS(libcman.h,,$bailout) | |
549 | check_lib_no_libs cman cman_init | |
550 | if test $NOTFOUND = 0; then | |
551 | AC_MSG_RESULT([no pkg for libcman, using -lcman]) | |
552 | CMAN_LIBS="-lcman" | |
553 | HAVE_CMAN=yes | |
554 | fi]) | |
555 | CHECKCONFDB=yes | |
556 | CHECKDLM=yes | |
557 | fi | |
558 | ||
559 | dnl -- Look for corosync that's required also for openais build | |
560 | dnl -- only enough recent version of corosync ship pkg-config files. | |
561 | dnl -- We can safely rely on that to detect the correct bits. | |
562 | if test x$BUILDCOROSYNC = xyes || \ | |
563 | test x$BUILDOPENAIS = xyes; then | |
564 | PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout) | |
565 | CHECKCONFDB=yes | |
566 | CHECKCMAP=yes | |
567 | fi | |
568 | ||
569 | dnl -- Look for corosync libraries if required. | |
570 | if test x$BUILDCOROSYNC = xyes; then | |
571 | PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout) | |
572 | CHECKCPG=yes | |
573 | CHECKDLM=yes | |
574 | fi | |
575 | ||
576 | dnl -- Look for openais libraries if required. | |
577 | if test x$BUILDOPENAIS = xyes; then | |
578 | PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout) | |
579 | CHECKCPG=yes | |
580 | fi | |
581 | ||
582 | dnl -- Below are checks for libraries common to more than one build. | |
583 | ||
584 | dnl -- Check confdb library. | |
585 | dnl -- mandatory for corosync < 2.0 build. | |
586 | dnl -- optional for openais/cman build. | |
587 | ||
588 | if test x$CHECKCONFDB = xyes; then | |
589 | PKG_CHECK_MODULES(CONFDB, libconfdb, | |
590 | [HAVE_CONFDB=yes], | |
591 | [HAVE_CONFDB=no]) | |
592 | ||
593 | AC_CHECK_HEADERS(corosync/confdb.h, | |
594 | [HAVE_CONFDB_H=yes], | |
595 | [HAVE_CONFDB_H=no]) | |
596 | ||
597 | if test x$HAVE_CONFDB != xyes && \ | |
598 | test x$HAVE_CONFDB_H = xyes; then | |
599 | check_lib_no_libs confdb confdb_initialize | |
600 | AC_MSG_RESULT([no pkg for confdb, using -lconfdb]) | |
601 | CONFDB_LIBS="-lconfdb" | |
602 | HAVE_CONFDB=yes | |
603 | fi | |
604 | fi | |
605 | ||
606 | dnl -- Check cmap library | |
607 | dnl -- mandatory for corosync >= 2.0 build. | |
608 | ||
609 | if test x$CHECKCMAP = xyes; then | |
610 | PKG_CHECK_MODULES(CMAP, libcmap, | |
611 | [HAVE_CMAP=yes], | |
612 | [HAVE_CMAP=no]) | |
613 | ||
614 | AC_CHECK_HEADERS(corosync/cmap.h, | |
615 | [HAVE_CMAP_H=yes], | |
616 | [HAVE_CMAP_H=no]) | |
617 | ||
618 | if test x$HAVE_CMAP != xyes && \ | |
619 | test x$HAVE_CMAP_H = xyes; then | |
620 | check_lib_no_libs cmap cmap_initialize | |
621 | AC_MSG_RESULT([no pkg for cmap, using -lcmap]) | |
622 | CMAP_LIBS="-lcmap" | |
623 | HAVE_CMAP=yes | |
624 | fi | |
625 | fi | |
626 | ||
627 | if test x$BUILDCOROSYNC = xyes; then | |
628 | if test x$HAVE_CMAP != xyes && \ | |
629 | test x$HAVE_CONFDB != xyes && \ | |
630 | test x$CLVMD != xall; then | |
631 | AC_MSG_ERROR([bailing out... cmap (corosync >= 2.0) or confdb (corosync < 2.0) library is required]) | |
632 | fi | |
633 | fi | |
634 | ||
635 | dnl -- Check cpg library. | |
636 | if test x$CHECKCPG = xyes; then | |
637 | PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout) | |
638 | fi | |
639 | ||
640 | dnl -- Check dlm library. | |
641 | if test x$CHECKDLM = xyes; then | |
642 | PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes], | |
643 | [NOTFOUND=0 | |
644 | AC_CHECK_HEADERS(libdlm.h,,$bailout) | |
645 | check_lib_no_libs dlm dlm_lock -lpthread | |
646 | if test $NOTFOUND = 0; then | |
647 | AC_MSG_RESULT([no pkg for libdlm, using -ldlm]) | |
648 | DLM_LIBS="-ldlm -lpthread" | |
649 | HAVE_DLM=yes | |
650 | fi]) | |
651 | fi | |
652 | ||
653 | dnl -- If we are autodetecting, we need to re-create | |
654 | dnl -- the depedencies checks and set a proper CLVMD, | |
655 | dnl -- together with init script Required-Start/Stop entries. | |
656 | if test x$CLVMD = xall; then | |
657 | CLVMD=none | |
658 | CLVMD_CMANAGERS="" | |
659 | CLVMD_NEEDS_QDISKD=no | |
660 | if test x$HAVE_CMAN = xyes && \ | |
661 | test x$HAVE_DLM = xyes; then | |
662 | AC_MSG_RESULT([Enabling clvmd cman cluster manager]) | |
663 | CLVMD="$CLVMD,cman" | |
664 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS cman" | |
665 | CLVMD_NEEDS_QDISKD=yes | |
666 | fi | |
667 | if test x$HAVE_COROSYNC = xyes && \ | |
668 | test x$HAVE_QUORUM = xyes && \ | |
669 | test x$HAVE_CPG = xyes && \ | |
670 | test x$HAVE_DLM = xyes; then | |
671 | if test x$HAVE_CONFDB = xyes || test x$HAVE_CMAP = xyes; then | |
672 | AC_MSG_RESULT([Enabling clvmd corosync cluster manager]) | |
673 | CLVMD="$CLVMD,corosync" | |
674 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS corosync" | |
675 | fi | |
676 | fi | |
677 | if test x$HAVE_COROSYNC = xyes && \ | |
678 | test x$HAVE_CPG = xyes && \ | |
679 | test x$HAVE_SALCK = xyes; then | |
680 | AC_MSG_RESULT([Enabling clvmd openais cluster manager]) | |
681 | CLVMD="$CLVMD,openais" | |
682 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS openais" | |
683 | fi | |
684 | if test x$CLVMD_NEEDS_QDISKD != xno; then | |
685 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS qdiskd" | |
686 | fi | |
687 | if test x$CLVMD = xnone; then | |
688 | AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.]) | |
689 | fi | |
690 | fi | |
691 | ||
692 | dnl -- Fixup CLVMD_CMANAGERS with new corosync | |
693 | dnl -- clvmd built with corosync >= 2.0 needs dlm (either init or systemd service) | |
694 | dnl -- to be started. | |
695 | if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then | |
696 | if test x$HAVE_CMAP = xyes; then | |
697 | CLVMD_CMANAGERS="$CLVMD_CMANAGERS dlm" | |
698 | fi | |
699 | fi | |
700 | ||
701 | ################################################################################ | |
702 | dnl -- clvmd pidfile | |
703 | if test "x$CLVMD" != xnone; then | |
704 | AC_ARG_WITH(clvmd-pidfile, | |
705 | AC_HELP_STRING([--with-clvmd-pidfile=PATH], | |
706 | [clvmd pidfile [[/var/run/clvmd.pid]]]), | |
707 | CLVMD_PIDFILE=$withval, | |
708 | CLVMD_PIDFILE="/var/run/clvmd.pid") | |
709 | AC_DEFINE_UNQUOTED(CLVMD_PIDFILE, ["$CLVMD_PIDFILE"], | |
710 | [Path to clvmd pidfile.]) | |
711 | fi | |
712 | ||
713 | ################################################################################ | |
714 | dnl -- Build cluster mirror log daemon | |
715 | AC_MSG_CHECKING(whether to build cluster mirror log daemon) | |
716 | AC_ARG_ENABLE(cmirrord, | |
717 | AC_HELP_STRING([--enable-cmirrord], | |
718 | [enable the cluster mirror log daemon]), | |
719 | CMIRRORD=$enableval, CMIRRORD=no) | |
720 | AC_MSG_RESULT($CMIRRORD) | |
721 | ||
722 | BUILD_CMIRRORD=$CMIRRORD | |
723 | ||
724 | ################################################################################ | |
725 | dnl -- cmirrord pidfile | |
726 | if test "x$BUILD_CMIRRORD" = xyes; then | |
727 | AC_ARG_WITH(cmirrord-pidfile, | |
728 | AC_HELP_STRING([--with-cmirrord-pidfile=PATH], | |
729 | [cmirrord pidfile [[/var/run/cmirrord.pid]]]), | |
730 | CMIRRORD_PIDFILE=$withval, | |
731 | CMIRRORD_PIDFILE="/var/run/cmirrord.pid") | |
732 | AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE, ["$CMIRRORD_PIDFILE"], | |
733 | [Path to cmirrord pidfile.]) | |
734 | fi | |
735 | ||
736 | ################################################################################ | |
737 | dnl -- Look for corosync libraries if required. | |
738 | if [[ "x$BUILD_CMIRRORD" = xyes ]]; then | |
739 | dnl -- init pkgconfig if required | |
740 | if test x$PKGCONFIG_INIT != x1; then | |
741 | pkg_config_init | |
742 | fi | |
743 | ||
744 | AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 1, [Define to 1 to include libSaCkpt.]) | |
745 | PKG_CHECK_MODULES(SACKPT, libSaCkpt, [HAVE_SACKPT=yes], | |
746 | [AC_MSG_RESULT([no libSaCkpt, compiling without it]) | |
747 | AC_DEFINE([CMIRROR_HAS_CHECKPOINT], 0, [Define to 0 to exclude libSaCkpt.])]) | |
748 | ||
749 | if test x$HAVE_CPG != xyes; then | |
750 | PKG_CHECK_MODULES(CPG, libcpg) | |
751 | fi | |
752 | fi | |
753 | ||
754 | ################################################################################ | |
755 | dnl -- Enable debugging | |
756 | AC_MSG_CHECKING(whether to enable debugging) | |
757 | AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [enable debugging]), | |
758 | DEBUG=$enableval, DEBUG=no) | |
759 | AC_MSG_RESULT($DEBUG) | |
760 | ||
761 | dnl -- Normally turn off optimisation for debug builds | |
762 | if test x$DEBUG = xyes; then | |
763 | COPTIMISE_FLAG= | |
764 | else | |
765 | CSCOPE_CMD= | |
766 | fi | |
767 | ||
768 | ################################################################################ | |
769 | dnl -- Override optimisation | |
770 | AC_MSG_CHECKING(for C optimisation flag) | |
771 | AC_ARG_WITH(optimisation, | |
772 | AC_HELP_STRING([--with-optimisation=OPT], | |
773 | [C optimisation flag [[OPT=-O2]]]), | |
774 | COPTIMISE_FLAG=$withval) | |
775 | AC_MSG_RESULT($COPTIMISE_FLAG) | |
776 | ||
777 | ################################################################################ | |
778 | dnl -- Enable profiling | |
779 | AC_MSG_CHECKING(whether to gather gcov profiling data) | |
780 | AC_ARG_ENABLE(profiling, | |
781 | AC_HELP_STRING(--enable-profiling, [gather gcov profiling data]), | |
782 | PROFILING=$enableval, PROFILING=no) | |
783 | AC_MSG_RESULT($PROFILING) | |
784 | ||
785 | if test "x$PROFILING" = xyes; then | |
786 | COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage" | |
787 | AC_PATH_PROG(LCOV, lcov) | |
788 | AC_PATH_PROG(GENHTML, genhtml) | |
789 | if test -z "$LCOV" -o -z "$GENHTML"; then | |
790 | AC_MSG_ERROR([lcov and genhtml are required for profiling]) | |
791 | fi | |
792 | AC_PATH_PROG(GENPNG, genpng) | |
793 | if test -n "$GENPNG"; then | |
794 | AC_MSG_CHECKING([whether $GENPNG has all required modules]) | |
795 | if $GENPNG --help > /dev/null 2>&1 ; then | |
796 | AC_MSG_RESULT(ok) | |
797 | GENHTML="$GENHTML --frames" | |
798 | else | |
799 | AC_MSG_RESULT(not supported) | |
800 | AC_MSG_WARN([GD.pm perl module is not installed]) | |
801 | GENPNG= | |
802 | fi | |
803 | fi | |
804 | fi | |
805 | ||
806 | ################################################################################ | |
807 | dnl -- Enable testing | |
808 | AC_MSG_CHECKING(whether to enable unit testing) | |
809 | AC_ARG_ENABLE(testing, | |
810 | AC_HELP_STRING(--enable-testing, [enable testing targets in the makefile]), | |
811 | TESTING=$enableval, TESTING=no) | |
812 | AC_MSG_RESULT($TESTING) | |
813 | ||
814 | if test "$TESTING" = yes; then | |
815 | PKG_CHECK_MODULES(CUNIT, cunit >= 2.0) | |
816 | fi | |
817 | ||
818 | ################################################################################ | |
819 | dnl -- Enable valgrind awareness of memory pools | |
820 | AC_MSG_CHECKING(whether to enable valgrind awareness of pools) | |
821 | AC_ARG_ENABLE(valgrind_pool, | |
822 | AC_HELP_STRING(--enable-valgrind-pool, [enable valgrind awareness of pools]), | |
823 | VALGRIND_POOL=$enableval, VALGRIND_POOL=no) | |
824 | AC_MSG_RESULT($VALGRIND_POOL) | |
825 | ||
826 | if test "$VALGRIND_POOL" = yes; then | |
827 | AC_CHECK_HEADERS([valgrind/memcheck.h], , [AC_MSG_ERROR(bailing out)]) | |
828 | AC_DEFINE([VALGRIND_POOL], 1, [Enable a valgrind aware build of pool]) | |
829 | fi | |
830 | ||
831 | ################################################################################ | |
832 | dnl -- Disable devmapper | |
833 | AC_MSG_CHECKING(whether to use device-mapper) | |
834 | AC_ARG_ENABLE(devmapper, | |
835 | AC_HELP_STRING([--disable-devmapper], | |
836 | [disable LVM2 device-mapper interaction]), | |
837 | DEVMAPPER=$enableval) | |
838 | AC_MSG_RESULT($DEVMAPPER) | |
839 | ||
840 | if test x$DEVMAPPER = xyes; then | |
841 | AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.]) | |
842 | fi | |
843 | ||
844 | ################################################################################ | |
845 | dnl -- Build lvmetad | |
846 | AC_MSG_CHECKING(whether to build LVMetaD) | |
847 | AC_ARG_ENABLE(lvmetad, | |
848 | AC_HELP_STRING([--enable-lvmetad], | |
849 | [enable the LVM Metadata Daemon]), | |
850 | LVMETAD=$enableval) | |
851 | AC_MSG_RESULT($LVMETAD) | |
852 | ||
853 | BUILD_LVMETAD=$LVMETAD | |
854 | ||
855 | if test x$BUILD_LVMETAD = xyes; then | |
856 | AC_DEFINE([LVMETAD_SUPPORT], 1, [Define to 1 to include code that uses lvmetad.]) | |
857 | fi | |
858 | ||
859 | ################################################################################ | |
860 | dnl -- Enable udev synchronisation | |
861 | AC_MSG_CHECKING(whether to enable synchronisation with udev processing) | |
862 | AC_ARG_ENABLE(udev_sync, | |
863 | AC_HELP_STRING([--enable-udev_sync], | |
864 | [enable synchronisation with udev processing]), | |
865 | UDEV_SYNC=$enableval, UDEV_SYNC=no) | |
866 | AC_MSG_RESULT($UDEV_SYNC) | |
867 | ||
868 | if test x$UDEV_SYNC = xyes; then | |
869 | dnl -- init pkgconfig if required | |
870 | if test x$PKGCONFIG_INIT != x1; then | |
871 | pkg_config_init | |
872 | fi | |
873 | PKG_CHECK_MODULES(UDEV, libudev >= 143, [UDEV_PC="libudev"]) | |
874 | AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.]) | |
875 | fi | |
876 | ||
877 | dnl -- Enable udev rules | |
878 | AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation) | |
879 | AC_ARG_ENABLE(udev_rules, | |
880 | AC_HELP_STRING([--enable-udev_rules], | |
881 | [install rule files needed for udev synchronisation]), | |
882 | UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC) | |
883 | AC_MSG_RESULT($UDEV_RULES) | |
884 | ||
885 | if test x$UDEV_RULES = xyes; then | |
886 | AC_MSG_CHECKING(whether udev supports builtin blkid) | |
887 | udev_version=$(udevadm info --version 2>/dev/null) | |
888 | if test -n "$udev_version" && test "$udev_version" -ge 176; then | |
889 | UDEV_HAS_BUILTIN_BLKID=yes | |
890 | else | |
891 | UDEV_HAS_BUILTIN_BLKID=no | |
892 | fi | |
893 | AC_MSG_RESULT($UDEV_HAS_BUILTIN_BLKID) | |
894 | fi | |
895 | ||
896 | ################################################################################ | |
897 | dnl -- Compatibility mode | |
898 | AC_ARG_ENABLE(compat, | |
899 | AC_HELP_STRING([--enable-compat], | |
900 | [enable support for old device-mapper versions]), | |
901 | DM_COMPAT=$enableval, DM_COMPAT=no) | |
902 | ||
903 | if test x$DM_COMPAT = xyes; then | |
904 | AC_MSG_ERROR( | |
905 | [--enable-compat is not currently supported. | |
906 | Since device-mapper version 1.02.66, only one version (4) of the device-mapper | |
907 | ioctl protocol is supported.] | |
908 | ) | |
909 | fi | |
910 | ||
911 | ################################################################################ | |
912 | dnl -- Compatible units suffix mode | |
913 | AC_ARG_ENABLE(units-compat, | |
914 | AC_HELP_STRING([--enable-units-compat], | |
915 | [enable output compatibility with old versions that | |
916 | that do not use KiB-style unit suffixes]), | |
917 | UNITS_COMPAT=$enableval, UNITS_COMPAT=no) | |
918 | ||
919 | if test x$UNITS_COMPAT = xyes; then | |
920 | AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.]) | |
921 | fi | |
922 | ||
923 | ################################################################################ | |
924 | dnl -- Disable ioctl | |
925 | AC_ARG_ENABLE(ioctl, | |
926 | AC_HELP_STRING([--disable-driver], | |
927 | [disable calls to device-mapper in the kernel]), | |
928 | DM_IOCTLS=$enableval) | |
929 | ||
930 | ################################################################################ | |
931 | dnl -- Disable O_DIRECT | |
932 | AC_MSG_CHECKING(whether to enable O_DIRECT) | |
933 | AC_ARG_ENABLE(o_direct, | |
934 | AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]), | |
935 | ODIRECT=$enableval) | |
936 | AC_MSG_RESULT($ODIRECT) | |
937 | ||
938 | if test x$ODIRECT = xyes; then | |
939 | AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.]) | |
940 | fi | |
941 | ||
942 | ################################################################################ | |
943 | dnl -- Enable liblvm2app.so | |
944 | AC_MSG_CHECKING(whether to build liblvm2app.so application library) | |
945 | AC_ARG_ENABLE(applib, | |
946 | AC_HELP_STRING([--enable-applib], [build application library]), | |
947 | APPLIB=$enableval, APPLIB=no) | |
948 | AC_MSG_RESULT($APPLIB) | |
949 | AC_SUBST([LVM2APP_LIB]) | |
950 | test x$APPLIB = xyes \ | |
951 | && LVM2APP_LIB=-llvm2app \ | |
952 | || LVM2APP_LIB= | |
953 | ||
954 | ################################################################################ | |
955 | dnl -- Enable cmdlib | |
956 | AC_MSG_CHECKING(whether to compile liblvm2cmd.so) | |
957 | AC_ARG_ENABLE(cmdlib, | |
958 | AC_HELP_STRING([--enable-cmdlib], [build shared command library]), | |
959 | CMDLIB=$enableval, CMDLIB=no) | |
960 | AC_MSG_RESULT($CMDLIB) | |
961 | AC_SUBST([LVM2CMD_LIB]) | |
962 | test x$CMDLIB = xyes \ | |
963 | && LVM2CMD_LIB=-llvm2cmd \ | |
964 | || LVM2CMD_LIB= | |
965 | ||
966 | ################################################################################ | |
967 | dnl -- Enable pkg-config | |
968 | AC_ARG_ENABLE(pkgconfig, | |
969 | AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]), | |
970 | PKGCONFIG=$enableval, PKGCONFIG=no) | |
971 | ||
972 | ################################################################################ | |
973 | dnl -- Enable installation of writable files by user | |
974 | AC_ARG_ENABLE(write_install, | |
975 | AC_HELP_STRING([--enable-write_install], | |
976 | [install user writable files]), | |
977 | WRITE_INSTALL=$enableval, WRITE_INSTALL=no) | |
978 | ||
979 | ################################################################################ | |
980 | dnl -- Enable fsadm | |
981 | AC_MSG_CHECKING(whether to install fsadm) | |
982 | AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]), | |
983 | FSADM=$enableval) | |
984 | AC_MSG_RESULT($FSADM) | |
985 | ||
986 | ################################################################################ | |
987 | dnl -- enable dmeventd handling | |
988 | AC_MSG_CHECKING(whether to use dmeventd) | |
989 | AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd], | |
990 | [enable the device-mapper event daemon]), | |
991 | DMEVENTD=$enableval) | |
992 | AC_MSG_RESULT($DMEVENTD) | |
993 | ||
994 | BUILD_DMEVENTD=$DMEVENTD | |
995 | ||
996 | dnl -- dmeventd currently requires internal mirror support | |
997 | if test x$DMEVENTD = xyes; then | |
998 | if test x$MIRRORS != xinternal; then | |
999 | AC_MSG_ERROR( | |
1000 | --enable-dmeventd currently requires --with-mirrors=internal | |
1001 | ) | |
1002 | fi | |
1003 | if test x$CMDLIB = xno; then | |
1004 | AC_MSG_ERROR( | |
1005 | --enable-dmeventd requires --enable-cmdlib to be used as well | |
1006 | ) | |
1007 | fi | |
1008 | fi | |
1009 | ||
1010 | if test x$DMEVENTD = xyes; then | |
1011 | AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.]) | |
1012 | fi | |
1013 | ||
1014 | ################################################################################ | |
1015 | dnl -- getline included in recent libc | |
1016 | ||
1017 | AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1, | |
1018 | [Define to 1 if getline is available.])) | |
1019 | ||
1020 | ################################################################################ | |
1021 | dnl -- canonicalize_file_name included in recent libc | |
1022 | ||
1023 | AC_CHECK_LIB(c, canonicalize_file_name, | |
1024 | AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1, | |
1025 | [Define to 1 if canonicalize_file_name is available.])) | |
1026 | ||
1027 | ################################################################################ | |
1028 | dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin | |
1029 | if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]]; | |
1030 | then exec_prefix=""; | |
1031 | fi; | |
1032 | ||
1033 | ################################################################################ | |
1034 | dnl -- Check for dlopen | |
1035 | AC_CHECK_LIB(dl, dlopen, [ | |
1036 | AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.]) | |
1037 | DL_LIBS="-ldl" | |
1038 | HAVE_LIBDL=yes ], [ | |
1039 | DL_LIBS= | |
1040 | HAVE_LIBDL=no ]) | |
1041 | ||
1042 | ################################################################################ | |
1043 | dnl -- Check for shared/static conflicts | |
1044 | if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \ | |
1045 | -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \ | |
1046 | -o "x$RAID" = xshared \ | |
1047 | \) -a "x$STATIC_LINK" = xyes ]]; | |
1048 | then AC_MSG_ERROR( | |
1049 | Features cannot be 'shared' when building statically | |
1050 | ) | |
1051 | fi | |
1052 | ||
1053 | ################################################################################ | |
1054 | if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then | |
1055 | AC_CHECK_LIB([pthread], [pthread_mutex_lock], | |
1056 | [PTHREAD_LIBS="-lpthread"], hard_bailout) | |
1057 | fi | |
1058 | ||
1059 | ################################################################################ | |
1060 | dnl -- Disable selinux | |
1061 | AC_MSG_CHECKING(whether to enable selinux support) | |
1062 | AC_ARG_ENABLE(selinux, | |
1063 | AC_HELP_STRING([--disable-selinux], [disable selinux support]), | |
1064 | SELINUX=$enableval) | |
1065 | AC_MSG_RESULT($SELINUX) | |
1066 | ||
1067 | ################################################################################ | |
1068 | dnl -- Check for selinux | |
1069 | if test x$SELINUX = xyes; then | |
1070 | AC_CHECK_LIB([sepol], [sepol_check_context], [ | |
1071 | AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.]) | |
1072 | SELINUX_LIBS="-lsepol"]) | |
1073 | ||
1074 | AC_CHECK_LIB([selinux], [is_selinux_enabled], [ | |
1075 | AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout) | |
1076 | AC_CHECK_HEADERS([selinux/label.h]) | |
1077 | AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.]) | |
1078 | SELINUX_LIBS="-lselinux $SELINUX_LIBS" | |
1079 | SELINUX_PC="libselinux" | |
1080 | HAVE_SELINUX=yes ], [ | |
1081 | AC_MSG_WARN(Disabling selinux) | |
1082 | SELINUX_LIBS= | |
1083 | SELINUX_PC= | |
1084 | HAVE_SELINUX=no ]) | |
1085 | fi | |
1086 | ||
1087 | ################################################################################ | |
1088 | dnl -- Check for realtime clock support | |
1089 | if test x$REALTIME = xyes; then | |
1090 | AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no) | |
1091 | ||
1092 | if test x$HAVE_REALTIME = xyes; then | |
1093 | AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.]) | |
1094 | LIBS="-lrt $LIBS" | |
1095 | else | |
1096 | AC_MSG_WARN(Disabling realtime clock) | |
1097 | fi | |
1098 | fi | |
1099 | ||
1100 | ################################################################################ | |
1101 | dnl -- Check for getopt | |
1102 | AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.])) | |
1103 | ||
1104 | ################################################################################ | |
1105 | dnl -- Check for readline (Shamelessly copied from parted 1.4.17) | |
1106 | if test x$READLINE != xno; then | |
1107 | lvm_saved_libs=$LIBS | |
1108 | AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib], | |
1109 | READLINE_LIBS=$ac_cv_search_tgetent, [ | |
1110 | if test "$READLINE" = yes; then | |
1111 | AC_MSG_ERROR( | |
1112 | [termcap could not be found which is required for the | |
1113 | --enable-readline option (which is enabled by default). Either disable readline | |
1114 | support with --disable-readline or download and install termcap from: | |
1115 | ftp.gnu.org/gnu/termcap | |
1116 | Note: if you are using precompiled packages you will also need the development | |
1117 | package as well (which may be called termcap-devel or something similar). | |
1118 | Note: (n)curses also seems to work as a substitute for termcap. This was | |
1119 | not found either - but you could try installing that as well.]) | |
1120 | fi]) | |
1121 | dnl -- Old systems may need extra termcap dependency explicitly in LIBS | |
1122 | AC_CHECK_LIB([readline], [readline], [ | |
1123 | AC_DEFINE([READLINE_SUPPORT], 1, | |
1124 | [Define to 1 to include the LVM readline shell.]) | |
1125 | dnl -- Try only with -lreadline and check for different symbol | |
1126 | LIBS=$lvm_saved_libs | |
1127 | AC_CHECK_LIB([readline], [rl_line_buffer], | |
1128 | [ READLINE_LIBS="-lreadline" ], [ | |
1129 | AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed]) | |
1130 | READLINE_LIBS="-lreadline $READLINE_LIBS" | |
1131 | ]) ], [ | |
1132 | READLINE_LIBS= | |
1133 | if test "$READLINE" = yes; then | |
1134 | AC_MSG_ERROR( | |
1135 | [GNU Readline could not be found which is required for the | |
1136 | --enable-readline option (which is enabled by default). Either disable readline | |
1137 | support with --disable-readline or download and install readline from: | |
1138 | ftp.gnu.org/gnu/readline | |
1139 | Note: if you are using precompiled packages you will also need the development | |
1140 | package as well (which may be called readline-devel or something similar).]) | |
1141 | fi ]) | |
1142 | LIBS="$READLINE_LIBS $lvm_saved_libs" | |
1143 | AC_CHECK_FUNCS([rl_completion_matches]) | |
1144 | LIBS=$lvm_saved_libs | |
1145 | fi | |
1146 | ||
1147 | ################################################################################ | |
1148 | dnl -- Internationalisation stuff | |
1149 | AC_MSG_CHECKING(whether to enable internationalisation) | |
1150 | AC_ARG_ENABLE(nls, | |
1151 | AC_HELP_STRING([--enable-nls], [enable Native Language Support]), | |
1152 | INTL=$enableval, INTL=no) | |
1153 | AC_MSG_RESULT($INTL) | |
1154 | ||
1155 | if test x$INTL = xyes; then | |
1156 | # FIXME - Move this - can be device-mapper too | |
1157 | INTL_PACKAGE="lvm2" | |
1158 | AC_PATH_PROG(MSGFMT, msgfmt) | |
1159 | if [[ "x$MSGFMT" == x ]]; | |
1160 | then AC_MSG_ERROR( | |
1161 | msgfmt not found in path $PATH | |
1162 | ) | |
1163 | fi; | |
1164 | ||
1165 | AC_ARG_WITH(localedir, | |
1166 | AC_HELP_STRING([--with-localedir=DIR], | |
1167 | [translation files in DIR | |
1168 | [[PREFIX/share/locale]]]), | |
1169 | LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale') | |
1170 | fi | |
1171 | ||
1172 | ################################################################################ | |
1173 | AC_ARG_WITH(confdir, | |
1174 | AC_HELP_STRING([--with-confdir=DIR], | |
1175 | [configuration files in DIR [[/etc]]]), | |
1176 | CONFDIR=$withval, CONFDIR="/etc") | |
1177 | ||
1178 | AC_ARG_WITH(staticdir, | |
1179 | AC_HELP_STRING([--with-staticdir=DIR], | |
1180 | [static binaries in DIR [[EPREFIX/sbin]]]), | |
1181 | STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin') | |
1182 | ||
1183 | AC_ARG_WITH(usrlibdir, | |
1184 | AC_HELP_STRING([--with-usrlibdir=DIR], | |
1185 | [usrlib in DIR [[PREFIX/lib]]]), | |
1186 | usrlibdir=$withval, usrlibdir='${prefix}/lib') | |
1187 | ||
1188 | AC_ARG_WITH(usrsbindir, | |
1189 | AC_HELP_STRING([--with-usrsbindir=DIR], | |
1190 | [usrsbin executables in DIR [[PREFIX/sbin]]]), | |
1191 | usrsbindir=$withval, usrsbindir='${prefix}/sbin') | |
1192 | ||
1193 | ################################################################################ | |
1194 | AC_ARG_WITH(udev_prefix, | |
1195 | AC_HELP_STRING([--with-udev-prefix=UPREFIX], | |
1196 | [install udev rule files in UPREFIX [[EPREFIX]]]), | |
1197 | udev_prefix=$withval, udev_prefix='${exec_prefix}') | |
1198 | ||
1199 | AC_ARG_WITH(udevdir, | |
1200 | AC_HELP_STRING([--with-udevdir=DIR], | |
1201 | [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]), | |
1202 | udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d') | |
1203 | ||
1204 | ################################################################################ | |
1205 | dnl -- Get the systemd system unit dir value from pkg_config automatically if value not given explicitly. | |
1206 | dnl -- This follows the recommendation for systemd integration best practices mentioned in daemon(7) manpage. | |
1207 | AC_ARG_WITH(systemdsystemunitdir, | |
1208 | AC_HELP_STRING([--with-systemdsystemunitdir=DIR], | |
1209 | [systemd service files in DIR]), | |
1210 | systemdsystemunitdir=$withval, | |
1211 | pkg_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)) | |
1212 | ||
1213 | if test -n "$pkg_systemdsystemunitdir"; then | |
1214 | systemdsystemunitdir=$pkg_systemdsystemunitdir; | |
1215 | fi | |
1216 | ||
1217 | if test -z "$systemdsystemunitdir"; then | |
1218 | systemdsystemunitdir='/lib/systemd/system'; | |
1219 | fi | |
1220 | ################################################################################ | |
1221 | AC_ARG_WITH(tmpfilesdir, | |
1222 | AC_HELP_STRING([--with-tmpfilesdir=DIR], | |
1223 | [install configuration files for management of volatile files and directories in DIR [[SYSCONFDIR/tmpfiles.d]]]), | |
1224 | tmpfilesdir=$withval, tmpfilesdir='${sysconfdir}/tmpfiles.d') | |
1225 | ################################################################################ | |
1226 | dnl -- Ensure additional headers required | |
1227 | if test x$READLINE = xyes; then | |
1228 | AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out)) | |
1229 | fi | |
1230 | ||
1231 | if test x$CLVMD != xnone; then | |
1232 | AC_CHECK_HEADERS(mntent.h netdb.h netinet/in.h pthread.h search.h sys/mount.h sys/socket.h sys/uio.h sys/un.h utmpx.h,,AC_MSG_ERROR(bailing out)) | |
1233 | AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out)) | |
1234 | AC_FUNC_GETMNTENT | |
1235 | AC_FUNC_SELECT_ARGTYPES | |
1236 | fi | |
1237 | ||
1238 | if test x$CLUSTER != xnone; then | |
1239 | AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out)) | |
1240 | AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out)) | |
1241 | fi | |
1242 | ||
1243 | if test x$DMEVENTD = xyes; then | |
1244 | AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out)) | |
1245 | fi | |
1246 | ||
1247 | if test x$HAVE_LIBDL = xyes; then | |
1248 | AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out)) | |
1249 | fi | |
1250 | ||
1251 | if test x$INTL = xyes; then | |
1252 | AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out)) | |
1253 | fi | |
1254 | ||
1255 | if test x$UDEV_SYNC = xyes; then | |
1256 | AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out)) | |
1257 | fi | |
1258 | ||
1259 | ################################################################################ | |
1260 | AC_PATH_PROG(MODPROBE_CMD, modprobe) | |
1261 | ||
1262 | if test x$MODPROBE_CMD != x; then | |
1263 | AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.]) | |
1264 | fi | |
1265 | ||
1266 | ||
1267 | lvm_exec_prefix=$exec_prefix | |
1268 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix | |
1269 | test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix | |
1270 | LVM_PATH="$lvm_exec_prefix/sbin/lvm" | |
1271 | AC_DEFINE_UNQUOTED(LVM_PATH, ["$LVM_PATH"], [Path to lvm binary.]) | |
1272 | ||
1273 | if test "$CLVMD" != none; then | |
1274 | clvmd_prefix=$ac_default_prefix | |
1275 | CLVMD_PATH="$clvmd_prefix/sbin/clvmd" | |
1276 | test "$prefix" != NONE && clvmd_prefix=$prefix | |
1277 | AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$CLVMD_PATH"], [Path to clvmd binary.]) | |
1278 | fi | |
1279 | ||
1280 | ################################################################################ | |
1281 | dnl -- dmeventd pidfile and executable path | |
1282 | if test "$BUILD_DMEVENTD" = yes; then | |
1283 | AC_ARG_WITH(dmeventd-pidfile, | |
1284 | AC_HELP_STRING([--with-dmeventd-pidfile=PATH], | |
1285 | [dmeventd pidfile [[/var/run/dmeventd.pid]]]), | |
1286 | DMEVENTD_PIDFILE=$withval, | |
1287 | DMEVENTD_PIDFILE="/var/run/dmeventd.pid") | |
1288 | AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"], | |
1289 | [Path to dmeventd pidfile.]) | |
1290 | fi | |
1291 | ||
1292 | if test "$BUILD_DMEVENTD" = yes; then | |
1293 | AC_ARG_WITH(dmeventd-path, | |
1294 | AC_HELP_STRING([--with-dmeventd-path=PATH], | |
1295 | [dmeventd path [[EPREFIX/sbin/dmeventd]]]), | |
1296 | DMEVENTD_PATH=$withval, | |
1297 | DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd") | |
1298 | AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"], | |
1299 | [Path to dmeventd binary.]) | |
1300 | fi | |
1301 | ||
1302 | AH_TEMPLATE(DEFAULT_RUN_DIR, [Name of default run directory.]) | |
1303 | AC_ARG_WITH(default-run-dir, | |
1304 | [ --with-default-run-dir=DIR Default run directory [[/var/run/lvm]] ], | |
1305 | [ DEFAULT_RUN_DIR="$withval" ], | |
1306 | [ DEFAULT_RUN_DIR="/var/run/lvm" ]) | |
1307 | AC_DEFINE_UNQUOTED(DEFAULT_RUN_DIR,["$DEFAULT_RUN_DIR"] ) | |
1308 | ||
1309 | ################################################################################ | |
1310 | dnl -- various defaults | |
1311 | AC_ARG_WITH(default-system-dir, | |
1312 | AC_HELP_STRING([--with-default-system-dir=DIR], | |
1313 | [default LVM system directory [[/etc/lvm]]]), | |
1314 | DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm") | |
1315 | AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"], | |
1316 | [Path to LVM system directory.]) | |
1317 | ||
1318 | AC_ARG_WITH(default-archive-subdir, | |
1319 | AC_HELP_STRING([--with-default-archive-subdir=SUBDIR], | |
1320 | [default metadata archive subdir [[archive]]]), | |
1321 | DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive) | |
1322 | AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"], | |
1323 | [Name of default metadata archive subdirectory.]) | |
1324 | ||
1325 | AC_ARG_WITH(default-backup-subdir, | |
1326 | AC_HELP_STRING([--with-default-backup-subdir=SUBDIR], | |
1327 | [default metadata backup subdir [[backup]]]), | |
1328 | DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup) | |
1329 | AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"], | |
1330 | [Name of default metadata backup subdirectory.]) | |
1331 | ||
1332 | AC_ARG_WITH(default-cache-subdir, | |
1333 | AC_HELP_STRING([--with-default-cache-subdir=SUBDIR], | |
1334 | [default metadata cache subdir [[cache]]]), | |
1335 | DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache) | |
1336 | AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"], | |
1337 | [Name of default metadata cache subdirectory.]) | |
1338 | ||
1339 | AC_ARG_WITH(default-locking-dir, | |
1340 | AC_HELP_STRING([--with-default-locking-dir=DIR], | |
1341 | [default locking directory [[/var/lock/lvm]]]), | |
1342 | DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm") | |
1343 | AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"], | |
1344 | [Name of default locking directory.]) | |
1345 | ||
1346 | ################################################################################ | |
1347 | dnl -- Setup default data alignment | |
1348 | AC_ARG_WITH(default-data-alignment, | |
1349 | AC_HELP_STRING([--with-default-data-alignment=NUM], | |
1350 | [set the default data alignment in MiB [[1]]]), | |
1351 | DEFAULT_DATA_ALIGNMENT=$withval, DEFAULT_DATA_ALIGNMENT=1) | |
1352 | AC_DEFINE_UNQUOTED(DEFAULT_DATA_ALIGNMENT, [$DEFAULT_DATA_ALIGNMENT], | |
1353 | [Default data alignment.]) | |
1354 | ||
1355 | ################################################################################ | |
1356 | dnl -- which kernel interface to use (ioctl only) | |
1357 | AC_MSG_CHECKING(for kernel interface choice) | |
1358 | AC_ARG_WITH(interface, | |
1359 | AC_HELP_STRING([--with-interface=IFACE], | |
1360 | [choose kernel interface (ioctl) [[ioctl]]]), | |
1361 | interface=$withval, interface=ioctl) | |
1362 | if [[ "x$interface" != xioctl ]]; | |
1363 | then | |
1364 | AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.) | |
1365 | fi | |
1366 | AC_MSG_RESULT($interface) | |
1367 | ||
1368 | ################################################################################ | |
1369 | DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\"" | |
1370 | AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version]) | |
1371 | ||
1372 | DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'` | |
1373 | ||
1374 | LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\"" | |
1375 | ||
1376 | VER=`cat "$srcdir"/VERSION` | |
1377 | LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\"" | |
1378 | VER=`echo "$VER" | $AWK '{print $1}'` | |
1379 | LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\"" | |
1380 | VER=`echo "$VER" | $AWK -F '-' '{print $1}'` | |
1381 | LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'` | |
1382 | LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'` | |
1383 | LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'` | |
1384 | LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'` | |
1385 | ||
1386 | ################################################################################ | |
1387 | AC_SUBST(APPLIB) | |
1388 | AC_SUBST(AWK) | |
1389 | AC_SUBST(BUILD_CMIRRORD) | |
1390 | AC_SUBST(BUILD_DMEVENTD) | |
1391 | AC_SUBST(BUILD_LVMETAD) | |
1392 | AC_SUBST(CFLAGS) | |
1393 | AC_SUBST(CFLOW_CMD) | |
1394 | AC_SUBST(CLDFLAGS) | |
1395 | AC_SUBST(CLDNOWHOLEARCHIVE) | |
1396 | AC_SUBST(CLDWHOLEARCHIVE) | |
1397 | AC_SUBST(CLUSTER) | |
1398 | AC_SUBST(CLVMD) | |
1399 | AC_SUBST(CLVMD_CMANAGERS) | |
1400 | AC_SUBST(CLVMD_PATH) | |
1401 | AC_SUBST(CMAN_CFLAGS) | |
1402 | AC_SUBST(CMAN_LIBS) | |
1403 | AC_SUBST(CMAP_CFLAGS) | |
1404 | AC_SUBST(CMAP_LIBS) | |
1405 | AC_SUBST(CMDLIB) | |
1406 | AC_SUBST(CONFDB_CFLAGS) | |
1407 | AC_SUBST(CONFDB_LIBS) | |
1408 | AC_SUBST(CONFDIR) | |
1409 | AC_SUBST(COPTIMISE_FLAG) | |
1410 | AC_SUBST(CPG_CFLAGS) | |
1411 | AC_SUBST(CPG_LIBS) | |
1412 | AC_SUBST(CSCOPE_CMD) | |
1413 | AC_SUBST(DEBUG) | |
1414 | AC_SUBST(DEFAULT_SYS_DIR) | |
1415 | AC_SUBST(DEFAULT_ARCHIVE_SUBDIR) | |
1416 | AC_SUBST(DEFAULT_BACKUP_SUBDIR) | |
1417 | AC_SUBST(DEFAULT_CACHE_SUBDIR) | |
1418 | AC_SUBST(DEFAULT_DATA_ALIGNMENT) | |
1419 | AC_SUBST(DEFAULT_LOCK_DIR) | |
1420 | AC_SUBST(DEFAULT_RUN_DIR) | |
1421 | AC_SUBST(DEVMAPPER) | |
1422 | AC_SUBST(DLM_CFLAGS) | |
1423 | AC_SUBST(DLM_LIBS) | |
1424 | AC_SUBST(DL_LIBS) | |
1425 | AC_SUBST(DMEVENTD) | |
1426 | AC_SUBST(DMEVENTD_PATH) | |
1427 | AC_SUBST(DM_COMPAT) | |
1428 | AC_SUBST(DM_DEVICE_GID) | |
1429 | AC_SUBST(DM_DEVICE_MODE) | |
1430 | AC_SUBST(DM_DEVICE_UID) | |
1431 | AC_SUBST(DM_IOCTLS) | |
1432 | AC_SUBST(DM_LIB_VERSION) | |
1433 | AC_SUBST(DM_LIB_PATCHLEVEL) | |
1434 | AC_SUBST(ELDFLAGS) | |
1435 | AC_SUBST(FSADM) | |
1436 | AC_SUBST(HAVE_LIBDL) | |
1437 | AC_SUBST(HAVE_REALTIME) | |
1438 | AC_SUBST(INTL) | |
1439 | AC_SUBST(INTL_PACKAGE) | |
1440 | AC_SUBST(JOBS) | |
1441 | AC_SUBST(LDDEPS) | |
1442 | AC_SUBST(LIBS) | |
1443 | AC_SUBST(LIB_SUFFIX) | |
1444 | AC_SUBST(LOCALEDIR) | |
1445 | AC_SUBST(LVM1) | |
1446 | AC_SUBST(LVM1_FALLBACK) | |
1447 | AC_SUBST(LVM_VERSION) | |
1448 | AC_SUBST(LVM_LIBAPI) | |
1449 | AC_SUBST(LVM_MAJOR) | |
1450 | AC_SUBST(LVM_MINOR) | |
1451 | AC_SUBST(LVM_PATCHLEVEL) | |
1452 | AC_SUBST(LVM_PATH) | |
1453 | AC_SUBST(LVM_RELEASE) | |
1454 | AC_SUBST(LVM_RELEASE_DATE) | |
1455 | AC_SUBST(MIRRORS) | |
1456 | AC_SUBST(MSGFMT) | |
1457 | AC_SUBST(OCF) | |
1458 | AC_SUBST(OCFDIR) | |
1459 | AC_SUBST(PKGCONFIG) | |
1460 | AC_SUBST(POOL) | |
1461 | AC_SUBST(PTHREAD_LIBS) | |
1462 | AC_SUBST(QUORUM_CFLAGS) | |
1463 | AC_SUBST(QUORUM_LIBS) | |
1464 | AC_SUBST(RAID) | |
1465 | AC_SUBST(READLINE_LIBS) | |
1466 | AC_SUBST(REPLICATORS) | |
1467 | AC_SUBST(SACKPT_CFLAGS) | |
1468 | AC_SUBST(SACKPT_LIBS) | |
1469 | AC_SUBST(SALCK_CFLAGS) | |
1470 | AC_SUBST(SALCK_LIBS) | |
1471 | AC_SUBST(SELINUX_LIBS) | |
1472 | AC_SUBST(SELINUX_PC) | |
1473 | AC_SUBST(SNAPSHOTS) | |
1474 | AC_SUBST(STATICDIR) | |
1475 | AC_SUBST(STATIC_LINK) | |
1476 | AC_SUBST(TESTING) | |
1477 | AC_SUBST(THIN) | |
1478 | AC_SUBST(UDEV_LIBS) | |
1479 | AC_SUBST(UDEV_PC) | |
1480 | AC_SUBST(UDEV_RULES) | |
1481 | AC_SUBST(UDEV_SYNC) | |
1482 | AC_SUBST(UDEV_HAS_BUILTIN_BLKID) | |
1483 | AC_SUBST(CUNIT_LIBS) | |
1484 | AC_SUBST(CUNIT_CFLAGS) | |
1485 | AC_SUBST(WRITE_INSTALL) | |
1486 | AC_SUBST(DMEVENTD_PIDFILE) | |
1487 | AC_SUBST(interface) | |
1488 | AC_SUBST(kerneldir) | |
1489 | AC_SUBST(missingkernel) | |
1490 | AC_SUBST(kernelvsn) | |
1491 | AC_SUBST(tmpdir) | |
1492 | AC_SUBST(udev_prefix) | |
1493 | AC_SUBST(udevdir) | |
1494 | AC_SUBST(systemdsystemunitdir) | |
1495 | AC_SUBST(tmpfilesdir) | |
1496 | AC_SUBST(usrlibdir) | |
1497 | AC_SUBST(usrsbindir) | |
1498 | ||
1499 | ################################################################################ | |
1500 | dnl -- First and last lines should not contain files to generate in order to | |
1501 | dnl -- keep utility scripts running properly | |
1502 | AC_CONFIG_FILES([ | |
1503 | Makefile | |
1504 | make.tmpl | |
1505 | daemons/Makefile | |
1506 | daemons/clvmd/Makefile | |
1507 | daemons/cmirrord/Makefile | |
1508 | daemons/dmeventd/Makefile | |
1509 | daemons/dmeventd/libdevmapper-event.pc | |
1510 | daemons/dmeventd/plugins/Makefile | |
1511 | daemons/dmeventd/plugins/lvm2/Makefile | |
1512 | daemons/dmeventd/plugins/raid/Makefile | |
1513 | daemons/dmeventd/plugins/mirror/Makefile | |
1514 | daemons/dmeventd/plugins/snapshot/Makefile | |
1515 | daemons/dmeventd/plugins/thin/Makefile | |
1516 | daemons/lvmetad/Makefile | |
1517 | doc/Makefile | |
1518 | doc/example.conf | |
1519 | include/.symlinks | |
1520 | include/Makefile | |
1521 | lib/Makefile | |
1522 | lib/format1/Makefile | |
1523 | lib/format_pool/Makefile | |
1524 | lib/locking/Makefile | |
1525 | lib/mirror/Makefile | |
1526 | lib/replicator/Makefile | |
1527 | lib/misc/lvm-version.h | |
1528 | lib/raid/Makefile | |
1529 | lib/snapshot/Makefile | |
1530 | lib/thin/Makefile | |
1531 | libdaemon/Makefile | |
1532 | libdaemon/client/Makefile | |
1533 | libdaemon/server/Makefile | |
1534 | libdm/Makefile | |
1535 | libdm/libdevmapper.pc | |
1536 | liblvm/Makefile | |
1537 | liblvm/liblvm2app.pc | |
1538 | man/Makefile | |
1539 | po/Makefile | |
1540 | scripts/clvmd_init_red_hat | |
1541 | scripts/cmirrord_init_red_hat | |
1542 | scripts/lvm2_lvmetad_init_red_hat | |
1543 | scripts/lvm2_lvmetad_systemd_red_hat.socket | |
1544 | scripts/lvm2_lvmetad_systemd_red_hat.service | |
1545 | scripts/lvm2_monitoring_init_red_hat | |
1546 | scripts/dm_event_systemd_red_hat.service | |
1547 | scripts/lvm2_monitoring_systemd_red_hat.service | |
1548 | scripts/lvm2_tmpfiles_red_hat.conf | |
1549 | scripts/Makefile | |
1550 | test/Makefile | |
1551 | test/api/Makefile | |
1552 | test/unit/Makefile | |
1553 | tools/Makefile | |
1554 | udev/Makefile | |
1555 | unit-tests/datastruct/Makefile | |
1556 | unit-tests/regex/Makefile | |
1557 | unit-tests/mm/Makefile | |
1558 | ]) | |
1559 | AC_OUTPUT | |
1560 | ||
1561 | if test x$ODIRECT != xyes; then | |
1562 | AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up) | |
1563 | fi |