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