]> sourceware.org Git - lvm2.git/blame - configure.in
Fix for bug 614164: No check for existing name when splitting mirror
[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
80992638 703################################################################################
8ce0cbda 704dnl -- Disable devmapper
ad6254c5 705AC_MSG_CHECKING(whether to use device-mapper)
71082be4
ZK
706AC_ARG_ENABLE(devmapper,
707 AC_HELP_STRING([--disable-devmapper],
708 [disable LVM2 device-mapper interaction]),
709 DEVMAPPER=$enableval)
ad6254c5 710AC_MSG_RESULT($DEVMAPPER)
199e490e 711
b896caa1 712if test x$DEVMAPPER = xyes; then
f6fc418d 713 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
714fi
715
5d518f1f
AK
716################################################################################
717dnl -- Enable udev synchronisation
718AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
71082be4
ZK
719AC_ARG_ENABLE(udev_sync,
720 AC_HELP_STRING([--enable-udev_sync],
721 [enable synchronisation with udev processing]),
722 UDEV_SYNC=$enableval, UDEV_SYNC=no)
5d518f1f
AK
723AC_MSG_RESULT($UDEV_SYNC)
724
725if test x$UDEV_SYNC = xyes; then
f7f0854e
ZK
726 AC_CHECK_LIB(udev, udev_queue_get_udev_is_active,
727 [UDEV_PC="libudev"; UDEV_LIBS="-ludev"],
728 [AC_MSG_ERROR([bailing out... libudev library is required])])
5d518f1f
AK
729 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
730fi
731
732dnl -- Enable udev rules
733AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
71082be4
ZK
734AC_ARG_ENABLE(udev_rules,
735 AC_HELP_STRING([--enable-udev_rules],
736 [install rule files needed for udev synchronisation]),
737 UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
5d518f1f
AK
738AC_MSG_RESULT($UDEV_RULES)
739
f6fc418d
AK
740################################################################################
741dnl -- Compatibility mode
71082be4
ZK
742AC_ARG_ENABLE(compat,
743 AC_HELP_STRING([--enable-compat],
744 [enable support for old device-mapper versions]),
745 DM_COMPAT=$enableval, DM_COMPAT=no)
f6fc418d 746
95eaa683
AK
747################################################################################
748dnl -- Compatible units suffix mode
749AC_ARG_ENABLE(units-compat,
71082be4
ZK
750 AC_HELP_STRING([--enable-units-compat],
751 [enable output compatibility with old versions that
752 that do not use KiB-style unit suffixes]),
753 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
95eaa683
AK
754
755if test x$UNITS_COMPAT = xyes; then
756 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
757fi
758
f6fc418d
AK
759################################################################################
760dnl -- Disable ioctl
71082be4
ZK
761AC_ARG_ENABLE(ioctl,
762 AC_HELP_STRING([--disable-driver],
763 [disable calls to device-mapper in the kernel]),
764 DM_IOCTLS=$enableval)
f6fc418d 765
80992638 766################################################################################
8ce0cbda 767dnl -- Disable O_DIRECT
ad6254c5 768AC_MSG_CHECKING(whether to enable O_DIRECT)
71082be4
ZK
769AC_ARG_ENABLE(o_direct,
770 AC_HELP_STRING([--disable-o_direct], [disable O_DIRECT]),
771 ODIRECT=$enableval)
ad6254c5 772AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
773
774if test x$ODIRECT = xyes; then
72b2cb61 775 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
776fi
777
572fefeb
AK
778################################################################################
779dnl -- Enable liblvm2app.so
780AC_MSG_CHECKING(whether to build liblvm2app.so application library)
781AC_ARG_ENABLE(applib,
71082be4
ZK
782 AC_HELP_STRING([--enable-applib], [build application library]),
783 APPLIB=$enableval, APPLIB=no)
572fefeb
AK
784AC_MSG_RESULT($APPLIB)
785AC_SUBST([LVM2APP_LIB])
786test x$APPLIB = xyes \
787 && LVM2APP_LIB=-llvm2app \
788 || LVM2APP_LIB=
789
80992638 790################################################################################
8ce0cbda 791dnl -- Enable cmdlib
ad6254c5 792AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
71082be4
ZK
793AC_ARG_ENABLE(cmdlib,
794 AC_HELP_STRING([--enable-cmdlib], [build shared command library]),
795 CMDLIB=$enableval, CMDLIB=no)
ad6254c5 796AC_MSG_RESULT($CMDLIB)
aa4d1e31 797AC_SUBST([LVM2CMD_LIB])
2a9a80c9 798test x$CMDLIB = xyes \
aa4d1e31
JM
799 && LVM2CMD_LIB=-llvm2cmd \
800 || LVM2CMD_LIB=
8106cdd5 801
f6fc418d
AK
802################################################################################
803dnl -- Enable pkg-config
71082be4
ZK
804AC_ARG_ENABLE(pkgconfig,
805 AC_HELP_STRING([--enable-pkgconfig], [install pkgconfig support]),
806 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 807
23b059e7
ZK
808################################################################################
809dnl -- Enable installation of writable files by user
71082be4
ZK
810AC_ARG_ENABLE(write_install,
811 AC_HELP_STRING([--enable-write_install],
812 [install user writable files]),
813 WRITE_INSTALL=$enableval, WRITE_INSTALL=no)
23b059e7 814
80992638 815################################################################################
8ce0cbda 816dnl -- Enable fsadm
1995c9ff 817AC_MSG_CHECKING(whether to install fsadm)
71082be4
ZK
818AC_ARG_ENABLE(fsadm, AC_HELP_STRING([--disable-fsadm], [disable fsadm]),
819 FSADM=$enableval)
ad6254c5 820AC_MSG_RESULT($FSADM)
809fae91 821
06f62ad1
AK
822################################################################################
823dnl -- enable dmeventd handling
824AC_MSG_CHECKING(whether to use dmeventd)
71082be4
ZK
825AC_ARG_ENABLE(dmeventd, AC_HELP_STRING([--enable-dmeventd],
826 [enable the device-mapper event daemon]),
827 DMEVENTD=$enableval)
06f62ad1
AK
828AC_MSG_RESULT($DMEVENTD)
829
f6fc418d
AK
830BUILD_DMEVENTD=$DMEVENTD
831
06f62ad1 832dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
833if test x$DMEVENTD = xyes; then
834 if test x$MIRRORS != xinternal; then
835 AC_MSG_ERROR(
836 --enable-dmeventd currently requires --with-mirrors=internal
837 )
838 fi
839 if test x$CMDLIB = xno; then
840 AC_MSG_ERROR(
841 --enable-dmeventd requires --enable-cmdlib to be used as well
842 )
843 fi
06f62ad1
AK
844fi
845
15d91f5a 846if test x$DMEVENTD = xyes; then
72b2cb61 847 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 848fi
f6fc418d
AK
849
850################################################################################
851dnl -- getline included in recent libc
852
853AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
854 [Define to 1 if getline is available.]))
855
856################################################################################
857dnl -- canonicalize_file_name included in recent libc
858
859AC_CHECK_LIB(c, canonicalize_file_name,
860 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
861 [Define to 1 if canonicalize_file_name is available.]))
862
80992638 863################################################################################
d0191583 864dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
865if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
866 then exec_prefix="";
867fi;
868
80992638 869################################################################################
8ce0cbda 870dnl -- Check for dlopen
19a2c6e0 871AC_CHECK_LIB(dl, dlopen, [
72b2cb61 872 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
19a2c6e0
ZK
873 DL_LIBS="-ldl"
874 HAVE_LIBDL=yes ], [
875 DL_LIBS=
876 HAVE_LIBDL=no ])
26e7f2e0 877
80992638 878################################################################################
8ce0cbda 879dnl -- Check for shared/static conflicts
80992638
AK
880if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
881 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 882 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 883 then AC_MSG_ERROR(
036f273a 884Features cannot be 'shared' when building statically
d68a82ec 885)
036f273a
AK
886fi
887
f30875db
ZK
888################################################################################
889if [[ "$DMEVENTD" = yes -o "$CLVMD" != none ]] ; then
890 AC_CHECK_LIB([pthread], [pthread_mutex_lock],
891 [PTHREAD_LIBS="-lpthread"], hard_bailout)
892fi
893
d0191583
JM
894################################################################################
895dnl -- Disable selinux
896AC_MSG_CHECKING(whether to enable selinux support)
71082be4
ZK
897AC_ARG_ENABLE(selinux,
898 AC_HELP_STRING([--disable-selinux], [disable selinux support]),
899 SELINUX=$enableval)
d0191583
JM
900AC_MSG_RESULT($SELINUX)
901
80992638 902################################################################################
8a2fc586 903dnl -- Check for selinux
80992638 904if test x$SELINUX = xyes; then
f8f6ec92
ZK
905 AC_CHECK_LIB([sepol], [sepol_check_context], [
906 AC_DEFINE([HAVE_SEPOL], 1, [Define to 1 if sepol_check_context is available.])
907 SELINUX_LIBS="-lsepol"])
8a2fc586 908
f8f6ec92
ZK
909 AC_CHECK_LIB([selinux], [is_selinux_enabled], [
910 AC_CHECK_HEADERS([selinux/selinux.h],, hard_bailout)
72b2cb61 911 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
e1b8a236 912 SELINUX_LIBS="-lselinux $SELINUX_LIBS"
f7f0854e 913 SELINUX_PC="libselinux"
f8f6ec92 914 HAVE_SELINUX=yes ], [
ad6254c5 915 AC_MSG_WARN(Disabling selinux)
f8f6ec92 916 SELINUX_LIBS=
f7f0854e 917 SELINUX_PC=
f8f6ec92 918 HAVE_SELINUX=no ])
036f273a 919fi
d68a82ec 920
8b1a3214
AK
921################################################################################
922dnl -- Check for realtime clock support
923if test x$REALTIME = xyes; then
8b1a3214 924 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
925
926 if test x$HAVE_REALTIME = xyes; then
927 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
928 LIBS="-lrt $LIBS"
929 else
930 AC_MSG_WARN(Disabling realtime clock)
931 fi
932fi
933
80992638 934################################################################################
8ce0cbda 935dnl -- Check for getopt
d0191583 936AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 937
80992638 938################################################################################
8ce0cbda 939dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 940if test x$READLINE != xno; then
539f4a77
ZK
941 lvm_saved_libs=$LIBS
942 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
943 READLINE_LIBS=$ac_cv_search_tgetent, [
944 if test "$READLINE" = yes; then
945 AC_MSG_ERROR(
946[termcap could not be found which is required for the
947--enable-readline option (which is enabled by default). Either disable readline
948support with --disable-readline or download and install termcap from:
949 ftp.gnu.org/gnu/termcap
950Note: if you are using precompiled packages you will also need the development
951 package as well (which may be called termcap-devel or something similar).
952Note: (n)curses also seems to work as a substitute for termcap. This was
953 not found either - but you could try installing that as well.])
954 fi])
955 dnl -- Old systems may need extra termcap dependency explicitly in LIBS
956 AC_CHECK_LIB([readline], [readline], [
957 AC_DEFINE([READLINE_SUPPORT], 1,
958 [Define to 1 to include the LVM readline shell.])
959 dnl -- Try only with -lreadline and check for different symbol
960 LIBS=$lvm_saved_libs
961 AC_CHECK_LIB([readline], [rl_line_buffer],
962 [ READLINE_LIBS="-lreadline" ], [
963 AC_MSG_RESULT([linking -lreadline with $READLINE_LIBS needed])
964 READLINE_LIBS="-lreadline $READLINE_LIBS"
965 ]) ], [
966 READLINE_LIBS=
967 if test "$READLINE" = yes; then
968 AC_MSG_ERROR(
969[GNU Readline could not be found which is required for the
795ca3e5
AK
970--enable-readline option (which is enabled by default). Either disable readline
971support with --disable-readline or download and install readline from:
972 ftp.gnu.org/gnu/readline
973Note: if you are using precompiled packages you will also need the development
539f4a77
ZK
974package as well (which may be called readline-devel or something similar).])
975 fi ])
976 LIBS="$READLINE_LIBS $lvm_saved_libs"
977 AC_CHECK_FUNCS([rl_completion_matches])
978 LIBS=$lvm_saved_libs
795ca3e5
AK
979fi
980
80992638 981################################################################################
8ce0cbda 982dnl -- Internationalisation stuff
ad6254c5 983AC_MSG_CHECKING(whether to enable internationalisation)
71082be4
ZK
984AC_ARG_ENABLE(nls,
985 AC_HELP_STRING([--enable-nls], [enable Native Language Support]),
986 INTL=$enableval, INTL=no)
ad6254c5 987AC_MSG_RESULT($INTL)
69792976
AK
988
989if test x$INTL = xyes; then
f6fc418d 990# FIXME - Move this - can be device-mapper too
69792976
AK
991 INTL_PACKAGE="lvm2"
992 AC_PATH_PROG(MSGFMT, msgfmt)
993 if [[ "x$MSGFMT" == x ]];
994 then AC_MSG_ERROR(
995 msgfmt not found in path $PATH
996 )
69792976
AK
997 fi;
998
999 AC_ARG_WITH(localedir,
71082be4
ZK
1000 AC_HELP_STRING([--with-localedir=DIR],
1001 [translation files in DIR
1002 [[PREFIX/share/locale]]]),
1003 LOCALEDIR=$withval, LOCALEDIR='${prefix}/share/locale')
69792976
AK
1004fi
1005
80992638 1006################################################################################
4a7f3eb2 1007AC_ARG_WITH(confdir,
71082be4
ZK
1008 AC_HELP_STRING([--with-confdir=DIR],
1009 [configuration files in DIR [[/etc]]]),
1010 CONFDIR=$withval, CONFDIR="/etc")
0a62c911
AK
1011
1012AC_ARG_WITH(staticdir,
71082be4
ZK
1013 AC_HELP_STRING([--with-staticdir=DIR],
1014 [static binaries in DIR [[EPREFIX/sbin]]]),
1015 STATICDIR=$withval, STATICDIR='${exec_prefix}/sbin')
0a62c911 1016
68f2de6d 1017AC_ARG_WITH(usrlibdir,
71082be4
ZK
1018 AC_HELP_STRING([--with-usrlibdir=DIR],
1019 [usrlib in DIR [[PREFIX/lib]]]),
1020 usrlibdir=$withval, usrlibdir='${prefix}/lib')
68f2de6d
AK
1021
1022AC_ARG_WITH(usrsbindir,
71082be4
ZK
1023 AC_HELP_STRING([--with-usrsbindir=DIR],
1024 [usrsbin executables in DIR [[PREFIX/sbin]]]),
1025 usrsbindir=$withval, usrsbindir='${prefix}/sbin')
68f2de6d 1026
5d518f1f
AK
1027################################################################################
1028AC_ARG_WITH(udev_prefix,
71082be4
ZK
1029 AC_HELP_STRING([--with-udev-prefix=UPREFIX],
1030 [install udev rule files in UPREFIX [[EPREFIX]]]),
1031 udev_prefix=$withval, udev_prefix='${exec_prefix}')
5d518f1f 1032
78ce7acc 1033AC_ARG_WITH(udevdir,
71082be4
ZK
1034 AC_HELP_STRING([--with-udevdir=DIR],
1035 [udev rules in DIR [[UPREFIX/lib/udev/rules.d]]]),
1036 udevdir=$withval, udevdir='${udev_prefix}/lib/udev/rules.d')
5d518f1f 1037
ad6254c5
AK
1038################################################################################
1039dnl -- Ensure additional headers required
1040if test x$READLINE = xyes; then
1041 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
1042fi
1043
5c7fc7c4 1044if test x$CLVMD != xnone; then
ad6254c5
AK
1045 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))
1046 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
1047 AC_FUNC_GETMNTENT
ad6254c5
AK
1048 AC_FUNC_SELECT_ARGTYPES
1049fi
1050
ad6254c5
AK
1051if test x$CLUSTER != xnone; then
1052 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
1053 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
1054fi
1055
d911ec67
AK
1056if test x$DMEVENTD = xyes; then
1057 AC_CHECK_HEADERS(arpa/inet.h,,AC_MSG_ERROR(bailing out))
1058fi
1059
ad6254c5
AK
1060if test x$HAVE_LIBDL = xyes; then
1061 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
1062fi
1063
1064if test x$INTL = xyes; then
1065 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
1066fi
1067
5d518f1f
AK
1068if test x$UDEV_SYNC = xyes; then
1069 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
1070fi
1071
a653923f
AK
1072################################################################################
1073AC_PATH_PROG(MODPROBE_CMD, modprobe)
1074
1075if test x$MODPROBE_CMD != x; then
72b2cb61 1076 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
1077fi
1078
a9b601e2
ZK
1079
1080lvm_exec_prefix=$exec_prefix
1081test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$prefix
1082test "$lvm_exec_prefix" = NONE && lvm_exec_prefix=$ac_default_prefix
1083AC_DEFINE_UNQUOTED(LVM_PATH, ["$lvm_exec_prefix/sbin/lvm"], [Path to lvm binary.])
b5c2529b
ZK
1084
1085if test "$CLVMD" != none; then
1086 clvmd_prefix=$ac_default_prefix
1087 test "$prefix" != NONE && clvmd_prefix=$prefix
71082be4
ZK
1088 AC_DEFINE_UNQUOTED(CLVMD_PATH, ["$clvmd_prefix/sbin/clvmd"],
1089 [Path to clvmd binary.])
b5c2529b
ZK
1090fi
1091
80992638 1092################################################################################
f6fc418d 1093dnl -- dmeventd pidfile and executable path
f6fc418d
AK
1094if test "$BUILD_DMEVENTD" = yes; then
1095 AC_ARG_WITH(dmeventd-pidfile,
71082be4
ZK
1096 AC_HELP_STRING([--with-dmeventd-pidfile=PATH],
1097 [dmeventd pidfile [[/var/run/dmeventd.pid]]]),
1098 DMEVENTD_PIDFILE=$withval,
1099 DMEVENTD_PIDFILE="/var/run/dmeventd.pid")
1100 AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE, ["$DMEVENTD_PIDFILE"],
1101 [Path to dmeventd pidfile.])
f6fc418d
AK
1102fi
1103
f6fc418d 1104if test "$BUILD_DMEVENTD" = yes; then
f6fc418d 1105 AC_ARG_WITH(dmeventd-path,
71082be4
ZK
1106 AC_HELP_STRING([--with-dmeventd-path=PATH],
1107 [dmeventd path [[EPREFIX/sbin/dmeventd]]]),
1108 DMEVENTD_PATH=$withval,
1109 DMEVENTD_PATH="$lvm_exec_prefix/sbin/dmeventd")
1110 AC_DEFINE_UNQUOTED(DMEVENTD_PATH, ["$DMEVENTD_PATH"],
1111 [Path to dmeventd binary.])
f6fc418d
AK
1112fi
1113
3399ae32
AK
1114################################################################################
1115dnl -- various defaults
3399ae32 1116AC_ARG_WITH(default-system-dir,
71082be4
ZK
1117 AC_HELP_STRING([--with-default-system-dir=DIR],
1118 [default LVM system directory [[/etc/lvm]]]),
1119 DEFAULT_SYS_DIR=$withval, DEFAULT_SYS_DIR="/etc/lvm")
1120AC_DEFINE_UNQUOTED(DEFAULT_SYS_DIR, ["$DEFAULT_SYS_DIR"],
1121 [Path to LVM system directory.])
3399ae32 1122
3399ae32 1123AC_ARG_WITH(default-archive-subdir,
71082be4
ZK
1124 AC_HELP_STRING([--with-default-archive-subdir=SUBDIR],
1125 [default metadata archive subdir [[archive]]]),
1126 DEFAULT_ARCHIVE_SUBDIR=$withval, DEFAULT_ARCHIVE_SUBDIR=archive)
1127AC_DEFINE_UNQUOTED(DEFAULT_ARCHIVE_SUBDIR, ["$DEFAULT_ARCHIVE_SUBDIR"],
1128 [Name of default metadata archive subdirectory.])
3399ae32 1129
3399ae32 1130AC_ARG_WITH(default-backup-subdir,
71082be4
ZK
1131 AC_HELP_STRING([--with-default-backup-subdir=SUBDIR],
1132 [default metadata backup subdir [[backup]]]),
1133 DEFAULT_BACKUP_SUBDIR=$withval, DEFAULT_BACKUP_SUBDIR=backup)
1134AC_DEFINE_UNQUOTED(DEFAULT_BACKUP_SUBDIR, ["$DEFAULT_BACKUP_SUBDIR"],
1135 [Name of default metadata backup subdirectory.])
3399ae32 1136
3399ae32 1137AC_ARG_WITH(default-cache-subdir,
71082be4
ZK
1138 AC_HELP_STRING([--with-default-cache-subdir=SUBDIR],
1139 [default metadata cache subdir [[cache]]]),
1140 DEFAULT_CACHE_SUBDIR=$withval, DEFAULT_CACHE_SUBDIR=cache)
1141AC_DEFINE_UNQUOTED(DEFAULT_CACHE_SUBDIR, ["$DEFAULT_CACHE_SUBDIR"],
1142 [Name of default metadata cache subdirectory.])
3399ae32 1143
3399ae32 1144AC_ARG_WITH(default-locking-dir,
71082be4
ZK
1145 AC_HELP_STRING([--with-default-locking-dir=DIR],
1146 [default locking directory [[/var/lock/lvm]]]),
1147 DEFAULT_LOCK_DIR=$withval, DEFAULT_LOCK_DIR="/var/lock/lvm")
1148AC_DEFINE_UNQUOTED(DEFAULT_LOCK_DIR, ["$DEFAULT_LOCK_DIR"],
1149 [Name of default locking directory.])
3399ae32 1150
f6fc418d
AK
1151################################################################################
1152dnl -- which kernel interface to use (ioctl only)
1153AC_MSG_CHECKING(for kernel interface choice)
1154AC_ARG_WITH(interface,
71082be4
ZK
1155 AC_HELP_STRING([--with-interface=IFACE],
1156 [choose kernel interface (ioctl) [[ioctl]]]),
1157 interface=$withval, interface=ioctl)
f6fc418d
AK
1158if [[ "x$interface" != xioctl ]];
1159then
1160 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1161fi
1162AC_MSG_RESULT($interface)
1163
1164################################################################################
db8b5af9 1165DM_LIB_VERSION="\"`cat "$srcdir"/VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
1166AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1167
db8b5af9 1168DM_LIB_PATCHLEVEL=`cat "$srcdir"/VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 1169
db8b5af9 1170LVM_VERSION="\"`cat "$srcdir"/VERSION 2>/dev/null || echo Unknown`\""
fae0c576 1171
db8b5af9 1172VER=`cat "$srcdir"/VERSION`
bf456146 1173LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
ec6a6fbe
AK
1174VER=`echo "$VER" | $AWK '{print $1}'`
1175LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1176VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1177LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1178LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
bf456146
AK
1179LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1180LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
ec6a6fbe 1181
80992638 1182################################################################################
572fefeb 1183AC_SUBST(APPLIB)
aaa2e046 1184AC_SUBST(AWK)
66fd4529 1185AC_SUBST(BUILD_CMIRRORD)
d0191583 1186AC_SUBST(BUILD_DMEVENTD)
a946372e
AK
1187AC_SUBST(CCS_CFLAGS)
1188AC_SUBST(CCS_LIBS)
b896caa1 1189AC_SUBST(CFLAGS)
d0191583 1190AC_SUBST(CFLOW_CMD)
8106cdd5 1191AC_SUBST(CLDFLAGS)
8106cdd5 1192AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
1193AC_SUBST(CLDWHOLEARCHIVE)
1194AC_SUBST(CLUSTER)
1195AC_SUBST(CLVMD)
a946372e
AK
1196AC_SUBST(CMAN_CFLAGS)
1197AC_SUBST(CMAN_LIBS)
d0191583 1198AC_SUBST(CMDLIB)
edf47283
AK
1199AC_SUBST(CONFDB_CFLAGS)
1200AC_SUBST(CONFDB_LIBS)
1201AC_SUBST(CONFDIR)
d0191583 1202AC_SUBST(COPTIMISE_FLAG)
edf47283
AK
1203AC_SUBST(CPG_CFLAGS)
1204AC_SUBST(CPG_LIBS)
d0191583 1205AC_SUBST(CSCOPE_CMD)
8ef2b021 1206AC_SUBST(DEBUG)
3399ae32
AK
1207AC_SUBST(DEFAULT_SYS_DIR)
1208AC_SUBST(DEFAULT_ARCHIVE_SUBDIR)
1209AC_SUBST(DEFAULT_BACKUP_SUBDIR)
1210AC_SUBST(DEFAULT_CACHE_SUBDIR)
1211AC_SUBST(DEFAULT_LOCK_DIR)
199e490e 1212AC_SUBST(DEVMAPPER)
a946372e
AK
1213AC_SUBST(DLM_CFLAGS)
1214AC_SUBST(DLM_LIBS)
19a2c6e0 1215AC_SUBST(DL_LIBS)
d0191583
JM
1216AC_SUBST(DMEVENTD)
1217AC_SUBST(DM_COMPAT)
1218AC_SUBST(DM_DEVICE_GID)
1219AC_SUBST(DM_DEVICE_MODE)
1220AC_SUBST(DM_DEVICE_UID)
1221AC_SUBST(DM_IOCTLS)
1222AC_SUBST(DM_LIB_VERSION)
597c3f8e 1223AC_SUBST(DM_LIB_PATCHLEVEL)
d0191583 1224AC_SUBST(FSADM)
a946372e
AK
1225AC_SUBST(GULM_CFLAGS)
1226AC_SUBST(GULM_LIBS)
26e7f2e0 1227AC_SUBST(HAVE_LIBDL)
8b1a3214 1228AC_SUBST(HAVE_REALTIME)
d0191583
JM
1229AC_SUBST(INTL)
1230AC_SUBST(INTL_PACKAGE)
1231AC_SUBST(JOBS)
1232AC_SUBST(LDDEPS)
1233AC_SUBST(LIBS)
1234AC_SUBST(LIB_SUFFIX)
69792976 1235AC_SUBST(LOCALEDIR)
d0191583
JM
1236AC_SUBST(LVM1)
1237AC_SUBST(LVM1_FALLBACK)
d0191583 1238AC_SUBST(LVM_VERSION)
bf456146 1239AC_SUBST(LVM_LIBAPI)
ec6a6fbe
AK
1240AC_SUBST(LVM_MAJOR)
1241AC_SUBST(LVM_MINOR)
1242AC_SUBST(LVM_PATCHLEVEL)
1243AC_SUBST(LVM_RELEASE)
1244AC_SUBST(LVM_RELEASE_DATE)
d0191583 1245AC_SUBST(MIRRORS)
8fea97b7 1246AC_SUBST(REPLICATORS)
d0191583 1247AC_SUBST(MSGFMT)
d0191583
JM
1248AC_SUBST(PKGCONFIG)
1249AC_SUBST(POOL)
f30875db 1250AC_SUBST(PTHREAD_LIBS)
edf47283
AK
1251AC_SUBST(QUORUM_CFLAGS)
1252AC_SUBST(QUORUM_LIBS)
539f4a77 1253AC_SUBST(READLINE_LIBS)
90c80887
AK
1254AC_SUBST(SACKPT_CFLAGS)
1255AC_SUBST(SACKPT_LIBS)
a946372e
AK
1256AC_SUBST(SALCK_CFLAGS)
1257AC_SUBST(SALCK_LIBS)
e1b8a236 1258AC_SUBST(SELINUX_LIBS)
f7f0854e 1259AC_SUBST(SELINUX_PC)
d0191583 1260AC_SUBST(SNAPSHOTS)
0a62c911 1261AC_SUBST(STATICDIR)
d0191583 1262AC_SUBST(STATIC_LINK)
db724a44 1263AC_SUBST(UDEV_LIBS)
f7f0854e 1264AC_SUBST(UDEV_PC)
5d518f1f 1265AC_SUBST(UDEV_RULES)
4df024c4 1266AC_SUBST(UDEV_SYNC)
23b059e7 1267AC_SUBST(WRITE_INSTALL)
f6fc418d
AK
1268AC_SUBST(interface)
1269AC_SUBST(kerneldir)
1270AC_SUBST(missingkernel)
1271AC_SUBST(kernelvsn)
1272AC_SUBST(tmpdir)
5d518f1f
AK
1273AC_SUBST(udev_prefix)
1274AC_SUBST(udevdir)
68f2de6d
AK
1275AC_SUBST(usrlibdir)
1276AC_SUBST(usrsbindir)
8106cdd5 1277
80992638 1278################################################################################
d3a356b4 1279dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 1280dnl -- keep utility scripts running properly
d3a356b4
JM
1281AC_CONFIG_FILES([
1282Makefile
1283make.tmpl
1284daemons/Makefile
1285daemons/clvmd/Makefile
5d311afb 1286daemons/cmirrord/Makefile
f6fc418d
AK
1287daemons/dmeventd/Makefile
1288daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 1289daemons/dmeventd/plugins/Makefile
d3d98fdc 1290daemons/dmeventd/plugins/lvm2/Makefile
f6fc418d
AK
1291daemons/dmeventd/plugins/mirror/Makefile
1292daemons/dmeventd/plugins/snapshot/Makefile
d3a356b4 1293doc/Makefile
da05c479 1294doc/example.conf
db8b5af9 1295include/.symlinks
f6fc418d
AK
1296include/Makefile
1297lib/Makefile
d3a356b4
JM
1298lib/format1/Makefile
1299lib/format_pool/Makefile
1300lib/locking/Makefile
1301lib/mirror/Makefile
8fea97b7 1302lib/replicator/Makefile
ec6a6fbe 1303lib/misc/lvm-version.h
d3a356b4 1304lib/snapshot/Makefile
f6fc418d
AK
1305libdm/Makefile
1306libdm/libdevmapper.pc
e0c64c6c 1307liblvm/Makefile
70046623 1308liblvm/liblvm2app.pc
f6fc418d
AK
1309man/Makefile
1310po/Makefile
2de38033 1311scripts/clvmd_init_red_hat
81410c8f 1312scripts/cmirrord_init_red_hat
595eaf92 1313scripts/lvm2_monitoring_init_red_hat
d3a356b4 1314scripts/Makefile
f6fc418d 1315test/Makefile
c7e363f9 1316test/api/Makefile
d3a356b4 1317tools/Makefile
5d518f1f 1318udev/Makefile
7a197a62
AK
1319])
1320AC_OUTPUT
2dc95e1c
AK
1321
1322if test x$ODIRECT != xyes; then
ad6254c5 1323 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 1324fi
This page took 0.226715 seconds and 5 git commands to generate.