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