]> sourceware.org Git - lvm2.git/blame - configure.in
Consolidate LV allocation into alloc_lv().
[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
7a197a62 14AC_PREREQ(2.57)
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
8b1a3214 43 REALTIME=yes
d3c8211f 44 CLUSTER=internal
f6fc418d 45 FSADM=yes
d0191583 46 ;;
8106cdd5 47 darwin*)
80992638 48 CFLAGS="$CFLAGS -no-cpp-precomp -fno-common"
8ce0cbda 49 COPTIMISE_FLAG="-O2"
80992638 50 CLDFLAGS="$CLDFLAGS"
8106cdd5
AK
51 CLDWHOLEARCHIVE="-all_load"
52 CLDNOWHOLEARCHIVE=
d0191583 53 LIB_SUFFIX=dylib
a653923f 54 DEVMAPPER=yes
1a9ea74d 55 ODIRECT=no
d0191583 56 DM_IOCTLS=no
80992638 57 SELINUX=no
8b1a3214 58 REALTIME=no
d3c8211f 59 CLUSTER=none
d0191583
JM
60 FSADM=no
61 ;;
b896caa1
AK
62esac
63
80992638 64################################################################################
8ce0cbda 65dnl -- Checks for programs.
162aefe8 66AC_PROG_SED
8ce0cbda
AK
67AC_PROG_AWK
68AC_PROG_CC
d0191583
JM
69
70dnl probably no longer needed in 2008, but...
71AC_PROG_GCC_TRADITIONAL
8ce0cbda
AK
72AC_PROG_INSTALL
73AC_PROG_LN_S
74AC_PROG_MAKE_SET
162aefe8 75AC_PROG_MKDIR_P
5556819a 76AC_PROG_RANLIB
8a2fc586
AK
77AC_PATH_PROG(CFLOW_CMD, cflow)
78AC_PATH_PROG(CSCOPE_CMD, cscope)
8ce0cbda
AK
79
80################################################################################
d0191583 81dnl -- Check for header files.
80992638
AK
82AC_HEADER_DIRENT
83AC_HEADER_STDC
ad6254c5
AK
84AC_HEADER_SYS_WAIT
85AC_HEADER_TIME
86
d0191583
JM
87AC_CHECK_HEADERS([locale.h stddef.h syslog.h sys/file.h sys/time.h assert.h \
88 libgen.h signal.h sys/mman.h sys/resource.h sys/utsname.h sys/wait.h time.h], ,
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
7a197a62 113AC_CHECK_MEMBERS([struct stat.st_rdev])
ad6254c5
AK
114AC_STRUCT_TM
115
116################################################################################
117dnl -- Check for functions
d0191583
JM
118AC_CHECK_FUNCS([gethostname getpagesize memset mkdir rmdir munmap setlocale \
119 strcasecmp strchr strdup strncasecmp strerror strrchr strstr strtol strtoul \
120 uname], , [AC_MSG_ERROR(bailing out)])
ad6254c5
AK
121AC_FUNC_ALLOCA
122AC_FUNC_CLOSEDIR_VOID
123AC_FUNC_FORK
124AC_FUNC_LSTAT
125AC_FUNC_MALLOC
126AC_FUNC_MEMCMP
127AC_FUNC_MMAP
128AC_FUNC_STAT
129AC_FUNC_STRTOD
d0191583 130AC_FUNC_VPRINTF
80992638 131
9c961554
MB
132################################################################################
133dnl -- Enables statically-linked tools
134AC_MSG_CHECKING(whether to use static linking)
135AC_ARG_ENABLE(static_link,
136 [ --enable-static_link Use this to link the tools to their libraries
137 statically. Default is dynamic linking],
138 STATIC_LINK=$enableval, STATIC_LINK=no)
139AC_MSG_RESULT($STATIC_LINK)
140
80992638 141################################################################################
8ce0cbda 142dnl -- Prefix is /usr by default, the exec_prefix default is setup later
795ca3e5
AK
143AC_PREFIX_DEFAULT(/usr)
144
80992638 145################################################################################
8ce0cbda 146dnl -- Setup the ownership of the files
ad6254c5 147AC_MSG_CHECKING(file owner)
80992638
AK
148OWNER="root"
149
795ca3e5 150AC_ARG_WITH(user,
d0191583 151 [ --with-user=USER Set the owner of installed files [[USER=root]] ],
a38df97f 152 [ OWNER="$withval" ])
ad6254c5 153AC_MSG_RESULT($OWNER)
a38df97f
AK
154
155if test x$OWNER != x; then
156 OWNER="-o $OWNER"
157fi
795ca3e5 158
80992638 159################################################################################
8ce0cbda 160dnl -- Setup the group ownership of the files
ad6254c5 161AC_MSG_CHECKING(group owner)
80992638 162GROUP="root"
795ca3e5 163AC_ARG_WITH(group,
d0191583 164 [ --with-group=GROUP Set the group owner of installed files [[GROUP=root]] ],
a38df97f 165 [ GROUP="$withval" ])
ad6254c5 166AC_MSG_RESULT($GROUP)
a38df97f
AK
167
168if test x$GROUP != x; then
169 GROUP="-g $GROUP"
170fi
795ca3e5 171
0782ad50
AK
172################################################################################
173dnl -- Setup device node ownership
174AC_MSG_CHECKING(device node uid)
175
176AC_ARG_WITH(device-uid,
177 [ --with-device-uid=UID Set the owner used for new device nodes [[UID=0]] ],
178 [ DM_DEVICE_UID="$withval" ], [ DM_DEVICE_UID="0" ] )
179AC_MSG_RESULT($DM_DEVICE_UID)
180
181################################################################################
182dnl -- Setup device group ownership
183AC_MSG_CHECKING(device node gid)
184
185AC_ARG_WITH(device-gid,
186 [ --with-device-gid=UID Set the group used for new device nodes [[GID=0]] ],
187 [ DM_DEVICE_GID="$withval" ], [ DM_DEVICE_GID="0" ] )
188AC_MSG_RESULT($DM_DEVICE_GID)
189
f6fc418d
AK
190################################################################################
191dnl -- Setup device mode
192AC_MSG_CHECKING(device node mode)
193
194AC_ARG_WITH(device-mode,
195 [ --with-device-mode=MODE Set the mode used for new device nodes [[MODE=0600]] ],
196 [ DM_DEVICE_MODE="$withval" ], [ DM_DEVICE_MODE="0600" ] )
197AC_MSG_RESULT($DM_DEVICE_MODE)
198
80992638 199################################################################################
7d1552c9 200dnl -- LVM1 tool fallback option
ad6254c5 201AC_MSG_CHECKING(whether to enable lvm1 fallback)
7d1552c9
AK
202AC_ARG_ENABLE(lvm1_fallback, [ --enable-lvm1_fallback Use this to fall back and use LVM1 binaries if
203 device-mapper is missing from the kernel], LVM1_FALLBACK=$enableval, LVM1_FALLBACK=no)
ad6254c5 204AC_MSG_RESULT($LVM1_FALLBACK)
7d1552c9
AK
205
206if test x$LVM1_FALLBACK = xyes; then
72b2cb61 207 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
208fi
209
80992638 210################################################################################
5a52dca9 211dnl -- format1 inclusion type
ad6254c5 212AC_MSG_CHECKING(whether to include support for lvm1 metadata)
5a52dca9
AK
213AC_ARG_WITH(lvm1,
214 [ --with-lvm1=TYPE LVM1 metadata support: internal/shared/none
215 [TYPE=internal] ],
216 [ LVM1="$withval" ],
217 [ LVM1="internal" ])
ad6254c5 218AC_MSG_RESULT($LVM1)
5a52dca9
AK
219
220if [[ "x$LVM1" != xnone -a "x$LVM1" != xinternal -a "x$LVM1" != xshared ]];
221 then AC_MSG_ERROR(
222--with-lvm1 parameter invalid
223)
5a52dca9
AK
224fi;
225
b896caa1 226if test x$LVM1 = xinternal; then
72b2cb61 227 AC_DEFINE([LVM1_INTERNAL], 1, [Define to 1 to include built-in support for LVM1 metadata.])
b896caa1
AK
228fi
229
80992638 230################################################################################
d8ac0fbc 231dnl -- format_pool inclusion type
ad6254c5 232AC_MSG_CHECKING(whether to include support for GFS pool metadata)
d8ac0fbc 233AC_ARG_WITH(pool,
60329273 234 [ --with-pool=TYPE GFS pool read-only support: internal/shared/none
d8ac0fbc
AK
235 [TYPE=internal] ],
236 [ POOL="$withval" ],
237 [ POOL="internal" ])
ad6254c5 238AC_MSG_RESULT($POOL)
d8ac0fbc
AK
239
240if [[ "x$POOL" != xnone -a "x$POOL" != xinternal -a "x$POOL" != xshared ]];
241 then AC_MSG_ERROR(
242--with-pool parameter invalid
243)
d8ac0fbc
AK
244fi;
245
246if test x$POOL = xinternal; then
72b2cb61 247 AC_DEFINE([POOL_INTERNAL], 1, [Define to 1 to include built-in support for GFS pool metadata.])
d8ac0fbc
AK
248fi
249
80992638 250################################################################################
d3c8211f 251dnl -- cluster_locking inclusion type
ad6254c5 252AC_MSG_CHECKING(whether to include support for cluster locking)
d3c8211f
AK
253AC_ARG_WITH(cluster,
254 [ --with-cluster=TYPE Cluster LVM locking support: internal/shared/none
255 [TYPE=internal] ],
256 [ CLUSTER="$withval" ])
ad6254c5 257AC_MSG_RESULT($CLUSTER)
d3c8211f
AK
258
259if [[ "x$CLUSTER" != xnone -a "x$CLUSTER" != xinternal -a "x$CLUSTER" != xshared ]];
260 then AC_MSG_ERROR(
261--with-cluster parameter invalid
262)
d3c8211f
AK
263fi;
264
265if test x$CLUSTER = xinternal; then
72b2cb61 266 AC_DEFINE([CLUSTER_LOCKING_INTERNAL], 1, [Define to 1 to include built-in support for clustered LVM locking.])
d3c8211f 267fi
d8ac0fbc 268
80992638 269################################################################################
4922197a 270dnl -- snapshots inclusion type
ad6254c5 271AC_MSG_CHECKING(whether to include snapshots)
4922197a
AK
272AC_ARG_WITH(snapshots,
273 [ --with-snapshots=TYPE Snapshot support: internal/shared/none
274 [TYPE=internal] ],
275 [ SNAPSHOTS="$withval" ],
276 [ SNAPSHOTS="internal" ])
ad6254c5 277AC_MSG_RESULT($SNAPSHOTS)
4922197a
AK
278
279if [[ "x$SNAPSHOTS" != xnone -a "x$SNAPSHOTS" != xinternal -a "x$SNAPSHOTS" != xshared ]];
280 then AC_MSG_ERROR(
281--with-snapshots parameter invalid
282)
4922197a
AK
283fi;
284
285if test x$SNAPSHOTS = xinternal; then
72b2cb61 286 AC_DEFINE([SNAPSHOT_INTERNAL], 1, [Define to 1 to include built-in support for snapshots.])
4922197a
AK
287fi
288
80992638 289################################################################################
4922197a 290dnl -- mirrors inclusion type
ad6254c5 291AC_MSG_CHECKING(whether to include mirrors)
4922197a
AK
292AC_ARG_WITH(mirrors,
293 [ --with-mirrors=TYPE Mirror support: internal/shared/none
294 [TYPE=internal] ],
295 [ MIRRORS="$withval" ],
296 [ MIRRORS="internal" ])
ad6254c5 297AC_MSG_RESULT($MIRRORS)
4922197a
AK
298
299if [[ "x$MIRRORS" != xnone -a "x$MIRRORS" != xinternal -a "x$MIRRORS" != xshared ]];
300 then AC_MSG_ERROR(
301--with-mirrors parameter invalid
302)
4922197a
AK
303fi;
304
305if test x$MIRRORS = xinternal; then
72b2cb61 306 AC_DEFINE([MIRRORED_INTERNAL], 1, [Define to 1 to include built-in support for mirrors.])
4922197a
AK
307fi
308
80992638 309################################################################################
1b523347 310dnl -- Disable readline
ad6254c5 311AC_MSG_CHECKING(whether to enable readline)
2c189a57 312AC_ARG_ENABLE([readline],
1b523347 313 [ --disable-readline Disable readline support],
ea7cfb00 314 [READLINE=$enableval], [READLINE=maybe])
ad6254c5 315AC_MSG_RESULT($READLINE)
795ca3e5 316
8b1a3214
AK
317################################################################################
318dnl -- Disable realtime clock support
319AC_MSG_CHECKING(whether to enable realtime support)
3d978351 320AC_ARG_ENABLE(realtime, [ --disable-realtime Disable realtime clock support],
8b1a3214
AK
321REALTIME=$enableval)
322AC_MSG_RESULT($REALTIME)
323
90c80887
AK
324################################################################################
325dnl -- Init pkg-config with dummy invokation:
326dnl -- this is required because PKG_CHECK_MODULES macro is expanded
327dnl -- to initialize the pkg-config environment only at the first invokation,
328dnl -- that would be conditional in this configure.in.
329pkg_config_init() {
330 PKG_CHECK_MODULES(PKGCONFIGINIT, pkgconfiginit, [],
331 [AC_MSG_RESULT([pkg-config initialized])])
332 PKGCONFIG_INIT=1
333}
334
80992638 335################################################################################
8ce0cbda 336dnl -- Build cluster LVM daemon
ad6254c5 337AC_MSG_CHECKING(whether to build cluster LVM daemon)
a266258f 338AC_ARG_WITH(clvmd,
a946372e 339 [ --with-clvmd=TYPE Build cluster LVM Daemon.
8c222979 340 The following cluster manager combinations are valid:
a946372e
AK
341 * cman,gulm (RHEL4 or equivalent)
342 * cman (RHEL5 or equivalent)
343 * cman,corosync,openais (or selection of them)
344 * all (autodetect)
345 * none (disable build)
a266258f
AK
346 [TYPE=none] ],
347 [ CLVMD="$withval" ],
348 [ CLVMD="none" ])
349if test x$CLVMD = xyes; then
5c7fc7c4 350 CLVMD=all
b1098701 351fi
ad6254c5 352AC_MSG_RESULT($CLVMD)
80992638 353
8ce0cbda 354dnl -- If clvmd enabled without cluster locking, automagically include it
a266258f 355if test x$CLVMD != xnone && test x$CLUSTER = xnone; then
d3c8211f
AK
356 CLUSTER=internal
357fi
d3c8211f 358
90c80887
AK
359dnl -- init pkgconfig if required
360if test x$CLVMD != xnone && test x$PKGCONFIG_INIT != x1; then
361 pkg_config_init
362fi
363
364
a946372e
AK
365dnl -- define build types
366if [[ `expr x"$CLVMD" : '.*gulm.*'` != 0 ]]; then
367 BUILDGULM=yes
368fi
369if [[ `expr x"$CLVMD" : '.*corosync.*'` != 0 ]]; then
370 BUILDCOROSYNC=yes
371fi
372if [[ `expr x"$CLVMD" : '.*openais.*'` != 0 ]]; then
373 BUILDOPENAIS=yes
374fi
375if [[ `expr x"$CLVMD" : '.*cman.*'` != 0 ]]; then
376 BUILDCMAN=yes
377fi
378
379dnl -- sanity check around user selection
380if test x$BUILDGULM = xyes; then
381 if test x$BUILDCOROSYNC = xyes || \
382 test x$BUILDOPENAIS = xyes; then
383 AC_MSG_ERROR([requested clvmd configuration is not valid])
384 fi
385fi
386
a946372e
AK
387dnl -- define a soft bailout if we are autodetecting
388soft_bailout() {
389 NOTFOUND=1
390}
391
392hard_bailout() {
393 AC_MSG_ERROR([bailing out])
394}
395
396dnl -- if clvmd=all then set soft_bailout (we don't want to error)
397dnl -- and set all builds to yes. We need to do this here
398dnl -- to skip the gulm + openais|corosync sanity check above.
399if test x$CLVMD = xall; then
400 bailout=soft_bailout
401 BUILDGULM=yes
402 BUILDCMAN=yes
403 BUILDCOROSYNC=yes
404 BUILDOPENAIS=yes
405else
406 bailout=hard_bailout
407fi
408
409dnl -- helper macro to check libs without adding them to LIBS
410check_lib_no_libs() {
411 lib_no_libs_arg1=$1
412 shift
413 lib_no_libs_arg2=$1
414 shift
415 lib_no_libs_args=$@
416 AC_CHECK_LIB([$lib_no_libs_arg1],
417 [$lib_no_libs_arg2],,
418 [$bailout],
419 [$lib_no_libs_args])
420 LIBS=$ac_check_lib_save_LIBS
421}
422
423dnl -- Look for gulm libraries if required.
424if test x$BUILDGULM = xyes; then
425 PKG_CHECK_MODULES(CCS, libccs, [HAVE_CCS=yes],
426 [NOTFOUND=0
427 AC_CHECK_HEADERS(ccs.h,,$bailout)
428 check_lib_no_libs ccs ccs_connect
429 if test $NOTFOUND = 0; then
430 AC_MSG_RESULT([no pkg for libccs, using -lccs])
431 CCS_LIBS="-lccs"
432 HAVE_CCS=yes
433 fi])
434 PKG_CHECK_MODULES(GULM, libgulm, [HAVE_GULM=yes],
435 [NOTFOUND=0
436 AC_CHECK_HEADERS(libgulm.h,,$bailout)
437 check_lib_no_libs gulm lg_core_login
438 if test $NOTFOUND = 0; then
439 AC_MSG_RESULT([no pkg for libgulm, using -lgulm])
440 GULM_LIBS="-lgulm"
441 HAVE_GULM=yes
442 fi])
443fi
444
445dnl -- Look for cman libraries if required.
446if test x$BUILDCMAN = xyes; then
447 PKG_CHECK_MODULES(CMAN, libcman, [HAVE_CMAN=yes],
448 [NOTFOUND=0
449 AC_CHECK_HEADERS(libcman.h,,$bailout)
450 check_lib_no_libs cman cman_init
451 if test $NOTFOUND = 0; then
452 AC_MSG_RESULT([no pkg for libcman, using -lcman])
453 CMAN_LIBS="-lcman"
454 HAVE_CMAN=yes
455 fi])
456 CHECKCONFDB=yes
457 CHECKDLM=yes
458fi
459
460dnl -- Look for corosync that's required also for openais build
461dnl -- only enough recent version of corosync ship pkg-config files.
462dnl -- We can safely rely on that to detect the correct bits.
463if test x$BUILDCOROSYNC = xyes || \
464 test x$BUILDOPENAIS = xyes; then
465 PKG_CHECK_MODULES(COROSYNC, corosync, [HAVE_COROSYNC=yes], $bailout)
466 CHECKCONFDB=yes
467fi
468
edf47283 469dnl -- Look for corosync libraries if required.
a946372e
AK
470if test x$BUILDCOROSYNC = xyes; then
471 PKG_CHECK_MODULES(QUORUM, libquorum, [HAVE_QUORUM=yes], $bailout)
472 CHECKCPG=yes
473 CHECKDLM=yes
474fi
475
476dnl -- Look for openais libraries if required.
477if test x$BUILDOPENAIS = xyes; then
478 PKG_CHECK_MODULES(SALCK, libSaLck, [HAVE_SALCK=yes], $bailout)
479 CHECKCPG=yes
480fi
481
482dnl -- Below are checks for libraries common to more than one build.
483
484dnl -- Check confdb library.
485dnl -- mandatory for corosync build.
486dnl -- optional for openais/cman build.
487
488if test x$CHECKCONFDB = xyes; then
489 PKG_CHECK_MODULES(CONFDB, libconfdb,
490 [HAVE_CONFDB=yes],
491 [HAVE_CONFDB=no])
492
493 AC_CHECK_HEADERS(corosync/confdb.h,
494 [HAVE_CONFDB_H=yes],
495 [HAVE_CONFDB_H=no])
496
497 if test x$HAVE_CONFDB != xyes && \
498 test x$HAVE_CONFDB_H = xyes; then
499 check_lib_no_libs confdb confdb_initialize
500 AC_MSG_RESULT([no pkg for confdb, using -lconfdb])
501 CONFDB_LIBS="-lconfdb"
502 HAVE_CONFDB=yes
503 fi
504
505 if test x$BUILDCOROSYNC = xyes && \
506 test x$HAVE_CONFDB != xyes &&
507 test x$CLVMD != xall; then
508 AC_MSG_ERROR([bailing out... confdb library is required])
509 fi
510fi
511
512dnl -- Check cpg library.
513if test x$CHECKCPG = xyes; then
514 PKG_CHECK_MODULES(CPG, libcpg, [HAVE_CPG=yes], $bailout)
515fi
516
517dnl -- Check dlm library.
518if test x$CHECKDLM = xyes; then
519 PKG_CHECK_MODULES(DLM, libdlm, [HAVE_DLM=yes],
520 [NOTFOUND=0
521 AC_CHECK_HEADERS(libdlm.h,,$bailout)
522 check_lib_no_libs dlm dlm_lock -lpthread
523 if test $NOTFOUND = 0; then
524 AC_MSG_RESULT([no pkg for libdlm, using -ldlm])
525 DLM_LIBS="-ldlm -lpthread"
526 HAVE_DLM=yes
527 fi])
528fi
529
530dnl -- If we are autodetecting, we need to re-create
531dnl -- the depedencies checks and set a proper CLVMD.
532if test x$CLVMD = xall; then
8c222979 533 CLVMD=none
a946372e
AK
534 if test x$HAVE_CCS = xyes && \
535 test x$HAVE_GULM = xyes; then
8c222979
FDN
536 AC_MSG_RESULT([Enabling clvmd gulm cluster manager])
537 CLVMD="$CLVMD,gulm"
a946372e
AK
538 fi
539 if test x$HAVE_CMAN = xyes && \
540 test x$HAVE_DLM = xyes; then
8c222979
FDN
541 AC_MSG_RESULT([Enabling clvmd cman cluster manager])
542 CLVMD="$CLVMD,cman"
a946372e
AK
543 fi
544 if test x$HAVE_COROSYNC = xyes && \
545 test x$HAVE_QUORUM = xyes && \
546 test x$HAVE_CPG = xyes && \
547 test x$HAVE_DLM = xyes && \
548 test x$HAVE_CONFDB = xyes; then
8c222979
FDN
549 AC_MSG_RESULT([Enabling clvmd corosync cluster manager])
550 CLVMD="$CLVMD,corosync"
a946372e
AK
551 fi
552 if test x$HAVE_COROSYNC = xyes && \
553 test x$HAVE_CPG = xyes && \
554 test x$HAVE_SALCK = xyes; then
8c222979
FDN
555 AC_MSG_RESULT([Enabling clvmd openais cluster manager])
556 CLVMD="$CLVMD,openais"
557 fi
558 if test x$CLVMD = xnone; then
559 AC_MSG_RESULT([Disabling clvmd build. No cluster manager detected.])
a946372e 560 fi
edf47283
AK
561fi
562
3c14bcca 563################################################################################
66fd4529
AK
564dnl -- Build cluster mirror log daemon
565AC_MSG_CHECKING(whether to build cluster mirror log daemon)
566AC_ARG_ENABLE(cmirrord, [ --enable-cmirrord Enable the cluster mirror log daemon],
567CMIRRORD=$enableval, CMIRRORD=no)
568AC_MSG_RESULT($CMIRRORD)
3c14bcca 569
66fd4529
AK
570BUILD_CMIRRORD=$CMIRRORD
571
572################################################################################
573dnl -- cmirrord pidfile
574AH_TEMPLATE(CMIRRORD_PIDFILE, [Path to cmirrord pidfile.])
575if test "x$BUILD_CMIRRORD" = xyes; then
576 AC_ARG_WITH(cmirrord-pidfile,
577 [ --with-cmirrord-pidfile=PATH cmirrord pidfile [[/var/run/cmirrord.pid]] ],
578 [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"$withval") ],
579 [ AC_DEFINE_UNQUOTED(CMIRRORD_PIDFILE,"/var/run/cmirrord.pid") ])
580fi
581
582################################################################################
3c14bcca 583dnl -- Look for corosync libraries if required.
66fd4529 584if [[ "x$BUILD_CMIRRORD" = xyes ]]; then
90c80887
AK
585 dnl -- init pkgconfig if required
586 if test x$PKGCONFIG_INIT != x1; then
587 pkg_config_init
588 fi
589 PKG_CHECK_MODULES(SACKPT, libSaCkpt)
590 if test x$HAVE_CPG != xyes; then
591 PKG_CHECK_MODULES(CPG, libcpg)
592 fi
3c14bcca
JEB
593fi
594
80992638 595################################################################################
8ce0cbda 596dnl -- Enable debugging
ad6254c5
AK
597AC_MSG_CHECKING(whether to enable debugging)
598AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging],
d0191583 599 DEBUG=$enableval, DEBUG=no)
ad6254c5 600AC_MSG_RESULT($DEBUG)
8ef2b021 601
8ce0cbda
AK
602dnl -- Normally turn off optimisation for debug builds
603if test x$DEBUG = xyes; then
604 COPTIMISE_FLAG=
8a2fc586
AK
605else
606 CSCOPE_CMD=
8ce0cbda
AK
607fi
608
609################################################################################
610dnl -- Override optimisation
ad6254c5 611AC_MSG_CHECKING(for C optimisation flag)
8ce0cbda 612AC_ARG_WITH(optimisation,
d0191583 613 [ --with-optimisation=OPT C optimisation flag [[OPT=-O2]] ],
8ce0cbda 614 [ COPTIMISE_FLAG="$withval" ])
ad6254c5 615AC_MSG_RESULT($COPTIMISE_FLAG)
8ce0cbda 616
fddafd51
ZK
617################################################################################
618dnl -- Enable profiling
5556819a 619AC_MSG_CHECKING(whether to gather gcov profiling data)
fddafd51 620AC_ARG_ENABLE(profiling,
5556819a
AK
621 AC_HELP_STRING(--enable-profiling, [Gather gcov profiling data]),
622 PROFILING=$enableval, PROFILING=no)
623AC_MSG_RESULT($PROFILING)
624
625if test "x$PROFILING" = xyes; then
626 COPTIMISE_FLAG="$COPTIMISE_FLAG -fprofile-arcs -ftest-coverage"
b145d876
ZK
627 AC_PATH_PROG(LCOV, lcov, no)
628 AC_PATH_PROG(GENHTML, genhtml, no)
629 if test "$LCOV" = no -o "$GENHTML" = no ; then
630 AC_MSG_ERROR([lcov and genhtml are required for profiling])
631 fi
5556819a 632fi
fddafd51 633
80992638 634################################################################################
8ce0cbda 635dnl -- Disable devmapper
ad6254c5 636AC_MSG_CHECKING(whether to use device-mapper)
f6fc418d 637AC_ARG_ENABLE(devmapper, [ --disable-devmapper Disable LVM2 device-mapper interaction],
ad6254c5
AK
638DEVMAPPER=$enableval)
639AC_MSG_RESULT($DEVMAPPER)
199e490e 640
b896caa1 641if test x$DEVMAPPER = xyes; then
f6fc418d 642 AC_DEFINE([DEVMAPPER_SUPPORT], 1, [Define to 1 to enable LVM2 device-mapper interaction.])
b896caa1
AK
643fi
644
5d518f1f
AK
645################################################################################
646dnl -- Enable udev synchronisation
647AC_MSG_CHECKING(whether to enable synchronisation with udev processing)
648AC_ARG_ENABLE(udev_sync, [ --enable-udev_sync Enable synchronisation with udev processing],
649UDEV_SYNC=$enableval, UDEV_SYNC=no)
650AC_MSG_RESULT($UDEV_SYNC)
651
652if test x$UDEV_SYNC = xyes; then
653 AC_DEFINE([UDEV_SYNC_SUPPORT], 1, [Define to 1 to enable synchronisation with udev processing.])
654fi
655
656dnl -- Enable udev rules
657AC_MSG_CHECKING(whether to enable installation of udev rules required for synchronisation)
658AC_ARG_ENABLE(udev_rules, [ --enable-udev_rules Install rule files needed for udev synchronisation],
659UDEV_RULES=$enableval, UDEV_RULES=$UDEV_SYNC)
660AC_MSG_RESULT($UDEV_RULES)
661
fd856332
PR
662################################################################################
663dnl -- Check for libudev's udev_queue_get_udev_is_active function when udev synchronisation is enabled
664
665if test x$UDEV_SYNC = xyes; then
666 AC_CHECK_LIB(udev, udev_queue_get_udev_is_active, HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE=yes,
667 HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE=no)
668
669 if test x$HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE = xyes; then
670 AC_DEFINE([HAVE_UDEV_QUEUE_GET_UDEV_IS_ACTIVE], 1,
671 [Define to 1 if libudev's udev_queue_get_udev_is_active function is available.])
672 LIBS="-ludev $LIBS"
673 fi
674fi
675
f6fc418d
AK
676################################################################################
677dnl -- Compatibility mode
678AC_ARG_ENABLE(compat, [ --enable-compat Enable support for old device-mapper versions],
679 DM_COMPAT=$enableval, DM_COMPAT=no)
680
95eaa683
AK
681################################################################################
682dnl -- Compatible units suffix mode
683AC_ARG_ENABLE(units-compat,
684 [ --enable-units-compat Enable output compatibility with old versions that
685 that don't use KiB-style unit suffixes],
686 UNITS_COMPAT=$enableval, UNITS_COMPAT=no)
687
688if test x$UNITS_COMPAT = xyes; then
689 AC_DEFINE([DEFAULT_SI_UNIT_CONSISTENCY], 0, [Define to 0 to reinstate the pre-2.02.54 handling of unit suffixes.])
690fi
691
f6fc418d
AK
692################################################################################
693dnl -- Disable ioctl
694AC_ARG_ENABLE(ioctl, [ --disable-driver Disable calls to device-mapper in the kernel],
695 DM_IOCTLS=$enableval)
696
80992638 697################################################################################
8ce0cbda 698dnl -- Disable O_DIRECT
ad6254c5
AK
699AC_MSG_CHECKING(whether to enable O_DIRECT)
700AC_ARG_ENABLE(o_direct, [ --disable-o_direct Disable O_DIRECT],
701ODIRECT=$enableval)
702AC_MSG_RESULT($ODIRECT)
2dc95e1c
AK
703
704if test x$ODIRECT = xyes; then
72b2cb61 705 AC_DEFINE([O_DIRECT_SUPPORT], 1, [Define to 1 to enable O_DIRECT support.])
2dc95e1c
AK
706fi
707
572fefeb
AK
708################################################################################
709dnl -- Enable liblvm2app.so
710AC_MSG_CHECKING(whether to build liblvm2app.so application library)
711AC_ARG_ENABLE(applib,
712 [ --enable-applib Build application library],
713 APPLIB=$enableval, APPLIB=no)
714AC_MSG_RESULT($APPLIB)
715AC_SUBST([LVM2APP_LIB])
716test x$APPLIB = xyes \
717 && LVM2APP_LIB=-llvm2app \
718 || LVM2APP_LIB=
719
80992638 720################################################################################
8ce0cbda 721dnl -- Enable cmdlib
ad6254c5
AK
722AC_MSG_CHECKING(whether to compile liblvm2cmd.so)
723AC_ARG_ENABLE(cmdlib, [ --enable-cmdlib Build shared command library],
724CMDLIB=$enableval, CMDLIB=no)
725AC_MSG_RESULT($CMDLIB)
aa4d1e31 726AC_SUBST([LVM2CMD_LIB])
2a9a80c9 727test x$CMDLIB = xyes \
aa4d1e31
JM
728 && LVM2CMD_LIB=-llvm2cmd \
729 || LVM2CMD_LIB=
8106cdd5 730
f6fc418d
AK
731################################################################################
732dnl -- Enable pkg-config
733AC_ARG_ENABLE(pkgconfig, [ --enable-pkgconfig Install pkgconfig support],
734 PKGCONFIG=$enableval, PKGCONFIG=no)
2a9a80c9 735
80992638 736################################################################################
8ce0cbda 737dnl -- Enable fsadm
1995c9ff 738AC_MSG_CHECKING(whether to install fsadm)
ad6254c5
AK
739AC_ARG_ENABLE(fsadm, [ --enable-fsadm Enable fsadm],
740FSADM=$enableval)
741AC_MSG_RESULT($FSADM)
809fae91 742
06f62ad1
AK
743################################################################################
744dnl -- enable dmeventd handling
745AC_MSG_CHECKING(whether to use dmeventd)
746AC_ARG_ENABLE(dmeventd, [ --enable-dmeventd Enable the device-mapper event daemon],
747DMEVENTD=$enableval)
748AC_MSG_RESULT($DMEVENTD)
749
f6fc418d
AK
750BUILD_DMEVENTD=$DMEVENTD
751
06f62ad1 752dnl -- dmeventd currently requires internal mirror support
2a9a80c9
PR
753if test x$DMEVENTD = xyes; then
754 if test x$MIRRORS != xinternal; then
755 AC_MSG_ERROR(
756 --enable-dmeventd currently requires --with-mirrors=internal
757 )
758 fi
759 if test x$CMDLIB = xno; then
760 AC_MSG_ERROR(
761 --enable-dmeventd requires --enable-cmdlib to be used as well
762 )
763 fi
06f62ad1
AK
764fi
765
15d91f5a 766if test x$DMEVENTD = xyes; then
72b2cb61 767 AC_DEFINE([DMEVENTD], 1, [Define to 1 to enable the device-mapper event daemon.])
15d91f5a 768fi
f6fc418d
AK
769
770################################################################################
771dnl -- getline included in recent libc
772
773AC_CHECK_LIB(c, getline, AC_DEFINE([HAVE_GETLINE], 1,
774 [Define to 1 if getline is available.]))
775
776################################################################################
777dnl -- canonicalize_file_name included in recent libc
778
779AC_CHECK_LIB(c, canonicalize_file_name,
780 AC_DEFINE([HAVE_CANONICALIZE_FILE_NAME], 1,
781 [Define to 1 if canonicalize_file_name is available.]))
782
80992638 783################################################################################
d0191583 784dnl -- Clear default exec_prefix - install into /sbin rather than /usr/sbin
795ca3e5
AK
785if [[ "x$exec_prefix" = xNONE -a "x$prefix" = xNONE ]];
786 then exec_prefix="";
787fi;
788
80992638 789################################################################################
8ce0cbda 790dnl -- Check for termcap (Shamelessly copied from parted 1.4.17)
ea7cfb00 791if test x$READLINE != xno; then
18dcfb69 792 AC_SEARCH_LIBS([tgetent], [tinfo ncurses curses termcap termlib],
ea7cfb00
JM
793 [tg_found=yes], [tg_found=no])
794 test x$READLINE:$tg_found = xyes:no &&
795 AC_MSG_ERROR(
795ca3e5
AK
796termcap could not be found which is required for the
797--enable-readline option (which is enabled by default). Either disable readline
798support with --disable-readline or download and install termcap from:
799 ftp.gnu.org/gnu/termcap
800Note: if you are using precompiled packages you will also need the development
801 package as well (which may be called termcap-devel or something similar).
802Note: (n)curses also seems to work as a substitute for termcap. This was
803 not found either - but you could try installing that as well.
804)
795ca3e5
AK
805fi
806
80992638 807################################################################################
8ce0cbda 808dnl -- Check for dlopen
26e7f2e0
AK
809AC_CHECK_LIB(dl, dlopen, HAVE_LIBDL=yes, HAVE_LIBDL=no)
810
7e9e9502 811if [[ "x$HAVE_LIBDL" = xyes ]]; then
72b2cb61 812 AC_DEFINE([HAVE_LIBDL], 1, [Define to 1 if dynamic libraries are available.])
26e7f2e0 813 LIBS="-ldl $LIBS"
d68a82ec
AK
814else
815 HAVE_LIBDL=no
26e7f2e0
AK
816fi
817
80992638 818################################################################################
8ce0cbda 819dnl -- Check for shared/static conflicts
80992638
AK
820if [[ \( "x$LVM1" = xshared -o "x$POOL" = xshared -o "x$CLUSTER" = xshared \
821 -o "x$SNAPSHOTS" = xshared -o "x$MIRRORS" = xshared \
4922197a 822 \) -a "x$STATIC_LINK" = xyes ]];
d68a82ec 823 then AC_MSG_ERROR(
036f273a 824Features cannot be 'shared' when building statically
d68a82ec 825)
036f273a
AK
826fi
827
d0191583
JM
828################################################################################
829dnl -- Disable selinux
830AC_MSG_CHECKING(whether to enable selinux support)
831AC_ARG_ENABLE(selinux, [ --disable-selinux Disable selinux support],
832 SELINUX=$enableval)
833AC_MSG_RESULT($SELINUX)
834
80992638 835################################################################################
8a2fc586 836dnl -- Check for selinux
80992638 837if test x$SELINUX = xyes; then
8a2fc586 838 AC_CHECK_LIB(sepol, sepol_check_context, HAVE_SEPOL=yes, HAVE_SEPOL=no)
8a2fc586
AK
839
840 if test x$HAVE_SEPOL = xyes; then
d0191583
JM
841 AC_DEFINE([HAVE_SEPOL], 1,
842 [Define to 1 if sepol_check_context is available.])
8a2fc586
AK
843 LIBS="-lsepol $LIBS"
844 fi
845
80992638
AK
846 AC_CHECK_LIB(selinux, is_selinux_enabled, HAVE_SELINUX=yes, HAVE_SELINUX=no)
847
848 if test x$HAVE_SELINUX = xyes; then
72b2cb61 849 AC_DEFINE([HAVE_SELINUX], 1, [Define to 1 to include support for selinux.])
80992638
AK
850 LIBS="-lselinux $LIBS"
851 else
ad6254c5 852 AC_MSG_WARN(Disabling selinux)
80992638 853 fi
66e941e8 854
d0191583 855 # With --enable-static_link and selinux enabled, linking
66e941e8
JM
856 # fails on at least Debian unstable due to unsatisfied references
857 # to pthread_mutex_lock and _unlock. See if we need -lpthread.
858 if test "$STATIC_LINK-$HAVE_SELINUX" = yes-yes; then
859 lvm_saved_libs=$LIBS
860 LIBS="$LIBS -static"
861 AC_SEARCH_LIBS([pthread_mutex_lock], [pthread],
862 [test "$ac_cv_search_pthread_mutex_lock" = "none required" ||
863 LIB_PTHREAD=-lpthread])
864 LIBS=$lvm_saved_libs
865 fi
036f273a 866fi
d68a82ec 867
8b1a3214
AK
868################################################################################
869dnl -- Check for realtime clock support
870if test x$REALTIME = xyes; then
8b1a3214 871 AC_CHECK_LIB(rt, clock_gettime, HAVE_REALTIME=yes, HAVE_REALTIME=no)
8b1a3214
AK
872
873 if test x$HAVE_REALTIME = xyes; then
874 AC_DEFINE([HAVE_REALTIME], 1, [Define to 1 to include support for realtime clock.])
875 LIBS="-lrt $LIBS"
876 else
877 AC_MSG_WARN(Disabling realtime clock)
878 fi
879fi
880
80992638 881################################################################################
8ce0cbda 882dnl -- Check for getopt
d0191583 883AC_CHECK_HEADERS(getopt.h, AC_DEFINE([HAVE_GETOPTLONG], 1, [Define to 1 if getopt_long is available.]))
b896caa1 884
80992638 885################################################################################
8ce0cbda 886dnl -- Check for readline (Shamelessly copied from parted 1.4.17)
ea7cfb00 887if test x$READLINE != xno; then
0ad6b7e2
JM
888 rl_found=yes
889 AC_CHECK_LIB([readline], [readline], , [rl_found=no])
ea7cfb00
JM
890 test x$READLINE:$rl_found = xyes:no &&
891 AC_MSG_ERROR(
795ca3e5
AK
892GNU Readline could not be found which is required for the
893--enable-readline option (which is enabled by default). Either disable readline
894support with --disable-readline or download and install readline from:
895 ftp.gnu.org/gnu/readline
896Note: if you are using precompiled packages you will also need the development
897package as well (which may be called readline-devel or something similar).
898)
ea7cfb00 899 if test $rl_found = yes; then
0ad6b7e2 900 AC_CHECK_FUNCS([rl_completion_matches])
ea7cfb00
JM
901 AC_DEFINE([READLINE_SUPPORT], 1,
902 [Define to 1 to include the LVM readline shell.])
903 fi
795ca3e5
AK
904fi
905
80992638 906################################################################################
8ce0cbda 907dnl -- Internationalisation stuff
ad6254c5
AK
908AC_MSG_CHECKING(whether to enable internationalisation)
909AC_ARG_ENABLE(nls, [ --enable-nls Enable Native Language Support],
910 INTL=$enableval, INTL=no)
911AC_MSG_RESULT($INTL)
69792976
AK
912
913if test x$INTL = xyes; then
f6fc418d 914# FIXME - Move this - can be device-mapper too
69792976
AK
915 INTL_PACKAGE="lvm2"
916 AC_PATH_PROG(MSGFMT, msgfmt)
917 if [[ "x$MSGFMT" == x ]];
918 then AC_MSG_ERROR(
919 msgfmt not found in path $PATH
920 )
69792976
AK
921 fi;
922
923 AC_ARG_WITH(localedir,
d0191583
JM
924 [ --with-localedir=DIR Translation files in DIR [[PREFIX/share/locale]] ],
925 [ LOCALEDIR="$withval" ],
926 [ LOCALEDIR='${prefix}/share/locale' ])
69792976
AK
927fi
928
80992638 929################################################################################
4a7f3eb2 930AC_ARG_WITH(confdir,
5d518f1f 931 [ --with-confdir=DIR Configuration files in DIR [[/etc]]],
d0191583
JM
932 [ CONFDIR="$withval" ],
933 [ CONFDIR='/etc' ])
0a62c911
AK
934
935AC_ARG_WITH(staticdir,
5d518f1f 936 [ --with-staticdir=DIR Static binary in DIR [[EPREFIX/sbin]]],
d0191583
JM
937 [ STATICDIR="$withval" ],
938 [ STATICDIR='${exec_prefix}/sbin' ])
0a62c911 939
68f2de6d
AK
940AC_ARG_WITH(usrlibdir,
941 [ --with-usrlibdir=DIR],
942 [ usrlibdir="$withval"],
943 [ usrlibdir='${prefix}/lib' ])
944
945AC_ARG_WITH(usrsbindir,
946 [ --with-usrsbindir=DIR],
947 [ usrsbindir="$withval"],
948 [ usrsbindir='${prefix}/sbin' ])
949
5d518f1f
AK
950################################################################################
951AC_ARG_WITH(udev_prefix,
952 [ --with-udev-prefix=UPREFIX Install udev rule files in UPREFIX [[EPREFIX]]],
953 [ udev_prefix="$withval"],
954 [ udev_prefix='${exec_prefix}' ])
955
78ce7acc
AK
956AC_ARG_WITH(udevdir,
957 [ --with-udevdir=DIR udev rules in DIR [[UPREFIX/lib/udev/rules.d]]],
958 [ udevdir="$withval"],
959 [ udevdir='${udev_prefix}/lib/udev/rules.d' ])
5d518f1f 960
ad6254c5
AK
961################################################################################
962dnl -- Ensure additional headers required
963if test x$READLINE = xyes; then
964 AC_CHECK_HEADERS(readline/readline.h readline/history.h,,AC_MSG_ERROR(bailing out))
965fi
966
5c7fc7c4 967if test x$CLVMD != xnone; then
ad6254c5
AK
968 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))
969 AC_CHECK_FUNCS(dup2 getmntent memmove select socket,,AC_MSG_ERROR(bailing out))
970 AC_FUNC_GETMNTENT
971# AC_FUNC_REALLOC
972 AC_FUNC_SELECT_ARGTYPES
973fi
974
ad6254c5
AK
975if test x$CLUSTER != xnone; then
976 AC_CHECK_HEADERS(sys/socket.h sys/un.h,,AC_MSG_ERROR(bailing out))
977 AC_CHECK_FUNCS(socket,,AC_MSG_ERROR(bailing out))
978fi
979
980if test x$HAVE_LIBDL = xyes; then
981 AC_CHECK_HEADERS(dlfcn.h,,AC_MSG_ERROR(bailing out))
982fi
983
984if test x$INTL = xyes; then
985 AC_CHECK_HEADERS(libintl.h,,AC_MSG_ERROR(bailing out))
986fi
987
ad6254c5
AK
988if test x$HAVE_SELINUX = xyes; then
989 AC_CHECK_HEADERS(selinux/selinux.h,,AC_MSG_ERROR(bailing out))
990fi
4a7f3eb2 991
5d518f1f
AK
992if test x$UDEV_SYNC = xyes; then
993 AC_CHECK_HEADERS(sys/ipc.h sys/sem.h,,AC_MSG_ERROR(bailing out))
994fi
995
a653923f
AK
996################################################################################
997AC_PATH_PROG(MODPROBE_CMD, modprobe)
998
999if test x$MODPROBE_CMD != x; then
72b2cb61 1000 AC_DEFINE_UNQUOTED([MODPROBE_CMD], ["$MODPROBE_CMD"], [The path to 'modprobe', if available.])
a653923f
AK
1001fi
1002
80992638 1003################################################################################
f6fc418d
AK
1004dnl -- dmeventd pidfile and executable path
1005AH_TEMPLATE(DMEVENTD_PIDFILE, [Path to dmeventd pidfile.])
1006if test "$BUILD_DMEVENTD" = yes; then
1007 AC_ARG_WITH(dmeventd-pidfile,
1008 [ --with-dmeventd-pidfile=PATH dmeventd pidfile [[/var/run/dmeventd.pid]] ],
1009 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"$withval") ],
1010 [ AC_DEFINE_UNQUOTED(DMEVENTD_PIDFILE,"/var/run/dmeventd.pid") ])
1011fi
1012
1013AH_TEMPLATE(DMEVENTD_PATH, [Path to dmeventd binary.])
1014if test "$BUILD_DMEVENTD" = yes; then
1015 dmeventd_prefix="$exec_prefix"
1016 if test "x$dmeventd_prefix" = "xNONE"; then
1017 dmeventd_prefix="$prefix"
1018 fi
1019 if test "x$dmeventd_prefix" = "xNONE"; then
1020 dmeventd_prefix=""
1021 fi
1022 AC_ARG_WITH(dmeventd-path,
5d518f1f 1023 [ --with-dmeventd-path=PATH dmeventd path [[EPREFIX/sbin/dmeventd]] ],
f6fc418d
AK
1024 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$withval") ],
1025 [ AC_DEFINE_UNQUOTED(DMEVENTD_PATH,"$dmeventd_prefix/sbin/dmeventd") ])
1026fi
1027
1028################################################################################
1029dnl -- which kernel interface to use (ioctl only)
1030AC_MSG_CHECKING(for kernel interface choice)
1031AC_ARG_WITH(interface,
1032 [ --with-interface=IFACE Choose kernel interface (ioctl) [[ioctl]] ],
1033 [ interface="$withval" ],
1034 [ interface=ioctl ])
1035if [[ "x$interface" != xioctl ]];
1036then
1037 AC_MSG_ERROR(--with-interface=ioctl required. fs no longer supported.)
1038fi
1039AC_MSG_RESULT($interface)
1040
1041################################################################################
2c44337b 1042DM_LIB_VERSION="\"`cat VERSION_DM 2>/dev/null || echo Unknown`\""
f58b35b5
AK
1043AC_DEFINE_UNQUOTED(DM_LIB_VERSION, $DM_LIB_VERSION, [Library version])
1044
ec6a6fbe 1045DM_LIB_PATCHLEVEL=`cat VERSION_DM | $AWK -F '[[-. ]]' '{printf "%s.%s.%s",$1,$2,$3}'`
597c3f8e 1046
d0191583 1047LVM_VERSION="\"`cat VERSION 2>/dev/null || echo Unknown`\""
fae0c576 1048
ec6a6fbe 1049VER=`cat VERSION`
bf456146 1050LVM_RELEASE_DATE="\"`echo $VER | $SED 's/.* (//;s/).*//'`\""
ec6a6fbe
AK
1051VER=`echo "$VER" | $AWK '{print $1}'`
1052LVM_RELEASE="\"`echo "$VER" | $AWK -F '-' '{print $2}'`\""
1053VER=`echo "$VER" | $AWK -F '-' '{print $1}'`
1054LVM_MAJOR=`echo "$VER" | $AWK -F '.' '{print $1}'`
1055LVM_MINOR=`echo "$VER" | $AWK -F '.' '{print $2}'`
bf456146
AK
1056LVM_PATCHLEVEL=`echo "$VER" | $AWK -F '[[(.]]' '{print $3}'`
1057LVM_LIBAPI=`echo "$VER" | $AWK -F '[[()]]' '{print $2}'`
ec6a6fbe 1058
80992638 1059################################################################################
572fefeb 1060AC_SUBST(APPLIB)
66fd4529 1061AC_SUBST(BUILD_CMIRRORD)
d0191583 1062AC_SUBST(BUILD_DMEVENTD)
a946372e
AK
1063AC_SUBST(CCS_CFLAGS)
1064AC_SUBST(CCS_LIBS)
b896caa1 1065AC_SUBST(CFLAGS)
d0191583 1066AC_SUBST(CFLOW_CMD)
8106cdd5 1067AC_SUBST(CLDFLAGS)
8106cdd5 1068AC_SUBST(CLDNOWHOLEARCHIVE)
d0191583
JM
1069AC_SUBST(CLDWHOLEARCHIVE)
1070AC_SUBST(CLUSTER)
1071AC_SUBST(CLVMD)
a946372e
AK
1072AC_SUBST(CMAN_CFLAGS)
1073AC_SUBST(CMAN_LIBS)
d0191583 1074AC_SUBST(CMDLIB)
edf47283
AK
1075AC_SUBST(CONFDB_CFLAGS)
1076AC_SUBST(CONFDB_LIBS)
1077AC_SUBST(CONFDIR)
d0191583 1078AC_SUBST(COPTIMISE_FLAG)
edf47283
AK
1079AC_SUBST(CPG_CFLAGS)
1080AC_SUBST(CPG_LIBS)
d0191583 1081AC_SUBST(CSCOPE_CMD)
8ef2b021 1082AC_SUBST(DEBUG)
199e490e 1083AC_SUBST(DEVMAPPER)
a946372e
AK
1084AC_SUBST(DLM_CFLAGS)
1085AC_SUBST(DLM_LIBS)
d0191583
JM
1086AC_SUBST(DMEVENTD)
1087AC_SUBST(DM_COMPAT)
1088AC_SUBST(DM_DEVICE_GID)
1089AC_SUBST(DM_DEVICE_MODE)
1090AC_SUBST(DM_DEVICE_UID)
1091AC_SUBST(DM_IOCTLS)
1092AC_SUBST(DM_LIB_VERSION)
597c3f8e 1093AC_SUBST(DM_LIB_PATCHLEVEL)
d0191583
JM
1094AC_SUBST(FSADM)
1095AC_SUBST(GROUP)
a946372e
AK
1096AC_SUBST(GULM_CFLAGS)
1097AC_SUBST(GULM_LIBS)
26e7f2e0 1098AC_SUBST(HAVE_LIBDL)
8b1a3214 1099AC_SUBST(HAVE_REALTIME)
d0191583
JM
1100AC_SUBST(HAVE_SELINUX)
1101AC_SUBST(INTL)
1102AC_SUBST(INTL_PACKAGE)
1103AC_SUBST(JOBS)
1104AC_SUBST(LDDEPS)
1105AC_SUBST(LIBS)
1106AC_SUBST(LIB_SUFFIX)
69792976 1107AC_SUBST(LOCALEDIR)
d0191583
JM
1108AC_SUBST(LVM1)
1109AC_SUBST(LVM1_FALLBACK)
d0191583 1110AC_SUBST(LVM_VERSION)
bf456146 1111AC_SUBST(LVM_LIBAPI)
ec6a6fbe
AK
1112AC_SUBST(LVM_MAJOR)
1113AC_SUBST(LVM_MINOR)
1114AC_SUBST(LVM_PATCHLEVEL)
1115AC_SUBST(LVM_RELEASE)
1116AC_SUBST(LVM_RELEASE_DATE)
d0191583
JM
1117AC_SUBST(MIRRORS)
1118AC_SUBST(MSGFMT)
1119AC_SUBST(OWNER)
1120AC_SUBST(PKGCONFIG)
1121AC_SUBST(POOL)
edf47283
AK
1122AC_SUBST(QUORUM_CFLAGS)
1123AC_SUBST(QUORUM_LIBS)
90c80887
AK
1124AC_SUBST(SACKPT_CFLAGS)
1125AC_SUBST(SACKPT_LIBS)
a946372e
AK
1126AC_SUBST(SALCK_CFLAGS)
1127AC_SUBST(SALCK_LIBS)
d0191583 1128AC_SUBST(SNAPSHOTS)
0a62c911 1129AC_SUBST(STATICDIR)
d0191583 1130AC_SUBST(STATIC_LINK)
5d518f1f 1131AC_SUBST(UDEV_RULES)
66e941e8 1132AC_SUBST([LIB_PTHREAD])
f6fc418d
AK
1133AC_SUBST(interface)
1134AC_SUBST(kerneldir)
1135AC_SUBST(missingkernel)
1136AC_SUBST(kernelvsn)
1137AC_SUBST(tmpdir)
5d518f1f
AK
1138AC_SUBST(udev_prefix)
1139AC_SUBST(udevdir)
68f2de6d
AK
1140AC_SUBST(usrlibdir)
1141AC_SUBST(usrsbindir)
8106cdd5 1142
80992638 1143################################################################################
d3a356b4 1144dnl -- First and last lines should not contain files to generate in order to
8ce0cbda 1145dnl -- keep utility scripts running properly
d3a356b4
JM
1146AC_CONFIG_FILES([
1147Makefile
1148make.tmpl
1149daemons/Makefile
1150daemons/clvmd/Makefile
5d311afb 1151daemons/cmirrord/Makefile
f6fc418d
AK
1152daemons/dmeventd/Makefile
1153daemons/dmeventd/libdevmapper-event.pc
b7edb5bf 1154daemons/dmeventd/plugins/Makefile
f6fc418d
AK
1155daemons/dmeventd/plugins/mirror/Makefile
1156daemons/dmeventd/plugins/snapshot/Makefile
d3a356b4 1157doc/Makefile
f6fc418d
AK
1158include/Makefile
1159lib/Makefile
d3a356b4
JM
1160lib/format1/Makefile
1161lib/format_pool/Makefile
1162lib/locking/Makefile
1163lib/mirror/Makefile
ec6a6fbe 1164lib/misc/lvm-version.h
d3a356b4 1165lib/snapshot/Makefile
f6fc418d
AK
1166libdm/Makefile
1167libdm/libdevmapper.pc
e0c64c6c 1168liblvm/Makefile
70046623 1169liblvm/liblvm2app.pc
f6fc418d
AK
1170man/Makefile
1171po/Makefile
2de38033 1172scripts/clvmd_init_red_hat
595eaf92 1173scripts/lvm2_monitoring_init_red_hat
d3a356b4 1174scripts/Makefile
f6fc418d 1175test/Makefile
c7e363f9 1176test/api/Makefile
d3a356b4 1177tools/Makefile
5d518f1f 1178udev/Makefile
7a197a62
AK
1179])
1180AC_OUTPUT
2dc95e1c
AK
1181
1182if test x$ODIRECT != xyes; then
ad6254c5 1183 AC_MSG_WARN(Warning: O_DIRECT disabled: low-memory pvmove may lock up)
2dc95e1c 1184fi
This page took 0.205056 seconds and 5 git commands to generate.